📄 mpicxx.h
字号:
the_real_errhandler = obj; return *this; } void Free( void ) { MPIX_CALL( MPI_Errhandler_free( (MPI_Errhandler *) &the_real_errhandler )); }};class Request { friend class Comm; protected: MPI_Request the_real_request; public: // new/delete inline Request(MPI_Request obj) { the_real_request = obj; } inline Request(void) {the_real_request = MPI_REQUEST_NULL;} virtual ~Request() {} // copy/assignment Request :: Request(const Request &obj) { the_real_request = obj.the_real_request; } Request& Request::operator=(const Request &obj) { the_real_request = obj.the_real_request; return *this; } // logical bool operator== (const Request &obj) { return (the_real_request == obj.the_real_request); } bool operator!= (const Request &obj) { return (the_real_request != obj.the_real_request); } // C/C++ cast and assignment inline operator MPI_Request*() { return &the_real_request; } inline operator MPI_Request() { return the_real_request; } Request& Request::operator=(const MPI_Request& obj) { the_real_request = obj; return *this; } void Cancel( void ) { MPIX_CALL( MPI_Cancel( (MPI_Request *) &the_real_request )); } void Free( void ) { MPIX_CALL( MPI_Request_free( (MPI_Request *) &the_real_request )); } void Wait( Status & v2 ) { MPIX_CALL( MPI_Wait( (MPI_Request *) &the_real_request, (MPI_Status *)&(v2.the_real_status ) )); } int Test( Status & v3 ) { int v2; MPIX_CALL( MPI_Test( (MPI_Request *) &the_real_request, &v2, (MPI_Status *)&(v3.the_real_status ) )); return v2; }};class Prequest : public Request { protected: MPI_Request the_real_prequest; public: // new/delete inline Prequest(MPI_Request obj) { the_real_prequest = obj; } inline Prequest(void) {the_real_prequest = MPI_REQUEST_NULL;} virtual ~Prequest() {} // copy/assignment Prequest :: Prequest(const Prequest &obj) { the_real_prequest = obj.the_real_prequest; } Prequest& Prequest::operator=(const Prequest &obj) { the_real_prequest = obj.the_real_prequest; return *this; } // logical bool operator== (const Prequest &obj) { return (the_real_prequest == obj.the_real_prequest); } bool operator!= (const Prequest &obj) { return (the_real_prequest != obj.the_real_prequest); } // C/C++ cast and assignment inline operator MPI_Request*() { return &the_real_prequest; } inline operator MPI_Request() { return the_real_prequest; } Prequest& Prequest::operator=(const MPI_Request& obj) { the_real_prequest = obj; return *this; }};class Comm { friend class Cartcomm; friend class Intercomm; friend class Intracomm; friend class Graphcomm; friend class Datatype; protected: MPI_Comm the_real_comm; public: // new/delete inline Comm(MPI_Comm obj) { the_real_comm = obj; } inline Comm(void) {the_real_comm = MPI_COMM_NULL;} virtual ~Comm() {} // copy/assignment Comm :: Comm(const Comm &obj) { the_real_comm = obj.the_real_comm; } Comm& Comm::operator=(const Comm &obj) { the_real_comm = obj.the_real_comm; return *this; } // logical bool operator== (const Comm &obj) { return (the_real_comm == obj.the_real_comm); } bool operator!= (const Comm &obj) { return (the_real_comm != obj.the_real_comm); } // C/C++ cast and assignment inline operator MPI_Comm*() { return &the_real_comm; } inline operator MPI_Comm() { return the_real_comm; } Comm& Comm::operator=(const MPI_Comm& obj) { the_real_comm = obj; return *this; } void Sendrecv_repl( void* v1, int v2, Datatype v3, int v4, int v5, int v6, int v7, Status & v9 ) { MPIX_CALL( 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 ) )); } void Abort( int v2 ) { MPIX_CALL( MPI_Abort( (MPI_Comm) the_real_comm, v2 )); } Request Issend( void* v1, int v2, Datatype v3, int v4, int v5 ) { Request *v7 = new Request; MPIX_CALL( MPI_Issend( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7->the_real_request) )); return *v7; } void Rsend( void* v1, int v2, Datatype v3, int v4, int v5 ) { MPIX_CALL( MPI_Rsend( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm )); } int Get_size( void ) { int v2; MPIX_CALL( MPI_Comm_size( (MPI_Comm) the_real_comm, &v2 )); return v2; } void Send( void* v1, int v2, Datatype v3, int v4, int v5 ) { MPIX_CALL( MPI_Send( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm )); } int Get_topology( void ) { int v2; MPIX_CALL( MPI_Topo_test( (MPI_Comm) the_real_comm, &v2 )); return v2; } void Free( void ) { MPIX_CALL( MPI_Comm_free( (MPI_Comm *) &the_real_comm )); } void Ssend( void* v1, int v2, Datatype v3, int v4, int v5 ) { MPIX_CALL( MPI_Ssend( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm )); } Request Ibsend( void* v1, int v2, Datatype v3, int v4, int v5 ) { Request *v7 = new Request; MPIX_CALL( MPI_Ibsend( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7->the_real_request) )); return *v7; } void Sendrecv( void * v1, int v2, Datatype v3, int v4, int v5, void * v6, int v7, Datatype v8, int v9, int v10, Status & v12 ) { MPIX_CALL( MPI_Sendrecv( 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 ) )); } Request Recv_init( void* v1, int v2, Datatype v3, int v4, int v5 ) { Request *v7 = new Request; MPIX_CALL( MPI_Recv_init( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7->the_real_request) )); return *v7; } Request Bsend_init( void* v1, int v2, Datatype v3, int v4, int v5 ) { Request *v7 = new Request; MPIX_CALL( MPI_Bsend_init( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7->the_real_request) )); return *v7; } Request Rsend_init( void* v1, int v2, Datatype v3, int v4, int v5 ) { Request *v7 = new Request; MPIX_CALL( MPI_Rsend_init( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7->the_real_request) )); return *v7; } int Compare( Comm v2 ) { int v3; MPIX_CALL( MPI_Comm_compare( (MPI_Comm) the_real_comm, (MPI_Comm)(v2.the_real_comm), &v3 )); return v3; } void Bsend( void* v1, int v2, Datatype v3, int v4, int v5 ) { MPIX_CALL( MPI_Bsend( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm )); } Request Isend( void* v1, int v2, Datatype v3, int v4, int v5 ) { Request *v7 = new Request; MPIX_CALL( MPI_Isend( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7->the_real_request) )); return *v7; } int Iprobe( int v1, int v2, Status & v5 ) { int v4; MPIX_CALL( MPI_Iprobe( v1, v2, (MPI_Comm) the_real_comm, &v4, (MPI_Status *)&(v5.the_real_status ) )); return v4; } Request Send_init( void* v1, int v2, Datatype v3, int v4, int v5 ) { Request *v7 = new Request; MPIX_CALL( MPI_Send_init( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7->the_real_request) )); return *v7; } int Get_rank( void ) { int v2; MPIX_CALL( MPI_Comm_rank( (MPI_Comm) the_real_comm, &v2 )); return v2; } Group Get_group( void ) { Group *v2 = new Group; MPIX_CALL( MPI_Comm_group( (MPI_Comm) the_real_comm, &(v2->the_real_group) )); return *v2; } void Probe( int v1, int v2, Status & v4 ) { MPIX_CALL( MPI_Probe( v1, v2, (MPI_Comm) the_real_comm, (MPI_Status *)&(v4.the_real_status ) )); } Request Irsend( void* v1, int v2, Datatype v3, int v4, int v5 ) { Request *v7 = new Request; MPIX_CALL( MPI_Irsend( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, &(v7->the_real_request) )); return *v7; } void Recv( void* v1, int v2, Datatype v3, int v4, int v5, Status & v7 ) { MPIX_CALL( MPI_Recv( v1, v2, (MPI_Datatype)(v3.the_real_datatype), v4, v5, (MPI_Comm) the_real_comm, (MPI_Status *)&(v7.the_real_status ) )); }};class Intercomm : public Comm { friend class Intracomm; public: // new/delete inline Intercomm(MPI_Comm obj) { the_real_comm = obj; } inline Intercomm(void) {the_real_comm = MPI_COMM_NULL;} virtual ~Intercomm() {} // copy/assignment Intercomm :: Intercomm(const Intercomm &obj) { the_real_comm = obj.the_real_comm; } Intercomm& Intercomm::operator=(const Intercomm &obj) { the_real_comm = obj.the_real_comm; return *this; } // logical bool operator== (const Intercomm &obj) { return (the_real_comm == obj.the_real_comm); } bool operator!= (const Intercomm &obj) { return (the_real_comm != obj.the_real_comm); } // C/C++ cast and assignment inline operator MPI_Comm*() { return &the_real_comm; } inline operator MPI_Comm() { return the_real_comm; } Intercomm& Intercomm::operator=(const MPI_Comm& obj) { the_real_comm = obj; return *this; } Group Get_remote_group( void ) { Group *v2 = new Group; MPIX_CALL( MPI_Comm_remote_group( (MPI_Comm) the_real_comm, &(v2->the_real_group) )); return *v2; } int Get_remote_size( void ) { int v2; MPIX_CALL( MPI_Comm_remote_size( (MPI_Comm) the_real_comm, &v2 )); return v2; } Comm Merge( int v2 ) { Comm *v3 = new Comm; MPIX_CALL( MPI_Intercomm_merge( (MPI_Comm) the_real_comm, v2, &(v3->the_real_comm) )); return *v3; } Comm Dup( void ) { Comm *v2 = new Comm; MPIX_CALL( MPI_Comm_dup( (MPI_Comm) the_real_comm, &(v2->the_real_comm) )); return *v2; }};class Intracomm : public Comm { friend class Cartcomm; friend class Graphcomm; friend class Datatype; public: // new/delete inline Intracomm(MPI_Comm obj) { the_real_comm = obj; } inline Intracomm(void) {the_real_comm = MPI_COMM_NULL;} virtual ~Intracomm() {} // copy/assignment Intracomm :: Intracomm(const Intracomm &obj) { the_real_comm = obj.the_real_comm; } Intracomm& Intracomm::operator=(const Intracomm &obj) { the_real_comm = obj.the_real_comm; return *this; } // logical bool operator== (const Intracomm &obj) { return (the_real_comm == obj.the_real_comm); } bool operator!= (const Intracomm &obj) { return (the_real_comm != obj.the_real_comm); } // C/C++ cast and assignment inline operator MPI_Comm*() { return &the_real_comm; } inline operator MPI_Comm() { return the_real_comm; } Intracomm& Intracomm::operator=(const MPI_Comm& obj) { the_real_comm = obj; return *this; } Comm Create( Group v2 ) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -