Fixed failing unit tests (TestBlobAnalyze,TestSegDist) on NewRiver compute cluster (haswell)
This commit is contained in:
parent
091e69cd7a
commit
5126f51fca
@ -236,6 +236,8 @@ int main(int argc, char **argv)
|
|||||||
Dm.CommInit(comm); // Initialize communications for domains
|
Dm.CommInit(comm); // Initialize communications for domains
|
||||||
//.......................................................................
|
//.......................................................................
|
||||||
// Read in sphere pack (initialize the non-wetting phase as inside of spheres)
|
// Read in sphere pack (initialize the non-wetting phase as inside of spheres)
|
||||||
|
//
|
||||||
|
nspheres=4;
|
||||||
if (rank==1) printf("nspheres =%i \n",nspheres);
|
if (rank==1) printf("nspheres =%i \n",nspheres);
|
||||||
//.......................................................................
|
//.......................................................................
|
||||||
double *cx = new double[nspheres];
|
double *cx = new double[nspheres];
|
||||||
@ -243,8 +245,14 @@ int main(int argc, char **argv)
|
|||||||
double *cz = new double[nspheres];
|
double *cz = new double[nspheres];
|
||||||
double *rad = new double[nspheres];
|
double *rad = new double[nspheres];
|
||||||
//.......................................................................
|
//.......................................................................
|
||||||
if (rank == 0) printf("Reading the sphere packing \n");
|
//if (rank == 0) printf("Reading the sphere packing \n");
|
||||||
if (rank == 0) ReadSpherePacking(nspheres,cx,cy,cz,rad);
|
//if (rank == 0) ReadSpherePacking(nspheres,cx,cy,cz,rad);
|
||||||
|
// Hard coding the list of four spheres
|
||||||
|
cx[0]=0.25*Lx; cx[1]=0.5*Lx; cx[2]=0.5*Lx; cx[3]=0.75*Lx;
|
||||||
|
cy[0]=0.5*Ly; cx[1]=0.25*Ly; cx[2]=0.75*Ly; cx[3]=0.5*Ly;
|
||||||
|
cz[0]=0.25*Lz; cx[1]=0.75*Lz; cx[2]=0.25*Lz; cx[3]=0.25*Lz;
|
||||||
|
rad[0]=rad[1]=rad[2]=rad[3]=0.1*Lx;
|
||||||
|
|
||||||
MPI_Barrier(comm);
|
MPI_Barrier(comm);
|
||||||
// Broadcast the sphere packing to all processes
|
// Broadcast the sphere packing to all processes
|
||||||
MPI_Bcast(cx,nspheres,MPI_DOUBLE,0,comm);
|
MPI_Bcast(cx,nspheres,MPI_DOUBLE,0,comm);
|
||||||
|
@ -20,7 +20,7 @@ int main(int argc, char **argv)
|
|||||||
MPI_Comm comm = MPI_COMM_WORLD;
|
MPI_Comm comm = MPI_COMM_WORLD;
|
||||||
MPI_Comm_rank(comm,&rank);
|
MPI_Comm_rank(comm,&rank);
|
||||||
MPI_Comm_size(comm,&nprocs);
|
MPI_Comm_size(comm,&nprocs);
|
||||||
|
{
|
||||||
int i,j,k,n,nn;
|
int i,j,k,n,nn;
|
||||||
int iproc,jproc,kproc;
|
int iproc,jproc,kproc;
|
||||||
int nx,ny,nz;
|
int nx,ny,nz;
|
||||||
@ -111,7 +111,8 @@ int main(int argc, char **argv)
|
|||||||
if (rank==0) printf("Ny = %i \n",(int)Distance.size(1));
|
if (rank==0) printf("Ny = %i \n",(int)Distance.size(1));
|
||||||
if (rank==0) printf("Nz = %i \n",(int)Distance.size(2));
|
if (rank==0) printf("Nz = %i \n",(int)Distance.size(2));
|
||||||
|
|
||||||
printf("Initialized! Converting to Signed Distance function \n");
|
MPI_Barrier(comm);
|
||||||
|
if (rank==0) printf("Initialized! Converting to Signed Distance function \n");
|
||||||
SSO(Distance,id,Dm,10);
|
SSO(Distance,id,Dm,10);
|
||||||
|
|
||||||
double Error=0.0;
|
double Error=0.0;
|
||||||
@ -127,16 +128,12 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Error = sqrt(Error)/(double (Count));
|
Error = sqrt(Error)/(double (Count));
|
||||||
printf("Mean error %f \n", Error);
|
if (rank==0) printf("Mean error %f \n", Error);
|
||||||
|
|
||||||
char LocalRankFilename[40];
|
|
||||||
sprintf(LocalRankFilename,"Dist.%05i",rank);
|
|
||||||
FILE *DIST = fopen(LocalRankFilename,"wb");
|
|
||||||
fwrite(Distance.get(),8,Distance.length(),DIST);
|
|
||||||
fclose(DIST);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
MPI_Barrier(comm);
|
MPI_Barrier(comm);
|
||||||
MPI_Finalize();
|
}
|
||||||
|
MPI_Finalize();
|
||||||
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user