|
Packit Service |
c5cf8c |
/* This file created from f77/ext/c2fmult.c with f77tof90 */
|
|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
* (C) 2001 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
Check that MPI_xxxx_c2f, applied to the same object several times,
|
|
Packit Service |
c5cf8c |
yields the same handle. We do this because when MPI handles in
|
|
Packit Service |
c5cf8c |
C are a different length than those in Fortran, care needs to
|
|
Packit Service |
c5cf8c |
be exercised to ensure that the mapping from one to another is unique.
|
|
Packit Service |
c5cf8c |
(Test added to test a potential problem in ROMIO for handling MPI_File
|
|
Packit Service |
c5cf8c |
on 64-bit systems)
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
#include "mpi.h"
|
|
Packit Service |
c5cf8c |
#include <stdio.h>
|
|
Packit Service |
c5cf8c |
#include "mpitest.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int main(int argc, char *argv[])
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPI_Fint handleA, handleB;
|
|
Packit Service |
c5cf8c |
int rc;
|
|
Packit Service |
c5cf8c |
int errs = 0;
|
|
Packit Service |
c5cf8c |
int buf[1];
|
|
Packit Service |
c5cf8c |
MPI_Request cRequest;
|
|
Packit Service |
c5cf8c |
MPI_Status st;
|
|
Packit Service |
c5cf8c |
int tFlag;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MTest_Init(&argc, &argv);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Request */
|
|
Packit Service |
c5cf8c |
rc = MPI_Irecv(buf, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &cRequest);
|
|
Packit Service |
c5cf8c |
if (rc) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
printf("Unable to create request\n");
|
|
Packit Service |
c5cf8c |
} else {
|
|
Packit Service |
c5cf8c |
handleA = MPI_Request_c2f(cRequest);
|
|
Packit Service |
c5cf8c |
handleB = MPI_Request_c2f(cRequest);
|
|
Packit Service |
c5cf8c |
if (handleA != handleB) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
printf("MPI_Request_c2f does not give the same handle twice on the same MPI_Request\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
MPI_Cancel(&cRequest);
|
|
Packit Service |
c5cf8c |
MPI_Wait(&cRequest, &st);
|
|
Packit Service |
c5cf8c |
MPI_Test_cancelled(&st, &tFlag);
|
|
Packit Service |
c5cf8c |
if (!tFlag) {
|
|
Packit Service |
c5cf8c |
errs++;
|
|
Packit Service |
c5cf8c |
printf("Unable to cancel MPI_Irecv request\n");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
/* Using MPI_Request_free should be ok, but some MPI implementations
|
|
Packit Service |
c5cf8c |
* object to it imediately after the cancel and that isn't essential to
|
|
Packit Service |
c5cf8c |
* this test */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MTest_Finalize(errs);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return MTestReturnValue(errs);
|
|
Packit Service |
c5cf8c |
}
|