PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Naive OpenMP configuration question
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Performance and Benchmarking
View previous topic :: View next topic  
Author Message
hongyon



Joined: 19 Jul 2004
Posts: 551

PostPosted: Wed Oct 06, 2010 5:21 pm    Post subject: Reply with quote

Hi,

Do you have OpenMP directive in C/C++ source code at all? If that is the case, this could be a problem. Since your C/C++ is compiled with Visual C++ and it has its own Openmp implemenation. While your Fortran code is compiled with PGI and it also has its own implementation.

Let say, you don't have OpenMP code in C/C++, you will need to make sure that your main program/project is linked with PGI OpenMP library instead of Visual C++ OpenMP library.

Hongyon
Back to top
View user's profile
Eos Pengwern



Joined: 18 Aug 2010
Posts: 16

PostPosted: Wed Oct 06, 2010 5:36 pm    Post subject: Reply with quote

Thanks Hongyon;

No, I don't use any OpenMP in the C++ code; all the computationally-intensive stuff is kept within the Fortran DLL.

That being the case, is there a library I should explicitly link with, over and above those already listed in my linker command line (see my previous post)?

Stephen.
Back to top
View user's profile
hongyon



Joined: 19 Jul 2004
Posts: 551

PostPosted: Thu Oct 07, 2010 12:07 pm    Post subject: Reply with quote

In your Visual C++ main project, this is for a Release configuration:

Open up property page and set following properties:

1)
Configuration Properties -> C/C++ -> Code Generation -> Runtime Library -> Multi-threaded(/MT)

2) Configuration Properties -> General -> Common Language Runtime support ->No Common Language Runtime support

3) Configuration Properties -> Linker -> General -> Additional Library Directories

Added following 2 lines,
the first line depends on which version your PVF is.
the second line depends on where you put your Fortran library.

C:\Program Files\PGI\win64\10.9\lib
C:\Users\myname\Documents\Visual Studio 2008\Projects\openmpf\openmpf\x64\Release

4) Configuration Properties -> Linker -> Input -> Additional Dependencies -> [...]
Added following lines. openmpf.lib is your Fortran library name.

openmpf.lib
-defaultlib:pgmp
-defaultlib:pg
-defaultlib:pgf90
-defaultlib:pgf90_rpm1
-defaultlib:pgf902
-defaultlib:pgf90rtl
-defaultlib:pgftnrtl
-nodefaultlib:msvcrt
-nodefaultlib:msvcmrt
-defaultlib:libcmt
-defaultlib:pgc
-defaultlib:libnspgc
-defaultlib:oldnames



Also, I would make it static library instead of dll library. I am not sure it create DLL properly in PVF. If it works for you, go ahead.

Hongyon


Last edited by hongyon on Thu Oct 07, 2010 1:59 pm; edited 1 time in total
Back to top
View user's profile
hongyon



Joined: 19 Jul 2004
Posts: 551

PostPosted: Thu Oct 07, 2010 12:16 pm    Post subject: Reply with quote

I also noticed that you use MKL library. I don't have experience using them but it may have some specific library that you might use with PGI.

Hongyon
Back to top
View user's profile
hongyon



Joined: 19 Jul 2004
Posts: 551

PostPosted: Thu Feb 17, 2011 2:47 pm    Post subject: Reply with quote

I posted above that you should build static library instead of DLL.
All the dynamic library build in PVF is now should be as good as static library.

Hongyon
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Performance and Benchmarking All times are GMT - 7 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group