CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to configure a job script? Example for another app available as a basis (https://www.cfd-online.com/Forums/openfoam-solving/169692-how-configure-job-script-example-another-app-available-basis.html)

arsalan.dryi April 14, 2016 18:06

How to configure a job script? Example for another app available as a basis
 
Hi Bruno,

After all of this, I got compiled OpenFOAM 2.3.0 and swak4foam 0.3.2 in my home folder at the cluster with your huge help and your support is greatly appreciated.

Well, for running my simulations I have to submit a script to the working directory of the cluster,not in my home folder. I don't know that the openFOAM works well by changing the directory or not. By the way, as you now an alias command do not work in a shell script, so I can't run "of230" in my job script in the working directory.
Do you have any ideas to fix this problem?!

A template of the job script is shown below for fluent simulations, and I am a bit confused with changing this template to that I need for a foam job!

Code:

#!/bin/bash

#PBS -N FLUENT
#PBS -j oe
#PBS -l nodes=1:ppn=2
#PBS -l walltime=00:30:00

module add ansys/v150 > /dev/null 2>&1
if [ $? -ne 0 ]; then
        echo "unable to load module files"
        exit 1
fi

cd $PBS_O_WORKDIR

fluent 3d -g -i input > fluent.log 2>&1

And an awkward question, should I use a parallel run in the cluster or the serial one would be enough?! Because I think that the parallel computing is complicated especially in a cluster, isn't it?

Thank you so much again for your time and attention.

Best Regards,
Arsalan.

[ Moderator note: Moved from here: http://www.cfd-online.com/Forums/ope...ot-access.html ]

wyldckat April 15, 2016 19:21

Hi Arsalan,

I've moved your post from the other thread to a new one, because this is a new topic and it's related to "running", not "installing" ;)

Using your example as a basis, the following should do the trick:
Code:

#!/bin/bash

#PBS -N OpenFOAM
#PBS -j oe
#PBS -l nodes=1:ppn=2
#PBS -l walltime=00:30:00

module add mpi/openmpi/gcc/1.8 > /dev/null 2>&1
if [ $? -ne 0 ]; then
        echo "unable to load module files"
        exit 1
fi

#Load up OpenFOAM's environment
source $HOME/OpenFOAM/OpenFOAM-2.3.0/etc/bashrc WM_NCOMPPROCS=4 foamCompiler=ThirdParty WM_COMPILER=Gcc48 WM_MPLIB=SYSTEMOPENMPI

cd $PBS_O_WORKDIR

mpirun -np 2 simpleFoam -parallel > log.simpleFoam 2>&1

This should run simpleFoam in parallel with 2 cores.

Quote:

Originally Posted by arsalan.dryi (Post 595071)
And an awkward question, should I use a parallel run in the cluster or the serial one would be enough?! Because I think that the parallel computing is complicated especially in a cluster, isn't it?

If you're using a cluster, then you should run in parallel ;)

Nonetheless, keep in mind that not all of OpenFOAM's applications can run in parallel, e.g. blockMesh.

Best regards,
Bruno

arsalan.dryi April 25, 2016 15:01

Hi Bruno,

Your modified script worked properly as expected and finally, I could run my simulations in the cluster.

At this time,I'm studying the effect of the number of processors in CPU time of the parallel running.

I'm grateful to you for your help and attention.

King regards,
Arsalan.


All times are GMT -4. The time now is 12:09.