#!/bin/bash # ### variables SGE # ### shell du job #$ -S /bin/bash ### nom du job (a changer) #$ -N SommeVecVecSEQ ### file d'attente (a changer) #$ -q E5_test ### charger l'environnement utilisateur pour SGE #$ -cwd ### exporter les variables d'environnement sur tous les noeuds d'execution #$ -V ### mails en debut et fin d'execution #$ -m be # aller dans le repertoire de travail/soumission # important, sinon, le programme est lancé depuis ~/ cd ${SGE_O_WORKDIR} ### configurer l'environnement (a changer) module load GCC/7.2.0 ### definition SCRATCHDIR en fonction de la partition existent if [[ -d "/scratch/Lake" ]] 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 ###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} ### execution du programme EXECDIR=${SCRATCHDIR} ${EXECDIR}/SommeVecVecSEQ.exe > output_scratch ####./SommeVecVecSEQ.exe # copy results from scratch to home /bin/cp -r $SCRATCHDIR/output_scratch $SGE_O_WORKDIR/output_home # rm -fr ${SCRATCHDIR}/* # fin