Commit 203ef17a authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

Merge branch 'feature/tweak-slurm' into develop

parents be7f6da3 2862029d
Pipeline #65034 passed with stage
in 4 minutes and 39 seconds
......@@ -4,18 +4,18 @@
# #
# This file is part of bfps. #
# #
# TurTLE is free software: you can redistribute it and/or modify #
# TurTLE is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published #
# by the Free Software Foundation, either version 3 of the License, #
# or (at your option) any later version. #
# #
# TurTLE is distributed in the hope that it will be useful, #
# TurTLE is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with TurTLE. If not, see <http://www.gnu.org/licenses/> #
# along with TurTLE. If not, see <http://www.gnu.org/licenses/> #
# #
# Contact: Cristian.Lalescu@ds.mpg.de #
# #
......@@ -678,9 +678,9 @@ class _code(_base):
script_file.write('#SBATCH -o ' + out_file + '\n')
# set up environment
script_file.write('#SBATCH --get-user-env\n')
script_file.write('#SBATCH --partition={0}\n'.format(
self.host_info['environment']))
if self.host_info['explicit_slurm_environment']:
script_file.write('#SBATCH --partition={0}\n'.format(
self.host_info['environment']))
if 'account' in self.host_info.keys():
script_file.write('#SBATCH --account={0}\n'.format(
self.host_info['account']))
......@@ -717,11 +717,15 @@ class _code(_base):
script_file.write('#SBATCH --mail-type=none\n')
script_file.write('#SBATCH --time={0}:{1:0>2d}:00\n'.format(hours, minutes))
if 'extra_slurm_lines' in self.host_info.keys():
for line in self.host_info['extra_slurm_lines']:
script_file.write(line + '\n')
## following cleans up environment for job.
## put these in the 'extra_slurm_lines' list if you need them
## make sure that "~/.config/TurTLE/bashrc" exists and builds desired job environment
script_file.write('#SBATCH --export=NONE\n')
script_file.write('#SBATCH --get-user-env\n')
script_file.write('source ~/.config/TurTLE/bashrc\n')
#script_file.write('#SBATCH --export=NONE\n')
#script_file.write('#SBATCH --get-user-env\n')
#script_file.write('source ~/.config/TurTLE/bashrc\n')
if nb_threads_per_process > 1:
script_file.write('export OMP_NUM_THREADS={0}\n'.format(nb_threads_per_process))
script_file.write('export OMP_PLACES=cores\n')
......
......@@ -32,7 +32,9 @@ host_info = {'type' : 'pc'}
# 'deltanprocs' : info_template_deltanprocs,
# 'mail_address': info_template_mail_address,
# 'account' : info_template_account,
# 'executable_launcher': info_template_executable_launcher}
# 'executable_launcher' : info_template_executable_launcher,
# 'extra_slurm_lines' : info_template_extra_slurm_lines,
# 'explicit_slurm_environment' : info_template_explicit_slurm_environment}
# info_template_type can be one of:
# 'pc' --- jobs run interactively
......@@ -59,3 +61,13 @@ host_info = {'type' : 'pc'}
# info_template_executable_launcher, relevant for 'SLURM' clusters,
# is the binary that should be called to execute the hybrid MPI/OpenMP code.
# by default it is 'srun', but it may be 'mpiexec' for some machines.
# info_template_extra_slurm_lines, relevant for 'SLURM' clusters,
# is a list of strings, written as extra options within the SLURM file.
# for example something like `#SBATCH --get-user-env`
# info_template_explicit_slurm_environment, relevant for `SLURM` clusters,
# is a bool specifying whether the environment must be mentioned explicitly
# in the submission script, or whether the cluster chooses it based on the
# resources requested
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment