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

How to run OpenFoam using openMP.

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By mbeaudoin
  • 2 Post By zhulianhua

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2013, 05:02
Default How to run OpenFoam using openMP.
  #1
New Member
 
Ravi Kanth B
Join Date: Jul 2010
Posts: 10
Rep Power: 16
bravikanth is on a distinguished road
Dear all,

I want to run the simpleFoam solver using OpenMP. Can anyone suggest me how i can run the solver and what environment variables i need to set in order to make the openmp run.

Thanks,

Ravi
bravikanth is offline   Reply With Quote

Old   June 4, 2013, 05:25
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Parallelization in OpenFOAM is done with MPI, not OpenMP. If you really want to use OpenMP, youll have to write some code. If you just want to run in parallel, read the according section in the user guide to learn how to do so using MPI.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.

Last edited by akidess; June 4, 2013 at 05:26. Reason: added url to user guide
akidess is offline   Reply With Quote

Old   June 4, 2013, 07:21
Default
  #3
New Member
 
Ravi Kanth B
Join Date: Jul 2010
Posts: 10
Rep Power: 16
bravikanth is on a distinguished road
Thanks for your reply. I do not have any problem running the code in MPI. I just thought there should be something like setting up OMP_NUM_THREADS to 8 and i thought i can use mpirun.

But if it like what you are saying it is different. Do you have any idea on running using OpenMP.

Regards,
Ravi Kanth
bravikanth is offline   Reply With Quote

Old   June 4, 2013, 08:14
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
hi whats the advantage of openMI to MPI that you want to use it?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 4, 2013, 08:38
Default
  #5
New Member
 
Ravi Kanth B
Join Date: Jul 2010
Posts: 10
Rep Power: 16
bravikanth is on a distinguished road
I want to compare the solver times / performance / drag values with DMP and also i am comparing against inhouse solvers / commercial solvers.

That is the main intention of running the openMP and MPI both on OpenFoam
bravikanth is offline   Reply With Quote

Old   June 4, 2013, 11:14
Default
  #6
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
You can find here a very very short description of the main differences between OpenMP and MPI (where OpenMPI is a flavor of MPI).

http://lists.apple.com/archives/mt-s.../msg00002.html

This text refers to SMP systems. Nowadays, you can assume that multi-cores computers are a kind of SMP system.

Martin
immortality likes this.
mbeaudoin is offline   Reply With Quote

Old   July 21, 2013, 08:21
Default openMP in openFoam
  #7
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14
luckycfd is on a distinguished road
Hi,
can you give me some idea for start to implementation the openMP protocol for parallelization the openFoam linear solver.
luckycfd is offline   Reply With Quote

Old   July 21, 2013, 17:04
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Hassan,

Since you asked me through the private message and since you asked here as well, I'll answer here what I can remember:
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 30, 2013, 09:01
Default
  #9
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14
luckycfd is on a distinguished road
thank you bruno
luckycfd is offline   Reply With Quote

Old   August 24, 2013, 20:09
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
To help add information to this thread, I remembered this thread when I saw the PDF from this other post:
Quote:
Originally Posted by luckycfd View Post
According to the reference that it's address link is below, in page 53;
http://www.diva-portal.org/smash/get...T01.pdf‎
The document is titled "Hybrid Parallel Computation of OpenFOAM Solver on Multi-Core Cluster Systems", a Master of Science Thesis by Yuan Liu.
Quoting from the abstract:
Quote:
This thesis pick up the most used compressible reacting solver named
dieselFoam as the research target. Through the analysis of code struc-
ture in solver equation and native MPI implementation in OpenFOAM,
deploy two level parallelism structure on SMP cluster, which use Mes-
sage Passing Interface (MPI) between each SMP nodes and OpenMP
directives inside SMP node. The key idea is making use of feature of
threads parallelism, reduce unnecessary MPI communication overhead,
thereby achieve performance improvement.
Although the results seem a bit suspicious, because being able to cut down runtime by 25% in MPI vs OpenMP, seems awfully suspicious to me. 5-10% I would believe, but 25% is too much. But then again, I don't have evidence to back me up.
Wait... the test case has 168100 cells and it was subdivided into 8 sub-domains, which would explain the performance boost, since this would be 20 kcells vs the rule of thumb of 50 kcells for MPI. So this (in theory) gives the ability to improve scalability for low cell count in sub-domains, therefore allowing for more cores assigned for a case.
__________________
wyldckat is offline   Reply With Quote

Old   January 30, 2014, 08:46
Default openmp in openfoam
  #11
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14
luckycfd is on a distinguished road
Quote:
Originally Posted by bravikanth View Post
Dear all,

I want to run the simpleFoam solver using OpenMP. Can anyone suggest me how i can run the solver and what environment variables i need to set in order to make the openmp run.

Thanks,

Ravi
Hi,
for activate the openmp protocol in your openfoam projects, you must add the "-fopenm" flag into the Make/options file of your project.
regards
luckycfd is offline   Reply With Quote

Old   March 8, 2016, 04:18
Default
  #12
Member
 
Lianhua Zhu
Join Date: Aug 2011
Location: Wuhan, China
Posts: 35
Rep Power: 15
zhulianhua is on a distinguished road
Quote:
Originally Posted by luckycfd View Post
Hi,
for activate the openmp protocol in your openfoam projects, you must add the "-fopenm" flag into the Make/options file of your project.
regards

I have tried to put -fopenmp in the solver's Make/option. But it seems wmake ignored it.

Then I put -fopenmp in the wmake rules in
Code:
~/OpenFOAM/OpenFOAM-2.4.0/wmake/rules/linux64Icc/c++
, the OpenMP compilation worked.

My environment is
OS: CentOS 6.5 64 bit
OF: OF2.4.0
CXX: Icc 15.0.1
MPI: Intel MPI 5.0.2

Hope that information helps.

Lianhua
luckycfd and zhangyan like this.
zhulianhua is offline   Reply With Quote

Old   June 20, 2016, 11:11
Default
  #13
New Member
 
Xu Huang
Join Date: Apr 2015
Location: Netherlands
Posts: 23
Rep Power: 11
xuhuang is on a distinguished road
Quote:
Originally Posted by zhulianhua View Post
I have tried to put -fopenmp in the solver's Make/option. But it seems wmake ignored it.

Then I put -fopenmp in the wmake rules in
Code:
~/OpenFOAM/OpenFOAM-2.4.0/wmake/rules/linux64Icc/c++
, the OpenMP compilation worked.

My environment is
OS: CentOS 6.5 64 bit
OF: OF2.4.0
CXX: Icc 15.0.1
MPI: Intel MPI 5.0.2

Hope that information helps.

Lianhua
Hi Lianhua,

Apart from putting -fopenmp in the wmake rules, is there any other modifications needed for a solver?

Greetings,
Xu
xuhuang 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
[OpenFOAM] Questions about Paraview to show Parallel run of OpenFOAM padian ParaView 20 September 24, 2018 13:52
ESI-OpenCFD Releases OpenFOAM v2.2.0 opencfd OpenFOAM Announcements from ESI-OpenCFD 13 March 30, 2013 17:52
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 04:52
OpenFOAM Training in Europe and USA hjasak OpenFOAM 0 August 8, 2008 06:33
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 15:25


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