Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
2735154e
Unverified
Commit
2735154e
authored
Sep 25, 2024
by
Jakob Görgen
Browse files
runtime fixes in regards to preparation phase
parent
1c24e0fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
18 deletions
+17
-18
experiments/simbricks/orchestration/runtime_new/runs/base.py
experiments/simbricks/orchestration/runtime_new/runs/base.py
+0
-3
experiments/simbricks/orchestration/runtime_new/runs/local.py
...riments/simbricks/orchestration/runtime_new/runs/local.py
+0
-2
experiments/simbricks/orchestration/runtime_new/simulation_executor.py
...imbricks/orchestration/runtime_new/simulation_executor.py
+17
-13
No files found.
experiments/simbricks/orchestration/runtime_new/runs/base.py
View file @
2735154e
...
@@ -56,9 +56,6 @@ class Run:
...
@@ -56,9 +56,6 @@ class Run:
def
name
(
self
)
->
str
:
def
name
(
self
)
->
str
:
return
self
.
_simulation
.
name
+
"."
+
str
(
self
.
_run_nr
)
return
self
.
_simulation
.
name
+
"."
+
str
(
self
.
_run_nr
)
async
def
prep_dirs
(
self
,
executor
=
command_executor
.
LocalExecutor
())
->
None
:
await
self
.
_instantiation
.
prepare_directories
(
executor
=
executor
)
class
Runtime
(
metaclass
=
abc
.
ABCMeta
):
class
Runtime
(
metaclass
=
abc
.
ABCMeta
):
"""Base class for managing the execution of multiple runs."""
"""Base class for managing the execution of multiple runs."""
...
...
experiments/simbricks/orchestration/runtime_new/runs/local.py
View file @
2735154e
...
@@ -55,7 +55,6 @@ class LocalSimpleRuntime(run_base.Runtime):
...
@@ -55,7 +55,6 @@ class LocalSimpleRuntime(run_base.Runtime):
)
)
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
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
...
@@ -132,7 +131,6 @@ class LocalParallelRuntime(run_base.Runtime):
...
@@ -132,7 +131,6 @@ class LocalParallelRuntime(run_base.Runtime):
)
)
if
self
.
_profile_int
is
not
None
:
if
self
.
_profile_int
is
not
None
:
runner
.
_profile_int
=
self
.
_profile_int
runner
.
_profile_int
=
self
.
_profile_int
await
run
.
prep_dirs
(
executor
=
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
...
...
experiments/simbricks/orchestration/runtime_new/simulation_executor.py
View file @
2735154e
...
@@ -132,19 +132,24 @@ class ExperimentBaseRunner(abc.ABC):
...
@@ -132,19 +132,24 @@ class ExperimentBaseRunner(abc.ABC):
# copies.append(task)
# copies.append(task)
# await asyncio.gather(*copies)
# await asyncio.gather(*copies)
# TODO: FIXME
executor
=
command_executor
.
LocalExecutor
()
self
.
_instantiation
.
executor
=
executor
await
self
.
_instantiation
.
prepare
()
# prepare all simulators in parallel
# prepare all simulators in parallel
sims
=
[]
#
sims = []
for
sim
in
self
.
_simulation
.
all_simulators
():
#
for sim in self._simulation.all_simulators():
sim
.
prep_tar
(
self
.
_instantiation
)
#
sim.prep_tar(self._instantiation)
prep_cmds
=
list
(
sim
.
prep_cmds
(
inst
=
self
.
_instantiation
))
#
prep_cmds = list(sim.prep_cmds(inst=self._instantiation))
executor
=
self
.
sim_executor
(
sim
)
#
executor = self.sim_executor(sim)
task
=
asyncio
.
create_task
(
#
task = asyncio.create_task(
executor
.
run_cmdlist
(
#
executor.run_cmdlist(
'prepare_'
+
self
.
_simulation
.
name
,
prep_cmds
,
verbose
=
self
.
_verbose
#
'prepare_' + self._simulation.name, prep_cmds, verbose=self._verbose
)
#
)
)
#
)
sims
.
append
(
task
)
#
sims.append(task)
await
asyncio
.
gather
(
*
sims
)
#
await asyncio.gather(*sims)
async
def
wait_for_sims
(
self
)
->
None
:
async
def
wait_for_sims
(
self
)
->
None
:
"""Wait for simulators to terminate (the ones marked to wait on)."""
"""Wait for simulators to terminate (the ones marked to wait on)."""
...
@@ -254,7 +259,6 @@ class ExperimentSimpleRunner(ExperimentBaseRunner):
...
@@ -254,7 +259,6 @@ class ExperimentSimpleRunner(ExperimentBaseRunner):
return
self
.
_executor
return
self
.
_executor
# TODO: FIXME
class
ExperimentDistributedRunner
(
ExperimentBaseRunner
):
class
ExperimentDistributedRunner
(
ExperimentBaseRunner
):
"""Simple experiment runner with just one executor."""
"""Simple experiment runner with just one executor."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment