Skip to content

Commit

Permalink
BaseLammpsCalculation: Do not set CodeInfo.withmpi
Browse files Browse the repository at this point in the history
The plugin was setting `CodeInfo.withmpi` based on the inputs from
`metadata.options.withmpi`. This is not necessary as the metadata option
is already handled by the `CalcJob` base class. The plugin implementation
should only set `CodeInfo.withmpi` if it wants to _force_ the code to be
run with MPI enabled or disabled.

The `CalcJob` base implementation used to not distinguish between the
two, but in aiidateam/aiida-core#5922 the
handling of MPI was improved. A `Code` can now define whether it
should be run with MPI or not and so the `CalcJob` class now has to
raise if the MPI setting of the code and the plugin clash. The `withmpi`
option, if explicitly set by the user, is also checked.

Since the plugin doesn't intend to enforce MPI or not, the setting on
the `CodeInfo` is removed.
  • Loading branch information
Sebastiaan Huber committed Mar 16, 2023
1 parent 16af0ce commit 38d69fa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion aiida_lammps/calculations/lammps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ def prepare_for_submission(self, tempfolder): # pylint: disable=arguments-diffe
codeinfo = CodeInfo()
codeinfo.cmdline_params = list(self._cmdline_params)
codeinfo.code_uuid = self.inputs.code.uuid
codeinfo.withmpi = self.metadata.options.withmpi
codeinfo.stdout_name = self._stdout_name

calcinfo = CalcInfo()
Expand Down
2 changes: 0 additions & 2 deletions aiida_lammps/calculations/lammps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ def prepare_for_submission(self, folder):
codeinfo.code_uuid = self.inputs.code.uuid
# Set the name of the stdout
codeinfo.stdout_name = _output_filename
# Set whether or not one is running with MPI
codeinfo.withmpi = self.inputs.metadata.options.withmpi

# Generate the datastructure for the calculation information
calcinfo = datastructures.CalcInfo()
Expand Down

0 comments on commit 38d69fa

Please sign in to comment.