|
| 1 | +#!/bin/bash |
| 2 | +# Copyright 2013-2015 Axel Huebl, Anton Helm, 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 | +## calculation are done by tbg ## |
| 23 | +TBG_queue="k80" |
| 24 | +TBG_mailAddress=${MY_MAIL:-"someone@example.com"} |
| 25 | +TBG_mailSettings=${MY_MAILNOTIFY:-"n"} |
| 26 | + |
| 27 | +# 8 gpus per node if we need more than 8 gpus else same count as TBG_tasks |
| 28 | +TBG_gpusPerNode=`if [ $TBG_tasks -gt 8 ] ; then echo 8; else echo $TBG_tasks; fi` |
| 29 | + |
| 30 | +#number of cores per parallel node / default is 2 cores per gpu on k20 queue |
| 31 | +TBG_coresPerNode="$(( TBG_gpusPerNode * 2 ))" |
| 32 | + |
| 33 | +# use ceil to caculate nodes |
| 34 | +TBG_nodes="$(( ( TBG_tasks + TBG_gpusPerNode -1 ) / TBG_gpusPerNode))" |
| 35 | +## end calculations ## |
| 36 | + |
| 37 | +# PIConGPU batch script for hypnos PBS batch system |
| 38 | + |
| 39 | +#PBS -q !TBG_queue |
| 40 | +#PBS -l walltime=!TBG_wallTime |
| 41 | +# Sets batch job's name |
| 42 | +#PBS -N !TBG_jobName |
| 43 | +#PBS -l nodes=!TBG_nodes:ppn=!TBG_coresPerNode |
| 44 | +# send me a mail on (b)egin, (e)nd, (a)bortion |
| 45 | +#PBS -m !TBG_mailSettings -M !TBG_mailAddress |
| 46 | +#PBS -d !TBG_dstPath |
| 47 | +#PBS -n |
| 48 | + |
| 49 | +#PBS -o stdout |
| 50 | +#PBS -e stderr |
| 51 | + |
| 52 | +echo 'Running program...' |
| 53 | + |
| 54 | +cd !TBG_dstPath |
| 55 | + |
| 56 | +export MODULES_NO_OUTPUT=1 |
| 57 | +source ~/picongpu.profile |
| 58 | +if [ $? -ne 0 ] ; then |
| 59 | + echo "Error: ~/picongpu.profile not found!" |
| 60 | + exit 1 |
| 61 | +fi |
| 62 | +unset MODULES_NO_OUTPUT |
| 63 | + |
| 64 | +#set user rights to u=rwx;g=r-x;o=--- |
| 65 | +umask 0027 |
| 66 | + |
| 67 | +mkdir simOutput 2> /dev/null |
| 68 | +cd simOutput |
| 69 | + |
| 70 | +#wait that all nodes see ouput folder |
| 71 | +sleep 1 |
| 72 | + |
| 73 | +mpiexec --prefix $MPIHOME -tag-output --display-map -x LIBRARY_PATH -x LD_LIBRARY_PATH -am !TBG_dstPath/tbg/openib.conf --mca mpi_leave_pinned 0 -npernode !TBG_gpusPerNode -n !TBG_tasks !TBG_dstPath/picongpu/bin/cuda_memtest.sh |
| 74 | + |
| 75 | +if [ $? -eq 0 ] ; then |
| 76 | + mpiexec --prefix $MPIHOME -x LIBRARY_PATH -x LD_LIBRARY_PATH -tag-output --display-map -am !TBG_dstPath/tbg/openib.conf --mca mpi_leave_pinned 0 -npernode !TBG_gpusPerNode -n !TBG_tasks !TBG_dstPath/picongpu/bin/picongpu !TBG_programParams |
| 77 | +fi |
| 78 | + |
| 79 | +mpiexec --prefix $MPIHOME -x LIBRARY_PATH -x LD_LIBRARY_PATH -npernode !TBG_gpusPerNode -n !TBG_tasks killall -9 picongpu |
0 commit comments