PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

matlab hangs while loading libacml_mp.so

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Licenses and Installation
View previous topic :: View next topic  
Author Message
mikehogye



Joined: 21 Apr 2006
Posts: 2

PostPosted: Fri Apr 21, 2006 12:34 pm    Post subject: matlab hangs while loading libacml_mp.so Reply with quote

I am running Linux on a machine with 2 dual-core Opterons. I'd like to make use of all 4 cores for matrix multiplication in matlab, and PGI's acml looks promising. When I tell matlab to use the PGI libacml.so, everything works, but (obviously) stays on one processor. When I switch to libacml_mp.so, matlab hangs during startup, while loading the library.

The strace output looks normal for a few thousand lines, and then starts printing
Code:
    sched_yield()                           = 0
    sched_yield()                           = 0
    sched_yield()                           = 0
    ...

over and over, no end in sight.

Ideas?
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Apr 25, 2006 6:28 am    Post subject: Reply with quote

Hi Mike,

I personally have not used Matlab so don't know how Matlab does it's loading of dynamic objects. However, what might be occuring is that the ACML's dependent libraries, libpgmp.so and libpgc.so, are not being loaded. Assuming Matlab uses the "ld" loader, try setting the following environment variables to capture the loader's debug information:
Code:
export LD_DEBUG=all
export LD_DEBUG_OUTPUT="/tmp/ld.log"   (or other log file name)

Another user was able to use his own auto-parrallelized library (See here), which uses the same underlying PGI libraries as the openMP AMCL. While the library did load and run correctly, Matlab crashed while unloading the library. Chris contacted Matlab about the problem and they responded:
Quote:
matlab is single-threaded and trying to use multi-threaded code produces undefined behavior.



- Mat
Back to top
View user's profile
mikehogye



Joined: 21 Apr 2006
Posts: 2

PostPosted: Tue Apr 25, 2006 10:15 am    Post subject: Reply with quote

Mat,

Thanks for your prompt response. The LD_DEBUG thing is a handy trick!

The ld debug output shows libpgmp.so and libpgc.so load successfully from the right place (same directory as the PGI libacml_mp.so). There are no errors or warnings in the output.

It seems unlikely that I'll be able to get to the bottom of this without a sizable time commitment, so I'll have to settle for a single-threaded ACML.

My impression is that, in spite of the answer Chris got from the Matlab folks, there should be a way to get a multithreaded ACML working with Matlab. Intel's MKL does this sucessfully, and I don't see any reason Matlab should know or care whether there are multiple threads under the hood when it makes a LAPACK/BLAS call.


Has PGI considered deliberately targetting Matlab users with their ACML? I don't know what PGI's consumer demograhics are like, but multi-core amd64 systems and Matlab go really well together -- or would, if there were a multithreaded amd64 ACML implementation Matlab could handle. If PGI could work out the kinks with Matlab, they would have a (rapidly growing) captive audience.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Licenses and Installation 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