Software Archive
Read-only legacy content
17061 Discussions

mkl_lapack_dlacpy

Vishal1
Beginner
779 Views

Hi,

I get the following error when I use Compiler Assisted Offload -

On the sink, dlopen() returned NULL. The result of dlerror() is "/tmp/coi_procs/1/5052/load_lib/icpcout0f7Z77: undefined symbol: mkl_lapack_dlacpy"
On the remote process, dlopen() failed. The error message sent back from the sink is /tmp/coi_procs/1/5052/load_lib/icpcout0f7Z77: undefined symbol: mkl_lapack_dlacpy
offload error: cannot load library to the device 0 (error code 20)


I'm building with

icpc -c -std=c++11 -O3 -xHost -ip -parallel -funroll-loops -fno-alias -fno-fnalias -fargument-noalias   -DMKL_ILP64 -I/opt/intel/composer_xe_2013_sp1.1.106/mkl/include -offload-option,mic,compiler,"/opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/mic/libmkl_intel_ilp64.a /opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/mic/libmkl_sequential.a /opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/mic/libmkl_core.a" -offload-attribute-target=mic -openmp -I include/ src/ComputeSim.cpp  -Wl,--start-group  /opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_intel_ilp64.a /opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_sequential.a /opt/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -o src/obj/ComputeSim.o

 

0 Kudos
4 Replies
TimP
Honored Contributor III
779 Views

could you use the advice at

http://software.intel.com/sites/products/mkl/MKL_Link_Line_Advisor.html

?

I don't think the part between " " can be taken literally; it may need to be all one line, with \ continuations for other line breaks if in a script.

0 Kudos
Vishal1
Beginner
779 Views

Hi,

      I have problems with the exact same thing every time - linking with MKL when using compiler assisted offload.

1. When I build offloaded code that does not make any MKL calls in the offloaded region, I compile with -DMKL_ILP64 -mkl=sequential and link with -lpthread -lm as recommended by Ver 4 of the Link Line advisorI know that I'm running the sequential

2. Now when I include MKL calls (to DFTI descriptor configuration) in the offloaded region, I compile with -DMKL_ILP64 -mkl=sequential and link with -lpthread -lm i.e. the same compiler and linking options used when there was no MKL code in the offloaded regions. When i run my code, I get the following error -

offload error: process on the device 0 was terminated by signal 11 (SIGSEGV)

3. Using Ver 4 of the Link Line advisor, I select the following options -

  • Select Intel® product: Intel Composer XE 2013 SP1
  • Select OS: Linux
  • Select usage model of Intel® Xeon Phi™ Coprocessor: Compiler assisted Offload
  • Select compiler: Intel C/C++
  • Select architecture: Intel 64
  • Select dynamic or static linking: Dynamic
  • Select Interface Layer: ILP64 (64-bit Integer)
  • Select sequential or multi-threaded layer: Sequential
  •    

     

My Link Line I compile with -DMKL_ILP64 -mkl=sequential -offload-attribute-target=mic, and link with -lpthread -lm.

On the sink, dlopen() returned NULL. The result of dlerror() is "/tmp/coi_procs/1/5217/load_lib/icpcoutBZOw1k: undefined symbol: _ZN9KeplerObj11getRedShiftEv"
On the remote process, dlopen() failed. The error message sent back from the sink is /tmp/coi_procs/1/5217/load_lib/icpcoutBZOw1k: undefined symbol: _ZN9KeplerObj11getRedShiftEv
offload error: cannot load library to the device 0 (error code 20)

From my understanding of what the flag -offload-attribute-target=mic does, it marks every function and variable in the source file as offload-able!!! Correct me if I am wrong, but that is not the compiler option for me simply because I have C++ classes etc in my code (not meant to be offloaded) that are not supported for offload by #pragma offload {}. Now based on Kevin Davis's article - 'Effective Use of the intel Compiler's Offload Feature', based on my reading of the section on 'Using MKL and TBB on MIC', my using the -DMKL_ILP64 flag should be enough to make the compiler build MIC versions of my MKL code. So what's the problem? Could it be my MPSS? My MKL version? My compiler version?

I have tried many variants of the linking but while i can get simple code to compile and run, the code I need to get running simply does not work once I begin including MKL in the offload sections. I am willing to be as co-operative as is possible to help troubleshoot this. I would be happy to email someone my code (and a sample of the data that it needs to run on) so they can verify what's going on. Please help!

0 Kudos
TimP
Honored Contributor III
779 Views

It does appear now that you have C++ references of your own in off-loaded code to a function which hasn't been compiled for offload.  If you can't compile with flags which cause such functions to generate off-load code, you will need to designate them with pragmas.  Others here are more expert on this question than I; there should be examples in the samples in the compiler installation.

Among your options would be to file a ticket using your Intel Premier Support account created by registering your license, filling out the web form and attaching your files.  That would enable you to keep the files private, as would replying to an offer of support from an individual.

0 Kudos
Vishal1
Beginner
779 Views

I don't mind attaching my files to a public post - the code is for astrophysics research and so not really proprietary. I'd actually be glad to have someone test the code - which works fine when I remove all offloaded MKL calls, just to see if the problems are being caused by something environment specific. As I said earlier, simple MKL calls in offloaded code work just fine - the problems arise when I use similar calls in the real code. 

0 Kudos
Reply