Skip to content

Instantly share code, notes, and snippets.

@Tianqi26
Last active October 6, 2020 20:04
Show Gist options
  • Save Tianqi26/110b7d34066fd43d3d667d11a1b3f634 to your computer and use it in GitHub Desktop.
Save Tianqi26/110b7d34066fd43d3d667d11a1b3f634 to your computer and use it in GitHub Desktop.
install of5.x in HPC

install of5.x in SuperMike2 HPC

It is not applicable for two or more nodes simulation. The mpi should select intelmpi

qsub -I -l nodes=1:ppn=16,walltime=02:00:00 -q workq -A hpc_cdss01

#Download and unpack
cd /project/cs16/tma5/OpenFOAM
git clone https://github.com/OpenFOAM/OpenFOAM-5.x.git
git clone https://github.com/OpenFOAM/ThirdParty-5.x.git

#load library

module load gcc/6.4.0
module unload mpich
module load openmpi

#Check arch version, it should be x86_64 in SuperMike II
uname -m

#compile need to set directory
export PROJECT=/project/cs16/tma5

#Setup building parameters, warning'change the 'WM_COMPILER_TYPE' setting to 'system'' is ok
source $PROJECT/OpenFOAM/OpenFOAM-5.x/etc/bashrc WM_COMPILER_TYPE=system WM_COMPILER=Gcc64 WM_MPLIB=SYSTEMOPENMPI


#Then save an alias in the personal .bashrc file, simply by running the following command:
echo "alias of5x='source $PROJECT/OpenFOAM/OpenFOAM-5.x/etc/bashrc $FOAM_SETTINGS'" >> $HOME/.bashrc


#------!!!Build OpenFoam!!!--------
cd $WM_PROJECT_DIR

#For faster compile using 16 cores in SuperMike II
export WM_NCOMPPROCS=16

#!!! unload the intelmpi for my hpc setting to use the self compiled mpi
./Allwmake -j $WM_NCOMPPROCS > log.make 2>&1

#------!!!Testing!!!--------
of5.x
icoFoam -help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment