Skip to content
Snippets Groups Projects
Commit e93178fe authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

Merge branch 'fix/core-distribution' into develop

parents c9d3514b eaeff75d
No related branches found
No related tags found
No related merge requests found
Pipeline #122518 passed
......@@ -760,12 +760,15 @@ class _code(_base):
script_file.write('export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}\n')
# explicit binding options that can be used further on if needed
core_masks = TurTLE.tools.distribute_cores_evenly(
nprocesses = nb_processes_per_node,
nthreads_per_process = nb_threads_per_process,
total_number_of_cores = nb_cpus_per_node)
script_file.write('export SLURM_CPU_BIND_OPTION="--cpu-bind=verbose,mask_cpu:' +
','.join(['0x{0:x}'.format(mm) for mm in core_masks]) + '"\n')
if 'use_TurTLE_core_distribution' not in host_info.keys():
host_info['use_TurTLE_core_distribution'] = False
if host_info['use_TurTLE_core_distribution']:
core_masks = TurTLE.tools.distribute_cores_evenly(
nprocesses = nb_processes_per_node,
nthreads_per_process = nb_threads_per_process,
total_number_of_cores = nb_cpus_per_node)
script_file.write('export SLURM_CPU_BIND_OPTION="--cpu-bind=verbose,mask_cpu:' +
','.join(['0x{0:x}'.format(mm) for mm in core_masks]) + '"\n')
script_file.write('echo "Start time is `date`"\n')
script_file.write('cd ' + self.work_dir + '\n')
......@@ -783,7 +786,9 @@ class _code(_base):
if 'executable_launcher' in self.host_info.keys():
executable_launcher = self.host_info['executable_launcher']
else:
executable_launcher = 'srun ${SLURM_CPU_BIND_OPTION}'
executable_launcher = 'srun'
if host_info['use_TurTLE_core_distribution']:
executable_launcher += ' ${SLURM_CPU_BIND_OPTION}'
if host_info['use_vtune']:
if 'vtune_executable' not in host_info.keys():
host_info['vtune_executable'] = 'vtune'
......
......@@ -32,9 +32,10 @@ host_info = {'type' : 'pc'}
# 'deltanprocs' : info_template_deltanprocs,
# 'mail_address': info_template_mail_address,
# 'account' : info_template_account,
# 'executable_launcher' : info_template_executable_launcher,
# 'extra_slurm_lines' : info_template_extra_slurm_lines,
# 'explicit_slurm_environment' : info_template_explicit_slurm_environment}
# 'executable_launcher' : info_template_executable_launcher,
# 'extra_slurm_lines' : info_template_extra_slurm_lines,
# 'explicit_slurm_environment' : info_template_explicit_slurm_environment,
# 'use_TurTLE_core_distribution' : info_use_TurTLE_core_distribution}
# info_template_type can be one of:
# 'pc' --- jobs run interactively
......@@ -73,3 +74,7 @@ host_info = {'type' : 'pc'}
# in the submission script, or whether the cluster chooses it based on the
# resources requested
# info_use_TurTLE_core_distribution, relevant for `SLURM` clusters,
# is a bool specifying whether TurTLE should request explicit core
# masks for the individual MPI processes.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment