Skip to content

Commit e33f3f8

Browse files
committed
Enabled Aggregate flag which computes the h-mean of bandwidth over all configs
1 parent 9e7d0c9 commit e33f3f8

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

src/Spatter/Configuration.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void ConfigurationBase::report() {
125125
#else
126126
double min_time = *std::min_element(time_seconds.begin(), time_seconds.end());
127127
double bandwidth = static_cast<double>(bytes_moved) / min_time / 1000000.0;
128+
m_maximum_bandwidth = bandwidth;
128129

129130
print_no_mpi(bytes_moved, min_time, bandwidth);
130131
#endif
@@ -309,6 +310,8 @@ void ConfigurationBase::print_mpi(
309310
0));
310311
double average_maximum_bandwidth_per_rank = total_maximum_bandwidth /
311312
static_cast<double>(vector_maximum_bandwidth.size());
313+
314+
m_maximum_bandwidth = average_maximum_bandwidth_per_rank;
312315

313316
std::cout << std::setw(15) << std::left << id << std::setw(30) << std::left
314317
<< average_bytes_per_rank << std::setw(30) << std::left

src/Spatter/Configuration.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ public:
151151

152152
Spatter::Timer timer;
153153
std::vector<double> time_seconds;
154+
double m_maximum_bandwidth = -1.0;
154155
};
155156

156157
std::ostream &operator<<(std::ostream &out, const ConfigurationBase &config);

src/main.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ int main(int argc, char **argv) {
125125

126126
const unsigned long warmup_runs = 10;
127127
bool timed = 0;
128+
// Vars for aggregate
129+
double total_inverse_bandwidth = 0.0;
130+
size_t n_configs = 0;
128131

129132
Spatter::ClArgs cl;
130133
if (Spatter::parse_input(argc, argv, cl) != 0)
@@ -164,9 +167,21 @@ int main(int argc, char **argv) {
164167
if (rank == 0) {
165168
#endif
166169
config->report();
170+
171+
if(cl.aggregate && config->m_maximum_bandwidth > 0.0){
172+
total_inverse_bandwidth += (1.0 / config->m_maximum_bandwidth);
173+
n_configs++;
174+
}
175+
167176
#ifdef USE_MPI
168177
}
169178
#endif
179+
180+
}
181+
if(cl.aggregate && n_configs > 0){
182+
double hmean_bandwidth = static_cast<double>(n_configs) / total_inverse_bandwidth;
183+
184+
std::cout << "Aggregate Summary - Mean Bandwidth: " << hmean_bandwidth << " MB/s" << std::endl;
170185
}
171186

172187
#ifdef USE_MPI

0 commit comments

Comments
 (0)