2 /* Creator: Bronis R. de Supinski (bronis@llnl.gov) */
4 /* op-no-error.c -- construct some MPI_Ops and free them */
8 "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/op-no-error.c,v 1.1 2002/05/29 16:09:50 bronis Exp $";
15 /* construct multiple instances of same op to exercise more Umpire code... */
24 myProd (void *inp, void *inoutp, int *len, MPI_Datatype *dptr)
28 Complex *in = (Complex *) inp;
29 Complex *inout = (Complex *) inoutp;
31 for (i =0; i < *len; ++i) {
32 c.real = inout->real*in->real - inout->imag*in->imag;
33 c.imag = inout->real*in->imag + inout->imag*in->real;
43 main (int argc, char **argv)
47 MPI_Comm comm = MPI_COMM_WORLD;
49 char processor_name[128];
51 MPI_Op newop[OP_COUNT];
52 MPI_Op newop2[OP_COUNT];
55 MPI_Init (&argc, &argv);
56 MPI_Comm_size (comm, &nprocs);
57 MPI_Comm_rank (comm, &rank);
58 MPI_Get_processor_name (processor_name, &namelen);
59 printf ("(%d) is alive on %s\n", rank, processor_name);
64 for (i = 0; i < OP_COUNT; i++)
65 MPI_Op_create (myProd, 1, &newop[i]);
67 for (i = 0; i < OP_COUNT; i++)
68 MPI_Op_free (&newop[i]);
72 /* now with an alias... */
73 for (i = 0; i < OP_COUNT; i++)
74 MPI_Op_create (myProd, 1, &newop[i]);
76 for (i = 0; i < OP_COUNT; i++) {
78 MPI_Op_free (&newop2[i]);
83 printf ("(%d) Finished normally\n", rank);