e8759ca66b
Signed-off-by: Ralph Castain <rhc@open-mpi.org>
24 строки
330 B
C
24 строки
330 B
C
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <mpi.h>
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int rank;
|
|
|
|
if(argc < 2) {
|
|
return 0;
|
|
}
|
|
MPI_Init(&argc, &argv);
|
|
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
|
|
|
|
int i = atoi(argv[1]);
|
|
|
|
MPI_Finalize();
|
|
|
|
if (i != rank) {
|
|
sleep(1);
|
|
}
|
|
return i;
|
|
}
|