|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* (C) 2009 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
#include <mpi.h>
|
|
Packit Service |
c5cf8c |
#include <stdlib.h>
|
|
Packit Service |
c5cf8c |
#include <stdio.h>
|
|
Packit Service |
c5cf8c |
#include "mpitest.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* tests multiple invocations of MPI_Comm_free_keyval on the same keyval */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int delete_fn(MPI_Comm comm, int keyval, void *attr, void *extra);
|
|
Packit Service |
c5cf8c |
int delete_fn(MPI_Comm comm, int keyval, void *attr, void *extra)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPI_Comm_free_keyval(&keyval);
|
|
Packit Service |
c5cf8c |
return MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int main(int argc, char **argv)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPI_Comm duped;
|
|
Packit Service |
c5cf8c |
int keyval = MPI_KEYVAL_INVALID;
|
|
Packit Service |
c5cf8c |
int keyval_copy = MPI_KEYVAL_INVALID;
|
|
Packit Service |
c5cf8c |
int errs = 0;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MTest_Init(&argc, &argv);
|
|
Packit Service |
c5cf8c |
MPI_Comm_dup(MPI_COMM_SELF, &duped);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Comm_create_keyval(MPI_NULL_COPY_FN, delete_fn, &keyval, NULL);
|
|
Packit Service |
c5cf8c |
keyval_copy = keyval;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Comm_set_attr(MPI_COMM_SELF, keyval, NULL);
|
|
Packit Service |
c5cf8c |
MPI_Comm_set_attr(duped, keyval, NULL);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Comm_free(&duped); /* first MPI_Comm_free_keyval */
|
|
Packit Service |
c5cf8c |
MPI_Comm_free_keyval(&keyval); /* second MPI_Comm_free_keyval */
|
|
Packit Service |
c5cf8c |
MPI_Comm_free_keyval(&keyval_copy); /* third MPI_Comm_free_keyval */
|
|
Packit Service |
c5cf8c |
MTest_Finalize(errs);
|
|
Packit Service |
c5cf8c |
return MTestReturnValue(errs);
|
|
Packit Service |
c5cf8c |
}
|