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 Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 27, 2013, 11: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, 10:28
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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


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
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 02:36
[OpenFOAM] paraview v4 - building with python - OF2.3.0, PVv4, Python 2.7 aylalisa ParaView 4 June 13, 2014 09: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 17:04.