/* -*- Mode: C++; c-basic-offset:4 ; -*- */ /* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. * * This file is automatically generated by buildiface -nosep -initfile=./cxx.vlist * DO NOT EDIT */ /* style: c++ header */ #ifdef MPI #error "You cannot define MPI; that name is reserved for the MPI namespace" #endif /* * Because the API is defined, some methods have parameters that are * not used. The following definition allows us to suppress warnings * about unused arguments in methods when -Wall -Wextra are specified. * this definition is removed at the end of this file. */ #ifdef MPIR_ARGUNUSED #error MPIR_ARGUNUSED defined #endif #if defined(__GNUC__) && __GNUC__ >= 4 #define MPIR_ARGUNUSED __attribute__((unused)) #else #define MPIR_ARGUNUSED #endif // There is a name conflict between stdio.h and iostream (or iostream.h) // and the MPI C++ binding with respect to the names SEEK_SET, SEEK_CUR, // and SEEK_END. MPI wants these in the MPI namespace, but stdio.h, // iostream, or iostream.h will #define these to integer values. // #undef'ing these can cause obscure problems. #ifndef MPICH_IGNORE_CXX_SEEK // MPICH_DONT_INCLUDE_STDIO_H is another escape hatch for us, just like // MPICH_IGNORE_CXX_SEEK. If we encounter a wacky environment or user in the // wild that does not want our workaround and/or the stdio.h header, then we can // offer them a way out. #ifndef MPICH_DONT_INCLUDE_STDIO_H // ensure that we have SEEK_* defined # include #endif enum MPIR_Dummy_seek_type { MPIR_DUMMY_SEEK_COMMA_VAL = -1 // permits cleaner comma logic #ifdef SEEK_SET , MPIR_SEEK_SET = SEEK_SET # undef SEEK_SET , SEEK_SET = MPIR_SEEK_SET #endif #ifdef SEEK_CUR , MPIR_SEEK_CUR = SEEK_CUR # undef SEEK_CUR , SEEK_CUR = MPIR_SEEK_CUR #endif #ifdef SEEK_END , MPIR_SEEK_END = SEEK_END # undef SEEK_END , SEEK_END = MPIR_SEEK_END #endif #ifdef LOCK_SHARED , MPIR_LOCK_SHARED = LOCK_SHARED # undef LOCK_SHARED , LOCK_SHARED = MPIR_LOCK_SHARED #endif }; #endif // MPICH_IGNORE_CXX_SEEK namespace MPI { #if 1 #define MPIX_CALLREF( _objptr, fnc ) \ { int err = fnc; if (err) { (_objptr)->Call_errhandler( err ); }} #define MPIX_CALLOBJ( _obj, fnc ) \ { int err = fnc; if (err) { (_obj).Call_errhandler( err ); }} #define MPIX_CALLWORLD( fnc ) \ { int err = fnc ; if (err) MPIR_Call_world_errhand( err ); } extern void MPIR_Call_world_errhand( int ); #else #define MPIX_CALLREF( _objptr, fnc ) (void)fnc #define MPIX_CALLOBJ( _obj, fnc ) (void)fnc #define MPIX_CALLWORLD( fnc ) (void)fnc #endif // Typedefs for basic int types typedef MPI_Offset Offset; typedef MPI_Aint Aint; typedef MPI_Fint Fint; // Special internal routine void MPIR_CXX_InitDatatypeNames( void ); // Forward class declarations class Comm; class Nullcomm; class Intercomm; class Intracomm; class Cartcomm; class Graphcomm; class File; // base (classless) routines extern int Detach_buffer( void *&v1 ) ; extern bool Is_initialized( void ) ; extern void Get_processor_name( char * v1, int &v2 ) ; extern void Get_error_string( int v1, char * v2, int &v3 ) ; extern void Compute_dims( int v1, int v2, int v3[] ) ; extern void Get_version( int &v1, int &v2 ) ; extern void Finalize( void ) ; extern void Pcontrol( const int v1, ... ) ; extern void Attach_buffer( void * v1, int v2 ) ; extern int Get_error_class( int v1 ) ; extern Intracomm COMM_WORLD; extern File FILE_NULL; class Exception { protected: int the_real_exception; public: // new/delete inline Exception(int obj) : the_real_exception(obj) {} inline Exception(void) : the_real_exception(0) {} virtual ~Exception() {} // copy/assignment Exception(const Exception &obj) : the_real_exception(obj.the_real_exception){} Exception& operator=(const Exception &obj) { the_real_exception = obj.the_real_exception; return *this; } // logical bool operator== (const Exception &obj) { return (the_real_exception == obj.the_real_exception); } bool operator!= (const Exception &obj) { return (the_real_exception != obj.the_real_exception); } // C/C++ cast and assignment inline operator int*() { return &the_real_exception; } inline operator int() const { return the_real_exception; } Exception& operator=(const int& obj) { the_real_exception = obj; return *this; } protected: char the_error_message[MPI_MAX_ERROR_STRING]; public: int Get_error_code(void) { return the_real_exception; } int Get_error_class(void) { return MPI::Get_error_class(the_real_exception); } const char *Get_error_string(void) { int len; MPI_Error_string(the_real_exception, the_error_message, &len); return the_error_message; } }; class Datatype { friend class Comm; friend class Status; friend class Intracomm; friend class Intercomm; friend class Win; friend class File; friend class Op; protected: MPI_Datatype the_real_datatype; public: // new/delete inline Datatype(MPI_Datatype obj) : the_real_datatype(obj) {} inline Datatype(void) : the_real_datatype(MPI_DATATYPE_NULL) {} virtual ~Datatype() {} // copy/assignment Datatype(const Datatype &obj) : the_real_datatype(obj.the_real_datatype){} Datatype& operator=(const Datatype &obj) { the_real_datatype = obj.the_real_datatype; return *this; } // logical bool operator== (const Datatype &obj) { return (the_real_datatype == obj.the_real_datatype); } bool operator!= (const Datatype &obj) { return (the_real_datatype != obj.the_real_datatype); } // C/C++ cast and assignment inline operator MPI_Datatype*() { return &the_real_datatype; } inline operator MPI_Datatype() const { return the_real_datatype; } Datatype& operator=(const MPI_Datatype& obj) { the_real_datatype = obj; return *this; } virtual void Commit( void ) { MPIX_CALLWORLD( MPI_Type_commit( (MPI_Datatype *) &the_real_datatype )); } virtual void Free( void ) { MPIX_CALLWORLD( MPI_Type_free( (MPI_Datatype *) &the_real_datatype )); } virtual Datatype Create_indexed( int v1, const int * v2, const int * v3 ) const { Datatype v5; MPIX_CALLWORLD( MPI_Type_indexed( v1, (const int *)v2, (const int *)v3, (MPI_Datatype) the_real_datatype, &(v5.the_real_datatype) )); return v5; } virtual Datatype Create_contiguous( int v1 ) const { Datatype v3; MPIX_CALLWORLD( MPI_Type_contiguous( v1, (MPI_Datatype) the_real_datatype, &(v3.the_real_datatype) )); return v3; } virtual Datatype Create_vector( int v1, int v2, int v3 ) const { Datatype v5; MPIX_CALLWORLD( MPI_Type_vector( v1, v2, v3, (MPI_Datatype) the_real_datatype, &(v5.the_real_datatype) )); return v5; } static Datatype Create_struct( int v1, int v2[], Aint v3[], const Datatype v4[] ) { Datatype v5; MPI_Datatype *l4 = new MPI_Datatype[v1]; { int i4; for (i4=0;i4