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#ifdef MPI 12#error "You cannot define MPI; that name is reserved for the MPI namespace" 13#endif 14 15// Check for incompatible GCC versions 16// GCC (specifically) g++ changed the calling convention 17// between 3.2.3 and 3.4.3 (!!) Normally such changes 18// should only occur at major releases (e.g., version 3 to 4) 19#ifdef __GNUC__ 20# if __GNUC__ >= @GNUCXX_VERSION@ 21# if __GNUC_MINOR__ > 2 && @GNUCXX_MINORVERSION@ == 2 22# error 'Please use the same version of GCC and g++ for compiling MPICH2 and user MPI programs' 23# endif 24# endif 25#endif 26 27/* 28 * Because the API is defined, some methods have parameters that are 29 * not used. The following definition allows us to suppress warnings 30 * about unused arguments in methods when -Wall -Wextra are specified. 31 * this definition is removed at the end of this file. 32 */ 33#ifdef MPIR_ARGUNUSED 34#error MPIR_ARGUNUSED defined 35#endif 36#if defined(__GNUC__) && __GNUC__ >= 4 37#define MPIR_ARGUNUSED __attribute__((unused)) 38#else 39#define MPIR_ARGUNUSED 40#endif 41// There is a name conflict between stdio.h and iostream (or iostream.h) 42// and the MPI C++ binding with respect to the names SEEK_SET, SEEK_CUR, 43// and SEEK_END. MPI wants these in the MPI namespace, but stdio.h, 44// iostream, or iostream.h will #define these to integer values. 45// #undef'ing these can cause obscure problems. 46#ifndef MPICH_IGNORE_CXX_SEEK 47 48// MPICH_DONT_INCLUDE_STDIO_H is another escape hatch for us, just like 49// MPICH_IGNORE_CXX_SEEK. If we encounter a wacky environment or user in the 50// wild that does not want our workaround and/or the stdio.h header, then we can 51// offer them a way out. 52#ifndef MPICH_DONT_INCLUDE_STDIO_H 53// ensure that we have SEEK_* defined 54# include <stdio.h> 55#endif 56 57enum MPIR_Dummy_seek_type { 58 MPIR_DUMMY_SEEK_COMMA_VAL = -1 // permits cleaner comma logic 59#ifdef SEEK_SET 60 , MPIR_SEEK_SET = SEEK_SET 61# undef SEEK_SET 62 , SEEK_SET = MPIR_SEEK_SET 63#endif 64#ifdef SEEK_CUR 65 , MPIR_SEEK_CUR = SEEK_CUR 66# undef SEEK_CUR 67 , SEEK_CUR = MPIR_SEEK_CUR 68#endif 69#ifdef SEEK_END 70 , MPIR_SEEK_END = SEEK_END 71# undef SEEK_END 72 , SEEK_END = MPIR_SEEK_END 73#endif 74#ifdef LOCK_SHARED 75 , MPIR_LOCK_SHARED = LOCK_SHARED 76# undef LOCK_SHARED 77 , LOCK_SHARED = MPIR_LOCK_SHARED 78#endif 79}; 80 81#endif // MPICH_IGNORE_CXX_SEEK 82namespace MPI { 83#if @HAVE_CXX_EXCEPTIONS@ 84#define MPIX_CALLREF( _objptr, fnc ) \ 85 { int err = fnc; if (err) { (_objptr)->Call_errhandler( err ); }} 86#define MPIX_CALLOBJ( _obj, fnc ) \ 87 { int err = fnc; if (err) { (_obj).Call_errhandler( err ); }} 88#define MPIX_CALLWORLD( fnc ) \ 89 { int err = fnc ; if (err) MPIR_Call_world_errhand( err ); } 90extern void MPIR_Call_world_errhand( int ); 91#else 92#define MPIX_CALLREF( _objptr, fnc ) (void)fnc 93#define MPIX_CALLOBJ( _obj, fnc ) (void)fnc 94#define MPIX_CALLWORLD( fnc ) (void)fnc 95#endif 96 97// Typedefs for basic int types 98typedef MPI_Offset Offset; 99typedef MPI_Aint Aint; 100typedef MPI_Fint Fint; 101 102// Special internal routine 103void MPIR_CXX_InitDatatypeNames( void ); 104 105// Forward class declarations 106class Comm; 107class Nullcomm; 108class Intercomm; 109class Intracomm; 110class Cartcomm; 111class Graphcomm; 112class File; 113 114// base (classless) routines 115extern int Detach_buffer( void *&v1 ) ; 116extern bool Is_initialized( void ) ; 117extern void Get_processor_name( char * v1, int &v2 ) ; 118extern void Get_error_string( int v1, char * v2, int &v3 ) ; 119extern void Compute_dims( int v1, int v2, int * v3 ) ; 120extern void Get_version( int &v1, int &v2 ) ; 121extern void Finalize( void ) ; 122extern void Pcontrol( const int v1, ... ) ; 123extern void Attach_buffer( void* v1, int v2 ) ; 124extern int Get_error_class( int v1 ) ; 125extern Intracomm COMM_WORLD; 126extern File FILE_NULL; 127 128class Exception { 129 130 protected: 131 int the_real_exception; 132 133 public: 134 // new/delete 135 136 inline Exception(int obj) : the_real_exception(obj) {} 137 inline Exception(void) : the_real_exception(0) {} 138 139 virtual ~Exception() {} 140 // copy/assignment 141 142 Exception(const Exception &obj) : the_real_exception(obj.the_real_exception){} 143 144 Exception& operator=(const Exception &obj) { 145 the_real_exception = obj.the_real_exception; return *this; } 146 147 // logical 148 bool operator== (const Exception &obj) { 149 return (the_real_exception == obj.the_real_exception); } 150 bool operator!= (const Exception &obj) { 151 return (the_real_exception != obj.the_real_exception); } 152 // C/C++ cast and assignment 153 inline operator int*() { return &the_real_exception; } 154 inline operator int() const { return the_real_exception; } 155 Exception& operator=(const int& obj) { 156 the_real_exception = obj; return *this; } 157 158 protected: 159 char the_error_message[MPI_MAX_ERROR_STRING]; 160 public: 161 int Get_error_code(void) { return the_real_exception; } 162 int Get_error_class(void) { return MPI::Get_error_class(the_real_exception); } 163 const char *Get_error_string(void) 164 { 165 int len; 166 MPI_Error_string(the_real_exception, the_error_message, &len); 167 return the_error_message; 168 } 169}; 170 171class Datatype { 172 friend class Comm; 173 friend class Status; 174 friend class Intracomm; 175 friend class Intercomm; 176 friend class Win; 177 friend class File; 178 friend class Op; 179 180 protected: 181 MPI_Datatype the_real_datatype; 182 183 public: 184 // new/delete 185 186 inline Datatype(MPI_Datatype obj) : the_real_datatype(obj) {} 187 inline Datatype(void) : the_real_datatype(MPI_DATATYPE_NULL) {} 188 189 virtual ~Datatype() {} 190 // copy/assignment 191 192 Datatype(const Datatype &obj) : the_real_datatype(obj.the_real_datatype){} 193 194 Datatype& operator=(const Datatype &obj) { 195 the_real_datatype = obj.the_real_datatype; return *this; } 196 197 // logical 198 bool operator== (const Datatype &obj) { 199 return (the_real_datatype == obj.the_real_datatype); } 200 bool operator!= (const Datatype &obj) { 201 return (the_real_datatype != obj.the_real_datatype); } 202 // C/C++ cast and assignment 203 inline operator MPI_Datatype*() { return &the_real_datatype; } 204 inline operator MPI_Datatype() const { return the_real_datatype; } 205 Datatype& operator=(const MPI_Datatype& obj) { 206 the_real_datatype = obj; return *this; } 207 virtual void Commit( void ) 208 { 209 MPIX_CALLWORLD( MPI_Type_commit( (MPI_Datatype *) &the_real_datatype )); 210 } 211 virtual void Free( void ) 212 { 213 MPIX_CALLWORLD( MPI_Type_free( (MPI_Datatype *) &the_real_datatype )); 214 } 215 virtual Datatype Create_indexed( int v1, const MPICH2_CONST int * v2, const MPICH2_CONST int * v3 ) const 216 { 217 Datatype v5; 218 MPIX_CALLWORLD( MPI_Type_indexed( v1, (MPICH2_CONST int *)v2, (MPICH2_CONST int *)v3, (MPI_Datatype) the_real_datatype, &(v5.the_real_datatype) )); 219 return v5; 220 } 221 virtual Datatype Create_contiguous( int v1 ) const 222 { 223 Datatype v3; 224 MPIX_CALLWORLD( MPI_Type_contiguous( v1, (MPI_Datatype) the_real_datatype, &(v3.the_real_datatype) )); 225 return v3; 226 } 227 virtual Datatype Create_vector( int v1, int v2, int v3 ) const 228 { 229 Datatype v5; 230 MPIX_CALLWORLD( MPI_Type_vector( v1, v2, v3, (MPI_Datatype) the_real_datatype, &(v5.the_real_datatype) )); 231 return v5; 232 } 233 static Datatype Create_struct( int v1, int v2[], MPI_Aint v3[], const Datatype v4[] ) 234 { 235 Datatype v5; 236 MPI_Datatype *l4 = new MPI_Datatype[v1]; 237 { 238 int i4; 239 for (i4=0;i4<v1;i4++) { 240 l4[i4] = v4[i4].the_real_datatype; 241 } 242 } 243 MPIX_CALLWORLD( MPI_Type_create_struct( v1, (int *)v2, (MPI_Aint *)v3, l4, &(v5.the_real_datatype) )); 244 delete[] l4; 245 return v5; 246 } 247 virtual int Pack_size( int v1, const Comm &v3 ) const; 248 virtual void Pack( const void* v1, int v2, void * v4, int v5, int &v6, const Comm &v7 ) const; 249 virtual int Get_size( void ) const 250 { 251 int v2; 252 MPIX_CALLWORLD( MPI_Type_size( (MPI_Datatype) the_real_datatype, &v2 )); 253 return v2; 254 } 255 virtual void Get_envelope( int &v2, int &v3, int &v4, int &v5 ) const 256 { 257 MPIX_CALLWORLD( MPI_Type_get_envelope( (MPI_Datatype) the_real_datatype, &v2, &v3, &v4, &v5 )); 258 } 259 virtual Datatype Create_hvector( int v1, int v2, Aint v3 ) const 260 { 261 Datatype v5; 262 MPIX_CALLWORLD( MPI_Type_create_hvector( v1, v2, v3, (MPI_Datatype) the_real_datatype, &(v5.the_real_datatype) )); 263 return v5; 264 } 265 static Datatype Match_size( int v1, int v2 ) 266 { 267 Datatype v3; 268 MPIX_CALLWORLD( MPI_Type_match_size( v1, v2, &(v3.the_real_datatype) )); 269 return v3; 270 } 271 virtual Datatype Create_resized( const Aint v2, const Aint v3 ) const 272 { 273 Datatype v4; 274 MPIX_CALLWORLD( MPI_Type_create_resized( (MPI_Datatype) the_real_datatype, (MPI_Aint)v2, (MPI_Aint)v3, &(v4.the_real_datatype) )); 275 return v4; 276 } 277 virtual Datatype Create_indexed_block( int v1, int v2, const int v3[] ) const 278 { 279 Datatype v5; 280 MPIX_CALLWORLD( MPI_Type_create_indexed_block( v1, v2, (int *)v3, (MPI_Datatype) the_real_datatype, &(v5.the_real_datatype) )); 281 return v5; 282 } 283 virtual Aint Pack_external_size( char * v1, const int v2 ) const 284 { 285 MPI_Aint v4; 286 MPIX_CALLWORLD( MPI_Pack_external_size( v1, (int)v2, (MPI_Datatype) the_real_datatype, &v4 )); 287 return v4; 288 } 289 Datatype Dup( void ) const 290 { 291 Datatype v2; 292 MPIX_CALLWORLD( MPI_Type_dup( (MPI_Datatype) the_real_datatype, &(v2.the_real_datatype) )); 293 return v2; 294 } 295 virtual Datatype Create_hindexed( int v1, const int v2[], const Aint v3[] ) const 296 { 297 Datatype v5; 298 MPIX_CALLWORLD( MPI_Type_create_hindexed( v1, (int *)v2, (MPI_Aint *)v3, (MPI_Datatype) the_real_datatype, &(v5.the_real_datatype) )); 299 return v5; 300 } 301 virtual bool Get_attr( int v2, void * v3 ) const 302 { 303 int v4; 304 MPIX_CALLWORLD( MPI_Type_get_attr( (MPI_Datatype) the_real_datatype, v2, v3, &v4 )); 305 return v4!= 0; 306 } 307 virtual void Get_true_extent( Aint & v2, Aint & v3 ) const 308 { 309 MPIX_CALLWORLD( MPI_Type_get_true_extent( (MPI_Datatype) the_real_datatype, &v2, &v3 )); 310 } 311 virtual Datatype Create_darray( int v1, int v2, int v3, const int v4[], const int v5[], const int v6[], const int v7[], int v8 ) const 312 { 313 Datatype v10; 314 MPIX_CALLWORLD( MPI_Type_create_darray( v1, v2, v3, (int *)v4, (int *)v5, (int *)v6, (int *)v7, v8, (MPI_Datatype) the_real_datatype, &(v10.the_real_datatype) )); 315 return v10; 316 } 317 static Datatype Create_f90_real( int v1, int v2 ) 318 { 319 Datatype v3; 320 MPIX_CALLWORLD( MPI_Type_create_f90_real( v1, v2, &(v3.the_real_datatype) )); 321 return v3; 322 } 323 virtual void Get_contents( int v2, int v3, int v4, int v5[], MPI_Aint v6[], Datatype v7[] ) const 324 { 325 MPI_Datatype *l7 = new MPI_Datatype[v4]; 326 MPIX_CALLWORLD( MPI_Type_get_contents( (MPI_Datatype) the_real_datatype, v2, v3, v4, v5, v6, l7 )); 327 { 328 int i7; 329 for (i7=0;i7<v4;i7++) { 330 v7[i7].the_real_datatype = l7[i7]; 331 } 332 delete[] l7; 333 } 334 } 335 virtual void Set_attr( int v2, const void * v3 ) 336 { 337 MPIX_CALLWORLD( MPI_Type_set_attr( (MPI_Datatype) the_real_datatype, v2, (void *)v3 )); 338 } 339 virtual void Set_name( const MPICH2_CONST char * v2 ) 340 { 341 MPIX_CALLWORLD( MPI_Type_set_name( (MPI_Datatype) the_real_datatype, (MPICH2_CONST char *)v2 )); 342 } 343 static Datatype Create_f90_complex( int v1, int v2 ) 344 { 345 Datatype v3; 346 MPIX_CALLWORLD( MPI_Type_create_f90_complex( v1, v2, &(v3.the_real_datatype) )); 347 return v3; 348 } 349 virtual Datatype Create_subarray( int v1, int v2[], const int v3[], const int v4[], const int v5 ) const 350 { 351 Datatype v7; 352 MPIX_CALLWORLD( MPI_Type_create_subarray( v1, v2, (int *)v3, (int *)v4, (int)v5, (MPI_Datatype) the_real_datatype, &(v7.the_real_datatype) )); 353 return v7; 354 } 355 virtual void Unpack_external( char * v1, const MPICH2_CONST void * v2, const Aint v3, Aint & v4, void * v5, int v6 ) const 356 { 357 MPIX_CALLWORLD( MPI_Unpack_external( v1, (MPICH2_CONST void *)v2, (MPI_Aint)v3, &v4, v5, v6, (MPI_Datatype) the_real_datatype )); 358 } 359 static void Free_keyval( int &v1 ) 360 { 361 MPIX_CALLWORLD( MPI_Type_free_keyval( &v1 )); 362 } 363 static Datatype Create_struct( int v1, const int v2[], const Aint v3[], const Datatype v4[] ) 364 { 365 Datatype v5; 366 MPI_Datatype *l4 = new MPI_Datatype[v1]; 367 { 368 int i4; 369 for (i4=0;i4<v1;i4++) { 370 l4[i4] = v4[i4].the_real_datatype; 371 } 372 } 373 MPIX_CALLWORLD( MPI_Type_create_struct( v1, (int *)v2, (MPI_Aint *)v3, l4, &(v5.the_real_datatype) )); 374 delete[] l4; 375 return v5; 376 } 377 static Datatype Create_f90_integer( int v1 ) 378 { 379 Datatype v2; 380 MPIX_CALLWORLD( MPI_Type_create_f90_integer( v1, &(v2.the_real_datatype) )); 381 return v2; 382 } 383 virtual void Pack_external( char * v1, const MPICH2_CONST void * v2, const int v3, void * v5, Aint v6, Aint & v7 ) const 384 { 385 MPIX_CALLWORLD( MPI_Pack_external( v1, (MPICH2_CONST void *)v2, (int)v3, (MPI_Datatype) the_real_datatype, v5, v6, &v7 )); 386 } 387 virtual void Get_extent( Aint & v2, Aint & v3 ) const 388 { 389 MPIX_CALLWORLD( MPI_Type_get_extent( (MPI_Datatype) the_real_datatype, &v2, &v3 )); 390 } 391 virtual void Delete_attr( int v2 ) 392 { 393 MPIX_CALLWORLD( MPI_Type_delete_attr( (MPI_Datatype) the_real_datatype, v2 )); 394 } 395 virtual void Get_name( char * v2, int &v3 ) const 396 { 397 MPIR_CXX_InitDatatypeNames(); 398 MPIX_CALLWORLD( MPI_Type_get_name( (MPI_Datatype) the_real_datatype, v2, &v3 )); 399 } 400 401 void Unpack( const void *, int, void *, int, int &, const Comm & ) const; 402 typedef int Copy_attr_function(const Datatype& oldtype, int type_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, bool& flag); 403 typedef int Delete_attr_function(Datatype& type, int type_keyval, void* attribute_val, void* extra_state); 404 405 static int Create_keyval( Copy_attr_function *, Delete_attr_function *, 406 void * ); 407 // These functions are *not* part of MPI-2 but are provided 408 // because they should have been included 409 static int NULL_COPY_FN( const Datatype &oldtype MPIR_ARGUNUSED, 410 int keyval MPIR_ARGUNUSED, void *ex MPIR_ARGUNUSED, 411 void *attr_in MPIR_ARGUNUSED, void *attr_out MPIR_ARGUNUSED, 412 bool &flag ) { flag = 1; return 0;} 413 static int NULL_DELETE_FN( Datatype &type MPIR_ARGUNUSED, 414 int keyval MPIR_ARGUNUSED, void * attr MPIR_ARGUNUSED, 415 void *ex MPIR_ARGUNUSED ) { return 0; } 416 static int DUP_FN( const Datatype &oldtype MPIR_ARGUNUSED, 417 int keyval MPIR_ARGUNUSED, void *ex MPIR_ARGUNUSED, 418 void *attr_in, void *attr_out, bool &flag ) { flag = 1; 419 *(void **)attr_out = attr_in; return 0;} 420 421}; 422 423 typedef void User_function(const void *, void*, int, const Datatype&); 424 425class Info { 426 friend class File; 427 friend class Win; 428 friend class Comm; 429 friend class Intracomm; 430 431 protected: 432 MPI_Info the_real_info; 433 434 public: 435 // new/delete 436 437 inline Info(MPI_Info obj) : the_real_info(obj) {} 438 inline Info(void) : the_real_info(MPI_INFO_NULL) {} 439 440 virtual ~Info() {} 441 // copy/assignment 442 443 Info(const Info &obj) : the_real_info(obj.the_real_info){} 444 445 Info& operator=(const Info &obj) { 446 the_real_info = obj.the_real_info; return *this; } 447 448 // logical 449 bool operator== (const Info &obj) { 450 return (the_real_info == obj.the_real_info); } 451 bool operator!= (const Info &obj) { 452 return (the_real_info != obj.the_real_info); } 453 // C/C++ cast and assignment 454 inline operator MPI_Info*() { return &the_real_info; } 455 inline operator MPI_Info() const { return the_real_info; } 456 Info& operator=(const MPI_Info& obj) { 457 the_real_info = obj; return *this; } 458 virtual void Delete( const MPICH2_CONST char * v2 ) 459 { 460 MPIX_CALLWORLD( MPI_Info_delete( (MPI_Info) the_real_info, (MPICH2_CONST char *)v2 )); 461 } 462 virtual void Get_nthkey( int v2, char * v3 ) const 463 { 464 MPIX_CALLWORLD( MPI_Info_get_nthkey( (MPI_Info) the_real_info, v2, v3 )); 465 } 466 virtual void Free( void ) 467 { 468 MPIX_CALLWORLD( MPI_Info_free( (MPI_Info *) &the_real_info )); 469 } 470 static Info Create( void ) 471 { 472 Info v1; 473 MPIX_CALLWORLD( MPI_Info_create( &(v1.the_real_info) )); 474 return v1; 475 } 476 virtual void Set( const MPICH2_CONST char * v2, const MPICH2_CONST char * v3 ) 477 { 478 MPIX_CALLWORLD( MPI_Info_set( (MPI_Info) the_real_info, (MPICH2_CONST char *)v2, (MPICH2_CONST char *)v3 )); 479 } 480 Info Dup( void ) const 481 { 482 Info v2; 483 MPIX_CALLWORLD( MPI_Info_dup( (MPI_Info) the_real_info, &(v2.the_real_info) )); 484 return v2; 485 } 486 virtual bool Get_valuelen( const MPICH2_CONST char * v2, int &v3 ) const 487 { 488 int v4; 489 MPIX_CALLWORLD( MPI_Info_get_valuelen( (MPI_Info) the_real_info, (MPICH2_CONST char *)v2, &v3, &v4 )); 490 return v4!= 0; 491 } 492 virtual bool Get( const MPICH2_CONST char * v2, int v3, char * v4 ) const 493 { 494 int v5; 495 MPIX_CALLWORLD( MPI_Info_get( (MPI_Info) the_real_info, (MPICH2_CONST char *)v2, v3, v4, &v5 )); 496 return v5!= 0; 497 } 498 virtual int Get_nkeys( void ) const 499 { 500 int v2; 501 MPIX_CALLWORLD( MPI_Info_get_nkeys( (MPI_Info) the_real_info, &v2 )); 502 return v2; 503 } 504}; 505 506class Status { 507 friend class Comm; 508 friend class File; 509 friend class Request; 510 511 protected: 512 MPI_Status the_real_status; 513 514 public: 515 // new/delete 516 517 inline Status(MPI_Status obj) : the_real_status(obj) {} 518 inline Status(void) : the_real_status() {} 519 520 virtual ~Status() {} 521 // copy/assignment 522 523 Status(const Status &obj) : the_real_status(obj.the_real_status){} 524 525 Status& operator=(const Status &obj) { 526 the_real_status = obj.the_real_status; return *this; } 527 528 // C/C++ cast and assignment 529 inline operator MPI_Status*() { return &the_real_status; } 530 inline operator MPI_Status() const { return the_real_status; } 531 Status& operator=(const MPI_Status& obj) { 532 the_real_status = obj; return *this; } 533 virtual bool Is_cancelled( void ) const 534 { 535 int v2; 536 MPIX_CALLWORLD( MPI_Test_cancelled( (MPI_Status *) &the_real_status, &v2 )); 537 return v2!= 0; 538 } 539 virtual int Get_elements( const Datatype &v2 ) const 540 { 541 int v3; 542 MPIX_CALLWORLD( MPI_Get_elements( (MPI_Status *) &the_real_status, (MPI_Datatype)(v2.the_real_datatype), &v3 )); 543 return v3; 544 } 545 virtual int Get_count( const Datatype &v2 ) const 546 { 547 int v3; 548 MPIX_CALLWORLD( MPI_Get_count( (MPI_Status *) &the_real_status, (MPI_Datatype)(v2.the_real_datatype), &v3 )); 549 return v3; 550 } 551 virtual void Set_cancelled( bool v2 ) 552 { 553 int l2; 554 l2 = (v2 == true) ? 1 : 0; 555 MPIX_CALLWORLD( MPI_Status_set_cancelled( (MPI_Status *) &the_real_status, l2 )); 556 } 557 virtual void Set_elements( const Datatype &v2, int v3 ) 558 { 559 MPIX_CALLWORLD( MPI_Status_set_elements( (MPI_Status *) &the_real_status, (MPI_Datatype)(v2.the_real_datatype), v3 )); 560 } 561 562 int Get_source(void) const { return the_real_status.MPI_SOURCE; } 563 int Get_tag(void) const { return the_real_status.MPI_TAG; } 564 int Get_error(void) const { return the_real_status.MPI_ERROR; } 565 void Set_source(int source) { the_real_status.MPI_SOURCE = source; } 566 void Set_tag(int tag) { the_real_status.MPI_TAG = tag; } 567 void Set_error(int error) { the_real_status.MPI_ERROR = error; } 568}; 569 570class Group { 571 friend class Comm; 572 friend class Intracomm; 573 friend class Intercomm; 574 friend class Win; 575 friend class File; 576 577 protected: 578 MPI_Group the_real_group; 579 580 public: 581 // new/delete 582 583 inline Group(MPI_Group obj) : the_real_group(obj) {} 584 inline Group(void) : the_real_group(MPI_GROUP_NULL) {} 585 586 virtual ~Group() {} 587 // copy/assignment 588 589 Group(const Group &obj) : the_real_group(obj.the_real_group){} 590 591 Group& operator=(const Group &obj) { 592 the_real_group = obj.the_real_group; return *this; } 593 594 // logical 595 bool operator== (const Group &obj) { 596 return (the_real_group == obj.the_real_group); } 597 bool operator!= (const Group &obj) { 598 return (the_real_group != obj.the_real_group); } 599 // C/C++ cast and assignment 600 inline operator MPI_Group*() { return &the_real_group; } 601 inline operator MPI_Group() const { return the_real_group; } 602 Group& operator=(const MPI_Group& obj) { 603 the_real_group = obj; return *this; } 604 virtual Group Excl( int v2, const MPICH2_CONST int * v3 ) const 605 { 606 Group v4; 607 MPIX_CALLWORLD( MPI_Group_excl( (MPI_Group) the_real_group, v2, (MPICH2_CONST int *)v3, &(v4.the_real_group) )); 608 return v4; 609 } 610 virtual int Get_rank( void ) const 611 { 612 int v2; 613 MPIX_CALLWORLD( MPI_Group_rank( (MPI_Group) the_real_group, &v2 )); 614 return v2; 615 } 616 virtual void Free( void ) 617 { 618 MPIX_CALLWORLD( MPI_Group_free( (MPI_Group *) &the_real_group )); 619 } 620 static Group Union( const Group &v1, const Group &v2 ) 621 { 622 Group v3; 623 MPIX_CALLWORLD( MPI_Group_union( (MPI_Group)(v1.the_real_group), (MPI_Group)(v2.the_real_group), &(v3.the_real_group) )); 624 return v3; 625 } 626 static Group Intersect( const Group &v1, const Group &v2 ) 627 { 628 Group v3; 629 MPIX_CALLWORLD( MPI_Group_intersection( (MPI_Group)(v1.the_real_group), (MPI_Group)(v2.the_real_group), &(v3.the_real_group) )); 630 return v3; 631 } 632 virtual Group Range_excl( int v2, const int v3[][3] ) const 633 { 634 Group v4; 635 MPIX_CALLWORLD( MPI_Group_range_excl( (MPI_Group) the_real_group, v2, (int (*)[3])v3, &(v4.the_real_group) )); 636 return v4; 637 } 638 virtual Group Range_incl( int v2, const int v3[][3] ) const 639 { 640 Group v4; 641 MPIX_CALLWORLD( MPI_Group_range_incl( (MPI_Group) the_real_group, v2, (int (*)[3])v3, &(v4.the_real_group) )); 642 return v4; 643 } 644 static Group Difference( const Group &v1, const Group &v2 ) 645 { 646 Group v3; 647 MPIX_CALLWORLD( MPI_Group_difference( (MPI_Group)(v1.the_real_group), (MPI_Group)(v2.the_real_group), &(v3.the_real_group) )); 648 return v3; 649 } 650 static void Translate_ranks( const Group &v1, int v2, const MPICH2_CONST int * v3, const Group &v4, int * v5 ) 651 { 652 MPIX_CALLWORLD( MPI_Group_translate_ranks( (MPI_Group)(v1.the_real_group), v2, (MPICH2_CONST int *)v3, (MPI_Group)(v4.the_real_group), v5 )); 653 } 654 virtual Group Incl( int v2, const MPICH2_CONST int * v3 ) const 655 { 656 Group v4; 657 MPIX_CALLWORLD( MPI_Group_incl( (MPI_Group) the_real_group, v2, (MPICH2_CONST int *)v3, &(v4.the_real_group) )); 658 return v4; 659 } 660 virtual int Get_size( void ) const 661 { 662 int v2; 663 MPIX_CALLWORLD( MPI_Group_size( (MPI_Group) the_real_group, &v2 )); 664 return v2; 665 } 666 static int Compare( const Group &v1, const Group &v2 ) 667 { 668 int v3; 669 MPIX_CALLWORLD( MPI_Group_compare( (MPI_Group)(v1.the_real_group), (MPI_Group)(v2.the_real_group), &v3 )); 670 return v3; 671 } 672}; 673 674class Op { 675 friend class Intracomm; 676 friend class Intercomm; 677 friend class Win; 678 friend class Comm; 679 680 protected: 681 MPI_Op the_real_op; 682 683 public: 684 // new/delete 685 686 inline Op(MPI_Op obj) : the_real_op(obj) {} 687 inline Op(void) : the_real_op(MPI_OP_NULL) {} 688 689 virtual ~Op() {} 690 // copy/assignment 691 692 Op(const Op &obj) : the_real_op(obj.the_real_op){} 693 694 Op& operator=(const Op &obj) { 695 the_real_op = obj.the_real_op; return *this; } 696 697 // logical 698 bool operator== (const Op &obj) { 699 return (the_real_op == obj.the_real_op); } 700 bool operator!= (const Op &obj) { 701 return (the_real_op != obj.the_real_op); } 702 // C/C++ cast and assignment 703 inline operator MPI_Op*() { return &the_real_op; } 704 inline operator MPI_Op() const { return the_real_op; } 705 Op& operator=(const MPI_Op& obj) { 706 the_real_op = obj; return *this; } 707 virtual void Free( void ) 708 { 709 MPIX_CALLWORLD( MPI_Op_free( (MPI_Op *) &the_real_op )); 710 } 711 virtual bool Is_commutative( void ) 712 { 713 int v2; 714 MPIX_CALLWORLD( MPI_Op_commutative( (MPI_Op) the_real_op, &v2 )); 715 return v2!= 0; 716 } 717 virtual void Reduce_local( void * v1, void * v2, int v3, Datatype v4 ) 718 { 719 MPIX_CALLWORLD( MPI_Reduce_local( v1, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Op) the_real_op )); 720 } 721 722 void Init( User_function *, bool ); 723}; 724 725class Errhandler { 726 friend class Comm; 727 friend class File; 728 friend class Win; 729 730 protected: 731 MPI_Errhandler the_real_errhandler; 732 733 public: 734 // new/delete 735 736 inline Errhandler(MPI_Errhandler obj) : the_real_errhandler(obj) {} 737 inline Errhandler(void) : the_real_errhandler(MPI_ERRHANDLER_NULL) {} 738 739 virtual ~Errhandler() {} 740 // copy/assignment 741 742 Errhandler(const Errhandler &obj) : the_real_errhandler(obj.the_real_errhandler){} 743 744 Errhandler& operator=(const Errhandler &obj) { 745 the_real_errhandler = obj.the_real_errhandler; return *this; } 746 747 // logical 748 bool operator== (const Errhandler &obj) { 749 return (the_real_errhandler == obj.the_real_errhandler); } 750 bool operator!= (const Errhandler &obj) { 751 return (the_real_errhandler != obj.the_real_errhandler); } 752 // C/C++ cast and assignment 753 inline operator MPI_Errhandler*() { return &the_real_errhandler; } 754 inline operator MPI_Errhandler() const { return the_real_errhandler; } 755 Errhandler& operator=(const MPI_Errhandler& obj) { 756 the_real_errhandler = obj; return *this; } 757 virtual void Free( void ) 758 { 759 MPIX_CALLWORLD( MPI_Errhandler_free( (MPI_Errhandler *) &the_real_errhandler )); 760 } 761}; 762 763class Request { 764 friend class Comm; 765 friend class File; 766 friend class Grequest; 767 768 protected: 769 MPI_Request the_real_request; 770 771 public: 772 // new/delete 773 774 inline Request(MPI_Request obj) : the_real_request(obj) {} 775 inline Request(void) : the_real_request(MPI_REQUEST_NULL) {} 776 777 virtual ~Request() {} 778 // copy/assignment 779 780 Request(const Request &obj) : the_real_request(obj.the_real_request){} 781 782 Request& operator=(const Request &obj) { 783 the_real_request = obj.the_real_request; return *this; } 784 785 // logical 786 bool operator== (const Request &obj) { 787 return (the_real_request == obj.the_real_request); } 788 bool operator!= (const Request &obj) { 789 return (the_real_request != obj.the_real_request); } 790 // C/C++ cast and assignment 791 inline operator MPI_Request*() { return &the_real_request; } 792 inline operator MPI_Request() const { return the_real_request; } 793 Request& operator=(const MPI_Request& obj) { 794 the_real_request = obj; return *this; } 795 static bool Testany( int v1, Request v2[], int &v3, Status & v5 ) 796 { 797 int v4; 798 MPI_Request *l2 = new MPI_Request[v1]; 799 { 800 int i2; 801 for (i2=0;i2<v1;i2++) { 802 l2[i2] = v2[i2].the_real_request; 803 } 804 } 805 MPIX_CALLWORLD( MPI_Testany( v1, l2, &v3, &v4, (MPI_Status *)&(v5.the_real_status ) )); 806 { 807 int i2; 808 for (i2=0;i2<v1;i2++) { 809 v2[i2].the_real_request = l2[i2]; 810 } 811 delete[] l2; 812 } 813 return v4!= 0; 814 } 815 static bool Testany( int v1, Request v2[], int &v3 ) 816 { 817 int v4; 818 MPI_Request *l2 = new MPI_Request[v1]; 819 { 820 int i2; 821 for (i2=0;i2<v1;i2++) { 822 l2[i2] = v2[i2].the_real_request; 823 } 824 } 825 MPIX_CALLWORLD( MPI_Testany( v1, l2, &v3, &v4, MPI_STATUS_IGNORE )); 826 { 827 int i2; 828 for (i2=0;i2<v1;i2++) { 829 v2[i2].the_real_request = l2[i2]; 830 } 831 delete[] l2; 832 } 833 return v4!= 0; 834 } 835 static int Waitsome( int v1, Request v2[], int * v4, Status v5[] ) 836 { 837 int v3; 838 MPI_Request *l2 = new MPI_Request[v1]; 839 MPI_Status *l5 = new MPI_Status[v1]; 840 { 841 int i2; 842 for (i2=0;i2<v1;i2++) { 843 l2[i2] = v2[i2].the_real_request; 844 } 845 } 846 MPIX_CALLWORLD( MPI_Waitsome( v1, l2, &v3, v4, l5 )); 847 { 848 int i2; 849 for (i2=0;i2<v1;i2++) { 850 v2[i2].the_real_request = l2[i2]; 851 } 852 delete[] l2; 853 } 854 { 855 int i5; 856 for (i5=0;i5<v1;i5++) { 857 v5[i5].the_real_status = l5[i5]; 858 } 859 delete[] l5; 860 } 861 return v3; 862 } 863 static int Waitsome( int v1, Request v2[], int * v4 ) 864 { 865 int v3; 866 MPI_Request *l2 = new MPI_Request[v1]; 867 { 868 int i2; 869 for (i2=0;i2<v1;i2++) { 870 l2[i2] = v2[i2].the_real_request; 871 } 872 } 873 MPIX_CALLWORLD( MPI_Waitsome( v1, l2, &v3, v4, MPI_STATUSES_IGNORE )); 874 { 875 int i2; 876 for (i2=0;i2<v1;i2++) { 877 v2[i2].the_real_request = l2[i2]; 878 } 879 delete[] l2; 880 } 881 return v3; 882 } 883 virtual void Free( void ) 884 { 885 MPIX_CALLWORLD( MPI_Request_free( (MPI_Request *) &the_real_request )); 886 } 887 static bool Testall( int v1, Request v2[], Status v4[] ) 888 { 889 int v3; 890 MPI_Request *l2 = new MPI_Request[v1]; 891 MPI_Status *l4 = new MPI_Status[v1]; 892 { 893 int i2; 894 for (i2=0;i2<v1;i2++) { 895 l2[i2] = v2[i2].the_real_request; 896 } 897 } 898 MPIX_CALLWORLD( MPI_Testall( v1, l2, &v3, l4 )); 899 { 900 int i2; 901 for (i2=0;i2<v1;i2++) { 902 v2[i2].the_real_request = l2[i2]; 903 } 904 delete[] l2; 905 } 906 { 907 int i4; 908 for (i4=0;i4<v1;i4++) { 909 v4[i4].the_real_status = l4[i4]; 910 } 911 delete[] l4; 912 } 913 return v3!= 0; 914 } 915 static bool Testall( int v1, Request v2[] ) 916 { 917 int v3; 918 MPI_Request *l2 = new MPI_Request[v1]; 919 { 920 int i2; 921 for (i2=0;i2<v1;i2++) { 922 l2[i2] = v2[i2].the_real_request; 923 } 924 } 925 MPIX_CALLWORLD( MPI_Testall( v1, l2, &v3, MPI_STATUSES_IGNORE )); 926 { 927 int i2; 928 for (i2=0;i2<v1;i2++) { 929 v2[i2].the_real_request = l2[i2]; 930 } 931 delete[] l2; 932 } 933 return v3!= 0; 934 } 935 virtual void Wait( Status & v2 ) 936 { 937 MPIX_CALLWORLD( MPI_Wait( (MPI_Request *) &the_real_request, (MPI_Status *)&(v2.the_real_status ) )); 938 } 939 virtual void Wait( void ) 940 { 941 MPIX_CALLWORLD( MPI_Wait( (MPI_Request *) &the_real_request, MPI_STATUS_IGNORE )); 942 } 943 static int Testsome( int v1, Request v2[], int * v4, Status v5[] ) 944 { 945 int v3; 946 MPI_Request *l2 = new MPI_Request[v1]; 947 MPI_Status *l5 = new MPI_Status[v1]; 948 { 949 int i2; 950 for (i2=0;i2<v1;i2++) { 951 l2[i2] = v2[i2].the_real_request; 952 } 953 } 954 MPIX_CALLWORLD( MPI_Testsome( v1, l2, &v3, v4, l5 )); 955 { 956 int i2; 957 for (i2=0;i2<v1;i2++) { 958 v2[i2].the_real_request = l2[i2]; 959 } 960 delete[] l2; 961 } 962 { 963 int i5; 964 for (i5=0;i5<v1;i5++) { 965 v5[i5].the_real_status = l5[i5]; 966 } 967 delete[] l5; 968 } 969 return v3; 970 } 971 static int Testsome( int v1, Request v2[], int * v4 ) 972 { 973 int v3; 974 MPI_Request *l2 = new MPI_Request[v1]; 975 { 976 int i2; 977 for (i2=0;i2<v1;i2++) { 978 l2[i2] = v2[i2].the_real_request; 979 } 980 } 981 MPIX_CALLWORLD( MPI_Testsome( v1, l2, &v3, v4, MPI_STATUSES_IGNORE )); 982 { 983 int i2; 984 for (i2=0;i2<v1;i2++) { 985 v2[i2].the_real_request = l2[i2]; 986 } 987 delete[] l2; 988 } 989 return v3; 990 } 991 static void Waitall( int v1, Request v2[], Status v3[] ) 992 { 993 MPI_Request *l2 = new MPI_Request[v1]; 994 MPI_Status *l3 = new MPI_Status[v1]; 995 { 996 int i2; 997 for (i2=0;i2<v1;i2++) { 998 l2[i2] = v2[i2].the_real_request; 999 } 1000 } 1001 MPIX_CALLWORLD( MPI_Waitall( v1, l2, l3 )); 1002 { 1003 int i2; 1004 for (i2=0;i2<v1;i2++) { 1005 v2[i2].the_real_request = l2[i2]; 1006 } 1007 delete[] l2; 1008 } 1009 { 1010 int i3; 1011 for (i3=0;i3<v1;i3++) { 1012 v3[i3].the_real_status = l3[i3]; 1013 } 1014 delete[] l3; 1015 } 1016 } 1017 static void Waitall( int v1, Request v2[] ) 1018 { 1019 MPI_Request *l2 = new MPI_Request[v1]; 1020 { 1021 int i2; 1022 for (i2=0;i2<v1;i2++) { 1023 l2[i2] = v2[i2].the_real_request; 1024 } 1025 } 1026 MPIX_CALLWORLD( MPI_Waitall( v1, l2, MPI_STATUSES_IGNORE )); 1027 { 1028 int i2; 1029 for (i2=0;i2<v1;i2++) { 1030 v2[i2].the_real_request = l2[i2]; 1031 } 1032 delete[] l2; 1033 } 1034 } 1035 static int Waitany( int v1, Request v2[], Status & v4 ) 1036 { 1037 int v3; 1038 MPI_Request *l2 = new MPI_Request[v1]; 1039 { 1040 int i2; 1041 for (i2=0;i2<v1;i2++) { 1042 l2[i2] = v2[i2].the_real_request; 1043 } 1044 } 1045 MPIX_CALLWORLD( MPI_Waitany( v1, l2, &v3, (MPI_Status *)&(v4.the_real_status ) )); 1046 { 1047 int i2; 1048 for (i2=0;i2<v1;i2++) { 1049 v2[i2].the_real_request = l2[i2]; 1050 } 1051 delete[] l2; 1052 } 1053 return v3; 1054 } 1055 static int Waitany( int v1, Request v2[] ) 1056 { 1057 int v3; 1058 MPI_Request *l2 = new MPI_Request[v1]; 1059 { 1060 int i2; 1061 for (i2=0;i2<v1;i2++) { 1062 l2[i2] = v2[i2].the_real_request; 1063 } 1064 } 1065 MPIX_CALLWORLD( MPI_Waitany( v1, l2, &v3, MPI_STATUS_IGNORE )); 1066 { 1067 int i2; 1068 for (i2=0;i2<v1;i2++) { 1069 v2[i2].the_real_request = l2[i2]; 1070 } 1071 delete[] l2; 1072 } 1073 return v3; 1074 } 1075 virtual bool Test( Status & v3 ) 1076 { 1077 int v2; 1078 MPIX_CALLWORLD( MPI_Test( (MPI_Request *) &the_real_request, &v2, (MPI_Status *)&(v3.the_real_status ) )); 1079 return v2!= 0; 1080 } 1081 virtual bool Test( void ) 1082 { 1083 int v2; 1084 MPIX_CALLWORLD( MPI_Test( (MPI_Request *) &the_real_request, &v2, MPI_STATUS_IGNORE )); 1085 return v2!= 0; 1086 } 1087 virtual void Cancel( void ) const 1088 { 1089 MPIX_CALLWORLD( MPI_Cancel( (MPI_Request *) &the_real_request )); 1090 } 1091 virtual bool Get_status( Status & v3 ) const 1092 { 1093 int v2; 1094 MPIX_CALLWORLD( MPI_Request_get_status( (MPI_Request) the_real_request, &v2, (MPI_Status *)&(v3.the_real_status ) )); 1095 return v2!= 0; 1096 } 1097 virtual bool Get_status( void ) const 1098 { 1099 int v2; 1100 MPIX_CALLWORLD( MPI_Request_get_status( (MPI_Request) the_real_request, &v2, MPI_STATUS_IGNORE )); 1101 return v2!= 0; 1102 } 1103}; 1104 1105class Prequest : public Request { 1106 1107 public: 1108 // new/delete 1109 1110 inline Prequest(MPI_Request obj) : Request(obj) {} 1111 inline Prequest(void) : Request() {} 1112 1113 virtual ~Prequest() {} 1114 // copy/assignment 1115 1116 Prequest(const Prequest &obj) : Request(obj) {} 1117 1118 Prequest& operator=(const Prequest &obj) { 1119 the_real_request = obj.the_real_request; return *this; } 1120 1121 // C/C++ cast and assignment 1122 inline operator MPI_Request*() { return &the_real_request; } 1123 inline operator MPI_Request() const { return the_real_request; } 1124 Prequest& operator=(const MPI_Request& obj) { 1125 the_real_request = obj; return *this; } 1126 virtual void Start( void ) 1127 { 1128 MPIX_CALLWORLD( MPI_Start( (MPI_Request *) &the_real_request )); 1129 } 1130 static void Startall( int v1, Prequest v2[] ) 1131 { 1132 MPI_Request *l2 = new MPI_Request[v1]; 1133 { 1134 int i2; 1135 for (i2=0;i2<v1;i2++) { 1136 l2[i2] = v2[i2].the_real_request; 1137 } 1138 } 1139 MPIX_CALLWORLD( MPI_Startall( v1, l2 )); 1140 { 1141 int i2; 1142 for (i2=0;i2<v1;i2++) { 1143 v2[i2].the_real_request = l2[i2]; 1144 } 1145 delete[] l2; 1146 } 1147 } 1148}; 1149 1150class Comm { 1151 friend class Cartcomm; 1152 friend class Intercomm; 1153 friend class Intracomm; 1154 friend class Graphcomm; 1155 friend class Nullcomm; 1156 friend class Datatype; 1157 friend class Win; 1158 friend class File; 1159 1160 protected: 1161 MPI_Comm the_real_comm; 1162 1163 public: 1164 // new/delete 1165 1166 inline Comm(MPI_Comm obj) : the_real_comm(obj) {} 1167 inline Comm(void) : the_real_comm(MPI_COMM_NULL) {} 1168 1169 virtual ~Comm() {} 1170 // copy/assignment 1171 1172 Comm(const Comm &obj) : the_real_comm(obj.the_real_comm){} 1173 1174 Comm& operator=(const Comm &obj) { 1175 the_real_comm = obj.the_real_comm; return *this; } 1176 1177 // logical 1178 bool operator== (const Comm &obj) { 1179 return (the_real_comm == obj.the_real_comm); } 1180 bool operator!= (const Comm &obj) { 1181 return (the_real_comm != obj.the_real_comm); } 1182 // C/C++ cast and assignment 1183 inline operator MPI_Comm*() { return &the_real_comm; } 1184 inline operator MPI_Comm() const { return the_real_comm; } 1185 Comm& operator=(const MPI_Comm& obj) { 1186 the_real_comm = obj; return *this; } 1187 virtual Group Get_group( void ) const 1188 { 1189 Group v2; 1190 MPIX_CALLREF( this, MPI_Comm_group( (MPI_Comm) the_real_comm, &(v2.the_real_group) )); 1191 return v2; 1192 } 1193 virtual int Get_rank( void ) const 1194 { 1195 int v2; 1196 MPIX_CALLREF( this, MPI_Comm_rank( (MPI_Comm) the_real_comm, &v2 )); 1197 return v2; 1198 } 1199 virtual Prequest Bsend_init( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1200 { 1201 Prequest v7; 1202 MPIX_CALLREF( this, MPI_Bsend_init( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7.the_real_request) )); 1203 return v7; 1204 } 1205 virtual Prequest Ssend_init( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1206 { 1207 Prequest v7; 1208 MPIX_CALLREF( this, MPI_Ssend_init( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7.the_real_request) )); 1209 return v7; 1210 } 1211 virtual bool Is_inter( void ) const 1212 { 1213 int v2; 1214 MPIX_CALLREF( this, MPI_Comm_test_inter( (MPI_Comm) the_real_comm, &v2 )); 1215 return v2!= 0; 1216 } 1217 virtual Prequest Rsend_init( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1218 { 1219 Prequest v7; 1220 MPIX_CALLREF( this, MPI_Rsend_init( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7.the_real_request) )); 1221 return v7; 1222 } 1223 virtual Request Ibsend( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1224 { 1225 Request v7; 1226 MPIX_CALLREF( this, MPI_Ibsend( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7.the_real_request) )); 1227 return v7; 1228 } 1229 virtual void Abort( int v2 ) const 1230 { 1231 MPIX_CALLREF( this, MPI_Abort( (MPI_Comm) the_real_comm, v2 )); 1232 } 1233 virtual void Free( void ) 1234 { 1235 MPIX_CALLREF( this, MPI_Comm_free( (MPI_Comm *) &the_real_comm )); 1236 } 1237 virtual Prequest Send_init( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1238 { 1239 Prequest v7; 1240 MPIX_CALLREF( this, MPI_Send_init( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7.the_real_request) )); 1241 return v7; 1242 } 1243 virtual void Recv( void* v1, int v2, const Datatype &v3, int v4, int v5, Status & v7 ) const 1244 { 1245 MPIX_CALLREF( this, MPI_Recv( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, (MPI_Status *)&(v7.the_real_status ) )); 1246 } 1247 virtual void Recv( void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1248 { 1249 MPIX_CALLREF( this, MPI_Recv( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, MPI_STATUS_IGNORE )); 1250 } 1251 virtual void Sendrecv( const void * v1, int v2, const Datatype &v3, int v4, int v5, void * v6, int v7, const Datatype &v8, int v9, int v10, Status & v12 ) const 1252 { 1253 MPIX_CALLREF( this, MPI_Sendrecv( (void *)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, v6, v7, (MPI_Datatype)(v8.the_real_datatype), v9, v10, (MPI_Comm) the_real_comm, (MPI_Status *)&(v12.the_real_status ) )); 1254 } 1255 virtual void Sendrecv( const void * v1, int v2, const Datatype &v3, int v4, int v5, void * v6, int v7, const Datatype &v8, int v9, int v10 ) const 1256 { 1257 MPIX_CALLREF( this, MPI_Sendrecv( (void *)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, v6, v7, (MPI_Datatype)(v8.the_real_datatype), v9, v10, (MPI_Comm) the_real_comm, MPI_STATUS_IGNORE )); 1258 } 1259 virtual void Sendrecv_replace( void* v1, int v2, const Datatype &v3, int v4, int v5, int v6, int v7, Status & v9 ) const 1260 { 1261 MPIX_CALLREF( this, MPI_Sendrecv_replace( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, v6, v7, (MPI_Comm) the_real_comm, (MPI_Status *)&(v9.the_real_status ) )); 1262 } 1263 virtual void Sendrecv_replace( void* v1, int v2, const Datatype &v3, int v4, int v5, int v6, int v7 ) const 1264 { 1265 MPIX_CALLREF( this, MPI_Sendrecv_replace( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, v6, v7, (MPI_Comm) the_real_comm, MPI_STATUS_IGNORE )); 1266 } 1267 virtual int Get_topology( void ) const 1268 { 1269 int v2; 1270 MPIX_CALLREF( this, MPI_Topo_test( (MPI_Comm) the_real_comm, &v2 )); 1271 return v2; 1272 } 1273 virtual Request Isend( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1274 { 1275 Request v7; 1276 MPIX_CALLREF( this, MPI_Isend( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7.the_real_request) )); 1277 return v7; 1278 } 1279 virtual void Probe( int v1, int v2, Status & v4 ) const 1280 { 1281 MPIX_CALLREF( this, MPI_Probe( v1, v2, (MPI_Comm) the_real_comm, (MPI_Status *)&(v4.the_real_status ) )); 1282 } 1283 virtual void Probe( int v1, int v2 ) const 1284 { 1285 MPIX_CALLREF( this, MPI_Probe( v1, v2, (MPI_Comm) the_real_comm, MPI_STATUS_IGNORE )); 1286 } 1287 static int Compare( const Comm &v1, const Comm &v2 ) 1288 { 1289 int v3; 1290 MPIX_CALLWORLD( MPI_Comm_compare( (MPI_Comm)(v1.the_real_comm), (MPI_Comm)(v2.the_real_comm), &v3 )); 1291 return v3; 1292 } 1293 virtual int Get_size( void ) const 1294 { 1295 int v2; 1296 MPIX_CALLREF( this, MPI_Comm_size( (MPI_Comm) the_real_comm, &v2 )); 1297 return v2; 1298 } 1299 virtual Request Issend( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1300 { 1301 Request v7; 1302 MPIX_CALLREF( this, MPI_Issend( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7.the_real_request) )); 1303 return v7; 1304 } 1305 virtual void Set_errhandler( const Errhandler &v2 ) 1306 { 1307 MPIX_CALLREF( this, MPI_Comm_set_errhandler( (MPI_Comm) the_real_comm, (MPI_Errhandler)(v2.the_real_errhandler) )); 1308 } 1309 virtual void Send( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1310 { 1311 MPIX_CALLREF( this, MPI_Send( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm )); 1312 } 1313 virtual Request Irsend( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1314 { 1315 Request v7; 1316 MPIX_CALLREF( this, MPI_Irsend( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7.the_real_request) )); 1317 return v7; 1318 } 1319 virtual void Ssend( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1320 { 1321 MPIX_CALLREF( this, MPI_Ssend( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm )); 1322 } 1323 virtual Prequest Recv_init( void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1324 { 1325 Prequest v7; 1326 MPIX_CALLREF( this, MPI_Recv_init( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7.the_real_request) )); 1327 return v7; 1328 } 1329 virtual bool Iprobe( int v1, int v2, Status & v5 ) const 1330 { 1331 int v4; 1332 MPIX_CALLREF( this, MPI_Iprobe( v1, v2, (MPI_Comm) the_real_comm, &v4, (MPI_Status *)&(v5.the_real_status ) )); 1333 return v4!= 0; 1334 } 1335 virtual bool Iprobe( int v1, int v2 ) const 1336 { 1337 int v4; 1338 MPIX_CALLREF( this, MPI_Iprobe( v1, v2, (MPI_Comm) the_real_comm, &v4, MPI_STATUS_IGNORE )); 1339 return v4!= 0; 1340 } 1341 virtual void Bsend( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1342 { 1343 MPIX_CALLREF( this, MPI_Bsend( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm )); 1344 } 1345 virtual Request Irecv( void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1346 { 1347 Request v7; 1348 MPIX_CALLREF( this, MPI_Irecv( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7.the_real_request) )); 1349 return v7; 1350 } 1351 virtual Errhandler Get_errhandler( void ) const 1352 { 1353 Errhandler v2; 1354 MPIX_CALLREF( this, MPI_Comm_get_errhandler( (MPI_Comm) the_real_comm, &(v2.the_real_errhandler) )); 1355 return v2; 1356 } 1357 virtual void Rsend( const void* v1, int v2, const Datatype &v3, int v4, int v5 ) const 1358 { 1359 MPIX_CALLREF( this, MPI_Rsend( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm )); 1360 } 1361 virtual void Reduce_scatter_block( const void * v1, void * v2, int v3, const Datatype &v4, const Op &v5 ) const 1362 { 1363 MPIX_CALLREF( this, MPI_Reduce_scatter_block( (void *)v1, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Op)(v5.the_real_op), (MPI_Comm) the_real_comm )); 1364 } 1365 virtual void Gatherv( const void* v1, int v2, const Datatype &v3, void* v4, const MPICH2_CONST int * v5, const MPICH2_CONST int * v6, const Datatype &v7, int v8 ) const 1366 { 1367 MPIX_CALLREF( this, MPI_Gatherv( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, (MPICH2_CONST int *)v5, (MPICH2_CONST int *)v6, (MPI_Datatype)(v7.the_real_datatype), v8, (MPI_Comm) the_real_comm )); 1368 } 1369 virtual void Disconnect( void ) 1370 { 1371 MPIX_CALLREF( this, MPI_Comm_disconnect( (MPI_Comm *) &the_real_comm )); 1372 } 1373 virtual void Allreduce( const void* v1, void* v2, int v3, const Datatype &v4, const Op &v5 ) const 1374 { 1375 MPIX_CALLREF( this, MPI_Allreduce( (void*)v1, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Op)(v5.the_real_op), (MPI_Comm) the_real_comm )); 1376 } 1377 virtual void Alltoallw( const void * v1, const int v2[], const int v3[], const Datatype v4[], void * v5, const int v6[], const int v7[], const Datatype v8[] ) const 1378 { 1379 MPI_Datatype *l4 = new MPI_Datatype[Get_size()]; 1380 MPI_Datatype *l8 = new MPI_Datatype[Get_size()]; 1381 { 1382 int i4; 1383 for (i4=0;i4<Get_size();i4++) { 1384 l4[i4] = v4[i4].the_real_datatype; 1385 } 1386 } 1387 { 1388 int i8; 1389 for (i8=0;i8<Get_size();i8++) { 1390 l8[i8] = v8[i8].the_real_datatype; 1391 } 1392 } 1393 MPIX_CALLREF( this, MPI_Alltoallw( (void *)v1, (int *)v2, (int *)v3, l4, v5, (int *)v6, (int *)v7, l8, (MPI_Comm) the_real_comm )); 1394 delete[] l4; 1395 delete[] l8; 1396 } 1397 static Intercomm Join( const int v1 ) ; 1398 virtual void Alltoall( const void* v1, int v2, const Datatype &v3, void* v4, int v5, const Datatype &v6 ) const 1399 { 1400 MPIX_CALLREF( this, MPI_Alltoall( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Datatype)(v6.the_real_datatype), (MPI_Comm) the_real_comm )); 1401 } 1402 virtual bool Get_attr( int v2, void * v3 ) const 1403 { 1404 int v4; 1405 MPIX_CALLREF( this, MPI_Comm_get_attr( (MPI_Comm) the_real_comm, v2, v3, &v4 )); 1406 return v4!= 0; 1407 } 1408 virtual void Barrier( void ) const 1409 { 1410 MPIX_CALLREF( this, MPI_Barrier( (MPI_Comm) the_real_comm )); 1411 } 1412 virtual void Bcast( void* v1, int v2, const Datatype &v3, int v4 ) const 1413 { 1414 MPIX_CALLREF( this, MPI_Bcast( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, (MPI_Comm) the_real_comm )); 1415 } 1416 virtual void Set_attr( int v2, const void * v3 ) 1417 { 1418 MPIX_CALLREF( this, MPI_Comm_set_attr( (MPI_Comm) the_real_comm, v2, (void *)v3 )); 1419 } 1420 virtual void Set_name( const MPICH2_CONST char * v2 ) 1421 { 1422 MPIX_CALLREF( this, MPI_Comm_set_name( (MPI_Comm) the_real_comm, (MPICH2_CONST char *)v2 )); 1423 } 1424 static Intercomm Get_parent( void ) ; 1425 virtual void Alltoallv( const void* v1, const MPICH2_CONST int * v2, const MPICH2_CONST int * v3, const Datatype &v4, void* v5, const MPICH2_CONST int * v6, const MPICH2_CONST int * v7, const Datatype &v8 ) const 1426 { 1427 MPIX_CALLREF( this, MPI_Alltoallv( (void*)v1, (MPICH2_CONST int *)v2, (MPICH2_CONST int *)v3, (MPI_Datatype)(v4.the_real_datatype), v5, (MPICH2_CONST int *)v6, (MPICH2_CONST int *)v7, (MPI_Datatype)(v8.the_real_datatype), (MPI_Comm) the_real_comm )); 1428 } 1429 virtual void Reduce_scatter( const void* v1, void* v2, MPICH2_CONST int * v3, const Datatype &v4, const Op &v5 ) const 1430 { 1431 MPIX_CALLREF( this, MPI_Reduce_scatter( (void*)v1, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Op)(v5.the_real_op), (MPI_Comm) the_real_comm )); 1432 } 1433 virtual void Scatter( const void* v1, int v2, const Datatype &v3, void* v4, int v5, const Datatype &v6, int v7 ) const 1434 { 1435 MPIX_CALLREF( this, MPI_Scatter( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Datatype)(v6.the_real_datatype), v7, (MPI_Comm) the_real_comm )); 1436 } 1437 virtual void Call_errhandler( int v2 ) const; 1438 virtual void Gather( const void* v1, int v2, const Datatype &v3, void* v4, int v5, const Datatype &v6, int v7 ) const 1439 { 1440 MPIX_CALLREF( this, MPI_Gather( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Datatype)(v6.the_real_datatype), v7, (MPI_Comm) the_real_comm )); 1441 } 1442 static void Free_keyval( int &v1 ) 1443 { 1444 MPIX_CALLWORLD( MPI_Comm_free_keyval( &v1 )); 1445 } 1446 virtual void Reduce( const void* v1, void* v2, int v3, const Datatype &v4, const Op &v5, int v6 ) const 1447 { 1448 MPIX_CALLREF( this, MPI_Reduce( (void*)v1, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Op)(v5.the_real_op), v6, (MPI_Comm) the_real_comm )); 1449 } 1450 virtual void Allgather( const void* v1, int v2, const Datatype &v3, void* v4, int v5, const Datatype &v6 ) const 1451 { 1452 MPIX_CALLREF( this, MPI_Allgather( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Datatype)(v6.the_real_datatype), (MPI_Comm) the_real_comm )); 1453 } 1454 virtual void Delete_attr( int v2 ) 1455 { 1456 MPIX_CALLREF( this, MPI_Comm_delete_attr( (MPI_Comm) the_real_comm, v2 )); 1457 } 1458 virtual void Scatterv( const void* v1, const MPICH2_CONST int * v2, const MPICH2_CONST int * v3, const Datatype &v4, void* v5, int v6, const Datatype &v7, int v8 ) const 1459 { 1460 MPIX_CALLREF( this, MPI_Scatterv( (void*)v1, (MPICH2_CONST int *)v2, (MPICH2_CONST int *)v3, (MPI_Datatype)(v4.the_real_datatype), v5, v6, (MPI_Datatype)(v7.the_real_datatype), v8, (MPI_Comm) the_real_comm )); 1461 } 1462 virtual void Get_name( char * v2, int &v3 ) const 1463 { 1464 MPIX_CALLREF( this, MPI_Comm_get_name( (MPI_Comm) the_real_comm, v2, &v3 )); 1465 } 1466 virtual void Allgatherv( const void* v1, int v2, const Datatype &v3, void* v4, const MPICH2_CONST int * v5, const MPICH2_CONST int * v6, const Datatype &v7 ) const 1467 { 1468 MPIX_CALLREF( this, MPI_Allgatherv( (void*)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, (MPICH2_CONST int *)v5, (MPICH2_CONST int *)v6, (MPI_Datatype)(v7.the_real_datatype), (MPI_Comm) the_real_comm )); 1469 } 1470 virtual Comm &Clone(void) const = 0; 1471 typedef int Copy_attr_function(const Comm& oldcomm, int comm_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, bool& flag); 1472 typedef int Delete_attr_function(Comm& comm, int comm_keyval, void* attribute_val, void* extra_state); 1473 typedef void Errhandler_function(Comm &, int *, ... ); 1474 typedef Errhandler_function Errhandler_fn; 1475 1476 static int Create_keyval( Copy_attr_function *, Delete_attr_function *, 1477 void * ); 1478 1479 static int NULL_COPY_FN( const Comm &oldcomm MPIR_ARGUNUSED, 1480 int keyval MPIR_ARGUNUSED, void *ex MPIR_ARGUNUSED, 1481 void *attr_in MPIR_ARGUNUSED, void *attr_out MPIR_ARGUNUSED, 1482 bool &flag ) { flag = 0; return 0;} 1483 static int NULL_DELETE_FN( Comm &comm MPIR_ARGUNUSED, 1484 int keyval MPIR_ARGUNUSED, void * attr MPIR_ARGUNUSED, 1485 void *ex MPIR_ARGUNUSED ) { return 0; } 1486 static int DUP_FN( const Comm &oldcomm MPIR_ARGUNUSED, 1487 int keyval MPIR_ARGUNUSED, void *ex MPIR_ARGUNUSED, 1488 void *attr_in, void *attr_out, bool &flag ) { flag = 1; 1489 *(void **)attr_out = attr_in; return 0;} 1490 static Errhandler Create_errhandler( Errhandler_function * ); 1491 1492}; 1493 1494class Nullcomm : public Comm { 1495 1496 public: 1497 // new/delete 1498 1499 inline Nullcomm(MPI_Comm obj) : Comm(obj) {} 1500 inline Nullcomm(void) : Comm() {} 1501 1502 virtual ~Nullcomm() {} 1503 // copy/assignment 1504 1505 Nullcomm(const Nullcomm &obj) : Comm(obj) {} 1506 1507 Nullcomm& operator=(const Nullcomm &obj) { 1508 the_real_comm = obj.the_real_comm; return *this; } 1509 1510 // C/C++ cast and assignment 1511 inline operator MPI_Comm*() { return &the_real_comm; } 1512 inline operator MPI_Comm() const { return the_real_comm; } 1513 Nullcomm& operator=(const MPI_Comm& obj) { 1514 the_real_comm = obj; return *this; } 1515 1516// If the compiler does not support variable return types, return a 1517// reference to Comm. The user must then cast this to the correct type 1518// (Standard-conforming C++ compilers support variable return types) 1519#ifdef HAVE_NO_VARIABLE_RETURN_TYPE_SUPPORT 1520 virtual Comm & Clone(void) const { 1521 Comm *clone = new Nullcomm(MPI_COMM_NULL); 1522 return *clone; 1523 }; 1524#else 1525 virtual Nullcomm & Clone(void) const { 1526 Nullcomm *clone = new Nullcomm(); 1527 return *clone; 1528 }; 1529#endif 1530}; 1531 1532class Intercomm : public Comm { 1533 friend class Intracomm; 1534 1535 public: 1536 // new/delete 1537 1538 inline Intercomm(MPI_Comm obj) : Comm(obj) {} 1539 inline Intercomm(void) : Comm() {} 1540 1541 virtual ~Intercomm() {} 1542 // copy/assignment 1543 1544 Intercomm(const Intercomm &obj) : Comm(obj) {} 1545 1546 Intercomm& operator=(const Intercomm &obj) { 1547 the_real_comm = obj.the_real_comm; return *this; } 1548 1549 // C/C++ cast and assignment 1550 inline operator MPI_Comm*() { return &the_real_comm; } 1551 inline operator MPI_Comm() const { return the_real_comm; } 1552 Intercomm& operator=(const MPI_Comm& obj) { 1553 the_real_comm = obj; return *this; } 1554 virtual Intracomm Merge( bool v2 ) const; 1555 virtual Group Get_remote_group( void ) const 1556 { 1557 Group v2; 1558 MPIX_CALLREF( this, MPI_Comm_remote_group( (MPI_Comm) the_real_comm, &(v2.the_real_group) )); 1559 return v2; 1560 } 1561 virtual int Get_remote_size( void ) const 1562 { 1563 int v2; 1564 MPIX_CALLREF( this, MPI_Comm_remote_size( (MPI_Comm) the_real_comm, &v2 )); 1565 return v2; 1566 } 1567 Intercomm Dup( void ) const 1568 { 1569 Intercomm v2; 1570 MPIX_CALLREF( this, MPI_Comm_dup( (MPI_Comm) the_real_comm, &(v2.the_real_comm) )); 1571 return v2; 1572 } 1573 virtual Intercomm Split( int v2, int v3 ) const 1574 { 1575 Intercomm v4; 1576 MPIX_CALLREF( this, MPI_Comm_split( (MPI_Comm) the_real_comm, v2, v3, &(v4.the_real_comm) )); 1577 return v4; 1578 } 1579 1580// If the compiler does not support variable return types, return a 1581// reference to Comm. The user must then cast this to the correct type 1582// (Standard-conforming C++ compilers support variable return types) 1583#ifdef HAVE_NO_VARIABLE_RETURN_TYPE_SUPPORT 1584 virtual Comm & Clone(void) const { 1585 MPI_Comm ncomm; 1586 MPI_Comm_dup( (MPI_Comm)the_real_comm, &ncomm); 1587 Comm *clone = new Intercomm(ncomm); 1588 return *clone; 1589 }; 1590#else 1591 virtual Intercomm & Clone(void) const { 1592 MPI_Comm ncomm; 1593 MPI_Comm_dup( (MPI_Comm)the_real_comm, &ncomm); 1594 Intercomm *clone = new Intercomm(ncomm); 1595 return *clone; 1596 }; 1597#endif 1598}; 1599 1600class Intracomm : public Comm { 1601 friend class Cartcomm; 1602 friend class Graphcomm; 1603 friend class Datatype; 1604 1605 public: 1606 // new/delete 1607 1608 inline Intracomm(MPI_Comm obj) : Comm(obj) {} 1609 inline Intracomm(void) : Comm() {} 1610 1611 virtual ~Intracomm() {} 1612 // copy/assignment 1613 1614 Intracomm(const Intracomm &obj) : Comm(obj) {} 1615 1616 Intracomm& operator=(const Intracomm &obj) { 1617 the_real_comm = obj.the_real_comm; return *this; } 1618 1619 // C/C++ cast and assignment 1620 inline operator MPI_Comm*() { return &the_real_comm; } 1621 inline operator MPI_Comm() const { return the_real_comm; } 1622 Intracomm& operator=(const MPI_Comm& obj) { 1623 the_real_comm = obj; return *this; } 1624 virtual Intercomm Create_intercomm( int v2, const Comm &v3, int v4, int v5 ) const 1625 { 1626 Intercomm v6; 1627 MPIX_CALLREF( this, MPI_Intercomm_create( (MPI_Comm) the_real_comm, v2, (MPI_Comm)(v3.the_real_comm), v4, v5, &(v6.the_real_comm) )); 1628 return v6; 1629 } 1630 virtual Intracomm Split( int v2, int v3 ) const 1631 { 1632 Intracomm v4; 1633 MPIX_CALLREF( this, MPI_Comm_split( (MPI_Comm) the_real_comm, v2, v3, &(v4.the_real_comm) )); 1634 return v4; 1635 } 1636 virtual Graphcomm Create_graph( int v2, const MPICH2_CONST int * v3, const MPICH2_CONST int * v4, bool v5 ) const; 1637 virtual Cartcomm Create_cart( int v2, const MPICH2_CONST int * v3, const bool v4[], bool v5 ) const; 1638 virtual Intracomm Create( const Group &v2 ) const 1639 { 1640 Intracomm v3; 1641 MPIX_CALLREF( this, MPI_Comm_create( (MPI_Comm) the_real_comm, (MPI_Group)(v2.the_real_group), &(v3.the_real_comm) )); 1642 return v3; 1643 } 1644 Intracomm Dup( void ) const 1645 { 1646 Intracomm v2; 1647 MPIX_CALLREF( this, MPI_Comm_dup( (MPI_Comm) the_real_comm, &(v2.the_real_comm) )); 1648 return v2; 1649 } 1650 virtual void Scan( const void* v1, void* v2, int v3, const Datatype &v4, const Op &v5 ) const 1651 { 1652 MPIX_CALLREF( this, MPI_Scan( (void*)v1, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Op)(v5.the_real_op), (MPI_Comm) the_real_comm )); 1653 } 1654 virtual void Exscan( const void * v1, void * v2, int v3, const Datatype &v4, const Op &v5 ) const 1655 { 1656 MPIX_CALLREF( this, MPI_Exscan( (void *)v1, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Op)(v5.the_real_op), (MPI_Comm) the_real_comm )); 1657 } 1658 virtual Intercomm Accept( const char * v1, const Info &v2, int v3 ) const 1659 { 1660 Intercomm v5; 1661 MPIX_CALLREF( this, MPI_Comm_accept( (char *)v1, (MPI_Info)(v2.the_real_info), v3, (MPI_Comm) the_real_comm, &(v5.the_real_comm) )); 1662 return v5; 1663 } 1664 virtual Intercomm Connect( const char * v1, const Info &v2, int v3 ) const 1665 { 1666 Intercomm v5; 1667 MPIX_CALLREF( this, MPI_Comm_connect( (char *)v1, (MPI_Info)(v2.the_real_info), v3, (MPI_Comm) the_real_comm, &(v5.the_real_comm) )); 1668 return v5; 1669 } 1670 1671// If the compiler does not support variable return types, return a 1672// reference to Comm. The user must then cast this to the correct type 1673// (Standard-conforming C++ compilers support variable return types) 1674#ifdef HAVE_NO_VARIABLE_RETURN_TYPE_SUPPORT 1675 virtual Comm & Clone(void) const { 1676 MPI_Comm ncomm; 1677 MPI_Comm_dup( (MPI_Comm)the_real_comm, &ncomm); 1678 Comm *clone = new Intracomm(ncomm); 1679 return *clone; 1680 }; 1681#else 1682 virtual Intracomm & Clone(void) const { 1683 MPI_Comm ncomm; 1684 MPI_Comm_dup( (MPI_Comm)the_real_comm, &ncomm); 1685 Intracomm *clone = new Intracomm(ncomm); 1686 return *clone; 1687 }; 1688#endif 1689 1690Intercomm Spawn(const char* command, const char* argv[], int maxprocs, const MPI::Info& info, int root) const { 1691 Intercomm ic; 1692 MPIX_CALLREF( this, MPI_Comm_spawn( (char *)command, 1693 (char **)argv, 1694 maxprocs, info.the_real_info, root, the_real_comm, 1695 &(ic.the_real_comm), MPI_ERRCODES_IGNORE ) ); 1696 return ic; 1697} 1698Intercomm Spawn(const char* command, const char* argv[], int maxprocs, const MPI::Info& info, int root, int array_of_errcodes[]) const { 1699 Intercomm ic; 1700 MPIX_CALLREF( this, MPI_Comm_spawn( (char *)command, 1701 (char **)argv, 1702 maxprocs, info.the_real_info, root, the_real_comm, 1703 &(ic.the_real_comm), array_of_errcodes ) ); 1704 return ic; 1705} 1706Intercomm Spawn_multiple(int count, const char* array_of_commands[], const char** array_of_argv[], const int array_of_maxprocs[], const MPI::Info array_of_info[], int root) { 1707 Intercomm ic; 1708 MPI_Info *li = new MPI_Info [count]; 1709 int i; 1710 for (i=0; i<count; i++) { 1711 li[i] = array_of_info[i].the_real_info; 1712 } 1713 MPIX_CALLREF( this, MPI_Comm_spawn_multiple( count, 1714 (char **)array_of_commands, 1715 (char ***)array_of_argv, (int *)array_of_maxprocs, 1716 li, root, the_real_comm, &(ic.the_real_comm), 1717 MPI_ERRCODES_IGNORE ) ); 1718 delete [] li; 1719 return ic; 1720} 1721Intercomm Spawn_multiple(int count, const char* array_of_commands[], const char** array_of_argv[], const int array_of_maxprocs[], const MPI::Info array_of_info[], int root, int array_of_errcodes[]) { 1722 Intercomm ic; 1723 MPI_Info *li = new MPI_Info [count]; 1724 int i; 1725 for (i=0; i<count; i++) { 1726 li[i] = array_of_info[i].the_real_info; 1727 } 1728 MPIX_CALLREF( this, MPI_Comm_spawn_multiple( count, 1729 (char **)array_of_commands, 1730 (char ***)array_of_argv, (int *)array_of_maxprocs, 1731 li, root, the_real_comm, &(ic.the_real_comm), 1732 array_of_errcodes ) ); 1733 delete [] li; 1734 return ic; 1735} 1736 1737}; 1738 1739class Grequest : public Request { 1740 1741 public: 1742 // new/delete 1743 1744 inline Grequest(MPI_Request obj) : Request(obj) {} 1745 inline Grequest(void) : Request() {} 1746 1747 virtual ~Grequest() {} 1748 // copy/assignment 1749 1750 Grequest(const Grequest &obj) : Request(obj) {} 1751 1752 Grequest& operator=(const Grequest &obj) { 1753 the_real_request = obj.the_real_request; return *this; } 1754 1755 // logical 1756 bool operator== (const Grequest &obj) { 1757 return (the_real_request == obj.the_real_request); } 1758 bool operator!= (const Grequest &obj) { 1759 return (the_real_request != obj.the_real_request); } 1760 // C/C++ cast and assignment 1761 inline operator MPI_Request*() { return &the_real_request; } 1762 inline operator MPI_Request() const { return the_real_request; } 1763 Grequest& operator=(const MPI_Request& obj) { 1764 the_real_request = obj; return *this; } 1765 virtual void Complete( void ) 1766 { 1767 MPIX_CALLWORLD( MPI_Grequest_complete( (MPI_Request) the_real_request )); 1768 } 1769 1770 typedef int Query_function( void *, Status & ); 1771 typedef int Free_function( void * ); 1772 typedef int Cancel_function( void *, bool ); 1773 1774 Grequest Start( Query_function *query_fn, 1775 Free_function *free_fn, 1776 Cancel_function *cancel_fn, 1777 void *extra_state ); 1778}; 1779 1780class Win { 1781 1782 protected: 1783 MPI_Win the_real_win; 1784 1785 public: 1786 // new/delete 1787 1788 inline Win(MPI_Win obj) : the_real_win(obj) {} 1789 inline Win(void) : the_real_win(MPI_WIN_NULL) {} 1790 1791 virtual ~Win() {} 1792 // copy/assignment 1793 1794 Win(const Win &obj) : the_real_win(obj.the_real_win){} 1795 1796 Win& operator=(const Win &obj) { 1797 the_real_win = obj.the_real_win; return *this; } 1798 1799 // logical 1800 bool operator== (const Win &obj) { 1801 return (the_real_win == obj.the_real_win); } 1802 bool operator!= (const Win &obj) { 1803 return (the_real_win != obj.the_real_win); } 1804 // C/C++ cast and assignment 1805 inline operator MPI_Win*() { return &the_real_win; } 1806 inline operator MPI_Win() const { return the_real_win; } 1807 Win& operator=(const MPI_Win& obj) { 1808 the_real_win = obj; return *this; } 1809 virtual Group Get_group( void ) const 1810 { 1811 Group v2; 1812 MPIX_CALLREF( this, MPI_Win_get_group( (MPI_Win) the_real_win, &(v2.the_real_group) )); 1813 return v2; 1814 } 1815 virtual void Fence( int v1 ) const 1816 { 1817 MPIX_CALLREF( this, MPI_Win_fence( v1, (MPI_Win) the_real_win )); 1818 } 1819 virtual void Start( const Group &v1, int v2 ) const 1820 { 1821 MPIX_CALLREF( this, MPI_Win_start( (MPI_Group)(v1.the_real_group), v2, (MPI_Win) the_real_win )); 1822 } 1823 virtual void Free( void ) 1824 { 1825 MPIX_CALLREF( this, MPI_Win_free( (MPI_Win *) &the_real_win )); 1826 } 1827 virtual void Put( const void * v1, int v2, const Datatype &v3, int v4, Aint v5, int v6, const Datatype &v7 ) const 1828 { 1829 MPIX_CALLREF( this, MPI_Put( (void *)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, v6, (MPI_Datatype)(v7.the_real_datatype), (MPI_Win) the_real_win )); 1830 } 1831 virtual void Wait( void ) const 1832 { 1833 MPIX_CALLREF( this, MPI_Win_wait( (MPI_Win) the_real_win )); 1834 } 1835 virtual bool Test( void ) const 1836 { 1837 int v2; 1838 MPIX_CALLREF( this, MPI_Win_test( (MPI_Win) the_real_win, &v2 )); 1839 return v2!= 0; 1840 } 1841 virtual void Get( void * v1, int v2, const Datatype &v3, int v4, Aint v5, int v6, const Datatype &v7 ) const 1842 { 1843 MPIX_CALLREF( this, MPI_Get( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, v6, (MPI_Datatype)(v7.the_real_datatype), (MPI_Win) the_real_win )); 1844 } 1845 virtual bool Get_attr( int v2, void * v3 ) const 1846 { 1847 int v4; 1848 MPIX_CALLREF( this, MPI_Win_get_attr( (MPI_Win) the_real_win, v2, v3, &v4 )); 1849 return v4!= 0; 1850 } 1851 virtual void Set_attr( int v2, const void * v3 ) 1852 { 1853 MPIX_CALLREF( this, MPI_Win_set_attr( (MPI_Win) the_real_win, v2, (void *)v3 )); 1854 } 1855 virtual void Complete( void ) const 1856 { 1857 MPIX_CALLREF( this, MPI_Win_complete( (MPI_Win) the_real_win )); 1858 } 1859 virtual void Set_errhandler( const Errhandler &v2 ) 1860 { 1861 MPIX_CALLREF( this, MPI_Win_set_errhandler( (MPI_Win) the_real_win, (MPI_Errhandler)(v2.the_real_errhandler) )); 1862 } 1863 virtual void Set_name( const MPICH2_CONST char * v2 ) 1864 { 1865 MPIX_CALLREF( this, MPI_Win_set_name( (MPI_Win) the_real_win, (MPICH2_CONST char *)v2 )); 1866 } 1867 virtual void Accumulate( const void * v1, int v2, const Datatype &v3, int v4, Aint v5, int v6, const Datatype &v7, const Op &v8 ) const 1868 { 1869 MPIX_CALLREF( this, MPI_Accumulate( (void *)v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, v6, (MPI_Datatype)(v7.the_real_datatype), (MPI_Op)(v8.the_real_op), (MPI_Win) the_real_win )); 1870 } 1871 static Win Create( const void * v1, Aint v2, int v3, const Info &v4, const Intracomm &v5 ) 1872 { 1873 Win v6; 1874 MPIX_CALLOBJ( v5, MPI_Win_create( (void *)v1, v2, v3, (MPI_Info)(v4.the_real_info), (MPI_Comm)(v5.the_real_comm), &(v6.the_real_win) )); 1875 return v6; 1876 } 1877 virtual void Call_errhandler( int v2 ) const; 1878 static void Free_keyval( int &v1 ) 1879 { 1880 MPIX_CALLWORLD( MPI_Win_free_keyval( &v1 )); 1881 } 1882 virtual void Post( const Group &v1, int v2 ) const 1883 { 1884 MPIX_CALLREF( this, MPI_Win_post( (MPI_Group)(v1.the_real_group), v2, (MPI_Win) the_real_win )); 1885 } 1886 virtual void Unlock( int v1 ) const 1887 { 1888 MPIX_CALLREF( this, MPI_Win_unlock( v1, (MPI_Win) the_real_win )); 1889 } 1890 virtual void Delete_attr( int v2 ) 1891 { 1892 MPIX_CALLREF( this, MPI_Win_delete_attr( (MPI_Win) the_real_win, v2 )); 1893 } 1894 virtual void Lock( int v1, int v2, int v3 ) const 1895 { 1896 MPIX_CALLREF( this, MPI_Win_lock( v1, v2, v3, (MPI_Win) the_real_win )); 1897 } 1898 virtual Errhandler Get_errhandler( void ) const 1899 { 1900 Errhandler v2; 1901 MPIX_CALLREF( this, MPI_Win_get_errhandler( (MPI_Win) the_real_win, &(v2.the_real_errhandler) )); 1902 return v2; 1903 } 1904 virtual void Get_name( char * v2, int &v3 ) const 1905 { 1906 MPIX_CALLREF( this, MPI_Win_get_name( (MPI_Win) the_real_win, v2, &v3 )); 1907 } 1908 typedef void Errhandler_function(Win &, int *, ... ); 1909 typedef Errhandler_function Errhandler_fn; 1910 1911 static Errhandler Create_errhandler( Errhandler_function * ); 1912 1913 typedef int Copy_attr_function(const Win& oldwin, int win_keyval, void* extra_state, void* attribute_val_in, void* attribute_val_out, bool& flag); 1914 typedef int Delete_attr_function(Win& win, int win_keyval, void* attribute_val, void* extra_state); 1915 1916 static int Create_keyval( Copy_attr_function *, Delete_attr_function *, 1917 void * ); 1918 // These functions are *not* part of MPI-2 but are provided 1919 // because they should have been included 1920 static int NULL_COPY_FN( const Win &oldwin MPIR_ARGUNUSED, 1921 int keyval MPIR_ARGUNUSED, void *ex MPIR_ARGUNUSED, 1922 void *attr_in MPIR_ARGUNUSED, void *attr_out MPIR_ARGUNUSED, 1923 bool &flag ) { flag = 1; return 0;} 1924 static int NULL_DELETE_FN( Win &win MPIR_ARGUNUSED, 1925 int keyval MPIR_ARGUNUSED, void * attr MPIR_ARGUNUSED, 1926 void *ex MPIR_ARGUNUSED ) { return 0; } 1927 static int DUP_FN( const Win &oldwin MPIR_ARGUNUSED, 1928 int keyval MPIR_ARGUNUSED, void *ex MPIR_ARGUNUSED, 1929 void *attr_in, void *attr_out, bool &flag ) { flag = 1; 1930 *(void **)attr_out = attr_in; return 0;} 1931 1932}; 1933#ifndef MPI_FILE_NULL 1934#define MPI_FILE_NULL 0 1935typedef int MPI_File; 1936#endif 1937 1938class File { 1939 1940 protected: 1941 MPI_File the_real_file; 1942 1943 public: 1944 // new/delete 1945 1946 inline File(MPI_File obj) : the_real_file(obj) {} 1947 inline File(void) : the_real_file(MPI_FILE_NULL) {} 1948 1949 virtual ~File() {} 1950 // copy/assignment 1951 1952 File(const File &obj) : the_real_file(obj.the_real_file){} 1953 1954 File& operator=(const File &obj) { 1955 the_real_file = obj.the_real_file; return *this; } 1956 1957 // logical 1958 bool operator== (const File &obj) { 1959 return (the_real_file == obj.the_real_file); } 1960 bool operator!= (const File &obj) { 1961 return (the_real_file != obj.the_real_file); } 1962 // C/C++ cast and assignment 1963 inline operator MPI_File*() { return &the_real_file; } 1964 inline operator MPI_File() const { return the_real_file; } 1965 File& operator=(const MPI_File& obj) { 1966 the_real_file = obj; return *this; } 1967#ifdef MPI_MODE_RDONLY 1968 virtual Aint Get_type_extent( const Datatype &v2 ) const 1969 { 1970 MPI_Aint v3; 1971 MPIX_CALLREF( this, MPI_File_get_type_extent( (MPI_File) the_real_file, (MPI_Datatype)(v2.the_real_datatype), &v3 )); 1972 return v3; 1973 } 1974 virtual void Read_ordered_end( void * v2, Status & v3 ) 1975 { 1976 MPIX_CALLREF( this, MPI_File_read_ordered_end( (MPI_File) the_real_file, v2, (MPI_Status *)&(v3.the_real_status ) )); 1977 } 1978 virtual void Read_ordered_end( void * v2 ) 1979 { 1980 MPIX_CALLREF( this, MPI_File_read_ordered_end( (MPI_File) the_real_file, v2, MPI_STATUS_IGNORE )); 1981 } 1982 virtual void Seek_shared( Offset v2, int v3 ) 1983 { 1984 MPIX_CALLREF( this, MPI_File_seek_shared( (MPI_File) the_real_file, v2, v3 )); 1985 } 1986 virtual void Read_ordered( void * v2, int v3, const Datatype &v4, Status & v5 ) 1987 { 1988 MPIX_CALLREF( this, MPI_File_read_ordered( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Status *)&(v5.the_real_status ) )); 1989 } 1990 virtual void Read_ordered( void * v2, int v3, const Datatype &v4 ) 1991 { 1992 MPIX_CALLREF( this, MPI_File_read_ordered( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype), MPI_STATUS_IGNORE )); 1993 } 1994 virtual Request Iread_shared( void * v2, int v3, const Datatype &v4 ) 1995 { 1996 Request v5; 1997 MPIX_CALLREF( this, MPI_File_iread_shared( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPIO_Request *)&(v5.the_real_request) )); 1998 return v5; 1999 } 2000 virtual Info Get_info( void ) const 2001 { 2002 Info v2; 2003 MPIX_CALLREF( this, MPI_File_get_info( (MPI_File) the_real_file, &(v2.the_real_info) )); 2004 return v2; 2005 } 2006 virtual void Write_ordered_begin( const MPICH2_CONST void * v2, int v3, const Datatype &v4 ) 2007 { 2008 MPIX_CALLREF( this, MPI_File_write_ordered_begin( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype) )); 2009 } 2010 virtual void Set_info( const Info &v2 ) 2011 { 2012 MPIX_CALLREF( this, MPI_File_set_info( (MPI_File) the_real_file, (MPI_Info)(v2.the_real_info) )); 2013 } 2014 virtual void Write_ordered( const MPICH2_CONST void * v2, int v3, const Datatype &v4, Status & v5 ) 2015 { 2016 MPIX_CALLREF( this, MPI_File_write_ordered( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Status *)&(v5.the_real_status ) )); 2017 } 2018 virtual void Write_ordered( const MPICH2_CONST void * v2, int v3, const Datatype &v4 ) 2019 { 2020 MPIX_CALLREF( this, MPI_File_write_ordered( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype), MPI_STATUS_IGNORE )); 2021 } 2022 virtual void Sync( void ) 2023 { 2024 MPIX_CALLREF( this, MPI_File_sync( (MPI_File) the_real_file )); 2025 } 2026 virtual void Read( void * v2, int v3, const Datatype &v4, Status & v5 ) 2027 { 2028 MPIX_CALLREF( this, MPI_File_read( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Status *)&(v5.the_real_status ) )); 2029 } 2030 virtual void Read( void * v2, int v3, const Datatype &v4 ) 2031 { 2032 MPIX_CALLREF( this, MPI_File_read( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype), MPI_STATUS_IGNORE )); 2033 } 2034 virtual void Write_all( const MPICH2_CONST void * v2, int v3, const Datatype &v4, Status & v5 ) 2035 { 2036 MPIX_CALLREF( this, MPI_File_write_all( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Status *)&(v5.the_real_status ) )); 2037 } 2038 virtual void Write_all( const MPICH2_CONST void * v2, int v3, const Datatype &v4 ) 2039 { 2040 MPIX_CALLREF( this, MPI_File_write_all( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype), MPI_STATUS_IGNORE )); 2041 } 2042 virtual Offset Get_size( void ) const 2043 { 2044 MPI_Offset v2; 2045 MPIX_CALLREF( this, MPI_File_get_size( (MPI_File) the_real_file, &v2 )); 2046 return v2; 2047 } 2048 virtual void Write_all_end( const MPICH2_CONST void * v2, Status & v3 ) 2049 { 2050 MPIX_CALLREF( this, MPI_File_write_all_end( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, (MPI_Status *)&(v3.the_real_status ) )); 2051 } 2052 virtual void Write_all_end( const MPICH2_CONST void * v2 ) 2053 { 2054 MPIX_CALLREF( this, MPI_File_write_all_end( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, MPI_STATUS_IGNORE )); 2055 } 2056 static void Delete( const char * v1, const Info &v2 ) 2057 { 2058 MPIX_CALLOBJ( FILE_NULL, MPI_File_delete( (char *)v1, (MPI_Info)(v2.the_real_info) )); 2059 } 2060 virtual void Read_ordered_begin( void * v2, int v3, const Datatype &v4 ) 2061 { 2062 MPIX_CALLREF( this, MPI_File_read_ordered_begin( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype) )); 2063 } 2064 virtual Request Iread_at( Offset v2, void * v3, int v4, const Datatype &v5 ) 2065 { 2066 Request v6; 2067 MPIX_CALLREF( this, MPI_File_iread_at( (MPI_File) the_real_file, v2, v3, v4, (MPI_Datatype)(v5.the_real_datatype), (MPIO_Request *)&(v6.the_real_request) )); 2068 return v6; 2069 } 2070 virtual void Write_at_all_end( const MPICH2_CONST void * v2, Status & v3 ) 2071 { 2072 MPIX_CALLREF( this, MPI_File_write_at_all_end( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, (MPI_Status *)&(v3.the_real_status ) )); 2073 } 2074 virtual void Write_at_all_end( const MPICH2_CONST void * v2 ) 2075 { 2076 MPIX_CALLREF( this, MPI_File_write_at_all_end( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, MPI_STATUS_IGNORE )); 2077 } 2078 virtual Offset Get_position_shared( void ) const 2079 { 2080 MPI_Offset v2; 2081 MPIX_CALLREF( this, MPI_File_get_position_shared( (MPI_File) the_real_file, &v2 )); 2082 return v2; 2083 } 2084 virtual void Write_shared( const MPICH2_CONST void * v2, int v3, const Datatype &v4, Status & v5 ) 2085 { 2086 MPIX_CALLREF( this, MPI_File_write_shared( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Status *)&(v5.the_real_status ) )); 2087 } 2088 virtual void Write_shared( const MPICH2_CONST void * v2, int v3, const Datatype &v4 ) 2089 { 2090 MPIX_CALLREF( this, MPI_File_write_shared( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype), MPI_STATUS_IGNORE )); 2091 } 2092 virtual Request Iwrite_at( Offset v2, const MPICH2_CONST void * v3, int v4, const Datatype &v5 ) 2093 { 2094 Request v6; 2095 MPIX_CALLREF( this, MPI_File_iwrite_at( (MPI_File) the_real_file, (MPI_Offset)v2, (MPICH2_CONST void *)v3, v4, (MPI_Datatype)(v5.the_real_datatype), (MPIO_Request *)&(v6.the_real_request) )); 2096 return v6; 2097 } 2098 virtual void Get_view( Offset & v2, Datatype &v3, Datatype &v4, char * v5 ) const 2099 { 2100 MPIX_CALLREF( this, MPI_File_get_view( (MPI_File) the_real_file, &v2, (MPI_Datatype *)&(v3.the_real_datatype), (MPI_Datatype *)&(v4.the_real_datatype), v5 )); 2101 } 2102 virtual void Call_errhandler( int v2 ) const; 2103 virtual void Write_all_begin( const MPICH2_CONST void * v2, int v3, const Datatype &v4 ) 2104 { 2105 MPIX_CALLREF( this, MPI_File_write_all_begin( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype) )); 2106 } 2107 virtual void Read_all_end( void * v2, Status & v3 ) 2108 { 2109 MPIX_CALLREF( this, MPI_File_read_all_end( (MPI_File) the_real_file, v2, (MPI_Status *)&(v3.the_real_status ) )); 2110 } 2111 virtual void Read_all_end( void * v2 ) 2112 { 2113 MPIX_CALLREF( this, MPI_File_read_all_end( (MPI_File) the_real_file, v2, MPI_STATUS_IGNORE )); 2114 } 2115 virtual Offset Get_byte_offset( const Offset v2 ) const 2116 { 2117 MPI_Offset v3; 2118 MPIX_CALLREF( this, MPI_File_get_byte_offset( (MPI_File) the_real_file, (MPI_Offset)v2, &v3 )); 2119 return v3; 2120 } 2121 virtual Request Iread( void * v2, int v3, const Datatype &v4 ) 2122 { 2123 Request v5; 2124 MPIX_CALLREF( this, MPI_File_iread( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPIO_Request *)&(v5.the_real_request) )); 2125 return v5; 2126 } 2127 virtual void Read_at_all_end( void * v2, Status & v3 ) 2128 { 2129 MPIX_CALLREF( this, MPI_File_read_at_all_end( (MPI_File) the_real_file, v2, (MPI_Status *)&(v3.the_real_status ) )); 2130 } 2131 virtual void Read_at_all_end( void * v2 ) 2132 { 2133 MPIX_CALLREF( this, MPI_File_read_at_all_end( (MPI_File) the_real_file, v2, MPI_STATUS_IGNORE )); 2134 } 2135 virtual void Write_at( Offset v2, const MPICH2_CONST void * v3, int v4, const Datatype &v5, Status & v6 ) 2136 { 2137 MPIX_CALLREF( this, MPI_File_write_at( (MPI_File) the_real_file, v2, (MPICH2_CONST void *)v3, v4, (MPI_Datatype)(v5.the_real_datatype), (MPI_Status *)&(v6.the_real_status ) )); 2138 } 2139 virtual void Write_at( Offset v2, const MPICH2_CONST void * v3, int v4, const Datatype &v5 ) 2140 { 2141 MPIX_CALLREF( this, MPI_File_write_at( (MPI_File) the_real_file, v2, (MPICH2_CONST void *)v3, v4, (MPI_Datatype)(v5.the_real_datatype), MPI_STATUS_IGNORE )); 2142 } 2143 virtual void Write_at_all_begin( Offset v2, const MPICH2_CONST void * v3, int v4, const Datatype &v5 ) 2144 { 2145 MPIX_CALLREF( this, MPI_File_write_at_all_begin( (MPI_File) the_real_file, v2, (MPICH2_CONST void *)v3, v4, (MPI_Datatype)(v5.the_real_datatype) )); 2146 } 2147 virtual Errhandler Get_errhandler( void ) const 2148 { 2149 Errhandler v2; 2150 MPIX_CALLREF( this, MPI_File_get_errhandler( (MPI_File) the_real_file, &(v2.the_real_errhandler) )); 2151 return v2; 2152 } 2153 virtual int Get_amode( void ) const 2154 { 2155 int v2; 2156 MPIX_CALLREF( this, MPI_File_get_amode( (MPI_File) the_real_file, &v2 )); 2157 return v2; 2158 } 2159 virtual void Set_atomicity( bool v2 ) 2160 { 2161 int l2; 2162 l2 = (v2 == true) ? 1 : 0; 2163 MPIX_CALLREF( this, MPI_File_set_atomicity( (MPI_File) the_real_file, l2 )); 2164 } 2165 virtual Group Get_group( void ) const 2166 { 2167 Group v2; 2168 MPIX_CALLREF( this, MPI_File_get_group( (MPI_File) the_real_file, &(v2.the_real_group) )); 2169 return v2; 2170 } 2171 virtual Offset Get_position( void ) const 2172 { 2173 MPI_Offset v2; 2174 MPIX_CALLREF( this, MPI_File_get_position( (MPI_File) the_real_file, &v2 )); 2175 return v2; 2176 } 2177 static File Open( const Intracomm &v1, const MPICH2_CONST char * v2, int v3, const Info &v4 ) 2178 { 2179 File v5; 2180 MPIX_CALLOBJ( FILE_NULL, MPI_File_open( (MPI_Comm)(v1.the_real_comm), (MPICH2_CONST char *)v2, v3, (MPI_Info)(v4.the_real_info), &(v5.the_real_file) )); 2181 return v5; 2182 } 2183 virtual void Seek( Offset v2, int v3 ) 2184 { 2185 MPIX_CALLREF( this, MPI_File_seek( (MPI_File) the_real_file, v2, v3 )); 2186 } 2187 virtual void Read_all_begin( void * v2, int v3, const Datatype &v4 ) 2188 { 2189 MPIX_CALLREF( this, MPI_File_read_all_begin( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype) )); 2190 } 2191 virtual void Read_at_all_begin( Offset v2, void * v3, int v4, const Datatype &v5 ) 2192 { 2193 MPIX_CALLREF( this, MPI_File_read_at_all_begin( (MPI_File) the_real_file, v2, v3, v4, (MPI_Datatype)(v5.the_real_datatype) )); 2194 } 2195 virtual void Read_all( void * v2, int v3, const Datatype &v4, Status & v5 ) 2196 { 2197 MPIX_CALLREF( this, MPI_File_read_all( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Status *)&(v5.the_real_status ) )); 2198 } 2199 virtual void Read_all( void * v2, int v3, const Datatype &v4 ) 2200 { 2201 MPIX_CALLREF( this, MPI_File_read_all( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype), MPI_STATUS_IGNORE )); 2202 } 2203 virtual void Preallocate( Offset v2 ) 2204 { 2205 MPIX_CALLREF( this, MPI_File_preallocate( (MPI_File) the_real_file, v2 )); 2206 } 2207 virtual void Read_at_all( Offset v2, void * v3, int v4, const Datatype &v5, Status & v6 ) 2208 { 2209 MPIX_CALLREF( this, MPI_File_read_at_all( (MPI_File) the_real_file, v2, v3, v4, (MPI_Datatype)(v5.the_real_datatype), (MPI_Status *)&(v6.the_real_status ) )); 2210 } 2211 virtual void Read_at_all( Offset v2, void * v3, int v4, const Datatype &v5 ) 2212 { 2213 MPIX_CALLREF( this, MPI_File_read_at_all( (MPI_File) the_real_file, v2, v3, v4, (MPI_Datatype)(v5.the_real_datatype), MPI_STATUS_IGNORE )); 2214 } 2215 virtual void Read_shared( void * v2, int v3, const Datatype &v4, Status & v5 ) 2216 { 2217 MPIX_CALLREF( this, MPI_File_read_shared( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Status *)&(v5.the_real_status ) )); 2218 } 2219 virtual void Read_shared( void * v2, int v3, const Datatype &v4 ) 2220 { 2221 MPIX_CALLREF( this, MPI_File_read_shared( (MPI_File) the_real_file, v2, v3, (MPI_Datatype)(v4.the_real_datatype), MPI_STATUS_IGNORE )); 2222 } 2223 virtual Request Iwrite( const MPICH2_CONST void * v2, int v3, const Datatype &v4 ) 2224 { 2225 Request v5; 2226 MPIX_CALLREF( this, MPI_File_iwrite( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPIO_Request *)&(v5.the_real_request) )); 2227 return v5; 2228 } 2229 virtual Request Iwrite_shared( const MPICH2_CONST void * v2, int v3, const Datatype &v4 ) 2230 { 2231 Request v5; 2232 MPIX_CALLREF( this, MPI_File_iwrite_shared( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPIO_Request *)&(v5.the_real_request) )); 2233 return v5; 2234 } 2235 virtual void Set_errhandler( const Errhandler &v2 ) 2236 { 2237 MPIX_CALLREF( this, MPI_File_set_errhandler( (MPI_File) the_real_file, (MPI_Errhandler)(v2.the_real_errhandler) )); 2238 } 2239 virtual void Write_at_all( Offset v2, const MPICH2_CONST void * v3, int v4, const Datatype &v5, Status & v6 ) 2240 { 2241 MPIX_CALLREF( this, MPI_File_write_at_all( (MPI_File) the_real_file, v2, (MPICH2_CONST void *)v3, v4, (MPI_Datatype)(v5.the_real_datatype), (MPI_Status *)&(v6.the_real_status ) )); 2242 } 2243 virtual void Write_at_all( Offset v2, const MPICH2_CONST void * v3, int v4, const Datatype &v5 ) 2244 { 2245 MPIX_CALLREF( this, MPI_File_write_at_all( (MPI_File) the_real_file, v2, (MPICH2_CONST void *)v3, v4, (MPI_Datatype)(v5.the_real_datatype), MPI_STATUS_IGNORE )); 2246 } 2247 virtual void Set_size( Offset v2 ) 2248 { 2249 MPIX_CALLREF( this, MPI_File_set_size( (MPI_File) the_real_file, v2 )); 2250 } 2251 virtual void Set_view( Offset v2, const Datatype &v3, const Datatype v4, const MPICH2_CONST char * v5, const Info &v6 ) 2252 { 2253 MPIX_CALLREF( this, MPI_File_set_view( (MPI_File) the_real_file, v2, (MPI_Datatype)(v3.the_real_datatype), (MPI_Datatype)v4, (MPICH2_CONST char *)v5, (MPI_Info)(v6.the_real_info) )); 2254 } 2255 virtual void Read_at( Offset v2, void * v3, int v4, const Datatype &v5, Status & v6 ) 2256 { 2257 MPIX_CALLREF( this, MPI_File_read_at( (MPI_File) the_real_file, v2, v3, v4, (MPI_Datatype)(v5.the_real_datatype), (MPI_Status *)&(v6.the_real_status ) )); 2258 } 2259 virtual void Read_at( Offset v2, void * v3, int v4, const Datatype &v5 ) 2260 { 2261 MPIX_CALLREF( this, MPI_File_read_at( (MPI_File) the_real_file, v2, v3, v4, (MPI_Datatype)(v5.the_real_datatype), MPI_STATUS_IGNORE )); 2262 } 2263 virtual void Close( void ) 2264 { 2265 MPIX_CALLREF( this, MPI_File_close( (MPI_File *) &the_real_file )); 2266 } 2267 virtual void Write_ordered_end( const MPICH2_CONST void * v2, Status & v3 ) 2268 { 2269 MPIX_CALLREF( this, MPI_File_write_ordered_end( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, (MPI_Status *)&(v3.the_real_status ) )); 2270 } 2271 virtual void Write_ordered_end( const MPICH2_CONST void * v2 ) 2272 { 2273 MPIX_CALLREF( this, MPI_File_write_ordered_end( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, MPI_STATUS_IGNORE )); 2274 } 2275 virtual void Write( const MPICH2_CONST void * v2, int v3, const Datatype &v4, Status & v5 ) 2276 { 2277 MPIX_CALLREF( this, MPI_File_write( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype), (MPI_Status *)&(v5.the_real_status ) )); 2278 } 2279 virtual void Write( const MPICH2_CONST void * v2, int v3, const Datatype &v4 ) 2280 { 2281 MPIX_CALLREF( this, MPI_File_write( (MPI_File) the_real_file, (MPICH2_CONST void *)v2, v3, (MPI_Datatype)(v4.the_real_datatype), MPI_STATUS_IGNORE )); 2282 } 2283 virtual bool Get_atomicity( void ) const 2284 { 2285 int v2; 2286 MPIX_CALLREF( this, MPI_File_get_atomicity( (MPI_File) the_real_file, &v2 )); 2287 return v2!= 0; 2288 } 2289 typedef void Errhandler_function(File &, int *, ... ); 2290 typedef Errhandler_function Errhandler_fn; 2291 2292 static Errhandler Create_errhandler( Errhandler_function * ); 2293 2294#endif 2295}; 2296 2297class Graphcomm : public Intracomm { 2298 2299 public: 2300 // new/delete 2301 2302 inline Graphcomm(MPI_Comm obj) : Intracomm(obj) {} 2303 inline Graphcomm(void) : Intracomm() {} 2304 2305 virtual ~Graphcomm() {} 2306 // copy/assignment 2307 2308 Graphcomm(const Graphcomm &obj) : Intracomm(obj) {} 2309 2310 Graphcomm& operator=(const Graphcomm &obj) { 2311 the_real_comm = obj.the_real_comm; return *this; } 2312 2313 // C/C++ cast and assignment 2314 inline operator MPI_Comm*() { return &the_real_comm; } 2315 inline operator MPI_Comm() const { return the_real_comm; } 2316 Graphcomm& operator=(const MPI_Comm& obj) { 2317 the_real_comm = obj; return *this; } 2318 virtual void Get_dims( int * v2, int * v3 ) const 2319 { 2320 MPIX_CALLREF( this, MPI_Graphdims_get( (MPI_Comm) the_real_comm, v2, v3 )); 2321 } 2322 virtual void Get_topo( int v2, int v3, int * v4, int * v5 ) const 2323 { 2324 MPIX_CALLREF( this, MPI_Graph_get( (MPI_Comm) the_real_comm, v2, v3, v4, v5 )); 2325 } 2326 virtual int Map( int v2, const MPICH2_CONST int * v3, const MPICH2_CONST int * v4 ) const 2327 { 2328 int v5; 2329 MPIX_CALLREF( this, MPI_Graph_map( (MPI_Comm) the_real_comm, v2, (MPICH2_CONST int *)v3, (MPICH2_CONST int *)v4, &v5 )); 2330 return v5; 2331 } 2332 virtual void Get_neighbors( int v2, int v3, int * v4 ) const 2333 { 2334 MPIX_CALLREF( this, MPI_Graph_neighbors( (MPI_Comm) the_real_comm, v2, v3, v4 )); 2335 } 2336 virtual int Get_neighbors_count( int v2 ) const 2337 { 2338 int v3; 2339 MPIX_CALLREF( this, MPI_Graph_neighbors_count( (MPI_Comm) the_real_comm, v2, &v3 )); 2340 return v3; 2341 } 2342 Graphcomm Dup( void ) const 2343 { 2344 Graphcomm v2; 2345 MPIX_CALLREF( this, MPI_Comm_dup( (MPI_Comm) the_real_comm, &(v2.the_real_comm) )); 2346 return v2; 2347 } 2348 2349// If the compiler does not support variable return types, return a 2350// reference to Comm. The user must then cast this to the correct type 2351// (Standard-conforming C++ compilers support variable return types) 2352#ifdef HAVE_NO_VARIABLE_RETURN_TYPE_SUPPORT 2353 virtual Comm & Clone(void) const { 2354 MPI_Comm ncomm; 2355 MPI_Comm_dup( (MPI_Comm)the_real_comm, &ncomm); 2356 Comm *clone = new Graphcomm(ncomm); 2357 return *clone; 2358 }; 2359#else 2360 virtual Graphcomm & Clone(void) const { 2361 MPI_Comm ncomm; 2362 MPI_Comm_dup( (MPI_Comm)the_real_comm, &ncomm); 2363 Graphcomm *clone = new Graphcomm(ncomm); 2364 return *clone; 2365 }; 2366#endif 2367}; 2368 2369class Cartcomm : public Intracomm { 2370 2371 public: 2372 // new/delete 2373 2374 inline Cartcomm(MPI_Comm obj) : Intracomm(obj) {} 2375 inline Cartcomm(void) : Intracomm() {} 2376 2377 virtual ~Cartcomm() {} 2378 // copy/assignment 2379 2380 Cartcomm(const Cartcomm &obj) : Intracomm(obj) {} 2381 2382 Cartcomm& operator=(const Cartcomm &obj) { 2383 the_real_comm = obj.the_real_comm; return *this; } 2384 2385 // C/C++ cast and assignment 2386 inline operator MPI_Comm*() { return &the_real_comm; } 2387 inline operator MPI_Comm() const { return the_real_comm; } 2388 Cartcomm& operator=(const MPI_Comm& obj) { 2389 the_real_comm = obj; return *this; } 2390 virtual void Get_coords( int v2, int v3, int * v4 ) const 2391 { 2392 MPIX_CALLREF( this, MPI_Cart_coords( (MPI_Comm) the_real_comm, v2, v3, v4 )); 2393 } 2394 virtual int Get_cart_rank( const MPICH2_CONST int * v2 ) const 2395 { 2396 int v3; 2397 MPIX_CALLREF( this, MPI_Cart_rank( (MPI_Comm) the_real_comm, (MPICH2_CONST int *)v2, &v3 )); 2398 return v3; 2399 } 2400 virtual int Get_dim( void ) const 2401 { 2402 int v2; 2403 MPIX_CALLREF( this, MPI_Cartdim_get( (MPI_Comm) the_real_comm, &v2 )); 2404 return v2; 2405 } 2406 virtual void Get_topo( int v2, int * v3, bool v4[], int * v5 ) const 2407 { 2408 int *l4 = new int[v2]; 2409 MPIX_CALLREF( this, MPI_Cart_get( (MPI_Comm) the_real_comm, v2, v3, l4, v5 )); 2410 { 2411 int i4; 2412 for (i4=0;i4<v2;i4++) { 2413 // Unfortunately, at least one C++ compiler (Microsoft's) 2414 // generates warning messages when the type size changes 2415 // even when an explicit cast is used. To avoid these messages, we 2416 // cause the generated code to explicitly compute a 2417 // boolean value 2418 v4[i4] = l4[i4] != 0; 2419 } 2420 delete[] l4; 2421 } 2422 } 2423 virtual int Map( int v2, const MPICH2_CONST int * v3, const bool v4[] ) const 2424 { 2425 int v5; 2426 int *l4 = new int[v2]; 2427 { 2428 int i4; 2429 for (i4=0;i4<v2;i4++) { 2430 l4[i4] = v4[i4] == true ? 1 : 0; 2431 } 2432 } 2433 MPIX_CALLREF( this, MPI_Cart_map( (MPI_Comm) the_real_comm, v2, (MPICH2_CONST int *)v3, l4, &v5 )); 2434 2435 delete[] l4; 2436 return v5; 2437 } 2438 virtual Cartcomm Sub( const bool v2[] ) const 2439 { 2440 Cartcomm v3; 2441 int *l2 = new int[10]; 2442 { 2443 int i2; 2444 for (i2=0;i2<10;i2++) { 2445 l2[i2] = v2[i2] == true ? 1 : 0; 2446 } 2447 } 2448 MPIX_CALLREF( this, MPI_Cart_sub( (MPI_Comm) the_real_comm, l2, &(v3.the_real_comm) )); 2449 2450 delete[] l2; 2451 return v3; 2452 } 2453 virtual void Shift( int v2, int v3, int &v4, int &v5 ) const 2454 { 2455 MPIX_CALLREF( this, MPI_Cart_shift( (MPI_Comm) the_real_comm, v2, v3, &v4, &v5 )); 2456 } 2457 Cartcomm Dup( void ) const 2458 { 2459 Cartcomm v2; 2460 MPIX_CALLREF( this, MPI_Comm_dup( (MPI_Comm) the_real_comm, &(v2.the_real_comm) )); 2461 return v2; 2462 } 2463 2464// If the compiler does not support variable return types, return a 2465// reference to Comm. The user must then cast this to the correct type 2466// (Standard-conforming C++ compilers support variable return types) 2467#ifdef HAVE_NO_VARIABLE_RETURN_TYPE_SUPPORT 2468 virtual Comm & Clone(void) const { 2469 MPI_Comm ncomm; 2470 MPI_Comm_dup( (MPI_Comm)the_real_comm, &ncomm); 2471 Comm *clone = new Cartcomm(ncomm); 2472 return *clone; 2473 }; 2474#else 2475 virtual Cartcomm & Clone(void) const { 2476 MPI_Comm ncomm; 2477 MPI_Comm_dup( (MPI_Comm)the_real_comm, &ncomm); 2478 Cartcomm *clone = new Cartcomm(ncomm); 2479 return *clone; 2480 }; 2481#endif 2482}; 2483extern int Add_error_class( void ) ; 2484extern void* Alloc_mem( Aint v1, const Info &v2 ) ; 2485extern void Lookup_name( const char * v1, const Info &v2, char * v3 ) ; 2486extern void Publish_name( const char * v1, const Info &v2, const MPICH2_CONST char * v3 ) ; 2487extern void Unpublish_name( const char * v1, const Info &v2, const MPICH2_CONST char * v3 ) ; 2488extern Aint Get_address( void * v1 ) ; 2489extern void Add_error_string( int v1, const MPICH2_CONST char * v2 ) ; 2490extern int Query_thread( void ) ; 2491extern void Close_port( const char * v1 ) ; 2492extern int Add_error_code( int v1 ) ; 2493extern void Free_mem( void * v1 ) ; 2494extern void Open_port( const Info &v1, char * v2 ) ; 2495extern bool Is_finalized( void ) ; 2496extern bool Is_thread_main( void ) ; 2497 2498#ifdef MPI_MODE_RDONLY 2499typedef int Datarep_extent_function( const Datatype&, Aint&, void *); 2500typedef int Datarep_conversion_function( void *, Datatype &, int, void *, 2501 Offset, void * ); 2502#endif 2503 2504 2505extern Datatype CHAR; 2506extern Datatype UNSIGNED_CHAR; 2507extern Datatype BYTE; 2508extern Datatype SHORT; 2509extern Datatype UNSIGNED_SHORT; 2510extern Datatype INT; 2511extern Datatype UNSIGNED; 2512extern Datatype LONG; 2513extern Datatype UNSIGNED_LONG; 2514extern Datatype FLOAT; 2515extern Datatype DOUBLE; 2516extern Datatype LONG_DOUBLE; 2517extern Datatype LONG_LONG_INT; 2518extern Datatype LONG_LONG; 2519extern Datatype PACKED; 2520extern Datatype LB; 2521extern Datatype UB; 2522extern Datatype FLOAT_INT; 2523extern Datatype DOUBLE_INT; 2524extern Datatype LONG_INT; 2525extern Datatype SHORT_INT; 2526extern Datatype LONG_DOUBLE_INT; 2527extern Datatype REAL4; 2528extern Datatype REAL8; 2529extern Datatype REAL16; 2530extern Datatype COMPLEX8; 2531extern Datatype COMPLEX16; 2532extern Datatype COMPLEX32; 2533extern Datatype INTEGER1; 2534extern Datatype INTEGER2; 2535extern Datatype INTEGER4; 2536extern Datatype INTEGER8; 2537extern Datatype INTEGER16; 2538extern Datatype WCHAR; 2539extern Datatype SIGNED_CHAR; 2540extern Datatype UNSIGNED_LONG_LONG; 2541extern Datatype TWOINT; 2542extern Datatype BOOL; 2543#define MPIR_CXX_BOOL @MPIR_CXX_BOOL@ 2544extern Datatype COMPLEX; 2545#define MPIR_CXX_COMPLEX @MPIR_CXX_COMPLEX@ 2546extern Datatype DOUBLE_COMPLEX; 2547#define MPIR_CXX_DOUBLE_COMPLEX @MPIR_CXX_DOUBLE_COMPLEX@ 2548extern Datatype LONG_DOUBLE_COMPLEX; 2549#define MPIR_CXX_LONG_DOUBLE_COMPLEX @MPIR_CXX_LONG_DOUBLE_COMPLEX@ 2550extern Datatype DATATYPE_NULL; 2551 2552#if @FORTRAN_BINDING@ 2553extern Datatype INTEGER; 2554extern Datatype REAL; 2555extern Datatype DOUBLE_PRECISION; 2556extern Datatype F_COMPLEX; 2557extern Datatype F_DOUBLE_COMPLEX; 2558extern Datatype LOGICAL; 2559extern Datatype CHARACTER; 2560extern Datatype TWOREAL; 2561extern Datatype TWODOUBLE_PRECISION; 2562extern Datatype TWOINTEGER; 2563#endif 2564extern const Op MAX; 2565extern const Op MIN; 2566extern const Op SUM; 2567extern const Op PROD; 2568extern const Op LAND; 2569extern const Op BAND; 2570extern const Op LOR; 2571extern const Op BOR; 2572extern const Op LXOR; 2573extern const Op BXOR; 2574extern const Op MINLOC; 2575extern const Op MAXLOC; 2576extern const Op REPLACE; 2577extern const Op OP_NULL; 2578extern Intracomm COMM_SELF; 2579extern const Group GROUP_EMPTY; 2580extern const Nullcomm COMM_NULL; 2581extern const Group GROUP_NULL; 2582extern const Request REQUEST_NULL; 2583extern const Errhandler ERRHANDLER_NULL; 2584extern const Errhandler ERRORS_RETURN; 2585extern const Errhandler ERRORS_ARE_FATAL; 2586extern const Errhandler ERRORS_THROW_EXCEPTIONS; 2587extern const Info INFO_NULL; 2588extern const Win WIN_NULL; 2589extern const int BSEND_OVERHEAD; 2590extern const int KEYVAL_INVALID; 2591extern const int CART; 2592extern const int GRAPH; 2593extern const int IDENT; 2594extern const int SIMILAR; 2595extern const int CONGRUENT; 2596extern const int UNEQUAL; 2597extern const int PROC_NULL; 2598extern const int ANY_TAG; 2599extern const int ANY_SOURCE; 2600extern const int ROOT; 2601extern const int TAG_UB; 2602extern const int IO; 2603extern const int HOST; 2604extern const int WTIME_IS_GLOBAL; 2605extern const int UNIVERSE_SIZE; 2606extern const int LASTUSEDCODE; 2607extern const int APPNUM; 2608extern const int MAX_PROCESSOR_NAME; 2609extern const int MAX_ERROR_STRING; 2610extern const int MAX_PORT_NAME; 2611extern const int MAX_OBJECT_NAME; 2612extern const int MAX_INFO_VAL; 2613extern const int MAX_INFO_KEY; 2614extern const int UNDEFINED; 2615extern const int LOCK_EXCLUSIVE; 2616extern const int LOCK_SHARED; 2617extern const int WIN_BASE; 2618extern const int WIN_DISP_UNIT; 2619extern const int WIN_SIZE; 2620extern const int SUCCESS; 2621extern const int ERR_BUFFER; 2622extern const int ERR_COUNT; 2623extern const int ERR_TYPE; 2624extern const int ERR_TAG; 2625extern const int ERR_COMM; 2626extern const int ERR_RANK; 2627extern const int ERR_REQUEST; 2628extern const int ERR_ROOT; 2629extern const int ERR_GROUP; 2630extern const int ERR_OP; 2631extern const int ERR_TOPOLOGY; 2632extern const int ERR_DIMS; 2633extern const int ERR_ARG; 2634extern const int ERR_UNKNOWN; 2635extern const int ERR_TRUNCATE; 2636extern const int ERR_OTHER; 2637extern const int ERR_INTERN; 2638extern const int ERR_PENDING; 2639extern const int ERR_IN_STATUS; 2640extern const int ERR_LASTCODE; 2641extern const int ERR_FILE; 2642extern const int ERR_ACCESS; 2643extern const int ERR_AMODE; 2644extern const int ERR_BAD_FILE; 2645extern const int ERR_FILE_EXISTS; 2646extern const int ERR_FILE_IN_USE; 2647extern const int ERR_NO_SPACE; 2648extern const int ERR_NO_SUCH_FILE; 2649extern const int ERR_IO; 2650extern const int ERR_READ_ONLY; 2651extern const int ERR_CONVERSION; 2652extern const int ERR_DUP_DATAREP; 2653extern const int ERR_UNSUPPORTED_DATAREP; 2654extern const int ERR_INFO; 2655extern const int ERR_INFO_KEY; 2656extern const int ERR_INFO_VALUE; 2657extern const int ERR_INFO_NOKEY; 2658extern const int ERR_NAME; 2659extern const int ERR_NO_MEM; 2660extern const int ERR_NOT_SAME; 2661extern const int ERR_PORT; 2662extern const int ERR_QUOTA; 2663extern const int ERR_SERVICE; 2664extern const int ERR_SPAWN; 2665extern const int ERR_UNSUPPORTED_OPERATION; 2666extern const int ERR_WIN; 2667extern const int ERR_BASE; 2668extern const int ERR_LOCKTYPE; 2669extern const int ERR_KEYVAL; 2670extern const int ERR_RMA_CONFLICT; 2671extern const int ERR_RMA_SYNC; 2672extern const int ERR_SIZE; 2673extern const int ERR_DISP; 2674extern const int ERR_ASSERT; 2675extern const int TYPECLASS_REAL; 2676extern const int TYPECLASS_INTEGER; 2677extern const int TYPECLASS_COMPLEX; 2678#if defined(MPI_SEEK_SET) && !defined(MPICH_IGNORE_CXX_SEEK) && !defined(SEEK_SET) 2679extern const int SEEK_SET; 2680extern const int SEEK_END; 2681extern const int SEEK_CUR; 2682#endif 2683extern const int DISTRIBUTE_BLOCK; 2684extern const int DISTRIBUTE_CYCLIC; 2685extern const int DISTRIBUTE_DFLT_DARG; 2686extern const int DISTRIBUTE_NONE; 2687extern const int ORDER_C; 2688extern const int ORDER_FORTRAN; 2689// Include these only if MPI-IO is available 2690#ifdef MPI_MODE_RDONLY 2691extern const int MAX_DATAREP_STRING; 2692extern const MPI_Offset DISPLACEMENT_CURRENT; 2693extern const int MODE_APPEND; 2694extern const int MODE_CREATE; 2695extern const int MODE_DELETE_ON_CLOSE; 2696extern const int MODE_EXCL; 2697extern const int MODE_RDONLY; 2698extern const int MODE_RDWR; 2699extern const int MODE_SEQUENTIAL; 2700extern const int MODE_UNIQUE_OPEN; 2701extern const int MODE_WRONLY; 2702#endif // IO 2703extern const int MODE_NOCHECK; 2704extern const int MODE_NOPRECEDE; 2705extern const int MODE_NOPUT; 2706extern const int MODE_NOSTORE; 2707extern const int MODE_NOSUCCEED; 2708extern const int COMM_TYPE_SHARED; 2709extern const int COMBINER_CONTIGUOUS; 2710extern const int COMBINER_DARRAY; 2711extern const int COMBINER_DUP; 2712extern const int COMBINER_F90_COMPLEX; 2713extern const int COMBINER_F90_INTEGER; 2714extern const int COMBINER_F90_REAL; 2715extern const int COMBINER_HINDEXED_INTEGER; 2716extern const int COMBINER_HINDEXED; 2717extern const int COMBINER_HVECTOR_INTEGER; 2718extern const int COMBINER_HVECTOR; 2719extern const int COMBINER_INDEXED_BLOCK; 2720extern const int COMBINER_INDEXED; 2721extern const int COMBINER_NAMED; 2722extern const int COMBINER_RESIZED; 2723extern const int COMBINER_STRUCT_INTEGER; 2724extern const int COMBINER_STRUCT; 2725extern const int COMBINER_SUBARRAY; 2726extern const int COMBINER_VECTOR; 2727extern const int COMBINER_HINDEXED_BLOCK; 2728extern const int THREAD_FUNNELED; 2729extern const int THREAD_MULTIPLE; 2730extern const int THREAD_SERIALIZED; 2731extern const int THREAD_SINGLE; 2732extern const char ** const ARGV_NULL; 2733extern const char *** const ARGVS_NULL; 2734extern void * const BOTTOM; 2735extern void * const IN_PLACE; 2736extern void Init(void); 2737extern void Init(int &, char **& ); 2738extern int Init_thread(int); 2739extern int Init_thread(int &, char **&, int ); 2740extern double Wtime(void); 2741extern double Wtick(void); 2742} // namespace MPI 2743