Adding files from OLCF

This commit is contained in:
James E McClure 2016-10-28 15:18:00 -04:00
parent f79a66e5d3
commit db6dac1e49
4 changed files with 39 additions and 24 deletions

View File

@ -243,7 +243,7 @@ void run_analysis( int timestep, int restart_interval,
// Identify blobs and update global ids in time
type = static_cast<AnalysisType>( type | IdentifyBlobs );
}
#ifdef USE_CUDA
/* #ifdef USE_CUDA
if ( tpool.getQueueSize()<=3 && tpool.getNumThreads()>0 && timestep%50==0 ) {
// Keep a few blob identifications queued up to keep the processors busy,
// allowing us to track the blobs as fast as possible
@ -251,7 +251,7 @@ void run_analysis( int timestep, int restart_interval,
type = static_cast<AnalysisType>( type | IdentifyBlobs );
}
#endif
*/
if ( timestep%ANALYSIS_INTERVAL == 0 ) {
// Copy the averages to the CPU (and identify blobs)
type = static_cast<AnalysisType>( type | CopySimState );
@ -369,7 +369,7 @@ void run_analysis( int timestep, int restart_interval,
// Retain the timestep associated with the restart files
if (rank==0){
FILE *Rst = fopen("Restart.txt","w");
fprintf(Rst,"%i\n",timestep);
fprintf(Rst,"%i\n",timestep+5);
fclose(Rst);
}
// Write the restart file (using a seperate thread)

View File

@ -228,7 +228,7 @@ int main(int argc, char **argv)
printf("Force(x) = %f \n", Fx);
printf("Force(y) = %f \n", Fy);
printf("Force(z) = %f \n", Fz);
printf("Sub-domain size = %i x %i x %i\n",Nz,Nz,Nz);
printf("Sub-domain size = %i x %i x %i\n",Nx,Ny,Nz);
printf("Parallel domain size = %i x %i x %i\n",nprocx,nprocy,nprocz);
printf("********************************************************\n");
}
@ -246,7 +246,7 @@ int main(int argc, char **argv)
MPI_Barrier(comm);
Nz += 2;
Nx += 2; Ny += 2; Nz += 2;
//Nx = Ny = Nz; // Cubic domain
int N = Nx*Ny*Nz;

View File

@ -18,16 +18,20 @@ int main(int argc, char **argv)
// Initialize MPI
int rank, nprocs;
MPI_Init(&argc,&argv);
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Comm_rank(comm,&rank);
MPI_Comm_size(comm,&nprocs);
int SOLID=atoi(argv[1]);
{
int SOLID=atoi(argv[1]);
int NWP=atoi(argv[2]);
//char NWP,SOLID;
//SOLID=argv[1][0];
//NWP=argv[2][0];
if (rank==0){
printf("Solid Label %i \n",SOLID);
printf("NWP Label %i \n",NWP);
printf("Solid Label: %i \n",SOLID);
printf("NWP Label: %i \n",NWP);
}
//.......................................................................
// Reading the domain information file
@ -189,22 +193,15 @@ int main(int argc, char **argv)
nx+=2; ny+=2; nz+=2;
N=nx*ny*nz;
//if (rank==0) printf("WARNING: assumed that INPUT: WP(1),NWP(2) OUTPUT will be NWP(1),WP(2) (lbpm_segmented_decomp) \n");
if (rank==0) printf("All sub-domains recieved \n");
// Really need a better way to do this -- this is to flip convention for a particular data set
for (k=0;k<nz;k++){
for (j=0;j<ny;j++){
for (i=0;i<nx;i++){
n = k*nx*ny+j*nx+i;
if (Dm.id[n]==char(SOLID)) Dm.id[n] = 0;
else if (Dm.id[n]==char(NWP)) Dm.id[n] = 1;
else Dm.id[n] = 2;
else if (Dm.id[n]==char(NWP)) Dm.id[n] = 1;
else Dm.id[n] = 2;
// if (Dm.id[n] == 1) Dm.id[n]=2;
//else if (Dm.id[n] == 2) Dm.id[n]=1;
// Initialize the solid phase
// if (Dm.id[n] == 0) id[n] = 0;
// else id[n] = 1;
}
}
}
@ -230,6 +227,24 @@ int main(int argc, char **argv)
float porosity = float(totalGlobal-countGlobal)/totalGlobal;
if (rank==0) printf("Porosity=%f\n",porosity);
count = 0;
total = 0;
countGlobal = 0;
totalGlobal = 0;
for (k=1;k<nz-1;k++){
for (j=1;j<ny-1;j++){
for (i=1;i<nx-1;i++){
n=k*nx*ny+j*nx+i;
if (Dm.id[n] != 0) total++;
if (Dm.id[n] == 2) count++;
}
}
}
MPI_Allreduce(&count,&countGlobal,1,MPI_INT,MPI_SUM,comm);
MPI_Allreduce(&total,&totalGlobal,1,MPI_INT,MPI_SUM,comm);
float saturation = float(countGlobal)/totalGlobal;
if (rank==0) printf("wetting phase saturation=%f\n",saturation);
char LocalRankFilename[40];
@ -264,7 +279,7 @@ int main(int argc, char **argv)
// fwrite(SymDist.get(),8,SymDist.length(),SYMDIST);
fwrite(symid,1,N,SYMID);
fclose(SYMID);
}
MPI_Barrier(comm);
MPI_Finalize();
}

View File

@ -4,7 +4,7 @@ import csv
import glob
name=sys.argv[1]
numpts=int(sys.argv[2])
#numpts=int(sys.argv[2])
process="drain"
cwd=os.getcwd()
@ -13,7 +13,7 @@ print("Drainage should initialize imbibition!")
print("Base name is "+name)
# Parameters for color LBM
tau=0.7
tau=0.8
alpha=0.005
beta=0.95
phisol=-1.0
@ -25,7 +25,7 @@ Restart=1
pBC=3
din=1.001
dout=0.999
maxtime=100005
maxtime=2000005
interval=50000
tolerance=1e-5