I write a simple mpi program as follow:
#include "mpi.h"
#include <stdio.h>
#include <math.h>
void main(argc,argv)
int argc;
char *argv[];
{
int myid,numprocs;
int namelen;
char pro_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD,&myid);
MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
MPI_Get_processor_name(pro_name,&namelen);
printf("Process %d of %d on %s\n",myid,numprocs,pro_name);
MPI_Finalize();
}
When I compile it with "mpicc -o xxx xxx.c" and run it with "mpirun -np 8 ./xxx", it rightly creates 8 processes. But when I compile it with "mpiicc -o xxx xxx.c" and run with the same order as above, it only creates 1 process. I want to know what's the difference between the mpicc and mpiicc. Is it caused by some faults made during my installment? And how can I fix it? By the way, I install the impi and compiler of intel by installing the intel cluster studio (l_ics_2013.1.039_intel64).
Here is the result:
[root@localhost test]# mpicc -o mpitest mpi-test.c
[root@localhost test]# mpirun -np 8 ./mpitest
Process 3 of 8 on localhost.localdomain
Process 4 of 8 on localhost.localdomain
Process 5 of 8 on localhost.localdomain
Process 6 of 8 on localhost.localdomain
Process 7 of 8 on localhost.localdomain
Process 0 of 8 on localhost.localdomain
Process 1 of 8 on localhost.localdomain
Process 2 of 8 on localhost.localdomain
[root@localhost test]# mpiicc -o mpitest mpi-test.c
[root@localhost test]# mpirun -np 8 ./mpitest
Process 0 of 1 on localhost.localdomain
Process 0 of 1 on localhost.localdomain
Process 0 of 1 on localhost.localdomain
Process 0 of 1 on localhost.localdomain
Process 0 of 1 on localhost.localdomain
Process 0 of 1 on localhost.localdomain
Process 0 of 1 on localhost.localdomain
Process 0 of 1 on localhost.localdomain