cleanup up rendezvous diagnostic output
This commit is contained in:
committed by
Axel Kohlmeyer
parent
bbe6c9bb63
commit
62045a9c52
163
src/comm.cpp
163
src/comm.cpp
@ -796,7 +796,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs,
|
||||
"rendezvous:inbuf");
|
||||
irregular->exchange_data(inbuf,insize,inbuf_rvous);
|
||||
|
||||
bigint irregular1_bytes = 0; //irregular->irregular_bytes;
|
||||
bigint irregular1_bytes = irregular->memory_usage();
|
||||
irregular->destroy_data();
|
||||
delete irregular;
|
||||
|
||||
@ -826,7 +826,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs,
|
||||
"rendezvous:outbuf");
|
||||
irregular->exchange_data(outbuf_rvous,outsize,outbuf);
|
||||
|
||||
bigint irregular2_bytes = 0; //irregular->irregular_bytes;
|
||||
bigint irregular2_bytes = irregular->memory_usage();
|
||||
irregular->destroy_data();
|
||||
delete irregular;
|
||||
|
||||
@ -834,90 +834,11 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs,
|
||||
memory->sfree(outbuf_rvous);
|
||||
|
||||
// return number of output datums
|
||||
// last arg to stats() = memory for procs_rvous + irregular comm
|
||||
|
||||
if (!statflag) return nout;
|
||||
|
||||
// memory info for caller and rendezvous decompositions
|
||||
|
||||
bigint size_in_all,size_in_max,size_in_min;
|
||||
bigint size_out_all,size_out_max,size_out_min;
|
||||
bigint size_inrvous_all,size_inrvous_max,size_inrvous_min;
|
||||
bigint size_outrvous_all,size_outrvous_max,size_outrvous_min;
|
||||
|
||||
bigint size = (bigint) n*insize;
|
||||
MPI_Allreduce(&size,&size_in_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
MPI_Allreduce(&size,&size_in_max,1,MPI_LMP_BIGINT,MPI_MAX,world);
|
||||
MPI_Allreduce(&size,&size_in_min,1,MPI_LMP_BIGINT,MPI_MIN,world);
|
||||
|
||||
size = (bigint) nout*outsize;
|
||||
MPI_Allreduce(&size,&size_out_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
MPI_Allreduce(&size,&size_out_max,1,MPI_LMP_BIGINT,MPI_MAX,world);
|
||||
MPI_Allreduce(&size,&size_out_min,1,MPI_LMP_BIGINT,MPI_MIN,world);
|
||||
|
||||
size = (bigint) nrvous*insize;
|
||||
MPI_Allreduce(&size,&size_inrvous_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
MPI_Allreduce(&size,&size_inrvous_max,1,MPI_LMP_BIGINT,MPI_MAX,world);
|
||||
MPI_Allreduce(&size,&size_inrvous_min,1,MPI_LMP_BIGINT,MPI_MIN,world);
|
||||
|
||||
size = (bigint) nrvous_out*insize;
|
||||
MPI_Allreduce(&size,&size_outrvous_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
MPI_Allreduce(&size,&size_outrvous_max,1,MPI_LMP_BIGINT,MPI_MAX,world);
|
||||
MPI_Allreduce(&size,&size_outrvous_min,1,MPI_LMP_BIGINT,MPI_MIN,world);
|
||||
|
||||
int mbytes = 1024*1024;
|
||||
|
||||
if (me == 0) {
|
||||
if (screen) {
|
||||
fprintf(screen,"Rendezvous balance and memory info:\n");
|
||||
fprintf(screen," input datum count "
|
||||
"(tot,ave,max,min): " 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);
|
||||
fprintf(screen," input data (MB) "
|
||||
"(tot,ave,max,min): %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);
|
||||
fprintf(screen," output datum count "
|
||||
"(tot,ave,max,min): " 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);
|
||||
fprintf(screen," output data (MB) "
|
||||
"(tot,ave,max,min): %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 "
|
||||
"(tot,ave,max,min): " 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);
|
||||
fprintf(screen," input rvous data (MB) "
|
||||
"(tot,ave,max,min): %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);
|
||||
fprintf(screen," output rvous datum count "
|
||||
"(tot,ave,max,min): " 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);
|
||||
fprintf(screen," output rvous data (MB) "
|
||||
"(tot,ave,max,min): %g %g %g %g\n",
|
||||
1.0*size_outrvous_all/mbytes,1.0*size_outrvous_all/nprocs/mbytes,
|
||||
1.0*size_outrvous_max/mbytes,1.0*size_outrvous_min/mbytes);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
bigint rvous_bytes = 0;
|
||||
rvous_bytes += n*insize; // inbuf
|
||||
rvous_bytes += nout*outsize; // outbuf
|
||||
rvous_bytes += nrvous*insize; // inbuf_rvous
|
||||
rvous_bytes += nrvous_out*outsize; // outbuf_rvous
|
||||
rvous_bytes += nrvous_out*sizeof(int); // procs_rvous
|
||||
rvous_bytes += MAX(irregular1_bytes,irregular2_bytes); // max of 2 comms
|
||||
*/
|
||||
|
||||
if (statflag) rendezvous_stats(n,nout,nrvous,nrvous_out,insize,outsize,
|
||||
(bigint) nrvous_out*sizeof(int) +
|
||||
MAX(irregular1_bytes,irregular2_bytes));
|
||||
return nout;
|
||||
}
|
||||
|
||||
@ -1121,15 +1042,28 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs,
|
||||
memory->destroy(rdispls);
|
||||
|
||||
// return number of output datums
|
||||
// last arg to stats() = mem for procs_rvous + per-proc vecs + reordering ops
|
||||
|
||||
if (!statflag) return nout;
|
||||
if (statflag) rendezvous_stats(n,nout,nrvous,nrvous_out,insize,outsize,
|
||||
(bigint) nrvous_out*sizeof(int) +
|
||||
4*nprocs*sizeof(int) +
|
||||
MAX(all2all1_bytes,all2all2_bytes));
|
||||
return nout;
|
||||
}
|
||||
|
||||
// memory info for caller and rendezvous decompositions
|
||||
/* ----------------------------------------------------------------------
|
||||
print balance and memory info for rendezvous operation
|
||||
useful for debugging
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Comm::rendezvous_stats(int n, int nout, int nrvous, int nrvous_out,
|
||||
int insize, int outsize, bigint commsize)
|
||||
{
|
||||
bigint size_in_all,size_in_max,size_in_min;
|
||||
bigint size_out_all,size_out_max,size_out_min;
|
||||
bigint size_inrvous_all,size_inrvous_max,size_inrvous_min;
|
||||
bigint size_outrvous_all,size_outrvous_max,size_outrvous_min;
|
||||
bigint size_comm_all,size_comm_max,size_comm_min;
|
||||
|
||||
bigint size = (bigint) n*insize;
|
||||
MPI_Allreduce(&size,&size_in_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
@ -1151,62 +1085,49 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs,
|
||||
MPI_Allreduce(&size,&size_outrvous_max,1,MPI_LMP_BIGINT,MPI_MAX,world);
|
||||
MPI_Allreduce(&size,&size_outrvous_min,1,MPI_LMP_BIGINT,MPI_MIN,world);
|
||||
|
||||
size = commsize;
|
||||
MPI_Allreduce(&size,&size_comm_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
MPI_Allreduce(&size,&size_comm_max,1,MPI_LMP_BIGINT,MPI_MAX,world);
|
||||
MPI_Allreduce(&size,&size_comm_min,1,MPI_LMP_BIGINT,MPI_MIN,world);
|
||||
|
||||
int mbytes = 1024*1024;
|
||||
|
||||
if (me == 0) {
|
||||
if (screen) {
|
||||
fprintf(screen,"Rendezvous balance and memory info:\n");
|
||||
fprintf(screen," input datum count "
|
||||
"(tot,ave,max,min): " BIGINT_FORMAT " %g "
|
||||
BIGINT_FORMAT " " BIGINT_FORMAT "\n",
|
||||
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);
|
||||
fprintf(screen," input data (MB) "
|
||||
"(tot,ave,max,min): %g %g %g %g\n",
|
||||
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);
|
||||
fprintf(screen," output datum count "
|
||||
"(tot,ave,max,min): " BIGINT_FORMAT " %g "
|
||||
BIGINT_FORMAT " " BIGINT_FORMAT "\n",
|
||||
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);
|
||||
fprintf(screen," output data (MB) "
|
||||
"(tot,ave,max,min): %g %g %g %g\n",
|
||||
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 "
|
||||
"(tot,ave,max,min): " BIGINT_FORMAT " %g "
|
||||
BIGINT_FORMAT " " BIGINT_FORMAT "\n",
|
||||
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);
|
||||
fprintf(screen," input rvous data (MB) "
|
||||
"(tot,ave,max,min): %g %g %g %g\n",
|
||||
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);
|
||||
fprintf(screen," output rvous datum count "
|
||||
"(tot,ave,max,min): " BIGINT_FORMAT " %g "
|
||||
BIGINT_FORMAT " " BIGINT_FORMAT "\n",
|
||||
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);
|
||||
fprintf(screen," output rvous data (MB) "
|
||||
"(tot,ave,max,min): %g %g %g %g\n",
|
||||
fprintf(screen," output rvous data (MB): %g %g %g %g\n",
|
||||
1.0*size_outrvous_all/mbytes,1.0*size_outrvous_all/nprocs/mbytes,
|
||||
1.0*size_outrvous_max/mbytes,1.0*size_outrvous_min/mbytes);
|
||||
fprintf(screen," rvous comm (MB): %g %g %g %g\n",
|
||||
1.0*size_comm_all/mbytes,1.0*size_comm_all/nprocs/mbytes,
|
||||
1.0*size_comm_max/mbytes,1.0*size_comm_min/mbytes);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
bigint rvous_bytes = 0;
|
||||
rvous_bytes += n*insize; // inbuf
|
||||
rvous_bytes += nout*outsize; // outbuf
|
||||
rvous_bytes += nrvous*insize; // inbuf_rvous
|
||||
rvous_bytes += nrvous_out*outsize; // outbuf_rvous
|
||||
rvous_bytes += nrvous_out*sizeof(int); // procs_rvous
|
||||
rvous_bytes += 4*nprocs*sizeof(int); // all2all vectors
|
||||
rvous_bytes += MAX(all2all1_bytes,all2all2_bytes); // reorder ops
|
||||
*/
|
||||
|
||||
return nout;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user