Closed sphuber closed 8 months ago
@giovannipizzi I think this should have helped with the resource validation issue you encountered
Thanks - I was more thinking to enforce this at the execution level of the specific ShellJob, more than changing the default - the user might want to run on the same computer, even with localhost, with more MPI processes in the future? is it doable?
the user might want to run on the same computer, even with localhost, with more MPI processes in the future?
It is just the default though, nothing is preventing them from specifying more. If that is what they wanted to do, they would anyway have to explicitly specify it, and so nothing would change in that scenario, whether the computer defines a default or not.
is it doable?
I guess so. Instead of having the check in prepare_computer
, I could do a check in launch_shell_job
to check that if the computer doesn't define a default, then the metadata.options.resources
contains the num_mpiprocs_per_machine
key. But the current solution has the benefit that the "problem" is fixed even when directly launching the ShellJob
and not use the launch_shell_job
wrapper. If we put the solution in the wrapper, then the user would still have to manually specify the resources.
Fixes #78
If the
localhost
is created beforeprepare_computer
is ever called, it is possible that the propertydefault_mpiprocs_per_machine
is not set. This would result in theShellJob
validation failing if the scheduler type has a job resource class that is a subclass ofaiida.schedulers.datastructures.NodeNumberJobResource
.The
prepare_computer
function now checks that if thelocalhost
computer already exists that thedefault_mpiprocs_per_machine
property is defined if the scheduler has the relevant job resource class. If that is the case, the default is set to 1.