diff --git a/tests/lbpm_uCT_pp.cpp b/tests/lbpm_uCT_pp.cpp index 08128ae9..e3bbb40c 100644 --- a/tests/lbpm_uCT_pp.cpp +++ b/tests/lbpm_uCT_pp.cpp @@ -72,7 +72,7 @@ int main(int argc, char **argv) MPI_Bcast(&Lx,1,MPI_DOUBLE,0,comm); MPI_Bcast(&Ly,1,MPI_DOUBLE,0,comm); MPI_Bcast(&Lz,1,MPI_DOUBLE,0,comm); -/* //................................................. +/* //................................................. MPI_Bcast(&Ny,1,MPI_INT,0,comm); MPI_Bcast(&Ny,1,MPI_INT,0,comm); MPI_Bcast(&Nz,1,MPI_INT,0,comm); @@ -95,6 +95,8 @@ int main(int argc, char **argv) PROFILE_START("ReadVolume"); + Array VOLUME; + // Read the input volume to rank 0 only, then distribute pieces to workers if (rank==0){ // Open the netcdf file @@ -116,13 +118,20 @@ int main(int argc, char **argv) // Read the VOLUME data array std::string varname("VOLUME"); printf("Reading %s\n",varname.c_str()); - Array VOLUME = netcdf::getVar( fid, varname); - printf("VOLUME dims = %zu x %zu x %zu \n",VOLUME.size(0),VOLUME.size(1),VOLUME.size(2)); + VOLUME = netcdf::getVar( fid, varname); + Nx = int(VOLUME.size(0)); + Ny = int(VOLUME.size(1)); + Nz = int(VOLUME.size(2)); + printf("VOLUME dims = %i x %i x %i \n",Nx,Ny,Nz); printf("Sucess!! \n"); netcdf::close( fid ); } PROFILE_SAVE("ReadVolume"); + MPI_Bcast(&Ny,1,MPI_INT,0,comm); + MPI_Bcast(&Ny,1,MPI_INT,0,comm); + MPI_Bcast(&Nz,1,MPI_INT,0,comm); + MPI_Barrier(comm); // Get the rank info @@ -137,15 +146,22 @@ int main(int argc, char **argv) } } Dm.CommInit(comm); -/* + + // Allocate local arrays for every MPI rank + Array LOCVOL(nx+2,ny+2,nz+2); + // Set up the sub-domains + int xStart,yStart,zStart; + xStart=Nx/2; + yStart=Ny/2; + zStart=Nz/2; if (rank==0){ printf("Distributing subdomains across %i processors \n",nprocs); printf("Process grid: %i x %i x %i \n",Dm.nprocx,Dm.nprocy,Dm.nprocz); printf("Subdomain size: %i \n",N); - printf("Size of transition region: %i \n", z_transition_size); - char *tmp; - tmp = new char[N]; + // printf("Size of transition region: %i \n", z_transition_size); + float *tmp; + tmp = new float[N]; for (int kp=0; kp