redefining pad since it was strangely done

This commit is contained in:
James E McClure
2018-05-01 11:01:46 -04:00
parent eacd749403
commit 0c746bf4e3
4 changed files with 8 additions and 7 deletions

View File

@@ -271,17 +271,17 @@ int main(int argc, char **argv)
if (rank==0) printf ("Create ScaLBL_Communicator \n");
// Create a communicator for the device
int Npad=(Np/32 + 1)*32;
Np = Npad;
ScaLBL_Communicator ScaLBL_Comm(Mask);
int *neighborList;
IntArray Map(Nx,Ny,Nz);
neighborList= new int[18*(Np+32)];
neighborList= new int[18*(Np)];
Np = ScaLBL_Comm.MemoryOptimizedLayoutAA(Map,neighborList,Mask.id,Np);
MPI_Barrier(comm);
// LBM variables
if (rank==0) printf ("Allocating distributions \n");
//......................device distributions.................................
int dist_mem_size = Np*sizeof(double);
int neighborSize=18*(Np*sizeof(int));

View File

@@ -438,7 +438,7 @@ int main(int argc, char **argv)
//Create a second communicator based on the regular data layout
ScaLBL_Communicator ScaLBL_Comm_Regular(Mask);
int Npad=Np+32;
int Npad=(Np/32 + 1)*32;
if (rank==0) printf ("Set up memory efficient layout Npad=%i \n",Npad);
int *neighborList;
IntArray Map(Nx,Ny,Nz);

View File

@@ -447,7 +447,7 @@ int main(int argc, char **argv)
//Create a second communicator based on the regular data layout
ScaLBL_Communicator ScaLBL_Comm_Regular(Mask);
int Npad=Np+32;
int Npad=(Np/32 + 1)*32;
if (rank==0) printf ("Set up memory efficient layout Npad=%i \n",Npad);
int *neighborList;

View File

@@ -256,7 +256,8 @@ int main(int argc, char **argv)
MPI_Allreduce(&sum_local,&sum,1,MPI_DOUBLE,MPI_SUM,comm);
porosity = sum*iVol_global;
if (rank==0) printf("Media porosity = %f \n",porosity);
int Npad=(Np/32 + 1)*32;
Np=Npad;
//.........................................................
// don't perform computations at the eight corners
id[0] = id[Nx-1] = id[(Ny-1)*Nx] = id[(Ny-1)*Nx + Nx-1] = 0;
@@ -279,7 +280,7 @@ int main(int argc, char **argv)
int *neighborList;
IntArray Map(Nx,Ny,Nz);
neighborList= new int[18*(Np+32)];
neighborList= new int[18*(Np)];
Np = ScaLBL_Comm.MemoryOptimizedLayoutAA(Map,neighborList,Mask.id,Np);
MPI_Barrier(comm);