fix compiler warnings for data aggregator

This commit is contained in:
JamesEMcclure 2021-06-09 14:28:13 -04:00
parent a749ddd52d
commit c463c5182e

View File

@ -32,7 +32,7 @@ int main(int argc, char **argv){
NX = atol(argv[7]);
NY = atol(argv[8]);
NZ = atol(argv[9]);
printf("Size %i X %i X %i \n",NX,NY,NZ);
printf("Size %llu X %llu X %llu \n",(unsigned long long) NX, (unsigned long long) NY, (unsigned long long) NZ);
fflush(stdout);
}
else{
@ -53,10 +53,10 @@ int main(int argc, char **argv){
if (By>8) By=8;
if (Bz>8) Bz=8;
printf("System size (output) 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 location (read) is: %i, %i, %i \n", x0,y0,z0);
printf("Block number (read): %i x %i x %i \n",Bx,By,Bz);
printf("System size (output) is: %llu x %llu x %llu \n",(unsigned long long) NX,(unsigned long long) NY, (unsigned long long) NZ);
printf("Block size (read) is: %llu x %llu x %llu \n",(unsigned long long) Nx,(unsigned long long) Ny,(unsigned long long) Nz);
printf("Starting location (read) is: %llu, %llu, %llu \n", (unsigned long long) x0,(unsigned long long) y0,(unsigned long long) z0);
printf("Block number (read): %llu x %llu x %llu \n",(unsigned long long) Bx,(unsigned long long) By,(unsigned long long) Bz);
fflush(stdout);
// Filenames used
@ -65,7 +65,6 @@ int main(int argc, char **argv){
char sx[2];
char sy[2];
char sz[2];
char tmpstr[10];
//sprintf(LocalRankString,"%05d",rank);
N = Nx*Ny*Nz;
@ -90,7 +89,7 @@ int main(int argc, char **argv){
FILE *IDFILE = fopen(LocalRankFilename,"rb");
readID=fread(id,1,N,IDFILE);
fclose(IDFILE);
printf("Loading data ... \n");
printf("Loading data: %zu bytes ... \n", readID);
// Unpack the data into the main array
for ( k=0;k<Nz;k++){
for ( j=0;j<Ny;j++){
@ -113,7 +112,7 @@ int main(int argc, char **argv){
for (k=0; k<NZ; k++){
for (j=0; j<NY; j++){
for (i=0; i<NX; i++){
if (ID[k*NX*NY+j*NX+i] < 215) count++;
if (ID[k*NX*NY+j*NX+i] < 1) count++;
}
}
}