mpicxx.h

来自「Parallel Processing, Important document 」· C头文件 代码 · 共 1,691 行 · 第 1/5 页

H
1,691
字号
    static bool Testany( int v1, Request v2[], int &v3, Status & v5 ) 
    {
        int v4;
        MPI_Request *l2 = new MPI_Request[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Testany( v1, l2, &v3, &v4, (MPI_Status *)&(v5.the_real_status ) ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        return v4!= 0;
    }
    static bool Testany( int v1, Request v2[], int &v3 )
    {
        int v4;
        MPI_Request *l2 = new MPI_Request[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Testany( v1, l2, &v3, &v4, MPI_STATUS_IGNORE ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        return v4!= 0;
    }
    void Cancel( void ) const
    {
        MPIX_CALL( MPI_Cancel( (MPI_Request *) &the_real_request ));
    }
    static void Waitall( int v1, Request v2[], Status v3[] ) 
    {
        MPI_Request *l2 = new MPI_Request[v1];
        MPI_Status *l3 = new MPI_Status[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Waitall( v1, l2, l3 ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        { 
            int i3; 
            for (i3=0;i3<v1;i3++) {
                v3[i3].the_real_status = l3[i3];
            }
            delete[] l3;
        }
    }
    static void Waitall( int v1, Request v2[] )
    {
        MPI_Request *l2 = new MPI_Request[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Waitall( v1, l2, MPI_STATUSES_IGNORE ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
    }
    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 ) ));
    }
    void Wait( void )
    {
        MPIX_CALL( MPI_Wait( (MPI_Request *) &the_real_request, MPI_STATUS_IGNORE ));
    }
    static int Waitany( int v1, Request v2[], Status & v4 ) 
    {
        int v3;
        MPI_Request *l2 = new MPI_Request[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Waitany( v1, l2, &v3, (MPI_Status *)&(v4.the_real_status ) ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        return v3;
    }
    static int Waitany( int v1, Request v2[] )
    {
        int v3;
        MPI_Request *l2 = new MPI_Request[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Waitany( v1, l2, &v3, MPI_STATUS_IGNORE ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        return v3;
    }
    static int Testsome( int v1, Request v2[], int * v4, Status v5[] ) 
    {
        int v3;
        MPI_Request *l2 = new MPI_Request[v1];
        MPI_Status *l5 = new MPI_Status[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Testsome( v1, l2, &v3, v4, l5 ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        { 
            int i5; 
            for (i5=0;i5<v1;i5++) {
                v5[i5].the_real_status = l5[i5];
            }
            delete[] l5;
        }
        return v3;
    }
    static int Testsome( int v1, Request v2[], int * v4 )
    {
        int v3;
        MPI_Request *l2 = new MPI_Request[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Testsome( v1, l2, &v3, v4, MPI_STATUSES_IGNORE ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        return v3;
    }
    static int Waitsome( int v1, Request v2[], int * v4, Status v5[] ) 
    {
        int v3;
        MPI_Request *l2 = new MPI_Request[v1];
        MPI_Status *l5 = new MPI_Status[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Waitsome( v1, l2, &v3, v4, l5 ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        { 
            int i5; 
            for (i5=0;i5<v1;i5++) {
                v5[i5].the_real_status = l5[i5];
            }
            delete[] l5;
        }
        return v3;
    }
    static int Waitsome( int v1, Request v2[], int * v4 )
    {
        int v3;
        MPI_Request *l2 = new MPI_Request[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Waitsome( v1, l2, &v3, v4, MPI_STATUSES_IGNORE ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        return v3;
    }
    static bool Testall( int v1, Request v2[], Status v4[] ) 
    {
        int v3;
        MPI_Request *l2 = new MPI_Request[v1];
        MPI_Status *l4 = new MPI_Status[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Testall( v1, l2, &v3, l4 ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        { 
            int i4; 
            for (i4=0;i4<v1;i4++) {
                v4[i4].the_real_status = l4[i4];
            }
            delete[] l4;
        }
        return v3!= 0;
    }
    static bool Testall( int v1, Request v2[] )
    {
        int v3;
        MPI_Request *l2 = new MPI_Request[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                l2[i2] = v2[i2].the_real_request;
            }
        }
        MPIX_CALL( MPI_Testall( v1, l2, &v3, MPI_STATUSES_IGNORE ));
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {
                v2[i2].the_real_request = l2[i2];
            }
            delete[] l2;
        }
        return v3!= 0;
    }
    bool Test( Status & v3 ) 
    {
        int v2;
        MPIX_CALL( MPI_Test( (MPI_Request *) &the_real_request, &v2, (MPI_Status *)&(v3.the_real_status ) ));
        return v2!= 0;
    }
    bool Test( void )
    {
        int v2;
        MPIX_CALL( MPI_Test( (MPI_Request *) &the_real_request, &v2, MPI_STATUS_IGNORE ));
        return v2!= 0;
    }
    bool Get_status( Status & v3 ) const
    {
        int v2;
        MPIX_CALL( MPI_Request_get_status( (MPI_Request) the_real_request, &v2, (MPI_Status *)&(v3.the_real_status ) ));
        return v2!= 0;
    }
    bool Get_status( void )
    {
        int v2;
        MPIX_CALL( MPI_Request_get_status( (MPI_Request) the_real_request, &v2, MPI_STATUS_IGNORE ));
        return v2!= 0;
    }
};

class Prequest : public Request {

  public:
    // new/delete
    inline Prequest(MPI_Request obj) { the_real_request = obj; }
    inline Prequest(void) {the_real_request = MPI_REQUEST_NULL;}

    virtual ~Prequest() {}
    // copy/assignment
    Prequest(const Prequest &obj) {
      the_real_request = obj.the_real_request; }
    Prequest& operator=(const Prequest &obj) {
      the_real_request = obj.the_real_request; return *this; }

    // C/C++ cast and assignment
    inline operator MPI_Request*() { return &the_real_request; }
    inline operator MPI_Request() const { return the_real_request; }
    Prequest& operator=(const MPI_Request& obj) {
      the_real_request = obj; return *this; }
    void Start( void ) 
    {
        MPIX_CALL( MPI_Start( (MPI_Request *) &the_real_request ));
    }
    static void Startall( int v1, Prequest v2[] ) 
    {
        MPI_Request *l2 = new MPI_Request[v1];
        { 
            int i2; 
            for (i2=0;i2<v1;i2++) {

⌨️ 快捷键说明

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