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

Make mpirun use 4 out of 8 possible cpus

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 11, 2008, 07:01
Default Dear all, I am running Open
  #1
New Member
 
Christian Kunkelmann
Join Date: Mar 2009
Posts: 8
Rep Power: 17
christian_kunkelmann is on a distinguished road
Dear all,

I am running OpenFOAM 1.5 on a Debian machine with 2 quadcores. Is it possible to limit a simulation to 4 CPUs even if the number of subdomains is larger than 4?

Thanks in advance.
Christian
christian_kunkelmann is offline   Reply With Quote

Old   September 12, 2008, 13:54
Default You must simply decompose on 4
  #2
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
You must simply decompose on 4 subdomains and run on 4 processors, no matter how many cores you have in your machine.

Hope this helps,
Francesco
fra76 is offline   Reply With Quote

Old   September 15, 2008, 04:46
Default Or if you want to limit your O
  #3
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
Or if you want to limit your OpenFOAM-run to 4 CPUs (while doing other work with the remaining 4 cores) you might want to have a look at the man-page of the taskset-utility (or google arround for "setting the cpu-affinity of a process")

Although I don't know why you might run something in parallel with more subdomains than you have processors (except for debugging parallel stuff)

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 15, 2008, 05:05
Default Francesco, thanks for the answ
  #4
New Member
 
Christian Kunkelmann
Join Date: Mar 2009
Posts: 8
Rep Power: 17
christian_kunkelmann is on a distinguished road
Francesco, thanks for the answer.

The background is that I use an adaptive mesh. Therefore it could happen that one process is much heavier than all the others (because the mesh was strongly refined in this region). A possible solution would be to decompose in a higher number of subdomains and let the "easier" processes run all together on one core.

I know that the processes will be distributed on the CPUs even if the number of subdomains is higher than the number of CPUs.

However, what if I want to decompose in, say, 8 subdomains and then run on 4 CPUs even though there are 8 CPUs in the machine (because I am not the only one to run on this machine)?

Thanks alot in advance.

Christian
christian_kunkelmann is offline   Reply With Quote

Old   September 15, 2008, 06:00
Default Bernhardt, thanks for the s
  #5
New Member
 
Christian Kunkelmann
Join Date: Mar 2009
Posts: 8
Rep Power: 17
christian_kunkelmann is on a distinguished road
Bernhardt,

thanks for the suggestions. I will have a close look at that.

Christian
christian_kunkelmann is offline   Reply With Quote

Old   September 15, 2008, 08:28
Default Christian, if you decompose o
  #6
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
Christian,
if you decompose on "n" processors, you must run on "n" processors. How can you solve your problem ignoring half of it?
About load unbalancing, my opinion is that the best option is to rebalance when the unbalancing becomes unacceptable. I don't know in details how to do it on the fly in OpenFOAM, but I would follow this strategy.

Francesco
fra76 is offline   Reply With Quote

Old   September 15, 2008, 11:59
Default Francesco, the whole comput
  #7
New Member
 
Christian Kunkelmann
Join Date: Mar 2009
Posts: 8
Rep Power: 17
christian_kunkelmann is on a distinguished road
Francesco,

the whole computational domain is solved, of course. I just let each CPU solve a more than one subdomain.

Thanks for the suggestion about rebalancing on the fly when the unbalancing becomes unacceptable. I had already thought about that. However, before trying this I wanted to try the other way (which was easier to realize). If the performance suffers to much, I will have to re-decompose during the calculation.

Christian
christian_kunkelmann is offline   Reply With Quote

Old   September 15, 2008, 13:06
Default Ok, I understand. You want to
  #8
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
Ok, I understand.
You want to run 8 processes (with mpirun -np 8) but limit these processes to use only 4 cores of your machine, right?
This moves the issue from openfoam to the operating system. As Bernhard said, you must use "taskset" to force each process (8 different PIDs in your case) to use only a given list of cores (let's say, from 0 to 3). Check "man taskset" for the syntax.
However, I would avoid using this approach. 8 processes on 4 cores will be much slower than a proper 4 processes simulation. There are many reasons for this. As a quick test, try to run the same simulation on 8 cores (on your 8 cores machine) and then on 16 cores, on the same machine, and check the run time.

Hope this helps,
Francesco
fra76 is offline   Reply With Quote

Old   September 15, 2008, 16:58
Default Hi Guys, Rebalancing after
  #9
Member
 
Ola Widlund
Join Date: Mar 2009
Location: Sweden
Posts: 87
Rep Power: 17
olwi is on a distinguished road
Hi Guys,

Rebalancing after mesh refinement interests me. Doing it on the fly even more... Is that supported in OpenFOAM, somehow?

I'm currently putting the mesh refinement of interDyMFoam into a custom solver, and the load balancing is definately an issue. Any pointers appreciated.

Thanks,
Ola
olwi 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
Problems with mpirun duderino OpenFOAM 17 February 5, 2010 13:00
MPIRun How many processors markh83 OpenFOAM Running, Solving & CFD 4 October 29, 2008 08:37
MPIrun... AVL FIRE Peter Main CFD Forum 1 September 4, 2008 04:41
Intel Fortran debugger with mpirun agg Main CFD Forum 2 March 21, 2007 17:43
Lamboot and mpirun r2d2 OpenFOAM Running, Solving & CFD 2 January 10, 2006 11:31


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