|
| 1 | +#!/usr/bin/env bash |
| 2 | +# Copyright 2013-2017 Axel Huebl, Richard Pausch, Rene Widera |
| 3 | +# |
| 4 | +# This file is part of PIConGPU. |
| 5 | +# |
| 6 | +# PIConGPU is free software: you can redistribute it and/or modify |
| 7 | +# it under the terms of the GNU General Public License as published by |
| 8 | +# the Free Software Foundation, either version 3 of the License, or |
| 9 | +# (at your option) any later version. |
| 10 | +# |
| 11 | +# PIConGPU is distributed in the hope that it will be useful, |
| 12 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +# GNU General Public License for more details. |
| 15 | +# |
| 16 | +# You should have received a copy of the GNU General Public License |
| 17 | +# along with PIConGPU. |
| 18 | +# If not, see <http://www.gnu.org/licenses/>. |
| 19 | +# |
| 20 | + |
| 21 | + |
| 22 | +# PIConGPU batch script for taurus' SLURM batch system |
| 23 | + |
| 24 | +#SBATCH --partition=!TBG_queue |
| 25 | +#SBATCH --time=!TBG_wallTime |
| 26 | +# Sets batch job's name |
| 27 | +#SBATCH --job-name=!TBG_jobName |
| 28 | +#SBATCH --nodes=!TBG_nodes |
| 29 | +#SBATCH --ntasks=!TBG_tasks |
| 30 | +#SBATCH --mincpus=!TBG_mpiTasksPerNode |
| 31 | +#SBATCH --cpus-per-task=!TBG_coresPerGPU |
| 32 | +#SBATCH --exclusive |
| 33 | +# send me mails on BEGIN, END, FAIL, REQUEUE, ALL, |
| 34 | +# TIME_LIMIT, TIME_LIMIT_90, TIME_LIMIT_80 and/or TIME_LIMIT_50 |
| 35 | +#SBATCH --mail-type=!TBG_mailSettings |
| 36 | +#SBATCH --mail-user=!TBG_mailAddress |
| 37 | +#SBATCH --workdir=!TBG_dstPath |
| 38 | + |
| 39 | +#SBATCH -o stdout |
| 40 | +#SBATCH -e stderr |
| 41 | + |
| 42 | + |
| 43 | +## calculations will be performed by tbg ## |
| 44 | +.TBG_queue="general" |
| 45 | + |
| 46 | +# settings that can be controlled by environment variables before submit |
| 47 | +.TBG_mailSettings=${MY_MAILNOTIFY:-"ALL"} |
| 48 | +.TBG_mailAddress=${MY_MAIL:-"someone@example.com"} |
| 49 | +.TBG_author=${MY_NAME:+--author \"${MY_NAME}\"} |
| 50 | +.TBG_profile=${PIC_PROFILE:-"~/picongpu.profile"} |
| 51 | + |
| 52 | +# 1 gpus per node |
| 53 | +.TBG_gpusPerNode=2 |
| 54 | + |
| 55 | +# number of cores to block per GPU - we got 6 cpus per gpu |
| 56 | +# and we will be accounted 6 CPUs per GPU anyway |
| 57 | +.TBG_coresPerGPU=32 |
| 58 | + |
| 59 | +# We only start 2 MPI task per GPU |
| 60 | +.TBG_mpiTasksPerNode="!TBG_gpusPerNode" |
| 61 | + |
| 62 | +# use ceil to caculate nodes |
| 63 | +.TBG_nodes="$((( TBG_tasks + TBG_gpusPerNode -1 ) / TBG_gpusPerNode))" |
| 64 | + |
| 65 | +## end calculations ## |
| 66 | + |
| 67 | +echo 'Running program...' |
| 68 | + |
| 69 | +cd !TBG_dstPath |
| 70 | + |
| 71 | +export MODULES_NO_OUTPUT=1 |
| 72 | +source !TBG_profile |
| 73 | +if [ $? -ne 0 ] ; then |
| 74 | + echo "Error: PIConGPU environment profile under \"!TBG_profile\" not found!" |
| 75 | + exit 1 |
| 76 | +fi |
| 77 | +unset MODULES_NO_OUTPUT |
| 78 | + |
| 79 | +#set user rights to u=rwx;g=r-x;o=--- |
| 80 | +umask 0027 |
| 81 | + |
| 82 | +mkdir simOutput 2> /dev/null |
| 83 | +cd simOutput |
| 84 | + |
| 85 | +#wait that all nodes see ouput folder |
| 86 | +sleep 1 |
| 87 | + |
| 88 | +# Run PIConGPU |
| 89 | +srun -K1 !TBG_dstPath/tbg/cpuNumaStarter.sh !TBG_dstPath/input/bin/picongpu !TBG_author !TBG_programParams | tee output |
| 90 | + |
| 91 | + |
0 commit comments