Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Barry_W_
Beginner
80 Views

mpiicc -mmic Argument list too long

I am attempting to compile a simple MPI program for native execution on Xeon Phi.  I can successfully compile for the host using mpiicc, but when I add the -mmic flag it seems to hang for quite a while and then I get:

/opt/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/bin/mpiicc: line 116: /opt/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/bin/mpiicc: Argument list too long

Line 116 of mpiicc below is exec mpiicc "$@".  Looking at the code,  I suspect this is getting caught in a recursive loop as it calls mpiicc again with the same argument list.  Being so basic I don't doubt it is an environment problem, but looking at this I don't understand how it was supposed to work.

# Recognize the '-mmic' compiler switch.
for arg in "$@" ; do
{
 if [ "${arg}" = "-mmic" ] ; then
  . ${prefix}/mic/bin/mpivars.sh
  if [ -n "$VT_ROOT" ]; then
    if [ -f "$VT_ROOT/mic/bin/itacvars.sh" ]; then
      . "$VT_ROOT/mic/bin/itacvars.sh" ""
    fi
  fi
  exec mpiicc "$@"
 fi
}

Thanks in advance.

B

 

 

0 Kudos
4 Replies
Kevin_D_Intel
Employee
80 Views

Actually it is not looping. There are different mpiicc commands invoked.

The mpiicc invoked initially resides in the "intel64" sub-directory:  /opt/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/bin/mpiicc

The mpiicc exec'd by that script (in the cited code) resides in the "mic" sub-directory: /opt/intel/compilers_and_libraries_2016.0.109/linux/mpi/mic/bin/mpiicc

I cannot reproduce the failure. It may be a shell limit that's being surpassed. Will you please post the command-line you used that triggers this error.

Kevin_D_Intel
Employee
80 Views

I suppose this could loop in the mpiicc from the ‘intel64’ directory if for some reason the source of the mpivars.sh (e.g. . ${prefix}/mic/bin/mpivars.sh) in the code snippet shown failed to modify the underlying shell’s PATH setting such that the ‘mic’ directory failed to be inserted into the PATH ahead of the ‘intel64’ path.

To detect that, make a local copy of mpiicc and then insert a "which mpiicc" just before the "exec mpiicc" and/or insert an "echo $PATH" there. For this all to work correctly, mpiicc must resolve from /opt/intel/compilers_and_libraries_2016.0.109/linux/mpi/mic/bin. If it resolves from "intel64" then it would loop. 

Barry_W_
Beginner
80 Views

Thank you for your support.  I upgraded to parallel studio 2017 and everything works.  I have not fully debugged the issue, but I believe the problem was my environment was sourcing the correct ipmi environment variables (source /opt/intel/impi/5.1.1.109/mic/bin/mpivars.sh) but not the cluster compiler - it was pointing instead to a composer version (source /opt/intel/composer_xe_2015.1.133/bin/compilervars.sh intel64).  I suspect the mismatch caused my issue.

Thanks again. 

Kevin_D_Intel
Employee
80 Views

You're welcome. Glad to hear the 2017 release is working.

Reply