diff --git a/analysis/SubPhase.cpp b/analysis/SubPhase.cpp index ab469ace..56480813 100644 --- a/analysis/SubPhase.cpp +++ b/analysis/SubPhase.cpp @@ -688,31 +688,17 @@ void SubPhase::AggregateLabels(char *FILENAME){ int nx = Dm->Nx; int ny = Dm->Ny; int nz = Dm->Nz; - - int npx = Dm->nprocx(); - int npy = Dm->nprocy(); - int npz = Dm->nprocz(); - - int ipx = Dm->iproc(); - int ipy = Dm->jproc(); - int ipz = Dm->kproc(); - - int nprocs = Dm->nprocx()*Dm->nprocy()*Dm->nprocz(); - - int full_nx = npx*(nx-2); - int full_ny = npy*(ny-2); - int full_nz = npz*(nz-2); + int local_size = (nx-2)*(ny-2)*(nz-2); - long int full_size = long(full_nx)*long(full_ny)*long(full_nz); signed char *LocalID; LocalID = new signed char [local_size]; //printf("aggregate labels: local size=%i, global size = %i",local_size, full_size); // assign the ID for the local sub-region - for (int k=1; kid[n]; if (local_id_val > 0){ @@ -720,63 +706,13 @@ void SubPhase::AggregateLabels(char *FILENAME){ if (value > 0.0) local_id_val = 1; else local_id_val = 2; } - LocalID[(k-1)*(nx-2)*(ny-2) + (j-1)*(nx-2) + i-1] = local_id_val; + Dm->id[n] = local_id_val; } } } MPI_Barrier(Dm->Comm); - // populate the FullID - if (Dm->rank() == 0){ - signed char *FullID; - FullID = new signed char [full_size]; - // first handle local ID for rank 0 - for (int k=1; kComm,MPI_STATUS_IGNORE); - for (int k=1; krank(); - int dstrank = 0; - MPI_Send(LocalID,local_size,MPI_CHAR,dstrank,tag,Dm->Comm); - } - MPI_Barrier(Dm->Comm); + Dm->AggregateLabels(FILENAME); }