Compilation error while using libmpi_mt

Compilation error while using libmpi_mt

I'm facing the following error while compiling my application using mpiicpc. I'm using the compiler option -lmpi_mt, as well as -openmp flag for all files.

x86_64-k1om-linux-ld: MPIR_Thread: TLS definition in /opt/intel//impi/4.1.3.048/mic/lib/libmpi_mt.so section .tbss mismatches non-TLS definition in /opt/intel//impi/4.1.3.048/mic/lib/libmpi.so.4 section .bss

/opt/intel//impi/4.1.3.048/mic/lib/libmpi.so.4: could not read symbols: Bad value

The mpiicpc -show output is:

icpc -I/opt/intel//impi/4.1.3.048/intel64/include -L/opt/intel//impi/4.1.3.048/intel64/lib -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker /opt/intel//impi/4.1.3.048/intel64/lib -Xlinker -rpath -Xlinker /opt/intel/mpi-rt/4.1 -lmpigc4 -lmpigf -lmpi -lmpigi -ldl -lrt -lpthread

Can anyone suggest how to get rid of this error.

I went through this thread https://software.intel.com/en-us/forums/topic/392483 but couldn't resolve my issue.

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I found a post from a year ago in another forum on the IDZ site describing the same problem - although in that case, they are not using the Intel® Xeon Phi™ coprocessor (https://software.intel.com/en-us/forums/topic/392483). The answer in that case was to make sure each at least one of these flags was on the command line:

-mt_mpi, -openmp, -parallel, -threads, -reentrancy, or -reentrancy threaded

I know you said you are using "the compiler option -lmpi_mt, as well as -openmp flag for all files" but when I scanned the "mpiicpc -show" output, I didn't see any of those flags. I did see the library -lpthread but none of the flags. I think, with the exception of -lmpi_mt, it really needs to be a flag you specify, not a library, to force the use of the thread safe mpi library. Could you double check for the compile flags?

Hi Frances,
I've double checked on the flag, it really takes up the flag -openmp for all the files while compilation.
Is there a way to add flags to "mpiicpc" such that "mpiicpc -show" displays it? Because in my case it remains unchanged.

I don't know why you are not seeing the -openmp flag when you use the -show option. That is something I will need to look into.

But for right now, if you are using a makefile, would it be possible for you to send me a copy of your makefile and the complete text from a clean make? It really seems like somewhere, something is not picking up that it should be compiling against mpi_mt. Perhaps a library compiled separately from your make?

You can send the files as attachments to a private message (the Send Author A Message link on my post) if you prefer. 

Hi Frances,
I've sent you the files.
I've also been wondering if it is possible to do multithreaded MPI without being able to get this thread-safe feature working.
So here's the idea - I have 60 MPI ranks running on 60 cores of MIC. Within each rank I'm spawning 2 threads (which will be hyperthreads within the same core). Each of these two threads process one function each in parallel, both of which functions contain MPI sends and receives. Now, I'm defining within each rank that thread 0 should work on Func0 and thread 1 should work on Func1. And all the tags used in these MPI sends and receives within Func0 and Func1 have been appended with Thread IDs of the thread processing it.
Is the above scenario workable, even without getting thread-safety feature working (i.e, MPI_THREAD_MULTIPLE). Since essentially hyperthreads won't actually be active on the same clock cycle.
This is just an idea. Please correct me if I am wrong.
Thanks.

Best Reply

Ambuj, two things - In the log file you sent, most of the .so files are up-to-date and are not getting built. I know this is a painful thing to ask, but could you do a clean and then remake all the libraries. I realize that there is a lot of stuff in there and the build will probably take a long time but this is probably the easiest way to make sure all the libraries were built with the -openmp flag and there aren't one or more old libraries out there. Also, there are a number of third party libraries at the top of the log that should have been made to be thread safe. It would be good to check that they are.

As to the idea of trying to sneak by without using the multithreaded library - I would not recommend trying that. The threads (not hyperthreads) on a single core of the coprocessor may not run on the same clock cycle but the core is switching threads with each clock so effectively they are running together. I'm not sure what all problems can occur but I would worry about stack problems and mpi function that should not be entered by two threads at the same time.

Hi Frances,
The problem is resolved now. There was a place in one of the configuration files where -lmpi flag was mentioned, which was conflicting with my provided flag -lmpi_mt. Changing that lmpi to lmpi_mt did the task.
Thanks for you support.

Leave a Comment

Please sign in to add a comment. Not a member? Join today