Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

system command not executing with mpiicc -O

srinivasan_G_1
Beginner
674 Views

Hi,

I have intel Parallel studio XE cluster edition 2015 on my 10 Node server connected with infiniband band. I wrote my code in C. My code consists of system commands with sprintf commands like below

            printf("started \n");
            system("cp metis_input.txt $HOME/metis-4.0/.");
            sprintf(filename,"$HOME/metis-4.0/./partdmesh metis_input.txt %d",size-1);
            system(filename);
            sprintf(filename,"mv metis_input.txt.npart.%d nodes_proc.txt",size-1);
            system(filename);
            printf("completed \n");

when i compile my code n run it without any opmization flag it runs smoothly but when i compile my code with "mpiicc -O" the above lines dont even seem to b executed. I c that the above lines are being skipped. only the printf's r executed. Do i need to add anything extra in my code to get these system commands runnning for INTEL mpi compiler with -O ?  

0 Kudos
7 Replies
Artem_R_Intel1
Employee
674 Views

Hi Srinivasan,

I don't see anything suspicious in your code and unable to reproduce the described problem with the similar code. Could you please try this scenario with disabled SELinux?

Also you can check icc command line generated by mpiicc with '-show' option ('mpiicc -O ... -show').

0 Kudos
srinivasan_G_1
Beginner
674 Views

Hi atlem

i tried after disabling selinux. same issue is continuing... any other suggestion??

Regards 

G SRINIVASAN

0 Kudos
Artem_R_Intel1
Employee
674 Views

Hi Srinivasan,

Could you please provide the command line and environment variables you used to run this scenario?

0 Kudos
srinivasan_G_1
Beginner
674 Views

Hi artem

This is the command i used for this

mpiicc -O -cc=icc -g -ilp64 -c -Wall -L/app/intelMPI//impi/4.1.3.048/intel64/lib main.c

Regards

G SRINIVASAN

 

0 Kudos
Artem_R_Intel1
Employee
674 Views

You wrote:

when i compile my code n run it without any opmization flag it runs smoothly but when i compile my code with "mpiicc -O" the above lines dont even seem to b executed. I c that the above lines are being skipped. only the printf's r executed.

Could you please specify the command line and the environment used to run this scenario (not to compile)?

BTW you used '-ilp64' - this option is applicable for Fortran code only.

0 Kudos
srinivasan_G_1
Beginner
674 Views

This the command i used to run the code

 mpirun -n 32 -ppn 1 -hostfile hosts ./3D_TBL

To run the code i dint use any other flags other than this. I was using optimisation flags only for compiling dint use during execution. 

0 Kudos
Gergana_S_Intel
Employee
674 Views

Hi,

First, to clarify something.  The Intel MPI Library provides only wrappers scripts to the underlying compilers.  What this means in your case is that the option -O that you use on the mpiicc command line is in fact being passed down to icc without any alterations.  It seems like using the default optimization level for the Intel C++ Compiler is causing some print statements to not be executed for your code.

The default optimization level for the 2015 compiler is -O2.  Can you try rerunning with -O1 and let me know if you see the same problem?  If not, then the issue is with the level 2 optimizations performed by the compiler.  Is your application an MPI application?  If not, you can try compiling without the MPI library as follows:

icc -O -g -ilp64 -c -Wall main.c

If that works ok, then there's something wrong with our MPI wrapper. If this still exhibits the problem, then it's an issue with the compiler.

Regards,
~Gergana

0 Kudos
Reply