-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul parallel runs #188
Conversation
- remove the `core_number` and `node_number` arguments from Simulation; consistency changes - Fix the input schema by adding multiple types - Make the try-except block in read_main_input more robust
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I had a few comments on some minor things.
:type: | ||
``string``, ``null`` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like these changes tie in with the changes to overhauling parallel runs. Consider adding a note to the PR about these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
saltproc/app.py
Outdated
d : int | ||
Number of threads to use for shared-memory parallelism. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace d
with s
as done previously
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
saltproc/app.py
Outdated
depletion code simulation') | ||
default=None, | ||
help='Number of threads to use for shared-memory \ | ||
parallelism.') | ||
parser.add_argument('-i', # main input file | ||
type=str, | ||
default=None, | ||
help='path and name of SaltProc main input file') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Match capitalization in the help strings
saltproc/input_schema.json
Outdated
@@ -270,12 +281,12 @@ | |||
"type": "boolean", | |||
"default": false} | |||
}, | |||
"default": {}, | |||
"required": ["sim_name"] | |||
"required": ["sim_name", "db_name"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought db_name
was previously made optional since there was a default setting?
saltproc/input_schema.json
Outdated
"required": ["volume", "mass_flowrate", "power_levels", "depletion_timesteps", "timestep_units"] | ||
} | ||
}, | ||
"required": ["proc_input_file", "dot_input_file", "output_path", "depcode", "simulation", "reactor"] | ||
"required": ["proc_input_file", "dot_input_file", "output_path", "mpi_args", "depcode", "simulation", "reactor"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come mpi_args
is required, isn't it given a default value of None
?
saltproc/openmc_depcode.py
Outdated
'--directory', | ||
str(self.output_path)] | ||
if mpi_args is not None: | ||
args = mpi_args + args | ||
|
||
print('Running %s' % (self.codename)) | ||
# TODO: Need to figure out how to adapt this to openmc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO
line still needed?
def run_depletion_step(self, cores, nodes): | ||
"""Runs a depletion step in OpenMC as a subprocess with the given | ||
parameters. | ||
def run_depletion_step(self, mpi_args=None, threads=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see threads
called in this function, is it needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's needed in the signature, but it isn't used in the function.
if threads is not None: | ||
args = args + ['-omp', str(threads)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come this isn't in OpenMC run_depletion_step
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't currently a way to specify how many OpenMC threads to use when using depletion outside of an environment variable. Otherwise the transport simulation will use as many threads as there are on the machine/node.
tests/conftest.py
Outdated
@@ -27,13 +27,13 @@ def serpent_runtime(cwd, tmpdir_factory): | |||
"""SaltProc objects for Serpent unit tests""" | |||
saltproc_input = str(cwd / 'serpent_data' / 'tap_input.json') | |||
depcode_input, simulation_input, reactor_input = \ | |||
read_main_input(saltproc_input)[3] | |||
read_main_input(saltproc_input)[4] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rewrite this in a way that doesn't use a hard-coded value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of any, other than using -1
instead of 4
.
tests/conftest.py
Outdated
@@ -65,7 +65,7 @@ def openmc_runtime(cwd, tmpdir_factory): | |||
"""SaltProc objects for OpenMC unit tests""" | |||
saltproc_input = str(cwd / 'openmc_data' / 'tap_input.json') | |||
depcode_input, simulation_input, reactor_input = \ | |||
read_main_input(saltproc_input)[3] | |||
read_main_input(saltproc_input)[4] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@samgdotson @abachma2 bump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, let me know if you want me to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have anything to add here, these are pretty straightforward changes. However, the abc.py
file is still called abc.py
which should be changd.
As I've stated before, this will be happening in a future PR, and there is already an issue in the repo for this. |
@LukeSeifert is this good to merge? |
…ments Overhaul parallel runs 419447d
…arguments Overhaul parallel runs 419447d
Summary of changes
This PR adds support for flexible distributed memory runs on various machines with the addition of the
mpi_args
parameter. Specifically, this PR:-n
command line argument in favor of thempi_args
parameter.-d
command line argument to the more standard-s
/--threads
.Depcode.run_depletion_step()
,SerpentDepcode.run_depletion_step()
, andOpenMCDepcode.run_depletion_step()
functions.app.py
to handle the new variables.null
type to certain object properties in the input schema.Types of changes
Required for Merging
Associated Issues and PRs
mpiexec
flags when executing depletion codes via SaltProc #173Associated Developers
Checklist for Reviewers
Reviewers should use this link to get to the
Review Checklist before they begin their review.