Commit c69af499 authored by Claudia Canevari's avatar Claudia Canevari
Browse files

restored mpi_send/recv for mpi_datatype

parent 66ad2d8f
......@@ -502,23 +502,16 @@ bool Surface::getSurf(bool fillCav, double vol)
Q = Q + lenpanel1[r - 1];
H = H + lenpanel2[r - 1];
short *_status = NULL;
bool *_idebmap = NULL;
int *_epsmapx = NULL;
int *_epsmapz = NULL;
if (delphi->buildStatus)
{
if (lenpanel0[r] != 0)
{
/*MPI_Datatype row_type_status;
MPI_Datatype row_type_status;
MPI_Type_vector(delphi->nx, lenpanel0[r] * delphi->nz, delphi->nx * delphi->ny, MPI_SHORT, &row_type_status);
MPI_Type_commit(&row_type_status);
MPI_Recv(delphi->status + N * delphi->nx, 1, row_type_status, r, STATUSTAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Type_free(&row_type_status);*/
MPI_Type_free(&row_type_status);
_status = new short[lenpanel0[r] * delphi->nx * delphi->nz];
MPI_Recv(_status, lenpanel0[r] * delphi->nx * delphi->nz, MPI_SHORT, r, STATUSTAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
// cout << INFO << " - MPIReceiv status from rank " << r << " : " << Timer::getTimeStamp() << endl;
}
}
......@@ -528,52 +521,32 @@ bool Surface::getSurf(bool fillCav, double vol)
if (lenpanel0[r] != 0)
{
/*MPI_Datatype row_type_idebmap;
MPI_Datatype row_type_idebmap;
MPI_Type_vector(delphi->nx, lenpanel0[r] * delphi->nz, delphi->nx * delphi->ny, MPI_C_BOOL, &row_type_idebmap);
MPI_Type_commit(&row_type_idebmap);
MPI_Recv(delphi->idebmap + N * delphi->nx, 1, row_type_idebmap, r, IDEBMAPTAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Type_free(&row_type_idebmap);*/
MPI_Type_free(&row_type_idebmap);
// cout << INFO << " - MPIReceiv idebmap from rank " << r << " : " << Timer::getTimeStamp() << endl;
/*MPI_Datatype row_type_epsmapx;
MPI_Datatype row_type_epsmapx;
MPI_Type_vector(delphi->nx, lenpanel0[r] * delphi->nz, delphi->nx * delphi->ny, MPI_INT, &row_type_epsmapx);
MPI_Type_commit(&row_type_epsmapx);
MPI_Recv(delphi->epsmap + N * delphi->nx, 1, row_type_epsmapx, r, EPSMAPXTAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Type_free(&row_type_epsmapx);*/
_idebmap = new bool[lenpanel0[r] * delphi->nx * delphi->nz];
MPI_Recv(_idebmap, lenpanel0[r] * delphi->nx * delphi->nz, MPI_C_BOOL, r, IDEBMAPTAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
// cout << INFO << " - MPIReceiv idebmap from rank " << r << " : " << Timer::getTimeStamp() << endl;
_epsmapx = new int[lenpanel0[r] * delphi->nx * delphi->nz];
MPI_Recv(_epsmapx, lenpanel0[r] * delphi->nx * delphi->nz, MPI_INT, r, EPSMAPXTAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Type_free(&row_type_epsmapx);
// cout << INFO << " - MPIReceiv epsmapx from rank " << r << " : " << Timer::getTimeStamp() << endl;
}
if (lenpanel1[r] != 0)
{
/*MPI_Datatype row_type_epsmapz;
MPI_Datatype row_type_epsmapz;
MPI_Type_vector(delphi->nx, lenpanel1[r] * delphi->nz, delphi->nx * delphi->ny, MPI_INT, &row_type_epsmapz);
MPI_Type_commit(&row_type_epsmapz);
MPI_Recv(delphi->epsmap + delphi->nx * delphi->ny * delphi->nz * 2 + Q * delphi->nx, 1, row_type_epsmapz, r, EPSMAPZTAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Type_free(&row_type_epsmapz);*/
int *_epsmapz = new int[lenpanel1[r] * delphi->nx * delphi->nz];
MPI_Recv(_epsmapz, lenpanel1[r] * delphi->nx * delphi->nz, MPI_INT, r, EPSMAPZTAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
for (int p = 0; p < delphi->nx; p++)
{
if (_epsmapz != NULL)
{
memcpy(delphi->epsmap + delphi->nx * delphi->ny * delphi->nz * 2 + Q * delphi->nx + p * delphi->nx * delphi->ny, _epsmapz + p * (delphi->ny * lenpanel1[r]), sizeof(int) * delphi->ny * lenpanel1[r]);
}
}
delete[] _epsmapz;
MPI_Type_free(&row_type_epsmapz);
// cout << INFO << " - MPIReceiv epsmapz from rank " << r << " : " << Timer::getTimeStamp() << " " << delphi->nx * lenpanel1[r] * delphi->nz << endl;
}
......@@ -590,41 +563,6 @@ bool Surface::getSurf(bool fillCav, double vol)
}
}
for (int p = 0; p < delphi->nx; p++)
{
if (_status != NULL)
{
memcpy(delphi->status + N * delphi->nx + p * delphi->nx * delphi->ny, _status + p * (delphi->ny * lenpanel0[r]), sizeof(bool) * delphi->ny * lenpanel0[r]);
}
if (_idebmap != NULL)
{
memcpy(delphi->idebmap + N * delphi->nx + p * delphi->nx * delphi->ny, _idebmap + p * (delphi->ny * lenpanel0[r]), sizeof(bool) * delphi->ny * lenpanel0[r]);
}
if (_epsmapx != NULL)
{
memcpy(delphi->epsmap + N * delphi->nx + p * delphi->nx * delphi->ny, _epsmapx + p * (delphi->ny * lenpanel0[r]), sizeof(int) * delphi->ny * lenpanel0[r]);
}
}
if (_status != NULL)
{
delete[] _status;
}
if (_idebmap != NULL)
{
delete[] _idebmap;
}
if (_epsmapx != NULL)
{
delete[] _epsmapx;
}
// cout << INFO << " copy data back from rank " << r << " : " << Timer::getTimeStamp() << endl;
if (accurateTriangulation && !isAvailableScalarField)
{
if (lenpanel2[r] != 0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment