From eb7310b6e08552d7b5890ded556bee18db4f2dcb Mon Sep 17 00:00:00 2001 From: James Willis <james.s.willis@durham.ac.uk> Date: Sun, 25 Sep 2016 11:58:49 +0100 Subject: [PATCH] Print which host each MPI rank is running on when the verbosity level is set to 2. --- examples/main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/examples/main.c b/examples/main.c index 41b303836c..5b9d2bf976 100644 --- a/examples/main.c +++ b/examples/main.c @@ -262,13 +262,22 @@ int main(int argc, char *argv[]) { message( "Executing a dry run. No i/o or time integration will be performed."); - /* Report CPU frequency. */ + /* Report CPU frequency.*/ cpufreq = clocks_get_cpufreq(); if (myrank == 0) { - message("Running on: %s",hostname()); message("CPU frequency used for tick conversion: %llu Hz", cpufreq); } + /* Report host name(s). */ + if (myrank == 0) { + message("Rank 0 Running on: %s", hostname()); + } +#ifdef WITH_MPI + else if (verbose > 1) { + message("Rank %d running on: %s", myrank, hostname()); + } +#endif + /* Do we choke on FP-exceptions ? */ if (with_fp_exceptions) { feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); -- GitLab