Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Michail_P_
Beginner
108 Views

Cannot execute binary error on an Intel Xeon Phi

Jump to solution

I am having a C code that compiles and runs properly locally on my machine.
But when I am trying to compile with the icc and the -mmic flag and test it on Intel Xeon Phi, I am getting the following message:

***/cm/local/apps/sge/current/spool/node079/job_scripts/5438755: line 14: ./sequential.mic: cannot execute binary file***


I run all my tests in a cluster which uses SGE job submission system.

**My makefile contains these lines:**

    sequential: Makefile
    icc -mmic -o sequential.mic sequential.c
    qsub sequential.job

***The job file for submitting the job is:***

    #!/bin/sh
    #$ -S /bin/sh
    #$ -l h_rt=00:10:00
    #$ -j y
    #$ -l fat,accel=XeoPhi
    #$ -cwd

    . /etc/bashrc
    
    module load intel/compiler/64/13.3/2013.3.163

    ./sequential.mic


Notes:

 - If i compile it with gcc and submit it to a regular node (XEON 5620)
   everything works as expected.
 - Also, i tried the file command to examine to the mic executable and the output is : **sequential.mic: ELF 64-bit LSB executable, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, not stripped**
 


Any suggestions are more than welcome.

 

0 Kudos
1 Solution
Kevin_D_Intel
Employee
108 Views

Compiling with -mmic and then running the resulting executable natively requires shipping the executable to the coprocessor. Perhaps in your case you can leverage the /usr/bin/micnativeloadex command. Within your batch script change the execution of your program to be this:

/usr/bin/micnativeloadex  ./sequential.mic

View solution in original post

3 Replies
Kevin_D_Intel
Employee
109 Views

Compiling with -mmic and then running the resulting executable natively requires shipping the executable to the coprocessor. Perhaps in your case you can leverage the /usr/bin/micnativeloadex command. Within your batch script change the execution of your program to be this:

/usr/bin/micnativeloadex  ./sequential.mic

View solution in original post

Michail_P_
Beginner
108 Views

Thank you very much that worked perfectly.

But now I got another issue. The program stores its output to a .txt file that now is not copies back from the Xeon Phi.

Do I need a specific command or something to copied back?

Kevin_D_Intel
Employee
108 Views

Glad to hear that.

I don't know what capabilities exist for the system you are using. Typically one uses scp to move files to/from the coprocessor. Some have NFS mounted filesystems between the host and coprocessor which enables rather convenient file sharing.

Can you check with the system admins for the system you are using to see if you have 'scp' access to the coprocessor?

If so then it should just be a matter of having your program open/create the output file in a known location (e.g. /tmp), and then you can use scp to pull the file back to the host after the micnativeloadex command has completed.

Reply