#!/bin/bash #PBS -N lancement_simu_mpi #PBS -q mpi #PBS -l walltime=24:0:0 #PBS -S /bin/bash #PBS -v DATAWORK,SCRATCH #PBS -j oe #PBS -o debuglancement_simu_mpi.log # ATTENTION: j’utilise BASH pour créer des raccourcis en tant que fonctions, # tandis que CSH ne permet pas de les créer. # Donc ce script ne peut pas être réécrit pour CSH ################################################## cd $PBS_O_WORKDIR # racine du nom de la simu a creer export SIMUL_BASENAME="simu_test_datarmor" # Si on ne lance pas dès le début du plan, 1ere simu #export START_SIM=0 # Si on ne run pas tout le plan #export N_SIM=5 # Zip/simulation blanche de base (absolute path, see myIsis for reason) export SIMUL_FILE=$PBS_O_WORKDIR/$SIMUL_BASENAME.zip # endroit où sauvegardés des simul (pour utiliser dans R) export ISIS_BD=$SCRATCH/myISISdb # de préférence sur DATAWORK ou SCRATCH # exécutable ISIS (repo d’Éric Chatellier) export ISIS_BIN=/appli/emh-commun/isis-fish/isis-fish-4.4.8*.1*/isis-fish-4.4.8.1.jar # exécutable JAVA (repo d’Éric Chatellier) export JAVA_BIN=/appli/emh-commun/isis-fish/jdk17/bin/java # shortcut to call ISIS from R myIsis () { # pass the full simul name as the 1st arg # relative paths are a bit difficult, so I use absolute paths $JAVA_BIN -Xmx2G -XX:+UseSerialGC -jar $ISIS_BIN \ --option launch.ui false \ --option perform.vcsupdate false \ --option perform.migration false \ --option perform.cron false \ --option isis.home.directory $ISIS_BD \ --simulateWithSimulation $1 $SIMUL_FILE # ces options viennent du code source ISIS > src/main/resources/templates/ssh/qsub-script.ftl # cf README pour la raison de fixer mémoire java à 2GB } export -f myIsis # calculer le nombre de cœurs, car utiliser $NCPUS pas fiable (cf tout en bas) export mpiproc=$(cat $PBS_NODEFILE | wc -l) # normalement = 28 × nº queue MPI choisie . /usr/share/Modules/3.2.10/init/bash module purge module load R/3.6.3-intel-cc-17.0.2.174 module list # enlever la version pour avoir R plus récent, mais à vérfier si {snow} est installé # shortcut to call R, for MPI only myR () { mpiexec -np $mpiproc $(R RHOME)/library/snow/RMPISNOW --no-restore --no-save --quiet $@ # shouldn’t use --vanilla because errors don’t stop execution } time myR -f runISIS_Laura.R &> "debugR_Laura.log" ############################################################################### echo simul: $SIMUL_BASENAME echo job id: $PBS_JOBID echo job name: $PBS_JOBNAME echo echo job submitted: $(qstat -f $PBS_JOBID | grep qtime) $(date +'%Z') echo job started: $(qstat -f $PBS_JOBID | grep stime) $(date +'%Z') echo current dir: $(pwd) echo originating queue: $PBS_O_QUEUE echo executing queue: $PBS_QUEUE echo current machine: $PBS_O_HOST echo how many cores: $NCPUS echo how many threads: $OMP_NUM_THREADS echo how many MPI process: $mpiproc echo