FANDOM


#!/bin/bash



## RENAME FOR YOUR JOB

#PBS -N dsale-compile-OpenFOAM



## REQUEST NUMBER OF CPUS AND NODES

#PBS -l nodes=1:ppn=8,feature=intel



## WALLTIME DEFAULTS TO ONE HOUR - ALWAYS SPECIFY FOR LONGER JOBS

#PBS -l walltime=10:00:00



## Put the output from jobs into the below directory

#PBS -o /gscratch/stf/dsale/job_output



## Put both the stderr and stdout into a single file

#PBS -j oe



## Send email when the job is aborted, begins, and terminates

#PBS -m abe -M sale.danny@gmail.com



## Specify the working directory for this job

#PBS -d /gscratch/stf/dsale/OpenFOAM/OpenFOAM-2.4.x



## Load the appropriate environment modules (modern versions of OpenFOAM require a newer version of GCC compilers that are not yet available on Hyak, so must resort to using the Intel compilers which Hyak IT recommends anyways)

module load icc_14.0.1-impi_4.1.3

module load cmake_3.2.3



## Debugging information

echo "**********************************************"

# Total Number of processors (cores) to be used by the job

HYAK_NPE=$(wc -l < $PBS_NODEFILE)

# Number of nodes used

HYAK_NNODES=$(uniq $PBS_NODEFILE | wc -l )

echo "**** Job Debugging Information ****"

echo "This job will run on $HYAK_NPE total CPUs on $HYAK_NNODES different nodes"

echo ""

echo "Node:CPUs Used"

uniq -c $PBS_NODEFILE | awk '{print $2 ":" $1}'
echo "SHARED LIBRARY CHECK"

#ldd ./Allwmake 2>&1 | tee log.Hyak-compile-OpenFOAM-ldd



echo "ENVIRONMENT VARIABLES"

set



echo "I ran my job on:"

cat $PBS_NODEFILE



echo "**********************************************"

## End Debugging information



# Prevent tasks from exceeding the total RAM of the node

# Requires HYAK_NPE and HYAK_NNODE or HYAK_TPN to be set.

HYAK_TPN=$((HYAK_NPE/HYAK_NNODES))

NODEMEM=`grep MemTotal /proc/meminfo | awk '{print $2}'`

NODEFREE=$((NODEMEM-2097152))

MEMPERTASK=$((NODEFREE/HYAK_TPN))

ulimit -v $MEMPERTASK



#### EDIT FOR YOUR JOB, BASH scripts from here below: ####

cd OpenFOAM-2.4.x

export WM_NCOMPPROCS=8

export export MPI_ROOT=$I_MPI_ROOT

# this loads the OpenFOAM environmental variables
source /gscratch/stf/dsale/OpenFOAM/OpenFOAM-2.4.x/etc/bashrc

# this starts compiling everything, and keeps a log file
./Allwmake 2>&1 | tee log.Hyak-compile-OpenFOAM

echo '==== FINISHED COMPILING OPENFOAM ====='

### include any post processing here ###

### ###

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.