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édente | ||
| documentation:tutorials:submit:jobsequentielbash [2018/01/14 13:53] – cicaluga | documentation:tutorials:submit:jobsequentielbash [2021/01/14 15:55] (Version actuelle) – [job séquentiel (shell bash)] cicaluga | ||
|---|---|---|---|
| Ligne 2: | Ligne 2: | ||
| - | Le système de batch actuellement utilisé par le PSMN est Sun Grid Engine (SGE). Sa documentation se trouve [[documentation: | + | Le système de batch actuellement utilisé par le PSMN est Sun Grid Engine (SGE). Sa documentation se trouve [[documentation: |
| Ligne 10: | Ligne 10: | ||
| <code bash> | <code bash> | ||
| - | qsub programme <input > | + | qsub script_seq |
| - | </ | + | |
| - | + | ||
| - | Il est possible de rajouter des options : | + | |
| - | <code bash> | + | |
| - | qsub -V -m b -m e -e / | + | |
| - | </ | + | |
| - | + | ||
| - | avec : | + | |
| - | < | + | |
| - | -V : export environment variables | + | |
| - | -m b : mail @begin | + | |
| - | -m e : mail @end | + | |
| - | -e : where to put error files | + | |
| - | -o : where to put output files | + | |
| - | -q : file d' | + | |
| - | </ | + | |
| - | + | ||
| - | **Il est plus simple de soumettre simplement un (ou plusieurs) script contenant plus d' | + | |
| - | + | ||
| - | < | + | |
| - | qsub -m b -m e monscript | + | |
| </ | </ | ||
| Ligne 46: | Ligne 25: | ||
| On peut soumettre son job en utilisant la commande suivante : | On peut soumettre son job en utilisant la commande suivante : | ||
| - | <code bash> qsub batch.sh</ | + | <code bash> qsub script_seq</ |
| - | <code bash batch.sh> | + | <code bash script_seq> |
| #!/bin/bash | #!/bin/bash | ||
| # | # | ||
| Ligne 57: | Ligne 36: | ||
| #$ -N SommeVecVecSEQ | #$ -N SommeVecVecSEQ | ||
| ### file d' | ### file d' | ||
| - | #$ -q E5-2670_test | + | #$ -q E5_test |
| ### charger l' | ### charger l' | ||
| #$ -cwd | #$ -cwd | ||
| Ligne 69: | Ligne 48: | ||
| cd ${SGE_O_WORKDIR} | cd ${SGE_O_WORKDIR} | ||
| - | ### configurer l' | + | # init env (should be in ~/.profile) |
| - | ### source /usr/share/modules/init/bash | + | source /usr/share/lmod/lmod/init/bash |
| - | ### module use / | + | |
| - | ### module load Base/psmn | + | |
| - | module load iccifort/ | + | |
| - | ### execution du programme | + | ### configurer l' |
| + | module load GCC/7.2.0 | ||
| + | |||
| + | ### execution du programme | ||
| ### | ### | ||
| ### | ### | ||
| - | ./ | + | ./ |
| # fin | # fin | ||
| Ligne 86: | Ligne 65: | ||
| Travailler dans le /scratch | Travailler dans le /scratch | ||
| - | <code bash batch.sh> | + | <code bash script_seq> |
| #!/bin/bash | #!/bin/bash | ||
| # | # | ||
| Ligne 96: | Ligne 75: | ||
| #$ -N SommeVecVecSEQ | #$ -N SommeVecVecSEQ | ||
| ### file d' | ### file d' | ||
| - | #$ -q E5-2670_test | + | #$ -q E5_test |
| ### charger l' | ### charger l' | ||
| #$ -cwd | #$ -cwd | ||
| Ligne 106: | Ligne 85: | ||
| # important, sinon, le programme est lancé depuis ~/ | # important, sinon, le programme est lancé depuis ~/ | ||
| cd ${SGE_O_WORKDIR} | cd ${SGE_O_WORKDIR} | ||
| - | ### configurer l' | + | ### configurer l' |
| - | ### source / | + | |
| - | ### source / | + | |
| - | ### module use / | + | |
| - | ### module load Base/psmn | + | |
| - | module load iccifort/ | + | |
| - | # for bash: | + | module load GCC/7.2.0 |
| - | SCRATCHDIR=${SGE_O_WORKDIR/home/ | + | |
| - | /bin/mkdir -p $SCRATCHDIR | + | |
| - | /bin/cp -rf SommeVecVecSEQ.f90.exe $SCRATCHDIR/ | + | ### definition |
| - | ###/bin/cp -rf $INPUT $SCRATCHDIR/ | + | |
| - | # go to scratch | + | if [[ -d "/ |
| + | then | ||
| + | SCRATCHDIR="/ | ||
| + | elif [[ -d "/ | ||
| + | then | ||
| + | SCRATCHDIR="/ | ||
| + | else | ||
| + | echo " | ||
| + | SCRATCHDIR=" | ||
| + | fi | ||
| + | |||
| + | ### | ||
| + | |||
| + | ### verif SCRATCHDIR | ||
| + | echo " | ||
| + | |||
| + | ### creation du repertoire de travail dans le /scratch | ||
| + | if [[ ! -d " | ||
| + | then | ||
| + | / | ||
| + | fi | ||
| + | |||
| + | ### copie des fichiers sources dans le /scratch | ||
| + | /bin/cp ${SGE_O_WORKDIR}/ | ||
| + | |||
| + | ### se placer dans le repertoire d' | ||
| cd ${SCRATCHDIR} | cd ${SCRATCHDIR} | ||
| + | |||
| ### execution du programme | ### execution du programme | ||
| - | ###### | ||
| 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 | # fin | ||
| </ | </ | ||
| - | |||
| ====== Surveiller un job ====== | ====== Surveiller un job ====== | ||
| Voir [[documentation: | Voir [[documentation: | ||