Commit 347830e0 authored by Hejing Li's avatar Hejing Li
Browse files

fix some more errors

parent 32271a5b
...@@ -267,7 +267,7 @@ def add_exp( ...@@ -267,7 +267,7 @@ def add_exp(
create_cp: bool, create_cp: bool,
restore_cp: bool, restore_cp: bool,
args: argparse.Namespace, args: argparse.Namespace,
) -> inst_base.InstantiationEnvironment: ):
outpath = f"{args.outdir}/{simulation.name}-{run_number}.json" outpath = f"{args.outdir}/{simulation.name}-{run_number}.json"
if os.path.exists(outpath) and not args.force: if os.path.exists(outpath) and not args.force:
...@@ -299,9 +299,10 @@ def add_exp( ...@@ -299,9 +299,10 @@ def add_exp(
tmp_simulation_files=tmp_sim_files, tmp_simulation_files=tmp_sim_files,
) )
inst_ = inst_base.Instantiation(inst_env)
run = runs.base.Run( run = runs.base.Run(
simulation=simulation, simulation=simulation,
instantiation=inst_env, instantiation=inst_,
prereq=prereq, prereq=prereq,
) )
......
...@@ -240,7 +240,7 @@ class Instantiation(util_base.IdObj): ...@@ -240,7 +240,7 @@ class Instantiation(util_base.IdObj):
# some sort of runtime on each machine that executes thus making pasing # some sort of runtime on each machine that executes thus making pasing
# an executor in here obsolete... # an executor in here obsolete...
wrkdir = self._instantiation.wrkdir() wrkdir = self.wrkdir()
shutil.rmtree(wrkdir, ignore_errors=True) shutil.rmtree(wrkdir, ignore_errors=True)
await executor.rmtree(wrkdir) await executor.rmtree(wrkdir)
......
...@@ -51,11 +51,11 @@ class LocalSimpleRuntime(run_base.Runtime): ...@@ -51,11 +51,11 @@ class LocalSimpleRuntime(run_base.Runtime):
"""Actually executes `run`.""" """Actually executes `run`."""
try: try:
runner = simulation_executor.ExperimentSimpleRunner( runner = simulation_executor.ExperimentSimpleRunner(
self._executor, run._simulation, run._inst_env, self.verbose self._executor, run._simulation, run._instantiation, self._verbose
) )
if self._profile_int: if self._profile_int:
runner.profile_int = self.profile_int runner.profile_int = self.profile_int
await run.prep_dirs(self.executor) await run.prep_dirs(self._executor)
await runner.prepare() await runner.prepare()
except asyncio.CancelledError: except asyncio.CancelledError:
# it is safe to just exit here because we are not running any # it is safe to just exit here because we are not running any
......
...@@ -32,7 +32,7 @@ class SimulationOutput: ...@@ -32,7 +32,7 @@ class SimulationOutput:
self._end_time: float = None self._end_time: float = None
self._success: bool = True self._success: bool = True
self._interrupted: bool = False self._interrupted: bool = False
self._metadata = exp.metadata self._metadata = sim.metadata
self._sims: dict[str, dict[str, str | list[str]]] = {} self._sims: dict[str, dict[str, str | list[str]]] = {}
def set_start(self) -> None: def set_start(self) -> None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment