diff --git a/common/Domain.cpp b/common/Domain.cpp index d975ce25..3d912305 100644 --- a/common/Domain.cpp +++ b/common/Domain.cpp @@ -231,6 +231,7 @@ void Domain::Decomp(std::shared_ptr domain_db ) //....................................................................... // Reading the domain information file //....................................................................... + int rank_offset = 0; int nprocs, nprocx, nprocy, nprocz, nx, ny, nz; int64_t global_Nx,global_Ny,global_Nz; int64_t i,j,k,n; @@ -316,17 +317,17 @@ void Domain::Decomp(std::shared_ptr domain_db ) char *SegData = NULL; // Rank=0 reads the entire segmented data and distributes to worker processes - if (rank==0){ + if (rank()==0){ printf("Dimensions of segmented image: %ld x %ld x %ld \n",global_Nx,global_Ny,global_Nz); int64_t SIZE = global_Nx*global_Ny*global_Nz; SegData = new char[SIZE]; if (ReadType == "8bit"){ printf("Reading 8-bit input data \n"); FILE *SEGDAT = fopen(Filename.c_str(),"rb"); - if (SEGDAT==NULL) ERROR("Error reading segmented data"); + if (SEGDAT==NULL) ERROR("Domain.cpp: Error reading segmented data"); size_t ReadSeg; ReadSeg=fread(SegData,1,SIZE,SEGDAT); - if (ReadSeg != size_t(SIZE)) printf("lbpm_segmented_decomp: Error reading segmented data (rank=%i)\n",rank); + if (ReadSeg != size_t(SIZE)) printf("Domain.cpp: Error reading segmented data \n"); fclose(SEGDAT); } else if (ReadType == "16bit"){ @@ -334,10 +335,10 @@ void Domain::Decomp(std::shared_ptr domain_db ) short int *InputData; InputData = new short int[SIZE]; FILE *SEGDAT = fopen(Filename.c_str(),"rb"); - if (SEGDAT==NULL) ERROR("Error reading segmented data"); + if (SEGDAT==NULL) ERROR("Domain.cpp: Error reading segmented data"); size_t ReadSeg; ReadSeg=fread(InputData,2,SIZE,SEGDAT); - if (ReadSeg != size_t(SIZE)) printf("lbpm_segmented_decomp: Error reading segmented data (rank=%i)\n",rank); + if (ReadSeg != size_t(SIZE)) printf("Domain.cpp: Error reading segmented data \n"); fclose(SEGDAT); for (int n=0; n domain_db ) std::vector LabelCount(ReadValues.size(),0); // Set up the sub-domains - if (rank==0){ + if (rank()==0){ printf("Distributing subdomains across %i processors \n",nprocs); printf("Process grid: %i x %i x %i \n",nprocx,nprocy,nprocz); printf("Subdomain size: %i x %i x %i \n",nx,ny,nz); diff --git a/common/Domain.h b/common/Domain.h index 5e0ddf12..1c9118e0 100755 --- a/common/Domain.h +++ b/common/Domain.h @@ -175,7 +175,7 @@ public: // Public variables (need to create accessors instead) signed char *id; void ReadIDs(); - void Decomp(); + void Decomp(std::shared_ptr domain_db); void CommunicateMeshHalo(DoubleArray &Mesh); void CommInit(); int PoreCount();