14 #define _XOPEN_SOURCE 700
24 #include "sion_error_handler.h"
29 #define DFUNCTION "_sion_create_and_init_collstat"
35 if (collstat == NULL) {
36 _sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"cannot allocate collstat structure of size %lu (sion_collstat), aborting ...\n",
41 collstat->req_collsize=sion_filedesc->
collsize;
42 collstat->firstsize=0;
44 collstat->avg_size_per_sender=0;
45 collstat->max_size_per_sender=0;
46 collstat->min_size_per_sender=1e10;
48 collstat->num_collectors=0;
49 collstat->avg_sender_per_collector=0;
50 collstat->max_sender_per_collector=0;
51 collstat->min_sender_per_collector=10000000;
52 collstat->avg_size_per_collector=0;
53 collstat->max_size_per_collector=0;
54 collstat->min_size_per_collector=1e10;
59 for (t = 0; t < sion_filedesc->
ntasks; t++) {
64 if(sion_filedesc->
ntasks>0) collstat->avg_size_per_sender = (double) collstat->gsize / (
double) sion_filedesc->
ntasks;
66 DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK,
"gsize=%ld\n", (
long) collstat->gsize));
73 #define DFUNCTION "_sion_update_collstat"
75 int rc = SION_SUCCESS;
77 sion_int64 currentsize;
81 for (t = 0; t < sion_filedesc->
ntasks; t++) {
93 collstat->num_collectors++;
94 collstat->avg_size_per_collector+=currentsize;
95 if(currentsize>collstat->max_size_per_collector) collstat->max_size_per_collector=currentsize;
96 if(currentsize<collstat->min_size_per_collector) collstat->min_size_per_collector=currentsize;
102 if(collstat->num_collectors>0) collstat->avg_size_per_collector/=collstat->num_collectors;
109 #define DFUNCTION "_sion_print_collstat"
111 int rc = SION_SUCCESS;
114 fprintf(stderr,
"collective statistics: req_collsize=%11d\n", collstat->req_collsize);
115 fprintf(stderr,
"collective statistics: req_num_collectors=%11d\n", collstat->req_num_collectors);
116 fprintf(stderr,
"collective statistics: num_collectors=%11d\n", collstat->num_collectors);
117 fprintf(stderr,
"collective statistics: avg_sender_per_collector=%14.2f\n", collstat->avg_sender_per_collector);
118 fprintf(stderr,
"collective statistics: min_sender_per_collector=%11d\n", collstat->min_sender_per_collector);
119 fprintf(stderr,
"collective statistics: max_sender_per_collector=%11d\n", collstat->max_sender_per_collector);
121 fprintf(stderr,
"collective statistics: avg_size_per_collector=%14.2f bytes\n", collstat->avg_size_per_collector);
122 fprintf(stderr,
"collective statistics: min_size_per_collector=%11lld bytes\n", collstat->min_size_per_collector);
123 fprintf(stderr,
"collective statistics: max_size_per_collector=%11lld bytes\n", collstat->max_size_per_collector);
125 fprintf(stderr,
"collective statistics: avg_size_per_sender=%14.2f bytes\n", collstat->avg_size_per_sender);
126 fprintf(stderr,
"collective statistics: min_size_per_sender=%11lld bytes\n", collstat->min_size_per_sender);
127 fprintf(stderr,
"collective statistics: max_size_per_sender=%11lld bytes\n", collstat->max_size_per_sender);
130 for (t = 0; t < sion_filedesc->
ntasks; t++) {
134 fprintf(stderr,
"collective statistics: startpointers[%2d]=%10lld (%10.4fMB) chunksizes[%2d]=%8lld COLLECTOR collsize=%3d\n",
140 fprintf(stderr,
"collective statistics: startpointers[%2d]=%10lld (%10.4fMB) chunksizes[%2d]=%8lld SENDER to %3d\n",
152 #define DFUNCTION "_sion_debugprint_collstat"
154 int rc = SION_SUCCESS;
158 DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK,
" enter\n"));
160 for (t = 0; t < sion_filedesc->
ntasks; t++) {
163 DPRINTFP((2048, DFUNCTION, _SION_DEFAULT_RANK,
" startpointers[%2d]=%10lld (%10.4fMB) chunksizes[%2d]=%8lld COLLECTOR collsize=%3d\n",
169 DPRINTFP((2048, DFUNCTION, _SION_DEFAULT_RANK,
" startpointers[%2d]=%10lld (%10.4fMB) chunksizes[%2d]=%8lld SENDER to %3d\n",
176 DPRINTFP((2, DFUNCTION, _SION_DEFAULT_RANK,
" leave\n",t));
181 #define DFUNCTION "_sion_dprint_collstat"
183 int rc = SION_SUCCESS;
Sion File Descriptor Structure.
sion_int32 * all_coll_collsize
sion_int32 * all_coll_collector
sion_int64 * all_chunksizes
sion_int64 * all_startpointers