Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 2217711

Browse files
authored
Print mechanism count and memory size only if count is >0 (#864)
1 parent 81744b1 commit 2217711

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

coreneuron/io/mech_report.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@ void write_mech_report() {
5656

5757
/// print global stats to stdout
5858
if (nrnmpi_myid == 0) {
59-
printf("\n================= MECHANISMS COUNT BY TYPE ===================\n");
59+
printf("\n============== MECHANISMS COUNT AND SIZE BY TYPE =============\n");
6060
printf("%4s %20s %10s %25s\n", "Id", "Name", "Count", "Total memory size (KiB)");
6161
for (size_t i = 0; i < total_mech_count.size(); i++) {
62-
printf("%4lu %20s %10ld %25.2lf\n",
63-
i,
64-
nrn_get_mechname(i),
65-
total_mech_count[i],
66-
static_cast<double>(total_mech_size[i]) / 1024);
62+
if (total_mech_count[i] > 0) {
63+
printf("%4lu %20s %10ld %25.2lf\n",
64+
i,
65+
nrn_get_mechname(i),
66+
total_mech_count[i],
67+
static_cast<double>(total_mech_size[i]) / 1024);
68+
}
6769
}
6870
printf("==============================================================\n");
6971
}

0 commit comments

Comments
 (0)