Software Archive
Read-only legacy content
17061 Discussions

A bug in icc 13.0

qian_c_
Beginner
1,266 Views

Hello! I got a problem when I run  the follow program:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main()
{
        #pragma offload target(mic:0)
        {
                char Host[32];
                int len;
                gethostname(Host,32);
                printf("%s\n",Host);
        }
        #pragma offload target(mic:1)
        {
                char Host[32];
                int len;
                gethostname(Host,32);
                printf("%s\n",Host);
        }

        #pragma offload target(mic:2)
        {
                char Host[32];
                int len;
                gethostname(Host,32);
                printf("%s\n",Host);
        }
        return 0;

}

I run it on a node with three MIC card.I compiled it with icc 13.0 ,then the result is as follow:

cn0-mic0

cn0-mic1

cn0-mic1

Then I compiled it with icc 14.0,the result is as follow:

cn0-mic0

cn0-mic1

cn0-mic2

Of course ,the result of icc14.0 is correct.Why icc 13.0 can not offload code to mic:2???

I am urgent,Please help me,Thank you!

0 Kudos
8 Replies
qian_c_
Beginner
1,266 Views

Can anyone help me?

0 Kudos
Kevin_D_Intel
Employee
1,266 Views

I'm not sure there's much you can do to avoid this in 13.0. I assume there must be a reason for wanting to stick with the 13.0 compiler, although it is an older version. It seems like there is a defect in the offload run-time library perhaps. I don't recall hearing reports about this in the past but there could have been (I will check) and perhaps there is a fix in a 13.0 update which maybe you could use if you do not already have the latest (which is 13.1.3.192 Build 20130607).

Can you tell me the specific version of your 13.0 icc (i.e. icc -V)?

If you do not require the 13.0 compiler, then can you use the 14.0 compiler?

Better than 14.0 would be to use the 15.0 compiler from the latest Intel® Parallel Studio XE 2015 Update 2 release, assuming you can.

0 Kudos
Kevin_D_Intel
Employee
1,266 Views

Another request, please add this source line just before your first offload (so it is called in host code) and then let us know the output:

printf(" number of device = %d \n",_Offload_number_of_devices());

0 Kudos
qian_c_
Beginner
1,266 Views

Kevin Davis (Intel) wrote:

I'm not sure there's much you can do to avoid this in 13.0. I assume there must be a reason for wanting to stick with the 13.0 compiler, although it is an older version. It seems like there is a defect in the offload run-time library perhaps. I don't recall hearing reports about this in the past but there could have been (I will check) and perhaps there is a fix in a 13.0 update which maybe you could use if you do not already have the latest (which is 13.1.3.192 Build 20130607).

Can you tell me the specific version of your 13.0 icc (i.e. icc -V)?

If you do not require the 13.0 compiler, then can you use the 14.0 compiler?

Better than 14.0 would be to use the 15.0 compiler from the latest Intel® Parallel Studio XE 2015 Update 2 release, assuming you can.

Hello Dvis,I have read a lot of your reply and I think you are a real expert.

My icc version is 13.0.0. The result of  _Offload_number_of_devices() is 3.

My program can be compiled by icc 14.0 or icpc 14.0, but when I run it , it down.

The error is very familiar (TvT):can not load library to device 0:Undefined symbol :_ZNTAMPT8DatatypeDS(messy code

So I have to compile my program by 1cpc 13.0, it works but can not run on the third mic card.

0 Kudos
qian_c_
Beginner
1,266 Views

Kevin Davis (Intel) wrote:

Another request, please add this source line just before your first offload (so it is called in host code) and then let us know the output:

printf(" number of device = %d \n",_Offload_number_of_devices());

Hello Davis, is there any environment variables or  function can solve the problem???

0 Kudos
qian_c_
Beginner
1,266 Views

Kevin Davis (Intel) wrote:

I'm not sure there's much you can do to avoid this in 13.0. I assume there must be a reason for wanting to stick with the 13.0 compiler, although it is an older version. It seems like there is a defect in the offload run-time library perhaps. I don't recall hearing reports about this in the past but there could have been (I will check) and perhaps there is a fix in a 13.0 update which maybe you could use if you do not already have the latest (which is 13.1.3.192 Build 20130607).

Can you tell me the specific version of your 13.0 icc (i.e. icc -V)?

If you do not require the 13.0 compiler, then can you use the 14.0 compiler?

Better than 14.0 would be to use the 15.0 compiler from the latest Intel® Parallel Studio XE 2015 Update 2 release, assuming you can.

Dear Davis:

This is the error.I successfully compiled the program with mpicxx(icpc 14.0,mpich 3.1.3) and run it,then the error appeared.

QQ截图20150401162610.png

Why it down?

0 Kudos
Kevin_D_Intel
Employee
1,266 Views

Thank you for the nice comment and additional details. The 13.0.0 is the initial 13.0 release so you could consider trying a newer 13.0 update. Unfortunately I do not have any system with greater than 2 coprocessors so I am unable to test anything to know whether any 13.0 update will help. I have not found anything similar previously reported either.

I do not know whether this will help at all but with 13.0, try setting the environment variable: OFFLOAD_DEVICES=0,1,2

The undefined symbol with 14.0 may indicate a lack of declaring variables/functions with the target attribute. With the 14.0 release, you can try an option on the compiler command-line that might shed more clues on where the unresolved originates. Try either:

-offload-option,mic,compiler,"-Wl,-zdefs"

*OR*

-offload-option,mic,ld,"-z defs"

Use the first variant if you are compiling and linking, and the second variant if only performing the link. Both of these are icc/icpc command-line options.

I'm sorry about the problems you are experiencing.

0 Kudos
Kevin_D_Intel
Employee
1,266 Views

Advice from Development was to look at your use of MPI. The error suggests there is perhaps target(mic) decoration lacking for MPI related functions/variables/classes/etc. It may be as simple as placing MPI headers within #pragma offload_attribute(push, target(mic))    and     #pragma offload_attribute(pop).

0 Kudos
Reply