Skip to content
Snippets Groups Projects
Commit 5eb66135 authored by Jan Siwiec's avatar Jan Siwiec
Browse files

Update openfoam.md

parent a05ed7f5
No related branches found
No related tags found
No related merge requests found
Pipeline #39705 failed
!!!warning
This page has not been updated yet. The page does not reflect the transition from PBS to Slurm.
# OpenFOAM # OpenFOAM
OpenFOAM is a free, open source CFD software package. OpenFOAM is a free, open source CFD software package.
...@@ -108,7 +105,7 @@ runApplication icoFoam ...@@ -108,7 +105,7 @@ runApplication icoFoam
Job submission (example for Karolina): Job submission (example for Karolina):
```console ```console
$ qsub -A OPEN-0-0 -q qprod -l select=1:ncpus=128,walltime=03:00:00 test.sh $ sbatch -A PROJECT_ID -p qcpu --nodes=1 --ntasks=128 --time=03:00:00 test.sh
``` ```
For information about job submission, look [here][2]. For information about job submission, look [here][2].
...@@ -140,21 +137,22 @@ runApplication decomposePar ...@@ -140,21 +137,22 @@ runApplication decomposePar
Job submission Job submission
```console ```console
$ qsub -A OPEN-0-0 -q qprod -l select=1:ncpus=16,walltime=03:00:00 test.sh $ sbatch -A PROJECT_ID -p qcpu --nodes=1 --ntasks=16 --time=03:00:00 test.sh
``` ```
This job creates a simple block mesh and domain decomposition. Check your decomposition and submit parallel computation: This job creates a simple block mesh and domain decomposition. Check your decomposition and submit parallel computation:
!!! note !!! note
Create a testParallel.pbs PBS script: Create a testParallel.slurm script:
```bash ```bash
#!/bin/bash #!/bin/bash
#PBS -N motorBike #SBATCH --job-name=motorBike
#PBS -l select=2:ncpus=16 #SBATCH --nodes=2
#PBS -l walltime=01:00:00 #SBATCH --ntasks-per-node=16
#PBS -q qprod #SBATCH --time=01:00:00
#PBS -A OPEN-0-0 #SBATCH --partition=qcpu
#SBATCH --account=ACCOUNT_ID
ml openfoam/2.2.1-icc-openmpi1.6.5-DP ml openfoam/2.2.1-icc-openmpi1.6.5-DP
source $FOAM_BASHRC source $FOAM_BASHRC
...@@ -163,11 +161,11 @@ cd $FOAM_RUN/tutorials/incompressible/simpleFoam/motorBike ...@@ -163,11 +161,11 @@ cd $FOAM_RUN/tutorials/incompressible/simpleFoam/motorBike
nproc = 32 nproc = 32
mpirun -hostfile ${PBS_NODEFILE} -np $nproc snappyHexMesh -overwrite -parallel | tee snappyHexMesh.log mpirun -hostfile ${$SLURM_JOB_NODELIST} -np $nproc snappyHexMesh -overwrite -parallel | tee snappyHexMesh.log
mpirun -hostfile ${PBS_NODEFILE} -np $nproc potentialFoam -noFunctionObject-writep -parallel | tee potentialFoam.log mpirun -hostfile ${$SLURM_JOB_NODELIST} -np $nproc potentialFoam -noFunctionObject-writep -parallel | tee potentialFoam.log
mpirun -hostfile ${PBS_NODEFILE} -np $nproc simpleFoam -parallel | tee simpleFoam.log mpirun -hostfile ${$SLURM_JOB_NODELIST} -np $nproc simpleFoam -parallel | tee simpleFoam.log
``` ```
`nproc` – the number of subdomains `nproc` – the number of subdomains
...@@ -175,7 +173,7 @@ mpirun -hostfile ${PBS_NODEFILE} -np $nproc simpleFoam -parallel | tee simpleFoa ...@@ -175,7 +173,7 @@ mpirun -hostfile ${PBS_NODEFILE} -np $nproc simpleFoam -parallel | tee simpleFoa
Job submission Job submission
```console ```console
$ qsub testParallel.pbs $ srun testParallel.slurm
``` ```
## Compile Your Own Solver ## Compile Your Own Solver
...@@ -198,7 +196,7 @@ $ cd applications/solvers ...@@ -198,7 +196,7 @@ $ cd applications/solvers
Copy icoFoam solver’s source files: Copy icoFoam solver’s source files:
```console ```console
$ cp -r $FOAM_SOLVERS/incompressible/icoFoam/ My_icoFoam $ cp -r $FOAM_SOLVERS/incompressible/icoFoam/My_icoFoam
$ cd My_icoFoam $ cd My_icoFoam
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment