25 #ifndef _chemistry_qc_analyze_array_h
26 #define _chemistry_qc_analyze_array_h
28 #include <chemistry/qc/lmp2/sma.h>
29 #include <util/group/message.h>
44 if ((distributed && grp && grp->n() == 1)
48 double n_block_max_total = 1;
49 double n_element_max_total = 1;
50 for (
int i=0; i<N; i++) {
51 n_block_max_total *= array.
index(i).nblock();
52 n_element_max_total *= array.
index(i).nindex();
54 double n_block_max = n_block_max_total;
55 double n_element_max = n_element_max_total;
57 n_block_max /= grp->n();
58 n_element_max /= grp->n();
60 double nblock = array.
n_block();
62 double nblock_total = nblock;
63 double nelement_total = nelement;
65 grp->sum(nblock_total);
66 grp->sum(nelement_total);
72 " %10s %5.0f of %5.0f blocks %10.0f of %10.0f elements locally",
73 name, nblock, n_block_max, nelement, n_element_max)
78 " %10s %5.0f of %5.0f blocks %10.0f of %10.0f elements globally", name, nblock_total, n_block_max_total, nelement_total,
85 " uses %11.3f MB for data locally",
86 nelement*
sizeof(
double)*1e-6)
91 " uses %11.3f MB for data and %11.3f MB for the map locally",
92 nelement*
sizeof(
double)*1e-6,