1
1
openmpi/orte/test/mpi/loop_child.c
Jeff Squyres 2cbcb4abf1 Remove the French and strip the tests down to essentials (no need for
buffer attaching/detaching, for example).

This commit was SVN r14216.
2007-04-04 15:38:23 +00:00

31 строка
639 B
C

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>
#include "mpi.h"
int main( int argc, char **argv )
{
MPI_Comm parent;
MPI_Comm merged;
int rank;
int size;
MPI_Init(&argc, &argv);
printf("Child: launch\n");
MPI_Comm_get_parent(&parent);
MPI_Intercomm_merge(parent, 1, &merged);
MPI_Comm_rank(merged, &rank);
MPI_Comm_size(merged, &size);
printf("Child merged rank = %d, size = %d\n", rank, size);
sleep(1);
MPI_Comm_free(&merged);
MPI_Finalize();
printf("Child: exiting\n");
return 0;
}