⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initcxx.cxx

📁 fortran并行计算包
💻 CXX
📖 第 1 页 / 共 2 页
字号:
/* -*- 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 * DO NOT EDIT *//* style: c++ header */#include "mpi.h"#include <stdarg.h>#include "mpichconf.h"// #define MPIX_TRACE_MEMORY#ifdef MPIX_TRACE_MEMORYint _mpi_lineno = __LINE__;// We need stdlib.h for size_t.  But that can cause problems if the// header isn't C++ clean.  Instead, we just include a definition// for size_t.  If this is not the correct size, then edit this line// (Note that this is needed only when memory tracing is enabled)typedef unsigned int size_t;extern "C" void *MPIU_trmalloc( unsigned int, int, const char [] );extern "C" void MPIU_trfree( void *, int, const char [] );extern "C" void MPIU_trdump( void *, int );void *operator new(size_t size) {    void *p = MPIU_trmalloc( (unsigned int) size, _mpi_lineno, __FILE__ );    return p;}void operator delete(void *p) {    MPIU_trfree( p, _mpi_lineno, __FILE__ );}void *operator new[]( size_t size) {    void *p = MPIU_trmalloc( (unsigned int) size, _mpi_lineno, __FILE__ );    return p;}void operator delete[](void *p) {    MPIU_trfree( p, _mpi_lineno, __FILE__ );}#define MPIX_TRSummary() MPIU_trdump( 0, -1 )#define MPIX_SetLineno _mpi_lineno = __LINE__ + 1#else#define MPIX_TRSummary()#define MPIX_SetLineno#endifnamespace MPI {Datatype CHAR(MPI_CHAR);Datatype UNSIGNED_CHAR(MPI_UNSIGNED_CHAR);Datatype BYTE(MPI_BYTE);Datatype SHORT(MPI_SHORT);Datatype UNSIGNED_SHORT(MPI_UNSIGNED_SHORT);Datatype INT(MPI_INT);Datatype UNSIGNED(MPI_UNSIGNED);Datatype LONG(MPI_LONG);Datatype UNSIGNED_LONG(MPI_UNSIGNED_LONG);Datatype FLOAT(MPI_FLOAT);Datatype DOUBLE(MPI_DOUBLE);Datatype LONG_DOUBLE(MPI_LONG_DOUBLE);Datatype LONG_LONG_INT(MPI_LONG_LONG_INT);Datatype LONG_LONG(MPI_LONG_LONG);Datatype PACKED(MPI_PACKED);Datatype LB(MPI_LB);Datatype UB(MPI_UB);Datatype FLOAT_INT(MPI_FLOAT_INT);Datatype DOUBLE_INT(MPI_DOUBLE_INT);Datatype LONG_INT(MPI_LONG_INT);Datatype SHORT_INT(MPI_SHORT_INT);Datatype LONG_DOUBLE_INT(MPI_LONG_DOUBLE_INT);Datatype REAL4(MPI_REAL4);Datatype REAL8(MPI_REAL8);Datatype REAL16(MPI_REAL16);Datatype COMPLEX8(MPI_COMPLEX8);Datatype COMPLEX16(MPI_COMPLEX16);Datatype COMPLEX32(MPI_COMPLEX32);Datatype INTEGER1(MPI_INTEGER1);Datatype INTEGER2(MPI_INTEGER2);Datatype INTEGER4(MPI_INTEGER4);Datatype INTEGER8(MPI_INTEGER8);Datatype INTEGER16(MPI_INTEGER16);Datatype WCHAR(MPI_WCHAR);Datatype SIGNED_CHAR(MPI_SIGNED_CHAR);Datatype UNSIGNED_LONG_LONG(MPI_UNSIGNED_LONG_LONG);Datatype TWOINT(MPI_2INT);Datatype BOOL(MPIR_CXX_BOOL);Datatype COMPLEX(MPIR_CXX_COMPLEX);Datatype DOUBLE_COMPLEX(MPIR_CXX_DOUBLE_COMPLEX);Datatype LONG_DOUBLE_COMPLEX(MPIR_CXX_LONG_DOUBLE_COMPLEX);Datatype DATATYPE_NULL;#ifdef HAVE_FORTRAN_BINDINGDatatype INTEGER(MPI_INTEGER);Datatype REAL(MPI_REAL);Datatype DOUBLE_PRECISION(MPI_DOUBLE_PRECISION);Datatype F_COMPLEX(MPI_COMPLEX);Datatype F_DOUBLE_COMPLEX(MPI_DOUBLE_COMPLEX);Datatype LOGICAL(MPI_LOGICAL);Datatype CHARACTER(MPI_CHARACTER);Datatype TWOREAL(MPI_2REAL);Datatype TWODOUBLE_PRECISION(MPI_2DOUBLE_PRECISION);Datatype TWOINTEGER(MPI_2INTEGER);#endifconst Op MAX(MPI_MAX);const Op MIN(MPI_MIN);const Op SUM(MPI_SUM);const Op PROD(MPI_PROD);const Op LAND(MPI_LAND);const Op BAND(MPI_BAND);const Op LOR(MPI_LOR);const Op BOR(MPI_BOR);const Op LXOR(MPI_LXOR);const Op BXOR(MPI_BXOR);const Op MINLOC(MPI_MINLOC);const Op MAXLOC(MPI_MAXLOC);const Op REPLACE(MPI_REPLACE);const Op OP_NULL;Intracomm COMM_WORLD(MPI_COMM_WORLD);Intracomm COMM_SELF(MPI_COMM_SELF);const Group GROUP_EMPTY(MPI_GROUP_EMPTY);const Nullcomm COMM_NULL;const Group GROUP_NULL;const Request REQUEST_NULL;const Errhandler ERRHANDLER_NULL;const Errhandler ERRORS_RETURN(MPI_ERRORS_RETURN);const Errhandler ERRORS_ARE_FATAL(MPI_ERRORS_ARE_FATAL);const Errhandler ERRORS_THROW_EXCEPTIONS(MPI_ERRORS_RETURN);const Info INFO_NULL;const Win WIN_NULL; File FILE_NULL;const int BSEND_OVERHEAD= MPI_BSEND_OVERHEAD;const int KEYVAL_INVALID= MPI_KEYVAL_INVALID;const int CART= MPI_CART;const int GRAPH= MPI_GRAPH;const int IDENT= MPI_IDENT;const int SIMILAR= MPI_SIMILAR;const int CONGRUENT= MPI_CONGRUENT;const int UNEQUAL= MPI_UNEQUAL;const int PROC_NULL= MPI_PROC_NULL;const int ANY_TAG= MPI_ANY_TAG;const int ANY_SOURCE= MPI_ANY_SOURCE;const int ROOT= MPI_ROOT;const int TAG_UB= MPI_TAG_UB;const int IO= MPI_IO;const int HOST= MPI_HOST;const int WTIME_IS_GLOBAL= MPI_WTIME_IS_GLOBAL;const int UNIVERSE_SIZE= MPI_UNIVERSE_SIZE;const int LASTUSEDCODE= MPI_LASTUSEDCODE;const int APPNUM= MPI_APPNUM;const int MAX_PROCESSOR_NAME= MPI_MAX_PROCESSOR_NAME;const int MAX_ERROR_STRING= MPI_MAX_ERROR_STRING;const int MAX_NAME_STRING= MPI_MAX_NAME_STRING;const int MAX_PORT_NAME= MPI_MAX_PORT_NAME;const int MAX_OBJECT_NAME= MPI_MAX_OBJECT_NAME;const int MAX_INFO_VAL= MPI_MAX_INFO_VAL;const int MAX_INFO_KEY= MPI_MAX_INFO_KEY;const int UNDEFINED= MPI_UNDEFINED;const int LOCK_EXCLUSIVE= MPI_LOCK_EXCLUSIVE;const int LOCK_SHARED= MPI_LOCK_SHARED;const int WIN_BASE= MPI_WIN_BASE;const int WIN_DISP_UNIT= MPI_WIN_DISP_UNIT;const int WIN_SIZE= MPI_WIN_SIZE;const int SUCCESS= MPI_SUCCESS;const int ERR_BUFFER= MPI_ERR_BUFFER;const int ERR_COUNT= MPI_ERR_COUNT;const int ERR_TYPE= MPI_ERR_TYPE;const int ERR_TAG= MPI_ERR_TAG;const int ERR_COMM= MPI_ERR_COMM;const int ERR_RANK= MPI_ERR_RANK;const int ERR_REQUEST= MPI_ERR_REQUEST;const int ERR_ROOT= MPI_ERR_ROOT;const int ERR_GROUP= MPI_ERR_GROUP;const int ERR_OP= MPI_ERR_OP;const int ERR_TOPOLOGY= MPI_ERR_TOPOLOGY;const int ERR_DIMS= MPI_ERR_DIMS;const int ERR_ARG= MPI_ERR_ARG;const int ERR_UNKNOWN= MPI_ERR_UNKNOWN;const int ERR_TRUNCATE= MPI_ERR_TRUNCATE;const int ERR_OTHER= MPI_ERR_OTHER;const int ERR_INTERN= MPI_ERR_INTERN;const int ERR_PENDING= MPI_ERR_PENDING;const int ERR_IN_STATUS= MPI_ERR_IN_STATUS;const int ERR_LASTCODE= MPI_ERR_LASTCODE;const int ERR_FILE= MPI_ERR_FILE;const int ERR_ACCESS= MPI_ERR_ACCESS;const int ERR_AMODE= MPI_ERR_AMODE;const int ERR_BAD_FILE= MPI_ERR_BAD_FILE;const int ERR_FILE_EXISTS= MPI_ERR_FILE_EXISTS;const int ERR_FILE_IN_USE= MPI_ERR_FILE_IN_USE;const int ERR_NO_SPACE= MPI_ERR_NO_SPACE;const int ERR_NO_SUCH_FILE= MPI_ERR_NO_SUCH_FILE;const int ERR_IO= MPI_ERR_IO;const int ERR_READ_ONLY= MPI_ERR_READ_ONLY;const int ERR_CONVERSION= MPI_ERR_CONVERSION;const int ERR_DUP_DATAREP= MPI_ERR_DUP_DATAREP;const int ERR_UNSUPPORTED_DATAREP= MPI_ERR_UNSUPPORTED_DATAREP;const int ERR_INFO= MPI_ERR_INFO;const int ERR_INFO_KEY= MPI_ERR_INFO_KEY;const int ERR_INFO_VALUE= MPI_ERR_INFO_VALUE;const int ERR_INFO_NOKEY= MPI_ERR_INFO_NOKEY;const int ERR_NAME= MPI_ERR_NAME;const int ERR_NO_MEM= MPI_ERR_NO_MEM;const int ERR_NOT_SAME= MPI_ERR_NOT_SAME;const int ERR_PORT= MPI_ERR_PORT;const int ERR_QUOTA= MPI_ERR_QUOTA;const int ERR_SERVICE= MPI_ERR_SERVICE;const int ERR_SPAWN= MPI_ERR_SPAWN;const int ERR_UNSUPPORTED_OPERATION= MPI_ERR_UNSUPPORTED_OPERATION;const int ERR_WIN= MPI_ERR_WIN;const int ERR_BASE= MPI_ERR_BASE;const int ERR_LOCKTYPE= MPI_ERR_LOCKTYPE;const int ERR_KEYVAL= MPI_ERR_KEYVAL;const int ERR_RMA_CONFLICT= MPI_ERR_RMA_CONFLICT;const int ERR_RMA_SYNC= MPI_ERR_RMA_SYNC;const int ERR_SIZE= MPI_ERR_SIZE;const int ERR_DISP= MPI_ERR_DISP;const int ERR_ASSERT= MPI_ERR_ASSERT;#if defined(MPI_SEEK_SET) && !defined(MPICH_IGNORE_CXX_SEEK) && !defined(SEEK_SET)const int SEEK_SET = MPI_SEEK_SET;const int SEEK_END = MPI_SEEK_END;const int SEEK_CUR = MPI_SEEK_CUR;#endifconst int DISTRIBUTE_BLOCK = MPI_DISTRIBUTE_BLOCK;const int DISTRIBUTE_CYCLIC = MPI_DISTRIBUTE_CYCLIC;const int DISTRIBUTE_DFLT_DARG = MPI_DISTRIBUTE_DFLT_DARG;const int DISTRIBUTE_NONE = MPI_DISTRIBUTE_NONE;const int ORDER_C = MPI_ORDER_C;const int ORDER_FORTRAN = MPI_ORDER_FORTRAN;// Include these only if MPI-IO is available#ifdef MPI_MODE_RDONLYconst int MAX_DATAREP_STRING = MPI_MAX_DATAREP_STRING;const MPI_Offset DISPLACEMENT_CURRENT = MPI_DISPLACEMENT_CURRENT;const int MODE_APPEND = MPI_MODE_APPEND;const int MODE_CREATE = MPI_MODE_CREATE;const int MODE_DELETE_ON_CLOSE = MPI_MODE_DELETE_ON_CLOSE;const int MODE_EXCL = MPI_MODE_EXCL;const int MODE_RDONLY = MPI_MODE_RDONLY;const int MODE_RDWR = MPI_MODE_RDWR;const int MODE_SEQUENTIAL = MPI_MODE_SEQUENTIAL;const int MODE_UNIQUE_OPEN = MPI_MODE_UNIQUE_OPEN;const int MODE_WRONLY = MPI_MODE_WRONLY;#endif // IOconst int MODE_NOCHECK = MPI_MODE_NOCHECK;const int MODE_NOPRECEDE = MPI_MODE_NOPRECEDE;const int MODE_NOPUT = MPI_MODE_NOPUT;const int MODE_NOSTORE = MPI_MODE_NOSTORE;const int MODE_NOSUCCEED = MPI_MODE_NOSUCCEED;const int COMBINER_CONTIGUOUS = MPI_COMBINER_CONTIGUOUS;const int COMBINER_DARRAY = MPI_COMBINER_DARRAY;const int COMBINER_DUP = MPI_COMBINER_DUP;const int COMBINER_F90_COMPLEX = MPI_COMBINER_F90_COMPLEX;const int COMBINER_F90_INTEGER = MPI_COMBINER_F90_INTEGER;const int COMBINER_F90_REAL = MPI_COMBINER_F90_REAL;const int COMBINER_HINDEXED_INTEGER = MPI_COMBINER_HINDEXED_INTEGER;const int COMBINER_HINDEXED = MPI_COMBINER_HINDEXED;const int COMBINER_HVECTOR_INTEGER = MPI_COMBINER_HVECTOR_INTEGER;const int COMBINER_HVECTOR = MPI_COMBINER_HVECTOR;const int COMBINER_INDEXED_BLOCK = MPI_COMBINER_INDEXED_BLOCK;const int COMBINER_INDEXED = MPI_COMBINER_INDEXED;const int COMBINER_NAMED = MPI_COMBINER_NAMED;const int COMBINER_RESIZED = MPI_COMBINER_RESIZED;const int COMBINER_STRUCT_INTEGER = MPI_COMBINER_STRUCT_INTEGER;const int COMBINER_STRUCT = MPI_COMBINER_STRUCT;const int COMBINER_SUBARRAY = MPI_COMBINER_SUBARRAY;const int COMBINER_VECTOR = MPI_COMBINER_VECTOR;const int THREAD_FUNNELED = MPI_THREAD_FUNNELED;const int THREAD_MULTIPLE = MPI_THREAD_MULTIPLE;const int THREAD_SERIALIZED = MPI_THREAD_SERIALIZED;const int THREAD_SINGLE = MPI_THREAD_SINGLE;const char ** const ARGV_NULL = 0;const char *** const ARGVS_NULL = 0;void * const BOTTOM = MPI_BOTTOM;void * const IN_PLACE = MPI_IN_PLACE;void Init( void ){    MPI_Init( 0, 0 );}void Init( int &argc, char **&argv ){    MPI_Init( &argc, &argv );}int Init_thread( int v1 ){    int provided;    MPI_Init_thread( 0, 0, v1, &provided );    return provided;}int Init_thread( int &argc, char **&argv, int req ){    int provided;    MPI_Init_thread( &argc, &argv, req, &provided );    return provided;}void Finalize( void ){    MPIX_TRSummary();    MPI_Finalize( );}bool Is_initialized(void)    { 	int flag;	MPI_Initialized( &flag );	return (flag != 0);    }void Compute_dims( int nnodes, int ndims, int dims[] )    {	MPIX_CALL( MPI_Dims_create( nnodes, ndims, dims ) );    }void Attach_buffer( void *buffer, int size )    {	MPIX_CALL( MPI_Buffer_attach( buffer, size ) );    }int Detach_buffer( void *&buffer )    {	int size;	MPIX_CALL( MPI_Buffer_detach( &buffer, &size ) );	return size;    }void Get_processor_name( char *name, int &resultlen )     {    MPIX_CALL( MPI_Get_processor_name( name, &resultlen ) );    }void Pcontrol( const int v, ... )    {	va_list ap;        va_start(ap,v);	MPIX_CALL( MPI_Pcontrol( (int)v, ap ) );    }int Get_error_class( int errcode )     {    int errclass;    MPIX_CALL( MPI_Error_class( errcode, &errclass ) );    return errclass;    }void Get_error_string( int errcode, char *name, int &resultlen )     {    MPIX_CALL( MPI_Error_string( errcode, name, &resultlen ) );    }Aint Get_address( void *ptr )    {    MPI_Aint a;    MPI_Get_address( ptr, &a );    return (Aint)a;    }void *Alloc_mem( Aint size, const Info &info )    {        void *result;        MPIX_CALL( MPI_Alloc_mem( size, (MPI_Info)info, &result ) );        return result;    }void Free_mem( void * base )    {     MPIX_CALL( MPI_Free_mem( base ) );    }    extern "C" {typedef void (*mpircallback)(void);}extern "C" void MPIR_Op_set_cxx( MPI_Op, void (*)(void) );extern "C" void MPIR_Call_op_fn( void *invec, void *outvec, int len, MPI_Datatype dtype,		     User_function *uop ){    MPI::Datatype cxxdtype = dtype;    (*uop)( invec, outvec, len, cxxdtype );}void Op::Init( User_function *f, bool commute )    {	MPIX_CALL( MPI_Op_create( (MPI_User_function *)f, 				 (int) commute, &the_real_op ) ); 	MPIR_Op_set_cxx( the_real_op, (mpircallback) MPIR_Call_op_fn );    }#include "mpihandlemem.h"extern "C" int MPIR_Call_delfn( int handleType, int handle, int keyval,				  void *value, void *extra_state, 				  void (*f)(void) ){    int err;    switch (handleType) {	case MPID_COMM:	{	    int ttype;	    MPI::Comm::Delete_attr_function *f1 = (MPI::Comm::Delete_attr_function *)f;	    	    MPI_Topo_test( handle, &ttype );	    if (ttype == MPI_UNDEFINED) {		MPI_Comm_test_inter( handle, &ttype );		if (ttype) {		    MPI::Intercomm comm1 = (MPI_Comm)handle;		    err=(*f1)( comm1, keyval, value, extra_state );		}		else {		    MPI::Intracomm comm1 = (MPI_Comm)handle;		    err=(*f1)( comm1, keyval, value, extra_state );		}	    }	    else if (ttype == MPI_CART) {		MPI::Cartcomm comm1 = (MPI_Comm)handle;		err=(*f1)( comm1, keyval, value, extra_state );	    }	    else {		MPI::Graphcomm comm1 = (MPI_Comm)handle;		err=(*f1)( comm1, keyval, value, extra_state );	    }        }	break;	case MPID_DATATYPE:	{	MPI::Datatype cxxtype = handle;        MPI::Datatype::Delete_attr_function *f1 = (MPI::Datatype::Delete_attr_function *)f;	err=(*f1)( cxxtype, keyval, value, extra_state );        }	break;	case MPID_WIN:	{	MPI::Win cxxwin = handle;        MPI::Win::Delete_attr_function *f1 = (MPI::Win::Delete_attr_function *)f;	err=(*f1)( cxxwin, keyval, value, extra_state );        }	break;    }    return err;  }extern "C" int MPIR_Call_copyfn( int handleType, int handle, int keyval,				   void *extra_state, void *value,				   void *new_value, int *cflag,				   void (*f)(void) ){    int err;    bool flag;    switch (handleType) {	case MPID_COMM:	{	    int ttype;	    MPI::Comm::Copy_attr_function *f1 = (MPI::Comm::Copy_attr_function *)f;	    	    MPI_Topo_test( handle, &ttype );	    if (ttype == MPI_UNDEFINED) {		MPI_Comm_test_inter( handle, &ttype );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -