Blame src/include/mpir_ext.h.in

Packit Service c5cf8c
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
Packit Service c5cf8c
/*
Packit Service c5cf8c
 *  (C) 2006 by Argonne National Laboratory.
Packit Service c5cf8c
 *      See COPYRIGHT in top-level directory.
Packit Service c5cf8c
 */
Packit Service c5cf8c
Packit Service c5cf8c
/* This file contains the prototypes for routines that are used with
Packit Service c5cf8c
   "external" modules such as ROMIO.  These allow the different packages to
Packit Service c5cf8c
   hide their internal datatypes from one another */
Packit Service c5cf8c
Packit Service c5cf8c
#ifndef MPIEXT_H_INCLUDED
Packit Service c5cf8c
#define MPIEXT_H_INCLUDED
Packit Service c5cf8c
Packit Service c5cf8c
#include <stdarg.h>
Packit Service c5cf8c
Packit Service c5cf8c
/* This routine, given an MPI_Errhandler (from a file), returns
Packit Service c5cf8c
   a pointer to the user-supplied error function.  The last argument
Packit Service c5cf8c
   is set to an integer indicating that the function is MPI_ERRORS_RETURN
Packit Service c5cf8c
   (value == 1), MPI_ERRORS_ARE_FATAL (value == 0), a valid user-function
Packit Service c5cf8c
   (value == 2), or a valid user-function that is a C++ routine (value == 3)
Packit Service c5cf8c
Packit Service c5cf8c
   This routine is implemented in mpich/src/mpi/errhan/file_set_errhandler.c
Packit Service c5cf8c
*/
Packit Service c5cf8c
void MPIR_Get_file_error_routine(MPI_Errhandler, void (**)(MPI_File *, int *, ...), int *);
Packit Service c5cf8c
Packit Service c5cf8c
/* Invoke the C++ error handler (this invokes a special C++ routine that
Packit Service c5cf8c
 in turn calls the provided function.  That special routine also
Packit Service c5cf8c
 resets the errorcode to MPI_SUCCESS to prevent the MPICH C++ error handling
Packit Service c5cf8c
 code from throwing an exception when the user routine returns.
Packit Service c5cf8c
*/
Packit Service c5cf8c
int MPIR_File_call_cxx_errhandler(MPI_File *, int *, void (*)(MPI_File *, int *, ...));
Packit Service c5cf8c
/*
Packit Service c5cf8c
   These routines provide access to the MPI_Errhandler field within the
Packit Service c5cf8c
   ROMIO MPI_File structure
Packit Service c5cf8c
 */
Packit Service c5cf8c
int MPIR_ROMIO_Get_file_errhand(MPI_File, MPI_Errhandler *);
Packit Service c5cf8c
int MPIR_ROMIO_Set_file_errhand(MPI_File, MPI_Errhandler);
Packit Service c5cf8c
Packit Service c5cf8c
/* FIXME: This routine is also defined in adio.h */
Packit Service c5cf8c
int MPIO_Err_return_file(MPI_File, int);
Packit Service c5cf8c
Packit Service c5cf8c
int MPIR_Err_create_code_valist(int, int, const char[], int, int,
Packit Service c5cf8c
                                const char[], const char[], va_list);
Packit Service c5cf8c
int MPIR_Err_is_fatal(int);
Packit Service c5cf8c
Packit Service c5cf8c
void MPIR_Get_file_error_routine(MPI_Errhandler, void (**)(MPI_File *, int *, ...), int *);
Packit Service c5cf8c
int MPIR_File_call_cxx_errhandler(MPI_File *, int *, void (*)(MPI_File *, int *, ...));
Packit Service c5cf8c
Packit Service c5cf8c
typedef int (*MPIR_Err_get_class_string_func_t) (int error, char *str, int length);
Packit Service c5cf8c
void MPIR_Err_get_string(int, char *, int, MPIR_Err_get_class_string_func_t);
Packit Service c5cf8c
Packit Service c5cf8c
struct MPIR_Comm;
Packit Service c5cf8c
int MPIR_Abort(MPI_Comm comm, int mpi_errno, int exit_code, const char *error_msg);
Packit Service c5cf8c
Packit Service c5cf8c
int MPIR_Ext_assert_fail(const char *cond, const char *file_name, int line_num);
Packit Service c5cf8c
Packit Service c5cf8c
#if (!defined(NDEBUG) && (@HAVE_ERROR_CHECKING@))
Packit Service c5cf8c
#define MPIR_Ext_assert(a_)                                \
Packit Service c5cf8c
    do {                                                   \
Packit Service c5cf8c
        if (!(a_)) {                                       \
Packit Service c5cf8c
            MPIR_Ext_assert_fail(#a_, __FILE__, __LINE__); \
Packit Service c5cf8c
        }                                                  \
Packit Service c5cf8c
    } while (0)
Packit Service c5cf8c
#else
Packit Service c5cf8c
#define MPIR_Ext_assert(a_) do {} while (0)
Packit Service c5cf8c
#endif
Packit Service c5cf8c
Packit Service c5cf8c
extern int MPIR_Ext_dbg_romio_terse_enabled;
Packit Service c5cf8c
extern int MPIR_Ext_dbg_romio_typical_enabled;
Packit Service c5cf8c
extern int MPIR_Ext_dbg_romio_verbose_enabled;
Packit Service c5cf8c
Packit Service c5cf8c
/* a copy of MPIU_Ensure_Aint_fits_in_pointer for external use, slightly
Packit Service c5cf8c
 * modified to use ROMIO's version of the pointer-casting macro */
Packit Service c5cf8c
#define MPIR_Ext_ensure_Aint_fits_in_pointer(aint) \
Packit Service c5cf8c
  MPIR_Ext_assert((aint) == (MPI_Aint)(uintptr_t) ADIOI_AINT_CAST_TO_VOID_PTR(aint));
Packit Service c5cf8c
Packit Service c5cf8c
/* to be called early by ROMIO's initialization process in order to setup init-time
Packit Service c5cf8c
 * glue code that cannot be initialized statically */
Packit Service c5cf8c
int MPIR_Ext_init(void);
Packit Service c5cf8c
Packit Service c5cf8c
void MPIR_Ext_cs_enter(void);
Packit Service c5cf8c
void MPIR_Ext_cs_exit(void);
Packit Service c5cf8c
void MPIR_Ext_cs_yield(void);
Packit Service c5cf8c
Packit Service c5cf8c
/* to facilitate error checking */
Packit Service c5cf8c
int MPIR_Ext_datatype_iscommitted(MPI_Datatype datatype);
Packit Service c5cf8c
Packit Service c5cf8c
/* make comm split based on access to a common file system easier */
Packit Service c5cf8c
int MPIR_Get_node_id(MPI_Comm comm, int rank, int *id);
Packit Service c5cf8c
Packit Service c5cf8c
#endif