Différences

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

Lien vers cette vue comparative

Prochaine révision
Révision précédente
Dernière révisionLes deux révisions suivantes
en:documentation:tutorials:submit:jobsequentielbash [2018/01/17 06:25] – créée cicalugaen: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:tools:sge|on this page]] as well as [[faq:sge|in the F.A.Q.]].+The batch system currently used at the PSMN is Sun Grid Engine (SGE). Its documentation is [[documentation:tools:sge|on this page]] as well as [[en:faq:accueil|in the F.A.Q.]].
  
  
Ligne 20: Ligne 20:
 <note warning> Some variables have to be updated, for exemple, according to [[documentation:clusters:batch#les_files_d_attente|the actual configurations of the queues]].</note> <note warning> Some variables have to be updated, for exemple, according to [[documentation:clusters:batch#les_files_d_attente|the actual configurations of the queues]].</note>
  
-Othere [[documentation:examples:tutorials_scripts|exemples of submission scripts ]], [[documentation:examples:submit_scripts|exemples of submission scripts]] as well as [[documentation:tutorials:build:accueil|tutorials]].+Other [[documentation:examples:tutorials_scripts|exemples of submission scripts ]], [[documentation:examples:submit_scripts|exemples of submission scripts]] as well as [[documentation:tutorials:build:accueil|tutorials]].
  
 ======for sequential programs  (shell bash)====== ======for sequential programs  (shell bash)======
Ligne 32: Ligne 32:
 # #
 ### variables SGE ### variables SGE
-### shell du job+### shell of the job
 #$ -S /bin/bash #$ -S /bin/bash
 ### job name (to change): ### job name (to change):
 #$ -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:
 ###EXECDIR=${HOME}/Formations/Sequentiel ###EXECDIR=${HOME}/Formations/Sequentiel
 ###${EXECDIR}/SommeVecVecSEQ.exe < Monfichierdedata > monfichierresultat ###${EXECDIR}/SommeVecVecSEQ.exe < Monfichierdedata > monfichierresultat
-./SommeVecVecSEQ.f90.exe+./SommeVecVecSEQ.exe
  
-fin+end
 </code> </code>
  
  
-Travailler dans le /scratch+Work in the  /scratch
  
-<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'attente (a changer)+### queue (to change)
 #$ -q E5-2670_test #$ -q E5-2670_test
-### charger l'environnement utilisateur pour SGE+### load the user environment for SGE
 #$ -cwd #$ -cwd
-### exporter les variables d'environnement sur tous les noeuds d'execution+### export environment variables on all execution nodes
 #$ -V #$ -V
-### mails en debut et fin d'execution+### start and end of execution mails
 #$ -m be #$ -m be
-aller dans le repertoire de travail/soumission +go to the work submission directory 
-# important, sinon, le programme est lancé depuis ~/+# important, otherwise the program is running since ~/
 cd ${SGE_O_WORKDIR} cd ${SGE_O_WORKDIR}
-### configurer l'environnement (a changer)+### configure the environment (to change)
  
-module load iccifort/2017.+module load GCC/7.2.0 
  
-for bash: +### SCRATCHDIR definition 
-SCRATCHDIR=${SGE_O_WORKDIR/home/scratch+SCRATCHDIR=/scratch/votre_login/${SGE_O_WORKDIR} 
-/bin/mkdir -p $SCRATCHDIR+### SCRATCHDIR checking 
 +echo "SCRATCHDIR=${SCRATCHDIR}"
  
-/bin/cp -rf SommeVecVecSEQ.f90.exe $SCRATCHDIR/ +### creation of the working directory in /scratch 
-###/bin/cp -rf $INPUT $SCRATCHDIR/+if [[ ! -d "${SCRATCHDIR}" ]]  
 +then 
 +   /bin/mkdir -${SCRATCHDIR
 +fi 
  
-go to scratch (instead of workdir) before running binary+### copy source files to /scratch 
 +/bin/cp ${SGE_O_WORKDIR}/* ${SCRATCHDIR}/ 
 +  
 +### move into the execution directory BEFORE launching the program
 cd ${SCRATCHDIR} cd ${SCRATCHDIR}
- +  
-### execution du programme+### program execution
 ######EXECDIR=/scratch/cicaluga/tempo ######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+end
 </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]].