Debugging tests/BlobAnalyzeParallel.cpp
This commit is contained in:
@@ -278,26 +278,22 @@ int main(int argc, char **argv)
|
||||
int b=0;
|
||||
|
||||
// Blobs.Set(Averages.BlobAverages.NBLOBS);
|
||||
int dimx = Averages.BlobAverages.size(0);
|
||||
int dimy = Averages.BlobAverages.size(1);
|
||||
int dimx = (int)Averages.BlobAverages.size(0);
|
||||
int dimy = (int)Averages.BlobAverages.size(1);
|
||||
int TotalBlobInfoSize=dimx*dimy;
|
||||
|
||||
FILE *BLOBLOG;
|
||||
if (rank==0){
|
||||
BLOBLOG=fopen("blobs.tcat","w");
|
||||
//printf("dimx=%i \n",dimx);
|
||||
}
|
||||
// BlobContainer Blobs;
|
||||
DoubleArray RecvBuffer(dimx);
|
||||
// MPI_Allreduce(&Averages.BlobAverages.get(),&Blobs.get(),1,MPI_DOUBLE,MPI_SUM,Dm.Comm);
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
if (rank==0) printf("All ranks passed gate \n");
|
||||
|
||||
for (int b=0; b<(int)Averages.BlobAverages.size(1); b++){
|
||||
for (int b=0; b<dimy; b++){
|
||||
|
||||
MPI_Allreduce(&Averages.BlobAverages(0,b),&RecvBuffer(0),dimx,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD);
|
||||
for (int idx=0; idx<dimx-1; idx++) Averages.BlobAverages(idx,b)=RecvBuffer(idx);
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
|
||||
if (Averages.BlobAverages(0,b) > 0.0){
|
||||
double Vn,pn,awn,ans,Jwn,Kwn,lwns,cwns,trawn,trJwn;
|
||||
Vn = Averages.BlobAverages(1,b);
|
||||
@@ -328,9 +324,14 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (rank==0) printf("Sorting blobs by volume \n");
|
||||
Averages.SortBlobs();
|
||||
|
||||
FILE *BLOBLOG;
|
||||
if (rank==0){
|
||||
printf("Writing the blob list \n");
|
||||
BLOBLOG=fopen("blobs.tcat","w");
|
||||
|
||||
// printf("Reduced blob %i \n",b);
|
||||
fprintf(BLOBLOG,"%.5g %.5g %.5g\n",Averages.vol_w_global,Averages.paw_global,Averages.aws_global);
|
||||
for (int b=0; b<(int)Averages.BlobAverages.size(1); b++){
|
||||
@@ -355,10 +356,11 @@ int main(int argc, char **argv)
|
||||
fprintf(BLOBLOG,"%.5g\n",cwns); //cwns
|
||||
}
|
||||
}
|
||||
fclose(BLOBLOG);
|
||||
}
|
||||
if (rank==0) fclose(BLOBLOG);
|
||||
|
||||
double Length=1.0;
|
||||
printf("Writing the blob states \n");
|
||||
if (rank==0) WriteBlobStates(Averages,Length,porosity);
|
||||
|
||||
/*FILE *BLOBS = fopen("Blobs.dat","wb");
|
||||
|
||||
Reference in New Issue
Block a user