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

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 pyFoam: 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: 3,926
Rep Power: 41
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
pyFoam and paraview eelcovv OpenFOAM Paraview & paraFoam 28 May 30, 2016 09:23
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 28 May 28, 2015 13:37
Running Parallel on Windows using Python Scripts amarkkassery SU2 Installation 6 April 4, 2013 12:37
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
pyFoam batch set up for OF 1.7 eelcovv OpenFOAM Running, Solving & CFD 3 January 19, 2011 09:38


All times are GMT -4. The time now is 20:28.