PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

IPA with libraries

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
frnkyl004



Joined: 06 Dec 2011
Posts: 50

PostPosted: Wed Feb 05, 2014 6:49 am    Post subject: IPA with libraries Reply with quote

Hi All,

I have a library (lib.a) consisting of libfile1.f and libfile2.f. I form the library as follows:
Code:
pgf90 -c -fast -Mipa=fast,libopt -Minfo=ccff -tp=sandybridge-64 libfile1.f
pgf90 -c -fast -Mipa=fast,libopt -Minfo=ccff -tp=sandybridge-64 libfile2.f
ar rcv lib.a libfile1.o libfile2.o
ar -s lib.a
I have other source files which I compile as follows:
Code:
pgf90 -c -fast -Mipa=fast,libopt -Minfo=ccff -tp=sandybridge-64 file1.f
pgf90 -c -fast -Mipa=fast,libopt -Minfo=ccff -tp=sandybridge-64 file2.f
pgf90 -c -fast -Mipa=fast,libopt -Minfo=ccff -tp=sandybridge-64 file3.f
I link everything using
Code:
pgf90 -o fast.exe -fast -Mipa=fast,libopt -Minfo=ccff -tp=sandybridge-64 file1.o file2.o file3.o lib.a
at which point the compiler starts the IPA optimizations and prints something like:
Code:
IPA: Recompiling file1.o: new IPA information
IPA: Recompiling file2.o: new IPA information
IPA: Recompiling file3.o: new IPA information
IPA: Recompiling from lib.a: libfile1.o
IPA: Recompiling from lib.a: libfile2.o
IPA objects file1_ipa6_gamess.oo, file2_ipa6_gamess.oo and file3_ipa6_gamess.oo are created for the non-library files in the current working directory while files like libfile1.ooZFbQoxtxy0T.ipa and libfile2.o_ZFb6drTN6Cp.ipa are created in /tmp/ for the library files.

All good so far...

If I relink using
Code:
pgf90 -o fast.exe -fast -Mipa=fast,libopt -Minfo=ccff -tp=sandybridge-64 file1.o file2.o file3.o lib.a
the compiler does not recompile the non-library files but does recompile the library files:
Code:
IPA: IPA information unchanged for 3 source files
IPA: Recompiling from lib.a: libfile1.o
IPA: Recompiling from lib.a: libfile2.o
even though neither the library nor the files of which it is comprised have changed. AFAIK this is an unavoidable consequence of the libopt option to -Mipa.

If possible, I'd like to avoid the unnecessary recompilation of the library files, but I still want to benefit from the IPA optimizations.

So my questions are:
1. Is it possible to build an IPA library (a library with IPA objects)? If it is, please provide an example.
2. Would this IPA library and other objects that use it still benefit from IPA optimizations at link time if libopt is removed from -Mipa or safe:lib.a is added to -Mipa? I think the answer to this should be yes because in my experience if subroutines/functions from file1.o are used in file2.o and only file1.o is modified, only file1.o is recompiled at link time with a message similar to:
Code:
IPA: Recompiling file1.o: stale object file
IPA: IPA information unchanged for 2 source files
IPA: Recompiling from lib.a: libfile1.o
IPA: Recompiling from lib.a: libfile2.o

Apologies for the extremely long post.

Cheers,
Kyle
Back to top
View user's profile
frnkyl004



Joined: 06 Dec 2011
Posts: 50

PostPosted: Sat Feb 08, 2014 12:09 am    Post subject: Reply with quote

It's awfully lonely in here... :\
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Mon Feb 10, 2014 10:55 am    Post subject: Reply with quote

Hi Kyle,

Sorry for the late response. I needed to send this to engineering for comment. With a major snow storm here in Portland, things have been a bit slower.

This is the first time we've had this request and not something our engineers had considered. The problem being that the "*.oo" files are specific for a binary so couldn't just be included in the library. They think they might be able do something to help, but I would need justification to put this on their work plans. Is the problem just the extra compilation time or is there a larger issue?

- Mat
Back to top
View user's profile
frnkyl004



Joined: 06 Dec 2011
Posts: 50

PostPosted: Tue Feb 11, 2014 2:50 am    Post subject: Reply with quote

Hi Mat,

Thanks for responding and I hope the weather improves soon.

The "problem" is just the extra compilation time; so it's not really a problem. I was just making sure that there wasn't an existing solution to this.

Cheers,
Kyle
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Tue Feb 11, 2014 9:57 am    Post subject: Reply with quote

Hi Kyle,

The big thaw is happening and it looks like things are starting to get back to normal.

I went ahead an put in a feature request (TPR#19836) for this.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
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