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

wmake - options for parallel code using omp.h

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2014, 08:30
Default wmake - options for parallel code using omp.h
  #1
New Member
 
Paweł Kuczyński
Join Date: Feb 2011
Location: Warsaw, Poland
Posts: 19
Rep Power: 15
kuczmas is on a distinguished road
Dear forumers,

I want to compile a code that incorporates omp.h library. This library uses '#pragma' statements in order to inform the compiler about the parallel parts of the code. So the if I compile the file test.cpp using g++ I have to put a flag '-fopenmp':
Code:
g++ test.cpp -fopenmp
Is it possible to set the '-fopenmp' flag in wmake? If yes, how to do it?

Any help will be greatly appreciated.
__________________
Best regards
P. Kuczynski.
kuczmas is offline   Reply With Quote

Old   May 15, 2014, 16:00
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Greetings Paweł,

I got the PM you sent me. The quick answer is: have a look into the files located at "wmake/rules/linux*Gcc/c*".
Problem is that editing those files will affect the whole building process. I'll try to have a better look into this during the coming weekend.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 17, 2014, 16:23
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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 Paweł,

OK, I've finally managed to have a look into this. The files I looked at were:
  • "wmake/Makefile"
  • "wmake/rules/General/standard"
  • "wmake/rules/linux64Gcc/c++"
  • Then the "Make/options" and "blockMeshApp.dep" files for the blockMesh application source code.
What I could figure out is that you can edit the file "Make/options" for your application and add this line to the beginning or end of that file:
Code:
ptFLAGS += -fopenmp
Best regards,
Bruno
__________________

Last edited by wyldckat; May 17, 2014 at 16:29. Reason: mistakenly posted without finishing the post
wyldckat is offline   Reply With Quote

Old   May 19, 2014, 04:15
Default
  #4
New Member
 
Paweł Kuczyński
Join Date: Feb 2011
Location: Warsaw, Poland
Posts: 19
Rep Power: 15
kuczmas is on a distinguished road
Hi Bruno,

tanks a lot for your quick and precise answer. It saved me a lot of time!

My model is added to OF in the form of separate dynamic library - where I would like to include parallel parts of the code. So I think it should be enough to compile only my library with -fopenmp flag and then use it normally inside the OF.

Many thanks!
__________________
Best regards
P. Kuczynski.
kuczmas is offline   Reply With Quote

Reply

Tags
compile, omp, parallel, wmake

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
[OpenFOAM.com] erros in Allwmake jiwon OpenFOAM Installation 7 December 30, 2015 12:34
Installation OF1.5-dev ttdtud OpenFOAM Installation 46 May 5, 2009 02:32
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 14:34
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 11:44
What kind of Cmmercial CFD code you feel well? Lans Main CFD Forum 13 October 27, 1998 10:20


All times are GMT -4. The time now is 07:39.