Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
en:documentation:tutorials:submit:jobsequentielbash [2018/01/17 06:59] – cicaluga | en:documentation:tutorials:submit:jobsequentielbash [2020/08/25 15:58] – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 2: | Ligne 2: | ||
- | The batch system currently used at the PSMN is Sun Grid Engine (SGE). Its documentation is [[documentation: | + | The batch system currently used at the PSMN is Sun Grid Engine (SGE). Its documentation is [[documentation: |
Ligne 37: | Ligne 37: | ||
#$ -N SommeVecVecSEQ | #$ -N SommeVecVecSEQ | ||
### queue (to change) | ### queue (to change) | ||
- | #$ -q E5-2670_test | + | #$ -q E5_test |
### load the user environment for SGE | ### load the user environment for SGE | ||
#$ -cwd | #$ -cwd | ||
Ligne 56: | Ligne 56: | ||
### | ### | ||
### | ### | ||
- | ./ | + | ./ |
- | # fin | + | # end |
</ | </ | ||
- | Travailler dans le /scratch | + | Work in the |
- | <code bash batch.sh> | + | <code bash script_seq> |
#!/bin/bash | #!/bin/bash | ||
# | # | ||
### variables SGE | ### variables SGE | ||
# | # | ||
- | ### shell du job | + | ### shell of the job |
#$ -S /bin/bash | #$ -S /bin/bash | ||
- | ### nom du job (a changer) | + | ### job name (to change): |
#$ -N SommeVecVecSEQ | #$ -N SommeVecVecSEQ | ||
- | ### file d' | + | ### queue (to change) |
#$ -q E5-2670_test | #$ -q E5-2670_test | ||
- | ### charger l' | + | ### load the user environment for SGE |
#$ -cwd | #$ -cwd | ||
- | ### exporter les variables | + | ### export environment |
#$ -V | #$ -V | ||
- | ### mails en debut et fin d'execution | + | ### start and end of execution |
#$ -m be | #$ -m be | ||
- | # aller dans le repertoire de travail/soumission | + | # go to the work / submission directory |
- | # important, | + | # important, |
cd ${SGE_O_WORKDIR} | cd ${SGE_O_WORKDIR} | ||
- | ### configurer l' | + | ### configure the environment |
- | module load iccifort/2017.4 | + | module load GCC/7.2.0 |
- | # for bash: | + | ### SCRATCHDIR definition |
- | SCRATCHDIR=${SGE_O_WORKDIR/ | + | SCRATCHDIR=/ |
- | /bin/mkdir -p $SCRATCHDIR | + | ### SCRATCHDIR checking |
+ | echo " | ||
- | /bin/ | + | ### creation of the working directory in /scratch |
- | ###/bin/cp -rf $INPUT | + | if [[ ! -d "${SCRATCHDIR}" ]] |
+ | then | ||
+ | /bin/mkdir -p ${SCRATCHDIR} | ||
+ | fi | ||
- | # go to scratch | + | ### copy source files to /scratch |
+ | /bin/cp ${SGE_O_WORKDIR}/ | ||
+ | |||
+ | ### move into the execution directory BEFORE launching the program | ||
cd ${SCRATCHDIR} | cd ${SCRATCHDIR} | ||
- | + | ||
- | ### execution | + | ### program |
###### | ###### | ||
EXECDIR=${SCRATCHDIR} | EXECDIR=${SCRATCHDIR} | ||
- | ${EXECDIR}/ | + | ${EXECDIR}/ |
- | #### | + | #### |
+ | |||
# copy results from scratch to home | # copy results from scratch to home | ||
- | /bin/cp -r $SCRATCHDIR/ | + | /bin/cp -r $SCRATCHDIR/ |
- | + | ||
- | rm -fr ${SCRATCHDIR}/ | + | # rm -fr ${SCRATCHDIR}/ |
- | + | ||
- | # fin | + | # end |
</ | </ | ||
- | |||
- | |||
====== Surveiller un job ====== | ====== Surveiller un job ====== | ||
Voir [[documentation: | Voir [[documentation: |