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++) {
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,
static std::ostream & out0()
Return an ostream that writes from node 0.
A template class that maintains references counts.
Definition ref.h:361
This class allows printf-like output to be sent to an ostream.
Definition formio.h:97
Implements a block sparse tensor.
Definition sma.h:1247
size_t n_element() const
Returns the number of elements contained in blocks.
Definition sma.h:1692
int n_block() const
Returns the number of blocks.
Definition sma.h:1688
const Range & index(int i) const
Gets the i'th Range.
Definition sma.h:1503
BlockInfo stores info about a block of data.
Definition sma.h:200
int nindex() const
Returns the dimension of this range.
Definition sma.h:125
int nblock() const
Returns the number of blocks.
Definition sma.h:127
Contains all MPQC code up to version 3.
Definition mpqcin.h:14
void analyze_array(typename sma2::Array< N > &array, const char *name, const sc::Ref< sc::MessageGrp > &grp=0, bool distributed=false)
Prints out information about an Array.
Definition analyze_array.h:41