1
1
openmpi/ompi/mpi/f77/datarep.h
Jeff Squyres 26d8fe70c3 Fixes trac:1029: add in support for MPI_CONVERSION_FN_NULL.
This commit brings over all the work from the /tmp-public/datarep
branch.  See commits r16855, r16859, r16860 for the highlights of what
was done.

This commit was SVN r16891.

The following SVN revisions from the original message are invalid or
inconsistent and therefore were not cross-referenced:
  r16855
  r16859
  r16860

The following Trac tickets were found above:
  Ticket 1029 --> https://svn.open-mpi.org/trac/ompi/ticket/1029
2007-12-07 13:09:07 +00:00

110 строки
3.7 KiB
C

/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* This file does two things:
*
* 1. Provides typedef for the Fortran versions of the callbacks
* registered by MPI_REGISTER_DATAREP. These typedefs are needed for
* the Fortran MPI API.
*
* 2. Provides the sentinel value functions/function pointers for
* Fortran's version of MPI_CONVERSION_FN_NULL, and some helpful
* macros for testing whether an argument passed to a Fortran MPI API
* function is that sentinel value or not.
*/
#ifndef OMPI_F77_DATAREP_H
#define OMPI_F77_DATAREP_H
#include "ompi_config.h"
#include "mpi.h"
BEGIN_C_DECLS
/**
* Function typedef for the conversion function pointer in
* MPI_REGISTER_DATAREP */
typedef void (ompi_mpi2_fortran_datarep_conversion_fn_t)
(char *userbuf, MPI_Fint *datatype, MPI_Fint *count, char *filebuf,
MPI_Offset *position, MPI_Aint *extra_state, MPI_Fint *ierr);
/**
* Function typedef for the extent function pointer in
* MPI_REGISTER_DATAREP */
typedef void (ompi_mpi2_fortran_datarep_extent_fn_t)
(MPI_Fint *datatype, MPI_Aint *extent, MPI_Aint *extra_state,
MPI_Fint *ierr);
/**
* Macro for declaring each of the 5 back-end Fortran functions for
* MPI_CONVERSION_FN_NULL. We need the 4 fortran compiler convetions
* and 1 for the "real" back-end function (even though these functions
* are never invoked -- they're only used as sentinel values -- it's
* simpler to use the same kind of code structure that we use for the
* Fortran MPI API bindings and other callback functions).
*/
#define OMPI_DATAREP_FORTRAN_DECLARE(lower_name, upper_name, args) \
OMPI_DECLSPEC void lower_name##_f args; \
OMPI_DECLSPEC void lower_name args; \
OMPI_DECLSPEC void lower_name##_ args; \
OMPI_DECLSPEC void lower_name##__ args; \
OMPI_DECLSPEC void upper_name args;
/*
* Declare the 5 functions.
*/
OMPI_DATAREP_FORTRAN_DECLARE(mpi_conversion_fn_null, MPI_CONVERSION_FN_NULL, (char *userbuf, MPI_Fint *datatype, MPI_Fint *count, char *filebuf, MPI_Offset *position, MPI_Aint *extra_state, MPI_Fint *ierr))
/* Be social and remove this private macro from the global header file
space */
#undef OMPI_DATAREP_FORTRAN_DECLARE
/**
* Declare the test macro in all of its forms. This macro provides a
* convenient way to check whether an argument is the sentinel value
* MPI_CONVERSION_FN_NULL.
*/
#if OMPI_HAVE_WEAK_SYMBOLS
#define OMPI_IS_FORTRAN_CONVERSION_FN_NULL(addr) \
(MPI_CONVERSION_FN_NULL == addr || \
mpi_conversion_fn_null == addr || \
mpi_conversion_fn_null_ == addr || \
mpi_conversion_fn_null__ == addr)
#elif OMPI_F77_CAPS
#define OMPI_IS_FORTRAN_CONVERSION_FN_NULL(addr) \
(MPI_CONVERSION_FN_NULL == addr)
#elif OMPI_F77_PLAIN
#define OMPI_IS_FORTRAN_CONVERSION_FN_NULL(addr) \
(mpi_conversion_fn_null == addr)
#elif OMPI_F77_SINGLE_UNDERSCORE
#define OMPI_IS_FORTRAN_CONVERSION_FN_NULL(addr) \
(mpi_conversion_fn_null_ == addr)
#else
#define OMPI_IS_FORTRAN_CONVERSION_FN_NULL(addr) \
(mpi_conversion_fn_null__ == addr)
#endif
END_C_DECLS
#endif