diff --git a/tests/DataAggregator.cpp b/tests/DataAggregator.cpp index 67cb1754..e51ccca5 100644 --- a/tests/DataAggregator.cpp +++ b/tests/DataAggregator.cpp @@ -17,21 +17,29 @@ int main(int argc, char **argv){ unsigned long int N, N_full; unsigned long int Z0,Zf; - Bx = atoi(argv[1]); - By = atoi(argv[2]); - Bz = atoi(argv[3]); - z0 = atoi(argv[4]); - Z0 = atoi(argv[5]); - ZF = atoi(argv[7]); + //Read the block size + Nx = atoi(argv[1]); + Ny = atoi(argv[2]); + Nz = atoi(argv[3]); + x0 = atoi(argv[4]); + y0 = atoi(argv[5]); + z0 = atoi(argv[6]); + NX = atoi(argv[7]); + NY = atoi(argv[8]); + NZ = atoi(argv[9]); + //Bx = By = Bz = 9; - Nx = Ny = Nz = 1024; + //Nx = Ny = Nz = 1024; N = Nx*Ny*Nz; - - NX=Bx*Nx; - NY=By*Ny; - NZ=Bz*Nz; - N_full=NX*NY*(ZF-Z0); + N_full=NX*NY*NZ; + + // compute the number of blocks to read + Bx=NX/Nx+1; + By=NY/Ny+1; + Bz=NZ/Nz+1; + printf("System size (read) is: %i x %i x %i \n",NX,NY,NZ); + printf("Block size (read) is: %i x %i x %i \n",Nx,Ny,Nz); printf("Starting block (read) is: %i, %i, %i \n", x0,y0,z0); printf("First z slice (write) is: %i \n", Z0); printf("Last z slice (write) is: %i \n", Zf); @@ -50,9 +58,9 @@ int main(int argc, char **argv){ char *ID; ID = new char [N_full]; - for (unsigned long int bz=z0; bz