def extra_options(): """Add custom easyconfig parameters for SystemMPI easyblock.""" # Gather extra_vars from inherited classes, order matters to make sure bundle initialises correctly extra_vars = ConfigureMake.extra_options() extra_vars.update(EB_impi.extra_options()) extra_vars.update(Bundle.extra_options()) # Add an option to add all module path extensions to the resultant easyconfig # This is useful if you are importing the MPI installation from a non-default path extra_vars.update({ 'generate_standalone_module': [False, "Add known path extensions and environment variables for the MPI " "installation to the final module", CUSTOM], }) return extra_vars
def make_module_extra(self, *args, **kwargs): """Add any additional module text.""" if self.cfg['generate_standalone_module']: if self.cfg['name'] in ['OpenMPI', 'SpectrumMPI']: extras = ConfigureMake.make_module_extra(self, *args, **kwargs) elif self.cfg['name'] in ['impi']: extras = EB_impi.make_module_extra(self, *args, **kwargs) else: raise EasyBuildError("I don't know how to generate extra module text for %s", self.cfg['name']) # include environment variables defined for MPI implementation for key, val in sorted(self.mpi_env_vars.items()): extras += self.module_generator.set_environment(key, val) self.log.debug("make_module_extra added this: %s" % extras) else: extras = super(SystemMPI, self).make_module_extra(*args, **kwargs) return extras
def make_module_req_guess(self): """ A dictionary of possible directories to look for. Return known dict for the system MPI. """ guesses = {} if self.cfg['generate_standalone_module']: if self.mpi_prefix in ['/usr', '/usr/local']: # Force off adding paths to module since unloading such a module would be a potential shell killer print_warning("Ignoring option 'generate_standalone_module' since installation prefix is %s", self.mpi_prefix) else: if self.cfg['name'] in ['OpenMPI', 'SpectrumMPI']: guesses = ConfigureMake.make_module_req_guess(self) elif self.cfg['name'] in ['impi']: guesses = EB_impi.make_module_req_guess(self) else: raise EasyBuildError("I don't know how to generate module var guesses for %s", self.cfg['name']) return guesses