get rid of more BIGINT_FORMAT macros

This commit is contained in:
Axel Kohlmeyer 2020-06-04 22:07:47 -04:00
parent c02c352ca2
commit 923e740872
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
2 changed files with 20 additions and 32 deletions

View File

@ -16,7 +16,7 @@
Axel Kohlmeyer (Temple U), Iain Bethune (EPCC)
------------------------------------------------------------------------- */
//#define BALANCE_DEBUG 1
// #define BALANCE_DEBUG 1
#include "balance.h"
#include <mpi.h>
@ -1160,8 +1160,7 @@ void Balance::dumpout(bigint tstep)
double *boxlo = domain->boxlo;
double *boxhi = domain->boxhi;
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT "\n",tstep);
fmt::print(fp,"ITEM: TIMESTEP\n{}\n",tstep);
fprintf(fp,"ITEM: NUMBER OF NODES\n");
if (dimension == 2) fprintf(fp,"%d\n",4*nprocs);
else fprintf(fp,"%d\n",8*nprocs);
@ -1236,8 +1235,7 @@ void Balance::dumpout(bigint tstep)
// write out one square/cube per processor for 2d/3d
fprintf(fp,"ITEM: TIMESTEP\n");
fprintf(fp,BIGINT_FORMAT "\n",tstep);
fmt::print(fp,"ITEM: TIMESTEP\n{}\n",tstep);
if (dimension == 2) fprintf(fp,"ITEM: NUMBER OF SQUARES\n");
else fprintf(fp,"ITEM: NUMBER OF CUBES\n");
fprintf(fp,"%d\n",nprocs);
@ -1281,14 +1279,11 @@ void Balance::debug_shift_output(int idim, int m, int np, double *split)
else if (bdim[idim] == Z) dim = "Z";
fprintf(stderr,"Dimension %s, Iteration %d\n",dim,m);
fprintf(stderr," Count:");
for (i = 0; i < np; i++) fprintf(stderr," " BIGINT_FORMAT,count[i]);
fprintf(stderr,"\n");
fprintf(stderr," Sum:");
for (i = 0; i <= np; i++) fprintf(stderr," " BIGINT_FORMAT,sum[i]);
for (i = 0; i <= np; i++) fmt::print(stderr," {}",sum[i]);
fprintf(stderr,"\n");
fprintf(stderr," Target:");
for (i = 0; i <= np; i++) fprintf(stderr," " BIGINT_FORMAT,target[i]);
for (i = 0; i <= np; i++) fmt::print(stderr," {}",target[i]);
fprintf(stderr,"\n");
fprintf(stderr," Actual cut:");
for (i = 0; i <= np; i++)
@ -1301,20 +1296,16 @@ void Balance::debug_shift_output(int idim, int m, int np, double *split)
for (i = 0; i <= np; i++) fprintf(stderr," %g",lo[i]);
fprintf(stderr,"\n");
fprintf(stderr," Low-sum:");
for (i = 0; i <= np; i++) fprintf(stderr," " BIGINT_FORMAT,losum[i]);
for (i = 0; i <= np; i++) fmt::print(stderr," {}",losum[i]);
fprintf(stderr,"\n");
fprintf(stderr," Hi:");
for (i = 0; i <= np; i++) fprintf(stderr," %g",hi[i]);
fprintf(stderr,"\n");
fprintf(stderr," Hi-sum:");
for (i = 0; i <= np; i++) fprintf(stderr," " BIGINT_FORMAT,hisum[i]);
for (i = 0; i <= np; i++) fmt::print(stderr," {}",hisum[i]);
fprintf(stderr,"\n");
fprintf(stderr," Delta:");
for (i = 0; i < np; i++) fprintf(stderr," %g",split[i+1]-split[i]);
fprintf(stderr,"\n");
bigint max = 0;
for (i = 0; i < np; i++) max = MAX(max,count[i]);
fprintf(stderr," Imbalance factor: %g\n",1.0*max*np/target[np]);
}
#endif

View File

@ -35,6 +35,7 @@
#include "memory.h"
#include "error.h"
#include "update.h"
#include "fmt/format.h"
#ifdef _OPENMP
#include <omp.h>
@ -1220,35 +1221,31 @@ void Comm::rendezvous_stats(int n, int nout, int nrvous, int nrvous_out,
if (me == 0) {
if (screen) {
fprintf(screen,"Rendezvous balance and memory info: (tot,ave,max,min) \n");
fprintf(screen," input datum count: "
BIGINT_FORMAT " %g " BIGINT_FORMAT " " BIGINT_FORMAT "\n",
size_in_all/insize,1.0*size_in_all/nprocs/insize,
size_in_max/insize,size_in_min/insize);
fmt::print(screen," input datum count: {} {} {} {}\n",
size_in_all/insize,1.0*size_in_all/nprocs/insize,
size_in_max/insize,size_in_min/insize);
fprintf(screen," input data (MB): %g %g %g %g\n",
1.0*size_in_all/mbytes,1.0*size_in_all/nprocs/mbytes,
1.0*size_in_max/mbytes,1.0*size_in_min/mbytes);
if (outsize)
fprintf(screen," output datum count: "
BIGINT_FORMAT " %g " BIGINT_FORMAT " " BIGINT_FORMAT "\n",
size_out_all/outsize,1.0*size_out_all/nprocs/outsize,
size_out_max/outsize,size_out_min/outsize);
fmt::print(screen," output datum count: {} {} {} {}\n",
size_out_all/outsize,1.0*size_out_all/nprocs/outsize,
size_out_max/outsize,size_out_min/outsize);
else
fprintf(screen," output datum count: %d %g %d %d\n",0,0.0,0,0);
fprintf(screen," output data (MB): %g %g %g %g\n",
1.0*size_out_all/mbytes,1.0*size_out_all/nprocs/mbytes,
1.0*size_out_max/mbytes,1.0*size_out_min/mbytes);
fprintf(screen," input rvous datum count: "
BIGINT_FORMAT " %g " BIGINT_FORMAT " " BIGINT_FORMAT "\n",
size_inrvous_all/insize,1.0*size_inrvous_all/nprocs/insize,
size_inrvous_max/insize,size_inrvous_min/insize);
fmt::print(screen," input rvous datum count: {} {} {} {}\n",
size_inrvous_all/insize,1.0*size_inrvous_all/nprocs/insize,
size_inrvous_max/insize,size_inrvous_min/insize);
fprintf(screen," input rvous data (MB): %g %g %g %g\n",
1.0*size_inrvous_all/mbytes,1.0*size_inrvous_all/nprocs/mbytes,
1.0*size_inrvous_max/mbytes,1.0*size_inrvous_min/mbytes);
if (outsize)
fprintf(screen," output rvous datum count: "
BIGINT_FORMAT " %g " BIGINT_FORMAT " " BIGINT_FORMAT "\n",
size_outrvous_all/outsize,1.0*size_outrvous_all/nprocs/outsize,
size_outrvous_max/outsize,size_outrvous_min/outsize);
fmt::print(screen," output rvous datum count: {} {} {} {}\n",
size_outrvous_all/outsize,1.0*size_outrvous_all/nprocs/outsize,
size_outrvous_max/outsize,size_outrvous_min/outsize);
else
fprintf(screen," output rvous datum count: %d %g %d %d\n",0,0.0,0,0);
fprintf(screen," output rvous data (MB): %g %g %g %g\n",