CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

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

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 3 Post By wyldckat
  • 1 Post By arsalan.dryi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 14, 2016, 19:06
Default How to configure a job script? Example for another app available as a basis
  #1
Member
 
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 12
arsalan.dryi is on a distinguished road
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 ]

Last edited by wyldckat; April 15, 2016 at 20:14. Reason: see "Moderator note:"
arsalan.dryi is offline   Reply With Quote

Old   April 15, 2016, 20:21
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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 View Post
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
arvindpj, arsalan.dryi and alia like this.
__________________
wyldckat is offline   Reply With Quote

Old   April 25, 2016, 16:01
Default
  #3
Member
 
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 12
arsalan.dryi is on a distinguished road
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.
wyldckat likes this.
arsalan.dryi is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mpirun, best parameters pablodecastillo Hardware 18 November 10, 2016 13:36
SGE fluent job submission script mrji8011 FLUENT 2 May 5, 2011 21:59
running OF on local machine with batch script / job scheduler val46 OpenFOAM 13 November 10, 2010 04:22
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 22:51
cfd job Dr. Don I anyanwu Main CFD Forum 20 May 17, 1999 16:13


All times are GMT -4. The time now is 10:27.