Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
documentation:tutorials:submit:jobsequentielbash [2018/01/17 05:55] cicalugadocumentation: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:tools:sge|à cette page]] ainsi que [[faq:sge|dans la F.A.Q.]].+Le système de batch actuellement utilisé par le PSMN est Sun Grid Engine (SGE). Sa documentation se trouve [[documentation:tools:sge|à cette page]] ainsi que [[faq:accueil|dans la F.A.Q.]].
  
  
Ligne 10: Ligne 10:
  
 <code bash> <code bash>
-qsub programme <input >output +qsub script_seq
-</code> +
- +
-Il est possible de rajouter des options : +
-<code bash> +
-qsub -V -m b -m e -e /path/to/workdir -o /path/to/workdir -q $QUEUE programme > output.log +
-</code> +
- +
-avec : +
-<code> +
--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'attente +
-</code> +
- +
-**Il est plus simple de soumettre simplement un (ou plusieurs) script contenant plus d'options** : +
- +
-<code> +
-qsub -m b -m e monscript+
 </code> </code>
  
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>+<code bash> qsub script_seq</code>
  
-<code bash batch.sh>+<code bash script_seq>
 #!/bin/bash #!/bin/bash
 # #
Ligne 57: Ligne 36:
 #$ -N SommeVecVecSEQ #$ -N SommeVecVecSEQ
 ### file d'attente (a changer) ### file d'attente (a changer)
-#$ -q E5-2670_test+#$ -q E5_test
 ### charger l'environnement utilisateur pour SGE ### charger l'environnement utilisateur pour SGE
 #$ -cwd #$ -cwd
Ligne 69: Ligne 48:
 cd ${SGE_O_WORKDIR} cd ${SGE_O_WORKDIR}
  
-### configurer l'environnement (a changer)+init env (should be in ~/.profile) 
 +source /usr/share/lmod/lmod/init/bash
  
-module load iccifort/2017.+### configurer l'environnement (a changer) 
 +module load GCC/7.2.0
  
 ### execution du programme (a changer avec votre executable) ### execution du programme (a changer avec votre executable)
 ###EXECDIR=${HOME}/Formations/Sequentiel ###EXECDIR=${HOME}/Formations/Sequentiel
 ###${EXECDIR}/SommeVecVecSEQ.exe < Monfichierdedata > monfichierresultat ###${EXECDIR}/SommeVecVecSEQ.exe < Monfichierdedata > monfichierresultat
-./SommeVecVecSEQ.f90.exe+./SommeVecVecSEQ.exe
  
 # fin # fin
Ligne 84: Ligne 65:
 Travailler dans le /scratch Travailler dans le /scratch
  
-<code bash batch.sh>+<code bash script_seq>
 #!/bin/bash #!/bin/bash
 # #
Ligne 94: Ligne 75:
 #$ -N SommeVecVecSEQ #$ -N SommeVecVecSEQ
 ### file d'attente (a changer) ### file d'attente (a changer)
-#$ -q E5-2670_test+#$ -q E5_test
 ### charger l'environnement utilisateur pour SGE ### charger l'environnement utilisateur pour SGE
 #$ -cwd #$ -cwd
Ligne 106: Ligne 87:
 ### configurer l'environnement (a changer) ### configurer l'environnement (a changer)
  
-module load iccifort/2017.+module load GCC/7.2.0 
  
-for bash: +### definition SCRATCHDIR en fonction de la partition existent
-SCRATCHDIR=${SGE_O_WORKDIR/home/scratch} +
-/bin/mkdir -p $SCRATCHDIR+
  
-/bin/cp -rf SommeVecVecSEQ.f90.exe $SCRATCHDIR/ +if [[ -d "/scratch/Lake" ]] 
-###/bin/cp -rf $INPUT $SCRATCHDIR/+then 
 +    SCRATCHDIR="/scratch/Lake/${USER}/${JOB_ID}/" 
 +elif [[ -d "/scratch/E5N" ]] 
 +then 
 +    SCRATCHDIR="/scratch/E5N/${USER}/${JOB_ID}/"  
 +else 
 +    echo "Cannot create ${SCRATCHDIR} on /scratch, creating it in the current directory" 
 +    SCRATCHDIR="${SGE_O_WORKDIR}/scratch/" 
 +fi
  
-go to scratch (instead of workdir) before running binary+###SCRATCHDIR=/scratch/E5N/votre_login/Formations/Sequentiel 
 + 
 +### verif SCRATCHDIR 
 +echo "SCRATCHDIR=${SCRATCHDIR}" 
 + 
 +### creation du repertoire de travail dans le /scratch 
 +if [[ ! -d "${SCRATCHDIR}" ]]  
 +then 
 +   /bin/mkdir -p ${SCRATCHDIR} 
 +fi  
 + 
 +### copie des fichiers sources dans le /scratch 
 +/bin/cp ${SGE_O_WORKDIR}/* ${SCRATCHDIR}/ 
 +  
 +### se placer dans le repertoire d'execution AVANT le lancement du programme
 cd ${SCRATCHDIR} cd ${SCRATCHDIR}
 + 
 ### execution du programme ### execution du programme
-######EXECDIR=/scratch/cicaluga/tempo 
 EXECDIR=${SCRATCHDIR} EXECDIR=${SCRATCHDIR}
-${EXECDIR}/SommeVecVecSEQ.f90.exe > output +${EXECDIR}/SommeVecVecSEQ.exe > output_scratch 
-####./SommeVecVecSEQ.f90.exe +####./SommeVecVecSEQ.exe 
 + 
 # copy results from scratch to home # copy results from scratch to home
-/bin/cp -r $SCRATCHDIR/output $SGE_O_WORKDIR/ +/bin/cp -r $SCRATCHDIR/output_scratch $SGE_O_WORKDIR/output_home 
- +  
-rm -fr ${SCRATCHDIR}/+rm -fr ${SCRATCHDIR}/
 + 
 # fin # fin
 </code> </code>
- 
  
 ====== Surveiller un job ====== ====== Surveiller un job ======
  
 Voir [[documentation:tools:sge#surveiller_les_jobs|la documentation]] qui correspond et [[documentation:examples:qstat_cli|les exemples]]. Voir [[documentation:tools:sge#surveiller_les_jobs|la documentation]] qui correspond et [[documentation:examples:qstat_cli|les exemples]].
documentation/tutorials/submit/jobsequentielbash.1516168542.txt.gz · Dernière modification : 2020/08/25 15:58 (modification externe)