This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
howto:palabos [2022/05/13 10:10] ccrosby [Instructions] |
howto:palabos [2022/05/13 14:59] (current) ccrosby [Instructions] |
||
|---|---|---|---|
| Line 22: | Line 22: | ||
| mv palabos-master palabos | mv palabos-master palabos | ||
| </ | </ | ||
| + | |||
| The next step is to load the cmake module | The next step is to load the cmake module | ||
| + | < | ||
| module load chpc/ | module load chpc/ | ||
| + | </ | ||
| To demonstrate how to compile and run a Palabos simulation, I will provide the scripts and instructions for the aneurysm example included in the palabos library. First change to the example build directory (assuming the Palabos install was renamed to palabos): | To demonstrate how to compile and run a Palabos simulation, I will provide the scripts and instructions for the aneurysm example included in the palabos library. First change to the example build directory (assuming the Palabos install was renamed to palabos): | ||
| + | < | ||
| cd / | cd / | ||
| + | </ | ||
| + | |||
| + | The next step is to compile the code. This can be run as a job with the script given below, or in an [[https:// | ||
| + | - Get into the right directory | ||
| + | - Source the OpenFOAM environment | ||
| + | - Load the cmake module | ||
| + | - Run '' | ||
| + | - Run '' | ||
| + | |||
| + | === Compile script === | ||
| + | <file bash PalabosCompile.pbs> | ||
| + | # | ||
| + | #PBS -P projectcode | ||
| + | #PBS -l select=1: | ||
| + | #PBS -q smp | ||
| + | #PBS -l walltime=01: | ||
| + | #PBS -o / | ||
| + | #PBS -e / | ||
| + | #PBS -m abe | ||
| + | #PBS -M username@email.com | ||
| + | ### Source the openFOAM environment (palabos needs this for the dependencies): | ||
| + | . / | ||
| + | ### load the cmake module | ||
| + | module add chpc/ | ||
| + | ##### Running commands | ||
| + | # Set this environment variable explicitly. | ||
| + | export PBS_JOBDIR=/ | ||
| + | # Explicitly change to the job directory | ||
| + | cd $PBS_JOBDIR | ||
| + | cmake .. > cmake.out | ||
| + | make > make.out | ||
| + | </ | ||
| + | |||
| + | === Running the example case === | ||
| + | To run the example you must change back one directory level to this directory: < | ||
| + | |||
| + | If you have not run this example before, first uncompress the geometry file: | ||
| + | < | ||
| + | If your OpenFOAM environment is still valid, you can run your aneurysm example on a single node with the following instruction: | ||
| + | |||
| + | < | ||
| + | |||
| + | To run the code as a PBS batch job over several nodes, you can use this script: | ||
| + | |||
| + | <file bash runPalabos.qsub> | ||
| + | # | ||
| + | #PBS -P projectcode | ||
| + | #PBS -l select=5: | ||
| + | #PBS -q normal | ||
| + | #PBS -l walltime=4: | ||
| + | #PBS -o / | ||
| + | #PBS -e / | ||
| + | #PBS -m abe | ||
| + | #PBS -M username@email.com | ||
| + | ### Source the openFOAM environment (palabos needs this for the dependencies): | ||
| + | . / | ||
| + | ### load the cmake module | ||
| + | module add chpc/ | ||
| + | ##### Running commands | ||
| + | # Set this environment variable explicitly. | ||
| + | export PBS_JOBDIR=/ | ||
| + | # Explicitly change to the job directory | ||
| + | cd $PBS_JOBDIR | ||
| + | nproc=`cat $PBS_NODEFILE | wc -l` | ||
| + | ###Run the code using MPI | ||
| + | exe=aneurysm | ||
| + | mpirun -iface ib0 -np $nproc $exe param.xml > run.out | ||
| + | </ | ||
| + | |||
| + | === Post-processing === | ||
| + | Palabos does not come with built-in post-processing tools. | ||
| + | < | ||
| + | chpc/ | ||
| + | chpc/ | ||
| + | </ | ||
| - | The next step is to compile the code. This must be run as a job with the below script. Note that the OpenFOAM environment is invoked as it contains all the dependencies for Palabos apart from cmake. With the cmake module loaded, it will be added through the compile script: | + | Load one of these modules if you need ImageMagick. |
| + | VTK files can be displayed with [[https:// | ||