From 93c0a1c916c143c19d493f45cd10489fc129d816 Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 7 Nov 2022 14:51:34 -0600 Subject: [PATCH] run_depcode() -> run_depletion_step() - adjust docstrings - associated changes in other files --- doc/releasenotes/v0.5.0.rst | 2 ++ saltproc/abc.py | 4 +-- saltproc/app.py | 2 +- saltproc/openmc_depcode.py | 4 +-- saltproc/serpent_depcode.py | 25 +++---------------- .../run_no_reprocessing/test.py | 4 +-- 6 files changed, 13 insertions(+), 28 deletions(-) diff --git a/doc/releasenotes/v0.5.0.rst b/doc/releasenotes/v0.5.0.rst index cb9cdcce8..a07fc578f 100644 --- a/doc/releasenotes/v0.5.0.rst +++ b/doc/releasenotes/v0.5.0.rst @@ -119,6 +119,7 @@ Python API Changes - ``read_depcode_step_param()`` → ``read_neutronics_parameters()`` - ``param`` → ``neutronics_parameters`` - ``read_dep_comp()`` → ``read_depleted_materials()`` + - ``run_depcode()`` → ``run_depletion_step()`` - ``DepcodeSerpent`` → ``SerpentDepcode`` @@ -130,6 +131,7 @@ Python API Changes - ``param`` → ``neutronics_parameters`` - ``read_dep_comp()`` → ``read_depleted_materials()`` - ``create_nuclide_name_map_zam_to_serpent()`` → ``map_nuclide_code_zam_to_serpent()`` + - ``run_depcode()`` → ``run_depletion_step()`` - ``OpenMCDepcode`` is a ``Depcode`` subclass that interfaces with ``openmc``. This class implements the following functions - ``run_depcode()`` diff --git a/saltproc/abc.py b/saltproc/abc.py index 50892755f..39a5ba87e 100644 --- a/saltproc/abc.py +++ b/saltproc/abc.py @@ -106,8 +106,8 @@ def read_depleted_materials(self, read_at_end=False): """ @abstractmethod - def run_depcode(self, cores, nodes): - """Runs depletion code as a subprocess with the given parameters. + def run_depletion_step(self, cores, nodes): + """Runs a depletion step as a subprocess with the given parameters. Parameters ---------- diff --git a/saltproc/app.py b/saltproc/app.py index 0dc9042f9..9444c16c4 100644 --- a/saltproc/app.py +++ b/saltproc/app.py @@ -43,7 +43,7 @@ def run(): simulation.sim_depcode.write_depcode_input(msr, dep_step, simulation.restart_flag) - depcode.run_depcode(cores, nodes) + depcode.run_depletion_step(cores, nodes) if dep_step == 0 and simulation.restart_flag is False: # First step # Read general simulation data which never changes simulation.store_run_init_info() diff --git a/saltproc/openmc_depcode.py b/saltproc/openmc_depcode.py index c26cb612a..6187a468a 100644 --- a/saltproc/openmc_depcode.py +++ b/saltproc/openmc_depcode.py @@ -114,8 +114,8 @@ def read_depleted_materials(self, read_at_end=False): """ - def run_depcode(self, cores, nodes): - """Runs OpenMC depletion simulation as a subprocess with the given + def run_depletion_step(self, cores, nodes): + """Runs a depletion step in OpenMC as a subprocess with the given parameters. Parameters diff --git a/saltproc/serpent_depcode.py b/saltproc/serpent_depcode.py index bdd88a530..4003b9c14 100644 --- a/saltproc/serpent_depcode.py +++ b/saltproc/serpent_depcode.py @@ -410,8 +410,9 @@ def replace_burnup_parameters( current_depstep)) return template_data - def run_depcode(self, cores, nodes): - """Runs Serpent2 as a subprocess with the given parameters. + def run_depletion_step(self, cores, nodes): + """Runs a depletion step in Serpent2 as a subprocess with the given + parameters. Parameters ---------- @@ -422,25 +423,7 @@ def run_depcode(self, cores, nodes): """ - if self.exec_path.startswith('/projects/sciteam/bahg/'): # check if BW - args = ( - 'aprun', - '-n', - str(nodes), - '-d', str(cores), - self.exec_path, - '-omp', - str(cores), - self.iter_inputfile) - elif self.exec_path.startswith('/apps/exp_ctl/'): # check if Falcon - args = ( - 'mpiexec', - self.exec_path, - self.iter_inputfile, - '-omp', - str(18)) - else: - args = (self.exec_path, '-omp', str(cores), self.iter_inputfile) + args = (self.exec_path, '-omp', str(cores), self.iter_inputfile) print('Running %s' % (self.codename)) try: subprocess.check_output( diff --git a/tests/integration_tests/run_no_reprocessing/test.py b/tests/integration_tests/run_no_reprocessing/test.py index 9a7c14384..78978424a 100644 --- a/tests/integration_tests/run_no_reprocessing/test.py +++ b/tests/integration_tests/run_no_reprocessing/test.py @@ -82,7 +82,7 @@ def runsim_no_reproc(simulation, reactor, nsteps): reactor, dep_step, False) - simulation.sim_depcode.run_depcode( + simulation.sim_depcode.run_depletion_step( simulation.core_number, simulation.node_number) # Read general simulation data which never changes @@ -94,7 +94,7 @@ def runsim_no_reproc(simulation, reactor, nsteps): # Finish of First step # Main sequence else: - simulation.sim_depcode.run_depcode( + simulation.sim_depcode.run_depletion_step( simulation.core_number, simulation.node_number) mats = simulation.sim_depcode.read_depleted_materials(