如何在C / C ++中将MPI_Datatypes传递给函数?

时间:2019-03-04 01:27:08

标签: c++ c types mpi hpc

我想尝试一下,但是我不知道在函数的输入参数中写什么。

void receiveCar(int value, ? Type2){
        MPI_Status status;
        cars = new car*[value]; //this is an array of Car (dyn. Allocated)
        for (int i=0;i<value;i++) cars[i] = new car(0,0,0);

 /* Here I want to receive the object BUT I need the datatype which is define elsewhere */
        MPI_Recv(cars[1], 1, Type2, 0, 0, MPI_COMM_WORLD, &status);

     for (int i=0;i<value;i++) delete cars[i];
     delete [] cars;


}

0 个答案:

没有答案