#!/bin/bash # #PBS -q four-twelve #PBS -N run_gnu_1 #PBS -l nodes=1:ppn=12 #PBS -e run_gnu.stderr #PBS -o run_gnu.stdout #- batch parameters are specified above (lines starting with #PBS); note that after 1rst # blank line (above), anything folowing "#" character is treated as comments # # example of a PBS batch script to run MITgcm on new (x86_64) acesgrid cluster # using executable compiled with gfortran (and OpenMPI if using MPI) # and running on /data/ disk(/net/eaps-80-11/data/) # $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/jmc_script/run_gnu.pbs,v 1.1 2012/10/25 21:17:10 jmc Exp $ # $Name: $ sfx=1 # directory suffix mpi=0 # number of MPI procs (=0 for non MPI run) mth=0 # number of OMP threads (=0 for non Multi-thread run) if test -f /etc/profile.d/modules.sh ; then . /etc/profile.d/modules.sh fi HERE=`pwd` echo "start from HERE='$HERE' at: "`date` echo " sfx=$sfx , mpi=$mpi , mth=$mth" #- dir where to run mitgcmuv (batch job starts in home dir; need to "cd" to run dir): runD="/net/eaps-80-11/data/jm_c/exp/atm_gray/run_$sfx" echo -n " run in runD='$runD' on nodes: " cat $PBS_NODEFILE | sort | uniq cd $runD echo " sfx=$sfx , mpi=$mpi , mth=$mth" > mf_run cat $PBS_NODEFILE >> mf_run umask 0022 #- to get case insensitive "ls" (and order of tested experiments) export LC_ALL="en_US.UTF-8" module add gcc if test $mpi = 0 ; then EXE="./mitgcmuv > std_outp" else module add openmpi nn=`cat $PBS_NODEFILE | sort | uniq | wc -l` if [ $nn -gt 1 ] ; then dd=`expr $mpi % $nn` ; else dd=1 ; fi if [ $dd -eq 0 ] ; then npn=`expr $mpi / $nn` echo " Nb of nodes=$nn , nb of process per node=$npn" cat $PBS_NODEFILE | sort | uniq > mf EXE="mpirun -v -hostfile mf -npernode $npn ./mitgcmuv" else EXE="mpirun -v -np $mpi ./mitgcmuv" fi fi if [ $mth -ge 1 ] ; then export OMP_NUM_THREADS=$mth export GOMP_STACKSIZE=400m fi echo "list of loaded modules:" module list 2>&1 echo " " echo "run command: $EXE" eval $EXE echo "" ; echo " run ended at: "`date`