-: 0:Source:/home/MPI/testing/mpich2/mpich2/src/binding/cxx/initcxx.cxx
-: 0:Graph:initcxx.gcno
-: 0:Data:initcxx.gcda
-: 0:Runs:518
-: 0:Programs:144
-: 1:/* -*- Mode: C++; c-basic-offset:4 ; -*- */
-: 2:/*
-: 3: * (C) 2001 by Argonne National Laboratory.
-: 4: * See COPYRIGHT in top-level directory.
-: 5: *
-: 6: * This file is automatically generated by buildiface -nosep
-: 7: * DO NOT EDIT
-: 8: */
-: 9:/* style: c++ header */
-: 10:
-: 11:#include "mpi.h"
-: 12:#include <stdarg.h>
-: 13:#include "mpichconf.h"
-: 14:
-: 15:// #define MPIX_TRACE_MEMORY
-: 16:#ifdef MPIX_TRACE_MEMORY
-: 17:int _mpi_lineno = __LINE__;
-: 18:// We need stdlib.h for size_t. But that can cause problems if the
-: 19:// header isn't C++ clean. Instead, we just include a definition
-: 20:// for size_t. If this is not the correct size, then edit this line
-: 21:// (Note that this is needed only when memory tracing is enabled)
-: 22:typedef unsigned int size_t;
-: 23:extern "C" void *MPIU_trmalloc( unsigned int, int, const char [] );
-: 24:extern "C" void MPIU_trfree( void *, int, const char [] );
-: 25:extern "C" void MPIU_trdump( void *, int );
-: 26:void *operator new(size_t size) {
-: 27: void *p = MPIU_trmalloc( (unsigned int) size, _mpi_lineno, __FILE__ );
-: 28: return p;}
-: 29:void operator delete(void *p) {
-: 30: MPIU_trfree( p, _mpi_lineno, __FILE__ );}
-: 31:void *operator new[]( size_t size) {
-: 32: void *p = MPIU_trmalloc( (unsigned int) size, _mpi_lineno, __FILE__ );
-: 33: return p;}
-: 34:void operator delete[](void *p) {
-: 35: MPIU_trfree( p, _mpi_lineno, __FILE__ );}
-: 36:#define MPIX_TRSummary() MPIU_trdump( 0, -1 )
-: 37:#define MPIX_SetLineno _mpi_lineno = __LINE__ + 1
-: 38:#else
-: 39:#define MPIX_TRSummary()
-: 40:#define MPIX_SetLineno
-: 41:#endif
-: 42:namespace MPI {
518: 43:Datatype CHAR(MPI_CHAR);
518: 44:Datatype UNSIGNED_CHAR(MPI_UNSIGNED_CHAR);
518: 45:Datatype BYTE(MPI_BYTE);
518: 46:Datatype SHORT(MPI_SHORT);
518: 47:Datatype UNSIGNED_SHORT(MPI_UNSIGNED_SHORT);
518: 48:Datatype INT(MPI_INT);
518: 49:Datatype UNSIGNED(MPI_UNSIGNED);
518: 50:Datatype LONG(MPI_LONG);
518: 51:Datatype UNSIGNED_LONG(MPI_UNSIGNED_LONG);
518: 52:Datatype FLOAT(MPI_FLOAT);
518: 53:Datatype DOUBLE(MPI_DOUBLE);
518: 54:Datatype LONG_DOUBLE(MPI_LONG_DOUBLE);
518: 55:Datatype LONG_LONG_INT(MPI_LONG_LONG_INT);
518: 56:Datatype LONG_LONG(MPI_LONG_LONG);
518: 57:Datatype PACKED(MPI_PACKED);
518: 58:Datatype LB(MPI_LB);
518: 59:Datatype UB(MPI_UB);
518: 60:Datatype FLOAT_INT(MPI_FLOAT_INT);
518: 61:Datatype DOUBLE_INT(MPI_DOUBLE_INT);
518: 62:Datatype LONG_INT(MPI_LONG_INT);
518: 63:Datatype SHORT_INT(MPI_SHORT_INT);
518: 64:Datatype LONG_DOUBLE_INT(MPI_LONG_DOUBLE_INT);
518: 65:Datatype REAL4(MPI_REAL4);
518: 66:Datatype REAL8(MPI_REAL8);
518: 67:Datatype REAL16(MPI_REAL16);
518: 68:Datatype COMPLEX8(MPI_COMPLEX8);
518: 69:Datatype COMPLEX16(MPI_COMPLEX16);
518: 70:Datatype COMPLEX32(MPI_COMPLEX32);
518: 71:Datatype INTEGER1(MPI_INTEGER1);
518: 72:Datatype INTEGER2(MPI_INTEGER2);
518: 73:Datatype INTEGER4(MPI_INTEGER4);
518: 74:Datatype INTEGER8(MPI_INTEGER8);
518: 75:Datatype INTEGER16(MPI_INTEGER16);
518: 76:Datatype WCHAR(MPI_WCHAR);
518: 77:Datatype SIGNED_CHAR(MPI_SIGNED_CHAR);
518: 78:Datatype UNSIGNED_LONG_LONG(MPI_UNSIGNED_LONG_LONG);
518: 79:Datatype TWOINT(MPI_2INT);
518: 80:Datatype BOOL(MPIR_CXX_BOOL);
518: 81:Datatype COMPLEX(MPIR_CXX_COMPLEX);
518: 82:Datatype DOUBLE_COMPLEX(MPIR_CXX_DOUBLE_COMPLEX);
518: 83:Datatype LONG_DOUBLE_COMPLEX(MPIR_CXX_LONG_DOUBLE_COMPLEX);
518: 84:Datatype DATATYPE_NULL;
-: 85:
-: 86:#ifdef HAVE_FORTRAN_BINDING
518: 87:Datatype INTEGER(MPI_INTEGER);
518: 88:Datatype REAL(MPI_REAL);
518: 89:Datatype DOUBLE_PRECISION(MPI_DOUBLE_PRECISION);
518: 90:Datatype F_COMPLEX(MPI_COMPLEX);
518: 91:Datatype F_DOUBLE_COMPLEX(MPI_DOUBLE_COMPLEX);
518: 92:Datatype LOGICAL(MPI_LOGICAL);
518: 93:Datatype CHARACTER(MPI_CHARACTER);
518: 94:Datatype TWOREAL(MPI_2REAL);
518: 95:Datatype TWODOUBLE_PRECISION(MPI_2DOUBLE_PRECISION);
518: 96:Datatype TWOINTEGER(MPI_2INTEGER);
-: 97:#endif
518: 98:const Op MAX(MPI_MAX);
518: 99:const Op MIN(MPI_MIN);
518: 100:const Op SUM(MPI_SUM);
518: 101:const Op PROD(MPI_PROD);
518: 102:const Op LAND(MPI_LAND);
518: 103:const Op BAND(MPI_BAND);
518: 104:const Op LOR(MPI_LOR);
518: 105:const Op BOR(MPI_BOR);
518: 106:const Op LXOR(MPI_LXOR);
518: 107:const Op BXOR(MPI_BXOR);
518: 108:const Op MINLOC(MPI_MINLOC);
518: 109:const Op MAXLOC(MPI_MAXLOC);
518: 110:const Op REPLACE(MPI_REPLACE);
518: 111:const Op OP_NULL;
518: 112:Intracomm COMM_WORLD(MPI_COMM_WORLD);
518: 113:Intracomm COMM_SELF(MPI_COMM_SELF);
518: 114:const Group GROUP_EMPTY(MPI_GROUP_EMPTY);
518: 115:const Nullcomm COMM_NULL;
518: 116:const Group GROUP_NULL;
518: 117:const Request REQUEST_NULL;
518: 118:const Errhandler ERRHANDLER_NULL;
518: 119:const Errhandler ERRORS_RETURN(MPI_ERRORS_RETURN);
518: 120:const Errhandler ERRORS_ARE_FATAL(MPI_ERRORS_ARE_FATAL);
518: 121:const Errhandler ERRORS_THROW_EXCEPTIONS(MPIR_ERRORS_THROW_EXCEPTIONS);
518: 122:const Info INFO_NULL;
518: 123:const Win WIN_NULL;
518: 124:File FILE_NULL(MPI_FILE_NULL);
-: 125:const int BSEND_OVERHEAD= MPI_BSEND_OVERHEAD;
-: 126:const int KEYVAL_INVALID= MPI_KEYVAL_INVALID;
-: 127:const int CART= MPI_CART;
-: 128:const int GRAPH= MPI_GRAPH;
-: 129:const int IDENT= MPI_IDENT;
-: 130:const int SIMILAR= MPI_SIMILAR;
-: 131:const int CONGRUENT= MPI_CONGRUENT;
-: 132:const int UNEQUAL= MPI_UNEQUAL;
-: 133:const int PROC_NULL= MPI_PROC_NULL;
-: 134:const int ANY_TAG= MPI_ANY_TAG;
-: 135:const int ANY_SOURCE= MPI_ANY_SOURCE;
-: 136:const int ROOT= MPI_ROOT;
-: 137:const int TAG_UB= MPI_TAG_UB;
-: 138:const int IO= MPI_IO;
-: 139:const int HOST= MPI_HOST;
-: 140:const int WTIME_IS_GLOBAL= MPI_WTIME_IS_GLOBAL;
-: 141:const int UNIVERSE_SIZE= MPI_UNIVERSE_SIZE;
-: 142:const int LASTUSEDCODE= MPI_LASTUSEDCODE;
-: 143:const int APPNUM= MPI_APPNUM;
-: 144:const int MAX_PROCESSOR_NAME= MPI_MAX_PROCESSOR_NAME;
-: 145:const int MAX_ERROR_STRING= MPI_MAX_ERROR_STRING;
-: 146:const int MAX_PORT_NAME= MPI_MAX_PORT_NAME;
-: 147:const int MAX_OBJECT_NAME= MPI_MAX_OBJECT_NAME;
-: 148:const int MAX_INFO_VAL= MPI_MAX_INFO_VAL;
-: 149:const int MAX_INFO_KEY= MPI_MAX_INFO_KEY;
-: 150:const int UNDEFINED= MPI_UNDEFINED;
-: 151:const int LOCK_EXCLUSIVE= MPI_LOCK_EXCLUSIVE;
-: 152:const int LOCK_SHARED= MPI_LOCK_SHARED;
-: 153:const int WIN_BASE= MPI_WIN_BASE;
-: 154:const int WIN_DISP_UNIT= MPI_WIN_DISP_UNIT;
-: 155:const int WIN_SIZE= MPI_WIN_SIZE;
-: 156:const int SUCCESS= MPI_SUCCESS;
-: 157:const int ERR_BUFFER= MPI_ERR_BUFFER;
-: 158:const int ERR_COUNT= MPI_ERR_COUNT;
-: 159:const int ERR_TYPE= MPI_ERR_TYPE;
-: 160:const int ERR_TAG= MPI_ERR_TAG;
-: 161:const int ERR_COMM= MPI_ERR_COMM;
-: 162:const int ERR_RANK= MPI_ERR_RANK;
-: 163:const int ERR_REQUEST= MPI_ERR_REQUEST;
-: 164:const int ERR_ROOT= MPI_ERR_ROOT;
-: 165:const int ERR_GROUP= MPI_ERR_GROUP;
-: 166:const int ERR_OP= MPI_ERR_OP;
-: 167:const int ERR_TOPOLOGY= MPI_ERR_TOPOLOGY;
-: 168:const int ERR_DIMS= MPI_ERR_DIMS;
-: 169:const int ERR_ARG= MPI_ERR_ARG;
-: 170:const int ERR_UNKNOWN= MPI_ERR_UNKNOWN;
-: 171:const int ERR_TRUNCATE= MPI_ERR_TRUNCATE;
-: 172:const int ERR_OTHER= MPI_ERR_OTHER;
-: 173:const int ERR_INTERN= MPI_ERR_INTERN;
-: 174:const int ERR_PENDING= MPI_ERR_PENDING;
-: 175:const int ERR_IN_STATUS= MPI_ERR_IN_STATUS;
-: 176:const int ERR_LASTCODE= MPI_ERR_LASTCODE;
-: 177:const int ERR_FILE= MPI_ERR_FILE;
-: 178:const int ERR_ACCESS= MPI_ERR_ACCESS;
-: 179:const int ERR_AMODE= MPI_ERR_AMODE;
-: 180:const int ERR_BAD_FILE= MPI_ERR_BAD_FILE;
-: 181:const int ERR_FILE_EXISTS= MPI_ERR_FILE_EXISTS;
-: 182:const int ERR_FILE_IN_USE= MPI_ERR_FILE_IN_USE;
-: 183:const int ERR_NO_SPACE= MPI_ERR_NO_SPACE;
-: 184:const int ERR_NO_SUCH_FILE= MPI_ERR_NO_SUCH_FILE;
-: 185:const int ERR_IO= MPI_ERR_IO;
-: 186:const int ERR_READ_ONLY= MPI_ERR_READ_ONLY;
-: 187:const int ERR_CONVERSION= MPI_ERR_CONVERSION;
-: 188:const int ERR_DUP_DATAREP= MPI_ERR_DUP_DATAREP;
-: 189:const int ERR_UNSUPPORTED_DATAREP= MPI_ERR_UNSUPPORTED_DATAREP;
-: 190:const int ERR_INFO= MPI_ERR_INFO;
-: 191:const int ERR_INFO_KEY= MPI_ERR_INFO_KEY;
-: 192:const int ERR_INFO_VALUE= MPI_ERR_INFO_VALUE;
-: 193:const int ERR_INFO_NOKEY= MPI_ERR_INFO_NOKEY;
-: 194:const int ERR_NAME= MPI_ERR_NAME;
-: 195:const int ERR_NO_MEM= MPI_ERR_NO_MEM;
-: 196:const int ERR_NOT_SAME= MPI_ERR_NOT_SAME;
-: 197:const int ERR_PORT= MPI_ERR_PORT;
-: 198:const int ERR_QUOTA= MPI_ERR_QUOTA;
-: 199:const int ERR_SERVICE= MPI_ERR_SERVICE;
-: 200:const int ERR_SPAWN= MPI_ERR_SPAWN;
-: 201:const int ERR_UNSUPPORTED_OPERATION= MPI_ERR_UNSUPPORTED_OPERATION;
-: 202:const int ERR_WIN= MPI_ERR_WIN;
-: 203:const int ERR_BASE= MPI_ERR_BASE;
-: 204:const int ERR_LOCKTYPE= MPI_ERR_LOCKTYPE;
-: 205:const int ERR_KEYVAL= MPI_ERR_KEYVAL;
-: 206:const int ERR_RMA_CONFLICT= MPI_ERR_RMA_CONFLICT;
-: 207:const int ERR_RMA_SYNC= MPI_ERR_RMA_SYNC;
-: 208:const int ERR_SIZE= MPI_ERR_SIZE;
-: 209:const int ERR_DISP= MPI_ERR_DISP;
-: 210:const int ERR_ASSERT= MPI_ERR_ASSERT;
-: 211:const int TYPECLASS_REAL= MPI_TYPECLASS_REAL;
-: 212:const int TYPECLASS_INTEGER= MPI_TYPECLASS_INTEGER;
-: 213:const int TYPECLASS_COMPLEX= MPI_TYPECLASS_COMPLEX;
-: 214:#if defined(MPI_SEEK_SET) && !defined(MPICH_IGNORE_CXX_SEEK) && !defined(SEEK_SET)
-: 215:const int SEEK_SET = MPI_SEEK_SET;
-: 216:const int SEEK_END = MPI_SEEK_END;
-: 217:const int SEEK_CUR = MPI_SEEK_CUR;
-: 218:#endif
-: 219:const int DISTRIBUTE_BLOCK = MPI_DISTRIBUTE_BLOCK;
-: 220:const int DISTRIBUTE_CYCLIC = MPI_DISTRIBUTE_CYCLIC;
-: 221:const int DISTRIBUTE_DFLT_DARG = MPI_DISTRIBUTE_DFLT_DARG;
-: 222:const int DISTRIBUTE_NONE = MPI_DISTRIBUTE_NONE;
-: 223:const int ORDER_C = MPI_ORDER_C;
-: 224:const int ORDER_FORTRAN = MPI_ORDER_FORTRAN;
-: 225:// Include these only if MPI-IO is available
-: 226:#ifdef MPI_MODE_RDONLY
-: 227:const int MAX_DATAREP_STRING = MPI_MAX_DATAREP_STRING;
-: 228:const MPI_Offset DISPLACEMENT_CURRENT = MPI_DISPLACEMENT_CURRENT;
-: 229:const int MODE_APPEND = MPI_MODE_APPEND;
-: 230:const int MODE_CREATE = MPI_MODE_CREATE;
-: 231:const int MODE_DELETE_ON_CLOSE = MPI_MODE_DELETE_ON_CLOSE;
-: 232:const int MODE_EXCL = MPI_MODE_EXCL;
-: 233:const int MODE_RDONLY = MPI_MODE_RDONLY;
-: 234:const int MODE_RDWR = MPI_MODE_RDWR;
-: 235:const int MODE_SEQUENTIAL = MPI_MODE_SEQUENTIAL;
-: 236:const int MODE_UNIQUE_OPEN = MPI_MODE_UNIQUE_OPEN;
-: 237:const int MODE_WRONLY = MPI_MODE_WRONLY;
-: 238:#endif // IO
-: 239:const int MODE_NOCHECK = MPI_MODE_NOCHECK;
-: 240:const int MODE_NOPRECEDE = MPI_MODE_NOPRECEDE;
-: 241:const int MODE_NOPUT = MPI_MODE_NOPUT;
-: 242:const int MODE_NOSTORE = MPI_MODE_NOSTORE;
-: 243:const int MODE_NOSUCCEED = MPI_MODE_NOSUCCEED;
-: 244:const int COMBINER_CONTIGUOUS = MPI_COMBINER_CONTIGUOUS;
-: 245:const int COMBINER_DARRAY = MPI_COMBINER_DARRAY;
-: 246:const int COMBINER_DUP = MPI_COMBINER_DUP;
-: 247:const int COMBINER_F90_COMPLEX = MPI_COMBINER_F90_COMPLEX;
-: 248:const int COMBINER_F90_INTEGER = MPI_COMBINER_F90_INTEGER;
-: 249:const int COMBINER_F90_REAL = MPI_COMBINER_F90_REAL;
-: 250:const int COMBINER_HINDEXED_INTEGER = MPI_COMBINER_HINDEXED_INTEGER;
-: 251:const int COMBINER_HINDEXED = MPI_COMBINER_HINDEXED;
-: 252:const int COMBINER_HVECTOR_INTEGER = MPI_COMBINER_HVECTOR_INTEGER;
-: 253:const int COMBINER_HVECTOR = MPI_COMBINER_HVECTOR;
-: 254:const int COMBINER_INDEXED_BLOCK = MPI_COMBINER_INDEXED_BLOCK;
-: 255:const int COMBINER_INDEXED = MPI_COMBINER_INDEXED;
-: 256:const int COMBINER_NAMED = MPI_COMBINER_NAMED;
-: 257:const int COMBINER_RESIZED = MPI_COMBINER_RESIZED;
-: 258:const int COMBINER_STRUCT_INTEGER = MPI_COMBINER_STRUCT_INTEGER;
-: 259:const int COMBINER_STRUCT = MPI_COMBINER_STRUCT;
-: 260:const int COMBINER_SUBARRAY = MPI_COMBINER_SUBARRAY;
-: 261:const int COMBINER_VECTOR = MPI_COMBINER_VECTOR;
-: 262:const int THREAD_FUNNELED = MPI_THREAD_FUNNELED;
-: 263:const int THREAD_MULTIPLE = MPI_THREAD_MULTIPLE;
-: 264:const int THREAD_SERIALIZED = MPI_THREAD_SERIALIZED;
-: 265:const int THREAD_SINGLE = MPI_THREAD_SINGLE;
-: 266:const char ** const ARGV_NULL = 0;
-: 267:const char *** const ARGVS_NULL = 0;
-: 268:void * const BOTTOM = MPI_BOTTOM;
-: 269:void * const IN_PLACE = MPI_IN_PLACE;
248: 270:void Init( void ){
248: 271: MPI_Init( 0, 0 );
248: 272:}
2: 273:void Init( int &argc, char **&argv )
-: 274:{
2: 275: MPI_Init( &argc, &argv );
2: 276:}
267: 277:int Init_thread( int v1 ){
-: 278: int provided;
267: 279: MPI_Init_thread( 0, 0, v1, &provided );
-: 280:
267: 281: return provided;
-: 282:}
1: 283:int Init_thread( int &argc, char **&argv, int req )
-: 284:{
-: 285: int provided;
1: 286: MPI_Init_thread( &argc, &argv, req, &provided );
1: 287: return provided;
-: 288:}
518: 289:void Finalize( void ){
-: 290: MPIX_TRSummary();
518: 291: MPI_Finalize( );
518: 292:}
512: 293:bool Is_initialized(void)
-: 294: {
-: 295: int flag;
-: 296:
512: 297: MPI_Initialized( &flag );
-: 298:
512: 299: return (flag != 0);
-: 300: }
14: 301:void Compute_dims( int nnodes, int ndims, int dims[] )
-: 302: {
-: 303:
14: 304: MPIX_CALLWORLD( MPI_Dims_create( nnodes, ndims, dims ) );
-: 305:
14: 306: }
17: 307:void Attach_buffer( void *buffer, int size )
-: 308: {
-: 309:
17: 310: MPIX_CALLWORLD( MPI_Buffer_attach( buffer, size ) );
-: 311:
17: 312: }
17: 313:int Detach_buffer( void *&buffer )
-: 314: {
-: 315: int size;
-: 316:
17: 317: MPIX_CALLWORLD( MPI_Buffer_detach( &buffer, &size ) );
-: 318:
17: 319: return size;
-: 320: }
4: 321:void Get_processor_name( char *name, int &resultlen )
-: 322: {
-: 323:
4: 324: MPIX_CALLWORLD( MPI_Get_processor_name( name, &resultlen ) );
-: 325:
4: 326: }
20: 327:void Pcontrol( const int v, ... )
-: 328: {
-: 329: va_list ap;
20: 330: va_start(ap,v);
-: 331:
20: 332: MPIX_CALLWORLD( MPI_Pcontrol( (int)v, ap ) );
-: 333:
20: 334: }
13: 335:int Get_error_class( int errcode )
-: 336: {
-: 337: int errclass;
-: 338:
13: 339: MPIX_CALLWORLD( MPI_Error_class( errcode, &errclass ) );
-: 340:
13: 341: return errclass;
-: 342: }
6: 343:void Get_error_string( int errcode, char *name, int &resultlen )
-: 344: {
-: 345:
6: 346: MPIX_CALLWORLD( MPI_Error_string( errcode, name, &resultlen ) );
-: 347:
6: 348: }
4: 349:Aint Get_address( void *ptr )
-: 350: {
-: 351: MPI_Aint a;
-: 352:
4: 353: MPI_Get_address( ptr, &a );
-: 354:
4: 355: return (Aint)a;
-: 356: }
2: 357:void *Alloc_mem( Aint size, const Info &info )
-: 358: {
-: 359: void *result;
-: 360:
2: 361: MPIX_CALLWORLD( MPI_Alloc_mem( size, (MPI_Info)info, &result ) );
-: 362:
2: 363: return result;
-: 364: }
2: 365:void Free_mem( void * base )
-: 366: {
-: 367:
2: 368: MPIX_CALLWORLD( MPI_Free_mem( base ) );
-: 369:
2: 370: }
-: 371:
-: 372: extern "C" {
-: 373:typedef void (*mpircallback)(void);
-: 374:}
-: 375:extern "C" void MPIR_Op_set_cxx( MPI_Op, void (*)(void) );
-: 376:extern "C"
943: 377:void MPIR_Call_op_fn( void *invec, void *outvec, int len, MPI_Datatype dtype,
-: 378: User_function *uop )
-: 379:{
-: 380: MPI::Datatype cxxdtype = dtype;
943: 381: (*uop)( invec, outvec, len, cxxdtype );
943: 382:}
29: 383:void Op::Init( User_function *f, bool commute )
-: 384: {
-: 385:
29: 386: MPIX_CALLWORLD( MPI_Op_create( (MPI_User_function *)f,
-: 387: (int) commute, &the_real_op ) );
29: 388: MPIR_Op_set_cxx( the_real_op, (mpircallback) MPIR_Call_op_fn );
-: 389:
29: 390: }
-: 391:#include "mpi_attr.h"
-: 392:#include "mpi_lang.h"
-: 393:static
-: 394:int
36: 395:MPIR_Comm_delete_attr_cxx_proxy(
-: 396: MPI_Comm_delete_attr_function* user_function,
-: 397: MPI_Comm comm,
-: 398: int keyval,
-: 399: MPIR_AttrType attrib_type,
-: 400: void* attrib,
-: 401: void* extra_state
-: 402: )
-: 403:{
36: 404: void *value = 0;
-: 405: /* Make sure that the attribute value is delivered as a pointer */
36: 406: if(MPIR_ATTR_KIND(attrib_type) == MPIR_ATTR_KIND(MPIR_ATTR_INT)){
|
#####: 407: value = &attrib;
-: 408: }
-: 409: else{
|
36: 410: value = attrib;
-: 411: }
36: 412: MPI::Comm::Delete_attr_function* f = (MPI::Comm::Delete_attr_function*)user_function;
-: 413:
-: 414: int ttype;
36: 415: MPI_Topo_test( comm, &ttype );
36: 416: if (ttype == MPI_UNDEFINED)
-: 417: {
36: 418: MPI_Comm_test_inter( comm, &ttype );
36: 419: if (ttype)
-: 420: {
-: 421: MPI::Intercomm c = comm;
24: 422: return f( c, keyval, value, extra_state );
-: 423: }
-: 424: else
-: 425: {
-: 426: MPI::Intracomm c = comm;
12: 427: return f( c, keyval, value, extra_state );
-: 428: }
-: 429: }
|
#####: 430: else if (ttype == MPI_CART)
-: 431: {
-: 432: MPI::Cartcomm c = comm;
#####: 433: return f( c, keyval, value, extra_state );
-: 434: }
-: 435: else
-: 436: {
-: 437: MPI::Graphcomm c = comm;
#####: 438: return f( c, keyval, value, extra_state );
-: 439: }
-: 440:}
-: 441:
-: 442:static
-: 443:int
|
18: 444:MPIR_Comm_copy_attr_cxx_proxy(
-: 445: MPI_Comm_copy_attr_function* user_function,
-: 446: MPI_Comm comm,
-: 447: int keyval,
-: 448: void* extra_state,
-: 449: MPIR_AttrType attrib_type,
-: 450: void* attrib,
-: 451: void** new_value,
-: 452: int* flag
-: 453: )
-: 454:{
18: 455: void *value = 0;
-: 456: /* Make sure that the attribute value is delivered as a pointer */
18: 457: if(MPIR_ATTR_KIND(attrib_type) == MPIR_ATTR_KIND(MPIR_ATTR_INT)){
|
#####: 458: value = &attrib;
-: 459: }
-: 460: else{
|
18: 461: value = attrib;
-: 462: }
-: 463:
18: 464: *flag = 0;
18: 465: MPI::Comm::Copy_attr_function* f = (MPI::Comm::Copy_attr_function*)user_function;
-: 466:
-: 467: int ttype;
18: 468: MPI_Topo_test( comm, &ttype );
18: 469: if (ttype == MPI_UNDEFINED)
-: 470: {
18: 471: MPI_Comm_test_inter( comm, &ttype );
18: 472: if (ttype)
-: 473: {
-: 474: MPI::Intercomm c = comm;
12: 475: return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
-: 476: }
-: 477: else
-: 478: {
-: 479: MPI::Intracomm c = comm;
6: 480: return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
-: 481: }
-: 482: }
|
#####: 483: else if (ttype == MPI_CART)
-: 484: {
-: 485: MPI::Cartcomm c = comm;
#####: 486: return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
-: 487: }
-: 488: else
-: 489: {
-: 490: MPI::Graphcomm c = comm;
#####: 491: return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
-: 492: }
-: 493:}
-: 494:
-: 495:
|
195: 496:int Comm::Create_keyval( Copy_attr_function *cf, Delete_attr_function *df, void *extra_state )
-: 497:{
-: 498: int keyval;
-: 499:
195: 500: if (cf == MPI::Comm::NULL_COPY_FN) cf = 0;
195: 501: if (df == MPI::Comm::NULL_DELETE_FN) df = 0;
195: 502: MPIX_CALLWORLD( MPI_Comm_create_keyval( (MPI_Comm_copy_attr_function *)cf,
-: 503: (MPI_Comm_delete_attr_function *)df,
-: 504: &keyval, extra_state ) );
195: 505: MPIR_Keyval_set_proxy( keyval, MPIR_Comm_copy_attr_cxx_proxy, MPIR_Comm_delete_attr_cxx_proxy );
195: 506: return keyval;
-: 507:}
-: 508:
-: 509:static
-: 510:int
12: 511:MPIR_Type_delete_attr_cxx_proxy(
-: 512: MPI_Type_delete_attr_function* user_function,
-: 513: MPI_Datatype datatype,
-: 514: int keyval,
-: 515: MPIR_AttrType attrib_type,
-: 516: void* attrib,
-: 517: void* extra_state
-: 518: )
-: 519:{
-: 520: MPI::Datatype d = datatype;
12: 521: MPI::Datatype::Delete_attr_function* f = (MPI::Datatype::Delete_attr_function*)user_function;
12: 522: void *value = 0;
-: 523: /* Make sure that the attribute value is delivered as a pointer */
12: 524: if(MPIR_ATTR_KIND(attrib_type) == MPIR_ATTR_KIND(MPIR_ATTR_INT)){
|
#####: 525: value = &attrib;
-: 526: }
-: 527: else{
|
12: 528: value = attrib;
-: 529: }
12: 530: return f( d, keyval, value, extra_state );
-: 531:}
-: 532:
-: 533:static
-: 534:int
6: 535:MPIR_Type_copy_attr_cxx_proxy(
-: 536: MPI_Type_copy_attr_function* user_function,
-: 537: MPI_Datatype datatype,
-: 538: int keyval,
-: 539: void* extra_state,
-: 540: MPIR_AttrType attrib_type,
-: 541: void* attrib,
-: 542: void** new_value,
-: 543: int* flag
-: 544: )
-: 545:{
6: 546: *flag = 0;
-: 547: MPI::Datatype d = datatype;
6: 548: MPI::Datatype::Copy_attr_function* f = (MPI::Datatype::Copy_attr_function*)user_function;
6: 549: void *value = 0;
-: 550: /* Make sure that the attribute value is delivered as a pointer */
6: 551: if(MPIR_ATTR_KIND(attrib_type) == MPIR_ATTR_KIND(MPIR_ATTR_INT)){
|
#####: 552: value = &attrib;
-: 553: }
-: 554: else{
|
6: 555: value = attrib;
-: 556: }
6: 557: return f( d, keyval, extra_state, value, new_value, *(bool*)flag );
-: 558:}
-: 559:
198: 560:int Datatype::Create_keyval( Copy_attr_function *cf, Delete_attr_function *df, void *extra_state )
-: 561:{
-: 562: int keyval;
-: 563:
198: 564: if (cf == MPI::Datatype::NULL_COPY_FN) cf = 0;
198: 565: if (df == MPI::Datatype::NULL_DELETE_FN) df = 0;
198: 566: MPIX_CALLWORLD( MPI_Type_create_keyval( (MPI_Type_copy_attr_function *)cf,
-: 567: (MPI_Type_delete_attr_function *)df,
-: 568: &keyval, extra_state ) );
198: 569: MPIR_Keyval_set_proxy( keyval, MPIR_Type_copy_attr_cxx_proxy, MPIR_Type_delete_attr_cxx_proxy );
198: 570: return keyval;
-: 571:}
-: 572:
-: 573:static
-: 574:int
4: 575:MPIR_Win_delete_attr_cxx_proxy(
-: 576: MPI_Win_delete_attr_function* user_function,
-: 577: MPI_Win win,
-: 578: int keyval,
-: 579: MPIR_AttrType attrib_type,
-: 580: void* attrib,
-: 581: void* extra_state
-: 582: )
-: 583:{
-: 584: MPI::Win w = win;
4: 585: MPI::Win::Delete_attr_function* f = (MPI::Win::Delete_attr_function*)user_function;
4: 586: void *value = 0;
-: 587: /* Make sure that the attribute value is delivered as a pointer */
4: 588: if(MPIR_ATTR_KIND(attrib_type) == MPIR_ATTR_KIND(MPIR_ATTR_INT)){
|
#####: 589: value = &attrib;
-: 590: }
-: 591: else{
|
4: 592: value = attrib;
-: 593: }
4: 594: return f( w, keyval, value, extra_state );
-: 595:}
-: 596:
-: 597:static
-: 598:int
|
#####: 599:MPIR_Win_copy_attr_cxx_proxy(
-: 600: MPI_Win_copy_attr_function* user_function,
-: 601: MPI_Win win,
-: 602: int keyval,
-: 603: void* extra_state,
-: 604: MPIR_AttrType attrib_type,
-: 605: void* attrib,
-: 606: void** new_value,
-: 607: int* flag
-: 608: )
-: 609:{
#####: 610: *flag = 0;
-: 611: MPI::Win w = win;
#####: 612: MPI::Win::Copy_attr_function* f = (MPI::Win::Copy_attr_function*)user_function;
#####: 613: void *value = 0;
-: 614: /* Make sure that the attribute value is delivered as a pointer */
#####: 615: if(MPIR_ATTR_KIND(attrib_type) == MPIR_ATTR_KIND(MPIR_ATTR_INT)){
#####: 616: value = &attrib;
-: 617: }
-: 618: else{
#####: 619: value = attrib;
-: 620: }
#####: 621: return f( w, keyval, extra_state, value, new_value, *(bool*)flag );
-: 622:}
-: 623:
|
134: 624:int Win::Create_keyval( Copy_attr_function *cf, Delete_attr_function *df, void *extra_state )
-: 625:{
-: 626: int keyval;
-: 627:
134: 628: if (cf == MPI::Win::NULL_COPY_FN) cf = 0;
134: 629: if (df == MPI::Win::NULL_DELETE_FN) df = 0;
134: 630: MPIX_CALLWORLD( MPI_Win_create_keyval( (MPI_Win_copy_attr_function *)cf,
-: 631: (MPI_Win_delete_attr_function *)df,
-: 632: &keyval, extra_state ) );
134: 633: MPIR_Keyval_set_proxy( keyval, MPIR_Win_copy_attr_cxx_proxy, MPIR_Win_delete_attr_cxx_proxy );
134: 634: return keyval;
-: 635:}
-: 636:
-: 637:// Provide a C routine that can call the C++ error handler, handling
-: 638:// any calling-sequence change.
-: 639:extern "C" void MPIR_Errhandler_set_cxx( MPI_Errhandler, void (*)(void) );
-: 640:extern "C"
8008: 641:void MPIR_Call_errhandler_function( int kind, int *handle, int *errcode,
-: 642: void (*cxxfn)(void) )
-: 643:{
-: 644: // Use horrible casts to get the correct routine signature
8008: 645: switch (kind) {
-: 646: case 0: // comm
-: 647: {
8003: 648: MPI_Comm *ch = (MPI_Comm *)handle;
-: 649: int flag;
8003: 650: MPI::Comm::Errhandler_function *f = (MPI::Comm::Errhandler_function *)cxxfn;
-: 651: // Make an actual Comm (inter or intra-comm)
8003: 652: MPI_Comm_test_inter( *ch, &flag );
8003: 653: if (flag) {
|
#####: 654: MPI::Intercomm ic(*ch);
#####: 655: (*f)( ic, errcode );
-: 656: }
-: 657: else {
|
8003: 658: MPI::Intracomm ic(*ch);
8003: 659: (*f)( ic, errcode );
-: 660: }
-: 661: }
-: 662: break;
-: 663:#ifdef MPI_MODE_RDONLY
-: 664: case 1: // file
-: 665: {
4: 666: MPI::File fh = (MPI_File)*(MPI_File*)handle;
4: 667: MPI::File::Errhandler_function *f = (MPI::File::Errhandler_function *)cxxfn;
4: 668: (*f)( fh, errcode );
-: 669: }
4: 670: break;
-: 671:#endif // IO
-: 672: case 2: // win
-: 673: {
1: 674: MPI::Win fh = (MPI_Win)*(MPI_Win*)handle;
1: 675: MPI::Win::Errhandler_function *f = (MPI::Win::Errhandler_function *)cxxfn;
1: 676: (*f)( fh, errcode );
-: 677: }
-: 678: break;
-: 679: }
8008: 680:}
-: 681:#ifdef MPI_MODE_RDONLY
3: 682:Errhandler File::Create_errhandler( Errhandler_function *f )
-: 683:{
-: 684: MPI_Errhandler eh;
3: 685: MPI::Errhandler e1;
3: 686: MPI_File_create_errhandler( (MPI_File_errhandler_function *)f, &eh );
-: 687: MPIR_Errhandler_set_cxx( eh,
3: 688: (mpircallback)MPIR_Call_errhandler_function );
3: 689: e1.the_real_errhandler = eh;
|
#####: 690: return e1;
-: 691:}
-: 692:#endif // IO
|
4005: 693:Errhandler Comm::Create_errhandler( Errhandler_function *f )
-: 694:{
-: 695: MPI_Errhandler eh;
4005: 696: MPI::Errhandler e1;
4005: 697: MPI_Comm_create_errhandler( (MPI_Comm_errhandler_function *)f, &eh );
-: 698: MPIR_Errhandler_set_cxx( eh,
4005: 699: (mpircallback)MPIR_Call_errhandler_function );
4005: 700: e1.the_real_errhandler = eh;
|
#####: 701: return e1;
-: 702:}
|
2: 703:Errhandler Win::Create_errhandler( Errhandler_function *f )
-: 704:{
-: 705: MPI_Errhandler eh;
2: 706: MPI::Errhandler e1;
2: 707: MPI_Win_create_errhandler( (MPI_Win_errhandler_function *)f, &eh );
-: 708: MPIR_Errhandler_set_cxx( eh,
2: 709: (mpircallback)MPIR_Call_errhandler_function );
2: 710: e1.the_real_errhandler = eh;
|
#####: 711: return e1;
-: 712:}
-: 713:
-: 714:
-: 715:// Call_errhandler implementations. These sadly must contain a bit of logic to
-: 716:// cover the ERRORS_THROW_EXCEPTIONS case.
|
8024: 717:void Comm::Call_errhandler( int errorcode ) const
-: 718:{
-: 719: int err;
-: 720: // we must free the Errhandler object returned from Get_errhandler because
-: 721: // Get_errhandler adds a reference (the MPI Standard says as though a new
-: 722: // object were created)
-: 723: // First, be careful of the communicator.
-: 724: Errhandler current;
8024: 725: if (the_real_comm == MPI_COMM_NULL) {
12: 726: current = MPI::COMM_WORLD.Get_errhandler();
-: 727: }
-: 728: else {
16036: 729: current = Get_errhandler();
-: 730: }
8024: 731: if (current == ERRORS_THROW_EXCEPTIONS) {
21: 732: current.Free();
42: 733: throw Exception(errorcode); // throw by value, catch by reference
-: 734: }
-: 735: else {
8003: 736: current.Free();
-: 737: }
8024: 738: err = MPI_Comm_call_errhandler( (MPI_Comm) the_real_comm, errorcode );
8003: 739:}
-: 740:
4: 741:void Win::Call_errhandler( int errorcode ) const
-: 742:{
-: 743: int err;
-: 744: // we must free the Errhandler object returned from Get_errhandler because
-: 745: // Get_errhandler adds a reference (the MPI Standard says as though a new
-: 746: // object were created)
-: 747: // First, be careful of the communicator.
-: 748: Errhandler current;
4: 749: if (the_real_win == MPI_WIN_NULL) {
|
#####: 750: current = MPI::COMM_WORLD.Get_errhandler();
-: 751: }
-: 752: else {
|
8: 753: current = Get_errhandler();
-: 754: }
4: 755: if (current == ERRORS_THROW_EXCEPTIONS) {
2: 756: current.Free();
4: 757: throw Exception(errorcode); // throw by value, catch by reference
-: 758: }
-: 759: else {
2: 760: current.Free();
-: 761: }
4: 762: err = MPI_Win_call_errhandler( (MPI_Win) the_real_win, errorcode );
2: 763:}
-: 764:
-: 765:#ifdef MPI_MODE_RDONLY
7: 766:void File::Call_errhandler( int errorcode ) const
-: 767:{
-: 768: int err;
-: 769: // we must free the Errhandler object returned from Get_errhandler because
-: 770: // Get_errhandler adds a reference (the MPI Standard says as though a new
-: 771: // object were created)
-: 772: // Note that we are allowed to set handlers on FILE_NULL
7: 773: Errhandler current = Get_errhandler();
7: 774: if (current == ERRORS_THROW_EXCEPTIONS) {
3: 775: current.Free();
6: 776: throw Exception(errorcode); // throw by value, catch by reference
-: 777: }
-: 778: else {
4: 779: current.Free();
-: 780: }
7: 781: err = MPI_File_call_errhandler( (MPI_File) the_real_file, errorcode );
4: 782:}
-: 783:#endif // IO
-: 784:
-: 785:// Helper function to invoke the comm_world C++ error handler.
2: 786:void MPIR_Call_world_errhand( int err )
-: 787:{
2: 788: MPI::COMM_WORLD.Call_errhandler( err );
|
#####: 789:}
-: 790:
-: 791:
-: 792:#ifdef MPI_MODE_RDONLY
-: 793:
-: 794:extern "C" {
-: 795://
-: 796:// Rather than use a registered interposer, instead we interpose, taking
-: 797:// advantage of the extra_data field, similar to the handling of Grequest.
-: 798:typedef struct {
-: 799: Datarep_conversion_function *read_fn;
-: 800: Datarep_conversion_function *write_fn;
-: 801: Datarep_extent_function *extent_fn;
-: 802: void *orig_extra_state;
-: 803: } MPIR_Datarep_data;
#####: 804:int MPIR_Call_datarep_read_fn( void *userbuf, MPI_Datatype datatype,
-: 805: int count,
-: 806: void *filebuf, MPI_Offset position,
-: 807: void *extra_state )
-: 808:{
#####: 809: MPIR_Datarep_data *ldata = (MPIR_Datarep_data *)extra_state;
-: 810: Datatype dtype = (Datatype)datatype;
-: 811: return (ldata->read_fn)( userbuf, dtype, count, filebuf,
#####: 812: position, ldata->orig_extra_state);
-: 813:}
#####: 814:int MPIR_Call_datarep_write_fn( void *userbuf, MPI_Datatype datatype,
-: 815: int count,
-: 816: void *filebuf, MPI_Offset position,
-: 817: void *extra_state )
-: 818:{
#####: 819: MPIR_Datarep_data *ldata = (MPIR_Datarep_data *)extra_state;
-: 820: Datatype dtype = (Datatype)datatype;
-: 821: return (ldata->write_fn)( userbuf, dtype, count, filebuf,
#####: 822: position, ldata->orig_extra_state);
-: 823:}
#####: 824:int MPIR_Call_datarep_extent_fn( MPI_Datatype datatype, MPI_Aint *extent,
-: 825: void *extra_state ) {
#####: 826: MPIR_Datarep_data *ldata = (MPIR_Datarep_data *)extra_state;
-: 827: Aint myextent;
-: 828: int err;
-: 829: err = (ldata->extent_fn)( (Datatype)datatype, myextent,
#####: 830: ldata->orig_extra_state);
#####: 831: *extent = myextent;
#####: 832: return err;
-: 833:}
-: 834:} /* extern C */
#####: 835:void Register_datarep( const char *datarep,
-: 836: Datarep_conversion_function *read_fn,
-: 837: Datarep_conversion_function *write_fn,
-: 838: Datarep_extent_function *extent_fn,
-: 839: void *orig_extra_state )
-: 840:{
#####: 841: MPIR_Datarep_data *ldata = new(MPIR_Datarep_data);
#####: 842: ldata->read_fn = read_fn;
#####: 843: ldata->write_fn = write_fn;
#####: 844: ldata->extent_fn = extent_fn;
#####: 845: ldata->orig_extra_state = orig_extra_state;
#####: 846: MPIX_CALLWORLD(MPI_Register_datarep( (char *)datarep,
-: 847: MPIR_Call_datarep_read_fn,
-: 848: MPIR_Call_datarep_write_fn,
-: 849: MPIR_Call_datarep_extent_fn, (void *)ldata ));
-: 850: /* Because datareps are never freed, the space allocated in this
-: 851: routine for ldata will never be freed */
#####: 852:}
-: 853:#endif
-: 854:
|
8: 855:void Datatype::Pack( const void *inbuf, int incount, void *outbuf,
-: 856: int outsize, int &position, const Comm &comm ) const {
-: 857:
8: 858: MPIX_CALLOBJ( comm,
-: 859: MPI_Pack( (void *)inbuf, incount, the_real_datatype,
-: 860: outbuf, outsize, &position, comm.the_real_comm ) );
-: 861:
8: 862: }
-: 863:
18: 864:int Datatype::Pack_size( int count, const Comm &comm ) const {
-: 865:
-: 866: int size;
18: 867: MPIX_CALLOBJ( comm,
-: 868: MPI_Pack_size( count, the_real_datatype,
-: 869: comm.the_real_comm, &size ) );
-: 870:
18: 871: return size;
-: 872: }
-: 873:
8: 874:void Datatype::Unpack( const void *inbuf, int insize, void *outbuf,
-: 875: int outcount, int &position, const Comm &comm ) const {
-: 876:
8: 877: MPIX_CALLOBJ( comm, MPI_Unpack( (void *)inbuf, insize,
-: 878: &position, outbuf, outcount,
-: 879: the_real_datatype, comm.the_real_comm ) );
-: 880:
8: 881: }
40: 882:double Wtime(void) { return MPI_Wtime(); }
80: 883:double Wtick(void) { return MPI_Wtick(); }
-: 884:
26: 885: Cartcomm Intracomm::Create_cart( int v2, const int * v3, const bool v4[], bool v5 ) const
-: 886: {
26: 887: Cartcomm v6;
26: 888: int *l4 = new int[v2];
-: 889: int l5;
-: 890: {
-: 891: int i4;
78: 892: for (i4=0;i4<v2;i4++) {
52: 893: l4[i4] = v4[i4] == true ? 1 : 0;
-: 894: }
-: 895: }
26: 896: l5 = (v5 == true) ? 1 : 0;
-: 897:
26: 898: MPIX_CALLREF( this,
-: 899: MPI_Cart_create( (MPI_Comm) the_real_comm, v2,
-: 900: (int *)v3, l4, l5, &(v6.the_real_comm) ));
-: 901:
26: 902: delete[] l4;
|
#####: 903: return v6;
-: 904: }
-: 905:
|
4: 906: Graphcomm Intracomm::Create_graph( int v2, const int * v3, const int * v4, bool v5 ) const
-: 907: {
4: 908: Graphcomm v6;
-: 909: int l5;
4: 910: l5 = (v5 == true) ? 1 : 0;
-: 911:
4: 912: MPIX_CALLREF( this,
-: 913: MPI_Graph_create( (MPI_Comm) the_real_comm,
-: 914: v2, (int *)v3, (int *)v4, l5, &(v6.the_real_comm) ));
-: 915:
|
#####: 916: return v6;
-: 917: }
-: 918:
|
8: 919: Intracomm Intercomm::Merge( bool v2 ) const
-: 920: {
8: 921: Intracomm v3;
-: 922: int l2;
8: 923: l2 = (v2 == true) ? 1 : 0;
-: 924:
8: 925: MPIX_CALLREF( this,
-: 926: MPI_Intercomm_merge( (MPI_Comm) the_real_comm, l2,
-: 927: &(v3.the_real_comm) ));
-: 928:
|
#####: 929: return v3;
-: 930: }
-: 931:
|
2: 932:bool Is_finalized( void )
-: 933: {
-: 934: int flag;
2: 935: MPIX_CALLWORLD( MPI_Finalized( &flag ) );
2: 936: return (flag != 0);
-: 937:}
-: 938:
2: 939:int Query_thread( void )
-: 940: {
-: 941: int provided;
2: 942: MPIX_CALLWORLD( MPI_Query_thread( &provided ) );
2: 943: return provided;
-: 944:}
-: 945:
2: 946:bool Is_thread_main( void )
-: 947: {
-: 948: int flag;
2: 949: MPIX_CALLWORLD( MPI_Is_thread_main( &flag ) );
2: 950: return (flag != 0);
-: 951:}
-: 952:
1: 953:void Get_version( int &v, int&sv )
-: 954: {
-: 955:
1: 956: MPIX_CALLWORLD( MPI_Get_version( &v,&sv ) );
1: 957:}
-: 958:
7: 959:int Add_error_class( void )
-: 960: {
-: 961: int eclass;
7: 962: MPIX_CALLWORLD( MPI_Add_error_class( &eclass ) );
7: 963: return eclass;
-: 964:}
-: 965:
8: 966:int Add_error_code( int eclass )
-: 967: {
-: 968: int ecode;
8: 969: MPIX_CALLWORLD( MPI_Add_error_code( eclass, &ecode ) );
8: 970: return ecode;
-: 971:}
-: 972:
9: 973:void Add_error_string( int ecode, const char *estring )
-: 974: {
-: 975:
9: 976: MPIX_CALLWORLD( MPI_Add_error_string( ecode, (char *)estring ) );
9: 977:}
-: 978:
3: 979:void Lookup_name( const char *sn, const Info &info, char *pn )
-: 980: {
-: 981:
3: 982: MPIX_CALLWORLD( MPI_Lookup_name( (char *)sn, (MPI_Info)info, pn ) );
1: 983:}
-: 984:
1: 985:void Publish_name( const char *sn, const Info &info, const char *pn )
-: 986: {
-: 987:
1: 988: MPIX_CALLWORLD( MPI_Publish_name( (char *)sn, (MPI_Info)info, (char *)pn ) );
1: 989:}
-: 990:
1: 991:void Unpublish_name( const char *sn, const Info &info, const char *pn )
-: 992: {
-: 993:
1: 994: MPIX_CALLWORLD( MPI_Unpublish_name( (char *)sn, (MPI_Info)info, (char *)pn ) );
1: 995:}
-: 996:
|
#####: 997:Intercomm Comm::Get_parent( void )
-: 998: {
-: 999: MPI::Intercomm v;MPI_Comm vv;
#####: 1000: MPIX_CALLWORLD( MPI_Comm_get_parent( &vv ) );
#####: 1001: return (v = (Intercomm)vv, v);
-: 1002:}
-: 1003:
#####: 1004:Intercomm Comm::Join( const int fd )
-: 1005: {
-: 1006: MPI::Intercomm v;MPI_Comm vv;
#####: 1007: MPIX_CALLWORLD( MPI_Comm_join( fd,&vv ) );
#####: 1008: return (v = (Intercomm)vv,v);
-: 1009:}
-: 1010:
|
1: 1011:void Close_port( const char *pn )
-: 1012: {
-: 1013:
1: 1014: MPIX_CALLWORLD( MPI_Close_port( (char *)pn ) );
1: 1015:}
-: 1016:
1: 1017:void Open_port( const Info &info, char *portname )
-: 1018: {
-: 1019:
1: 1020: MPIX_CALLWORLD( MPI_Open_port( (MPI_Info)info, portname ) );
1: 1021:}
-: 1022:
-: 1023://
-: 1024:// Rather than use a registered interposer, instead we interpose taking
-: 1025:// advantage of the extra_data field
-: 1026:typedef struct {
-: 1027: MPI::Grequest::Query_function *query_fn;
-: 1028: MPI::Grequest::Free_function *free_fn;
-: 1029: MPI::Grequest::Cancel_function *cancel_fn;
-: 1030: void *orig_extra_data; } MPIR_Grequest_data;
|
#####: 1031:extern "C" int MPIR_Grequest_call_query_fn( void *extra_data,
-: 1032: MPI_Status *status )
-: 1033:{
-: 1034: int err;
-: 1035: MPI::Status s;
#####: 1036: MPIR_Grequest_data *d = (MPIR_Grequest_data *)extra_data;
-: 1037:
#####: 1038: err = (d->query_fn)( d->orig_extra_data, s );
#####: 1039: *status = s;
-: 1040:
#####: 1041: return err;
-: 1042:}
#####: 1043:extern "C" int MPIR_Grequest_call_free_fn( void *extra_data )
-: 1044:{
-: 1045: int err;
#####: 1046: MPIR_Grequest_data *d = (MPIR_Grequest_data *)extra_data;
-: 1047:
#####: 1048: err = (d->free_fn)( d->orig_extra_data );
-: 1049:
-: 1050: // Recover the storage that we used for the extra_data item.
#####: 1051: delete d;
#####: 1052: return err;
-: 1053:}
#####: 1054:extern "C" int MPIR_Grequest_call_cancel_fn( void *extra_data, int done )
-: 1055:{
-: 1056: int err;
-: 1057: MPI::Status s;
#####: 1058: MPIR_Grequest_data *d = (MPIR_Grequest_data *)extra_data;
-: 1059:
-: 1060: // Pass a C++ bool to the C++ version of the cancel function
#####: 1061: err = (d->cancel_fn)( d->orig_extra_data, done ? true : false );
#####: 1062: return err;
-: 1063:}
#####: 1064:Grequest Grequest::Start( Grequest::Query_function *query_fn,
-: 1065: Grequest::Free_function *free_fn,
-: 1066: Grequest::Cancel_function *cancel_fn,
-: 1067: void *extra_state )
-: 1068:{
#####: 1069: MPI::Grequest req;
#####: 1070: MPIR_Grequest_data *d = new MPIR_Grequest_data;
#####: 1071: d->query_fn = query_fn;
#####: 1072: d->free_fn = free_fn;
#####: 1073: d->cancel_fn = cancel_fn;
#####: 1074: d->orig_extra_data = extra_state;
-: 1075: MPI_Grequest_start( MPIR_Grequest_call_query_fn,
-: 1076: MPIR_Grequest_call_free_fn,
-: 1077: MPIR_Grequest_call_cancel_fn,
#####: 1078: (void *)d, &req.the_real_request );
#####: 1079: return req;
-: 1080:}
-: 1081:
-: 1082:/* MT FIXME: this is not thread-safe */
|
52: 1083:void MPIR_CXX_InitDatatypeNames( void )
-: 1084:{
-: 1085: static int _isInit = 1;
52: 1086: if (_isInit) {
2: 1087: _isInit=0;
2: 1088: PMPI_Type_set_name( MPI::BOOL, (char *)"MPI::BOOL" );
2: 1089: PMPI_Type_set_name( MPI::COMPLEX, (char *)"MPI::COMPLEX" );
2: 1090: PMPI_Type_set_name( MPI::DOUBLE_COMPLEX, (char *)"MPI::DOUBLE_COMPLEX" );
-: 1091:#if defined(HAVE_LONG_DOUBLE)
2: 1092: PMPI_Type_set_name( MPI::LONG_DOUBLE_COMPLEX, (char *)"MPI::LONG_DOUBLE_COMPLEX" );
-: 1093:#endif
-: 1094: }
52: 1095:}
1554: 1096:} // namespace MPI
-: 1097:#undef MPIR_ARGUNUSED
|