@@ -34,7 +34,7 @@ class MpirunLauncher(Launcher):
3434 }
3535
3636 _distribution_options_map = {
37- CpuDistribution .DISTRIBUTE_BLOCK : 'core ' ,
37+ CpuDistribution .DISTRIBUTE_BLOCK : 'slot ' ,
3838 CpuDistribution .DISTRIBUTE_CYCLIC : 'numa' ,
3939 }
4040
@@ -45,27 +45,22 @@ def _get_distribution_options(self, job: Job) -> List[str]:
4545 CpuDistribution .DISTRIBUTE_USER ,
4646 None ,
4747 ]
48- if hasattr (job , 'distribute_remote' ) and job .distribute_remote not in do_nothing :
49- warning ('Specified remote distribution option ignored in MpirunLauncher' )
5048
51- # By default use core mapping. At least that's the default in the
52- # OpenMPI implementation
53- # (https://docs.open-mpi.org/en/main/man-openmpi/man1/mpirun.1.html#label-schizo-ompi-map-by).
54- map_by = 'core'
49+ # Ignore remote distribution options. Mpirun doesn't distinguish
50+ # between local/remote distribution as far as I know.
51+ if job . distribute_remote is not None :
52+ warning ( 'Distribute_remote options is ignored in MpirunLauncher' )
5553
5654 if job .distribute_local and job .distribute_local not in do_nothing :
57- map_by = self ._distribution_options_map [job .distribute_local ]
58- elif job .cpus_per_task is None :
59- # If no local distribution must be set and the number of threads
60- # isn't specified, we don't have to add any flags.
61- return []
55+ # Use map-by to control the distribution. If threads are used, we
56+ # also have to set the PE:number-of-threads option.
6257
63- # If multithreading is used, we have to specify the number of threads
64- # per process in the map_by statement.
65- if job .cpus_per_task :
66- return ['--map-by' , f'{ map_by } :PE= { job . cpus_per_task } ' ]
58+ map_by = self . _distribution_options_map [ job . distribute_local ]
59+ if job . cpus_per_task :
60+ return [ '--map-by' , f' { map_by } :PE= { job .cpus_per_task } ' ]
61+ return ['--map-by' , f'{ map_by } ' ]
6762
68- return ['--map-by' , f' { map_by } ' ]
63+ return []
6964
7065 def prepare (
7166 self ,
0 commit comments