CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[PyFoam] start Runner from python with machinefile

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 27, 2013, 10:35
Default start Runner from python with machinefile
  #1
New Member
 
Deutschland
Join Date: Jun 2013
Posts: 2
Rep Power: 0
Blub is on a distinguished road
Hello everyone,

I have a small issue with pyFoam: I wrote a script for my local machine and it uses this to call the solver

Code:
machine=LAMMachine(nr=no_proc)
theRun=AnalyzedRunner(analyzer,
argv=[solver,"-case",work.name],
silent=False,
lam=machine)
theRun.start()
this works fine. However I now want to do the same on a cluster where I need to provide the nodefile / machinfile for mpirun.

I tried the following:

Code:
machine=LAMMachine(machines=nodefile,nr=no_proc)
theRun=AnalyzedRunner(analyzer,
argv=["potentialFreeSurfaceAPMFoam","-case",work.name],
silent=True,
lam=machine)
theRun.start()
Unfortunately that didn't do the trick, so I am using brute force by executing:

Code:
run_str="mpirun -hostfile "+nodefile+" -np "+str(no_proc)+" "+ solver +" -case "+work.name+ " -parallel &> solver."+outputName_nospc+".log"
os.system(run_str)
which works.

Any suggestions on how to setup the correct call for pyFoamRunner will be appreciated

Thanks in advance,
Arne
Blub is offline   Reply With Quote

Old   August 28, 2013, 09:28
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,045
Rep Power: 43
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Blub View Post
Hello everyone,

I have a small issue with pyFoam: I wrote a script for my local machine and it uses this to call the solver

Code:
machine=LAMMachine(nr=no_proc)
theRun=AnalyzedRunner(analyzer,
argv=[solver,"-case",work.name],
silent=False,
lam=machine)
theRun.start()
this works fine. However I now want to do the same on a cluster where I need to provide the nodefile / machinfile for mpirun.

I tried the following:

Code:
machine=LAMMachine(machines=nodefile,nr=no_proc)
theRun=AnalyzedRunner(analyzer,
argv=["potentialFreeSurfaceAPMFoam","-case",work.name],
silent=True,
lam=machine)
theRun.start()
Unfortunately that didn't do the trick, so I am using brute force by executing:

Code:
run_str="mpirun -hostfile "+nodefile+" -np "+str(no_proc)+" "+ solver +" -case "+work.name+ " -parallel &> solver."+outputName_nospc+".log"
os.system(run_str)
which works.

Any suggestions on how to setup the correct call for pyFoamRunner will be appreciated

Thanks in advance,
Arne
"That didn't do the trick" is not really a description of a bug that allows me to help you. Does it hang? Does it crash? Does the machine emit pink smoke and green Leprechauns dance around you?

Additional questions: Does the parallel script work on the local machine? Is the Distro on the local machine the same as on the cluster? Are you from Ireland (answer only required in case of the Lepreachauns)?

See slide 53 and following of http://openfoamwiki.net/images/8/84/...ining_OFW8.pdf and try to set
Code:
[Debug]
ParallelExecution: True
This should output additional information (amongst it the actual call to mpirun). Either change the settings so that this call replicates your successful call or try to replicate the call that PyFoam generates on a local shell
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Tags
pyfoam

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 23:38
Sample not working correctly sihaqqi OpenFOAM Running, Solving & CFD 1 July 12, 2014 01:36
paraview v4 - building with python - OF2.3.0, PVv4, Python 2.7 aylalisa OpenFOAM Paraview & paraFoam 4 June 13, 2014 08:52
Plz Help on how to start coding (Beginner) Nikhil T Main CFD Forum 0 March 13, 2014 14:09
Lets start the public domain CFD-Project! Heinz Wilkening Main CFD Forum 3 March 11, 1999 23:55


All times are GMT -4. The time now is 22:33.