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

[PyFoam] First discussion thread about PyFoam

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

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 6, 2008, 04:27
Default Hello everyone, I am trying
  #61
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17
markusrehm is on a distinguished road
Hello everyone,

I am trying to use pyFoamBench and pyFoamRunner on our Cluster. Mpirun works for that case but pyFoamRunner gives me the following error:

node3: Connection refused
node4: Connection refused
[master:03543] [0,0,0] ORTE_ERROR_LOG: Timeout in file base/pls_base_orted_cmds.c at line 275
[master:03543] [0,0,0] ORTE_ERROR_LOG: Timeout in file pls_rsh_module.c at line 1166
[master:03543] [0,0,0] ORTE_ERROR_LOG: Timeout in file errmgr_hnp.c at line 90
[master:03543] ERROR: A daemon on node node3 failed to start as expected.
[master:03543] ERROR: There may be more information available from
[master:03543] ERROR: the remote shell (see above).
[master:03543] ERROR: The daemon exited unexpectedly with status 1.
[master:03543] ERROR: A daemon on node node4 failed to start as expected.
[master:03543] ERROR: There may be more information available from
[master:03543] ERROR: the remote shell (see above).
[master:03543] ERROR: The daemon exited unexpectedly with status 1.


Is there any possibility to change the mpi-settings in pyFoam?

Regards Markus.
markusrehm is offline   Reply With Quote

Old   February 7, 2008, 13:30
Default Hi Fabian! Sorry for answer
  #62
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
Hi Fabian!

Sorry for answering so late.

ParsedParamterFile is not a script, but a Python-class that is the working horse for the pyFoamScripts that in one way or another manipulate dictionaries. An example of its usage would be the following code fragment: it reads a velocity file and for all patches that have the string "Wall" in their name sets the appropriate boundary conditions and writes the file back to disk. It should be pretty straightforward if you understand Python and the structures of the OpenFOAM-field-files (but the class works for all the other dictionaries too) (In the fragment I've replaced all the obligatory spaces with _ because the Message board would swallow the spaces)


from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile

f=ParsedParameterFile("pitzDaily/0/U")

for b in f["boundaryField"]:
____if b.find("Wall")>=0:
________f["boundaryField"][b]["value"]="uniform (0 0 0)"
________f["boundaryField"][b]["type"]="fixedValue"

f.writeFile()


I hope this example gives you an idea about the possibilities of that class

Bernhard
__________________
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

Old   February 7, 2008, 13:53
Default Hi Markus! In fact there is
  #63
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
Hi Markus!

In fact there is a possibility to modify the mpirun-class There is a number of variables that modify some presets of PyFoam. They can be set via the file ~/.pyFoam/pyfoamrc.

The current settings can be viewed with the pyFoamDumpConfiguration.py-command. They are output in the format that is needed in pyfoamrc (so you can paste them in there and modify them) (BTW: the format is basically similar to the INI-files in Windows ca. 3.XX - in the days before the registry. It's primitive, but it's sufficient for our purposes)

The precedence of settings is:
1. Hardcoded in the PyFoam-sources
2. Systemwide in /etc/pyfoamrc
3. User-specific in ~/.pyFoam/pyfoamrc
Highest number wins

The section of variables that is relevant for your problem is

[MPI]
options_openmpi_post: ["-x","LD_LIBRARY_PATH","-x","WM_PROJECT_DIR","-x","FOAM_MPI_LIBBIN","-x","MPI_B UFFER_SIZE"]
options_openmpi_pre: ["--mca","pls_rsh_agent","rsh"]

The _pre-option is the command-line arguments that are added to the mpirun command-line BEFRORE the -np/-machinefie argument the _post-option is for stuff that comes afterward (but before the actual OpenFOAM-command)

The middle-part of the variable name depends on the value of the $WM_MPILIB-variable. So for LAM this would be options_lam_pre/post. But this doesn't concern you, because from your error message I deduce that you're living on planet OpenMPI

Is this sufficient for your purposes, Markus?

Bernhard
__________________
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

Old   February 8, 2008, 03:57
Default Hi Bernhard, nice :-) Thank
  #64
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
Hi Bernhard,

nice :-) Thanks!

Fabian
braennstroem is offline   Reply With Quote

Old   February 11, 2008, 07:05
Default Hello Bernhard, thanks for
  #65
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17
markusrehm is on a distinguished road
Hello Bernhard,

thanks for your help I found that the parameters
"--mca","pls_rsh_agent","rsh" in

options_openmpi_pre: ["--mca","pls_rsh_agent","rsh"] don't work. Erasing them works fine.

Regards, Markus
markusrehm is offline   Reply With Quote

Old   February 13, 2008, 19:40
Default Hi Bernhard, How to modify
  #66
Senior Member
 
Jens Klostermann
Join Date: Mar 2009
Posts: 117
Rep Power: 17
jens_klostermann is on a distinguished road
Hi Bernhard,

How to modify pyFoamBench.py so that the No. of cpus is rather taken from ghe *cfg file than by counting the cpus in the machinefile?

Jens

PS. Do I have to modyfiy decompose.py as well
jens_klostermann is offline   Reply With Quote

Old   February 14, 2008, 04:56
Default Hi Fabian! My assumptions:
  #67
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
Hi Fabian!

My assumptions:
- you're using OpenMPI
- in your machinefile there are more machines than the number you specified and the machinefile takes precedence
- you need a quick fix and are willing to test it (sorry, currently havn't got the time for it)

In the File Execution/ParallelExecution.py go to the method cpuNr of the class LAMmachine. In the branch for OpenMPI there is a statement

return nr

(just before elif self.procNr). Replace that with (the _ should be of course spaces)

if self.procNr==None:
____return nr
else:
____return min(nr,self.procNr)

So if the two values contradict each other the smaller one is used

Let me know whether this works for you (I'll then include it in the release-version)

Bernhard
__________________
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

Old   April 21, 2008, 09:59
Default Hi! Just to let those inter
  #68
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
Hi!

Just to let those interested know: a new Version of PyFoam (0.4.3) is out. There are no new killer-enhancements in this release, just some small new utilities and enhancments of the library.

Starting with this release the current stable version is available under Subversion (just use "svn co https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r/other/scripting/PyFoam/" to get it). For technical reasons this is not the version I'm developing with but I would like to encourage everyone who'd like to contribute to do his changes there. I will try to incorporate them into the next release.

Bernhard
__________________
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

Old   April 22, 2008, 01:22
Default Hi Bernhard, nice work :-)
  #69
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
Hi Bernhard,

nice work :-)

Does the new utitlity 'copylasttofirst' work in combination with 'mapFields', so different meshes work as well?

Fabian
braennstroem is offline   Reply With Quote

Old   April 22, 2008, 03:59
Default Hi Fabian! Unfortunately: N
  #70
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
Hi Fabian!

Unfortunately: No. I use this thing to copy a steady-state solution to the initial conditions of a transient solver which are both on the mesh. But mapping if the meshes are different might be a nice idea. I'll consider it for the next release

Bernhard
__________________
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

Old   September 9, 2008, 16:06
Default For those intested: the new ve
  #71
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
For those intested: the new version 0.5.0 of PyFoam is now publicly available (either via the Wiki or the SVN at OpenFOAM-extend). The "killer"-feature is that it understands the calling convention for utilities for 1.5 (no more "dot case") AS WELL as the one for previous version (the ones with "dot case") and switches between them according to the version that is used

I you have any problems, questions etc let me know

Bernhard
__________________
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

Old   November 5, 2008, 06:25
Default Hello everybody,
  #72
Senior Member
 
Suresh kumar Kannan
Join Date: Mar 2009
Location: Luxembourg, Luxembourg, Luxembourg
Posts: 129
Rep Power: 17
kumar is on a distinguished road
Hello everybody,
I just installed PyFoam on my ubuntu machine. I was using the previous version of Pyfoam 0.5.0. It was working ok with OpenFOAM version1.5 on my old machine. since I have a new Laptop now i am installing it again.. Since i saw that the new version is available i was interested in the new version.
I sucessfully installed it on my laptop without any error message, but when I add the following two lines to my .bashrc file:
export PYTHONPATH =/usr/lib/python2.5/site-packages:$PYTHONPATH
export PATH=$HOME/PyFoam-0.5.1/bin:$PATH
and source it with source .bashrc command
it gives me the following error, is this error normal or is there any mistake in the way i installed it:
bash: export: `=/usr/lib/python2.5/site-packages:/home/kumar/OpenFOAM/ThirdParty/ParaView3.3-c vs/platforms/linuxGcc/Utilities/VTKPythonWrapping:/home/kumar/OpenFOAM/ThirdPart y/ParaView3.3-cvs/platforms/linuxGcc/Utilities/VTKPythonWrapping': not a valid identifier
but i checked my installation using the steps explained in the wikki page, it gives me the correct corresponding path, so can i go ahead thinking that everything is fine. or should i do something to resolve this error message.
Since I am a new user of OpenFoam any comment will be very helpful.

bye
with regards
K.Suresh kumar
kumar is offline   Reply With Quote

Old   November 5, 2008, 08:18
Default Hi, Its just that the defi
  #73
Senior Member
 
Suresh kumar Kannan
Join Date: Mar 2009
Location: Luxembourg, Luxembourg, Luxembourg
Posts: 129
Rep Power: 17
kumar is on a distinguished road
Hi,
Its just that the definition of the PYTHONPATH is wrong. I just figured it out.

thanks
with regards
K.Suresh kumar
kumar is offline   Reply With Quote

Old   November 17, 2008, 01:40
Default Hi Bernhard, I just tried y
  #74
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
Hi Bernhard,

I just tried your newest pyFoam version and was curious about the CaseBuilder. Unfortunately, it is not working when running it the simplest way:

ceplx049~> pyFoamCaseBuilder.py
Traceback (most recent call last):
File "/scr/ceplx049/scr1/gcae504/Software/OpenFOAM/PyFOAM_0.5/bin//pyFoamCaseBuilder. py", line 3, in <module>
from PyFoam.Applications.CaseBuilder import CaseBuilder
ImportError: No module named CaseBuilder

Do you have a hint, what I am doing wrong?

Thanks!
Fabian
braennstroem is offline   Reply With Quote

Old   November 17, 2008, 07:17
Default Hi Fabian! I'm sorry. The c
  #75
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
Hi Fabian!

I'm sorry. The caseBuilder is not very well documented (even by my standards) yet. I'm planing to fix this in the next days.

Nevertheless: you problem is propably a PYTHONPATH-problem. There should be at least a file /scr/ceplx049/scr1/gcae504/Software/OpenFOAM/PyFOAM_0.5/PyFoam/Applications/Case Builder.py in your installation (at least it is included in the tar-file I distributed) and Python can't find it.

An two example-files for the CaseBuilder are included in a sub-directory of the examples-directory

Let me know if your problem persists.

Bernhard
__________________
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

Old   November 17, 2008, 11:42
Default Hi Bernhard, oh thanks; it
  #76
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
Hi Bernhard,

oh thanks; it was still pointing to the old version!
Though, I have still some trouble:

ceplx049~/SCR1/Software/OpenFOAM/PyFoam-0.5.1_Source/examples/CaseBuilder> pyFoamCaseBuilder.py simpleFluent.pfcb tst /home/gcae504/SCR1/Solververgleich/Freistrahl_Nottage/FLUENT/Tetra/Nottage_OB_AN SA_normaler_Durchmesser_VOL_TETRA.msh 10 0.000001 1.0
Read case description simpleFluent
Building case tst
Traceback (most recent call last):
File "/scr/ceplx049/scr1/gcae504/Software/OpenFOAM/PyFOAM_0.5/bin//pyFoamCaseBuilder. py", line 5, in <module>
CaseBuilder()
File "/scr/ceplx049/scr1/gcae504/Software/OpenFOAM/PyFOAM_0.5/lib/python2.5/site-pack ages/PyFoam/Applications/CaseBuilder.py", line 28, in __init__
exactNr=False)
File "/scr/ceplx049/scr1/gcae504/Software/OpenFOAM/PyFOAM_0.5/lib/python2.5/site-pack ages/PyFoam/Applications/PyFoamApplication.py", line 103, in __init__
self.run()
File "/scr/ceplx049/scr1/gcae504/Software/OpenFOAM/PyFOAM_0.5/lib/python2.5/site-pack ages/PyFoam/Applications/CaseBuilder.py", line 173, in run
desc.buildCase(cName,aDict)
File "/scr/ceplx049/scr1/gcae504/Software/OpenFOAM/PyFOAM_0.5/lib/python2.5/site-pack ages/PyFoam/Applications/CaseBuilderBackend.py", line 233, in buildCase
exec "pf"+pName+"="+pValue
File "<string>", line 1, in <module>
File "/scr/ceplx049/scr1/gcae504/Software/OpenFOAM/PyFOAM_0.5/lib/python2.5/site-pack ages/PyFoam/RunDictionary/ParsedParameterFile.py", line 80, in __getitem__
return self.content[key]
KeyError: 'nu'


Greetings!
Fabian

P.S. Did you think about integrating pyFoam in any powerfull python file manager, e.g. lfm (http://www.terra.es/personal7/inigoserna/lfm/) ?
braennstroem is offline   Reply With Quote

Old   November 17, 2008, 13:57
Default Hi Fabian! I tried to repro
  #77
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
Hi Fabian!

I tried to reproduce the error here, but couldn't. You didn't change the template-property in the pfcb-file, did you? Because the only way I can see this error happening is that the transportProperties-dictionary in the template-case doesn't have a 'nu'-entry (and it should because the file uses $FOAM_TUTORIALS/simpleFoam/pitzDaily as a template)

@lfm: you mean to navigate in cases using the VFS-facility of that manager? No I havn't

Bernhard
__________________
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

Old   November 17, 2008, 16:09
Default Hi Bernhard, yes, you are rig
  #78
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
Hi Bernhard,
yes, you are right. I was playing around with some of the other approaches and 'displaced' nu into a setup file... and obviously forgot that I even touched this pitzDaily. Sorry for bothering...

@lfm: vfs-facility would be one approach. A file manager (like dired in my case) is the backend of the daily work, so a good integration of a simulation setup for openfoam is would be awesome. Dired/Emacs is already great, but maybe lfm could be the base for further pyFoaming and including the future 'python layer' for openfoam?

Fabian
braennstroem is offline   Reply With Quote

Old   November 19, 2008, 16:52
Default Hi Fabian! @nu: No problem.
  #79
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
Hi Fabian!

@nu: No problem. That's one of the reasons why I write protect my OF-installation for my "everyday"-user. To reduce the temptation to mess up things.

@lfm: I'm a bit slow here. How would you like to add functionality? Don't get me wrong, I'm in no way opposed to that idea, I just don't quite get it what you are aiming at concretely: a OF-aware editing interface to FoamCases (like FoamX was)? Or "just" a file-manager that is aware of the special needs of a OF-case?

BTW: I finally gotten around to write some words about the case-builder (wouldn't call it docu): http://openfoamwiki.net/index.php/Co...oamcasebuilder
But I'm afraid by now you've figured most of what I'm saying there out by yourself.

Bernhard
__________________
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

Old   November 20, 2008, 05:18
Default Hi Bernhard, I had to save
  #80
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
Hi Bernhard,

I had to save disk space and removed the original tut-directory ...

@lfm: The file manager is the base of every work (setting up any cases,
postprocessing or just copying files around). Even in software like
office, starcd or fluent you need some simple 'file manager' for open
files, selecting the mesh, inlet profiles or batch files. Unfortunately,
you are not able to choose 'your best' file manager, but some 'stupid'
file-open-dialog (sometimes you are able to have bookmarks, but mostly
you have to go down a long directory tree until you can import the
mesh).

E.g. in lfm you have a two pane setup and could open up the poor-man-gui
just below the two pane (this is a dired example):


For pyFoam you would open up a similar dialouge as in you poor-man-gui,
but with the chance to quickly include mesh files and other needed files
by using a real file manager... in addition, one is able to extend the
file manager with OpenFoam and pyFoam menues/functionality. Then a real
python interactive scripting could be the next step!?
VFS could be a different way to adjust the case by quickly adjusting
some settings... but I like the above idea of using plugins better.

Greetings!
Fabian
lakeat likes this.
braennstroem is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Divergence detected in AMG solver: k when udf loaded google9002 Fluent UDF and Scheme Programming 3 November 7, 2019 23:34
udf problem jane Fluent UDF and Scheme Programming 37 February 20, 2018 04:17
Guide: Getting Started with the CFD Online Discussion Forums pete Site Help, Feedback & Discussions 8 July 29, 2016 05:00
Error messages atg enGrid 7 August 30, 2013 11:16
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 14:37


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