From 73188de3332af0a9814418c227da5befe3b0c967 Mon Sep 17 00:00:00 2001 From: Szilard Pall Date: Fri, 11 Jan 2013 07:47:19 +0100 Subject: [PATCH] console and log output improvements Improved the console and log output layout and messages. Change-Id: I0f81cbe9f74ada5a40b2da0c8b2d7dd405bfa7e5 --- src/gmxlib/gmx_detect_hardware.c | 2 +- src/gmxlib/gmx_omp_nthreads.c | 14 +++++++------- src/kernel/runner.c | 3 +-- src/mdlib/domdec.c | 2 +- src/mdlib/gmx_wallcycle.c | 14 +++++++------- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/gmxlib/gmx_detect_hardware.c b/src/gmxlib/gmx_detect_hardware.c index ad3dd9488a..fe4ca975a4 100644 --- a/src/gmxlib/gmx_detect_hardware.c +++ b/src/gmxlib/gmx_detect_hardware.c @@ -139,7 +139,7 @@ static void print_gpu_use_stats(FILE *fplog, } else { - sprintf(sbuf, "%d GPU%s %sselected to be used for this run: ", + sprintf(sbuf, "%d GPU%s %sselected for this run: ", ngpu, (ngpu > 1) ? "s" : "", gpu_info->bUserSet ? "user-" : "auto-"); for (i = 0; i < ngpu; i++) diff --git a/src/gmxlib/gmx_omp_nthreads.c b/src/gmxlib/gmx_omp_nthreads.c index 4cbdfca374..f05ce9e895 100644 --- a/src/gmxlib/gmx_omp_nthreads.c +++ b/src/gmxlib/gmx_omp_nthreads.c @@ -382,7 +382,7 @@ void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr, #endif /* inform the user about the settings */ - if (SIMMASTER(cr) && bOMP) + if (bOMP) { #ifdef GMX_THREAD_MPI const char *mpi_str="per tMPI thread"; @@ -393,15 +393,15 @@ void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr, /* for group scheme we print PME threads info only */ if (bFullOmpSupport) { - fprintf(stderr, "Using %d OpenMP thread%s %s\n", - modth.gnth,modth.gnth > 1 ? "s" : "", - cr->nnodes > 1 ? mpi_str : ""); + md_print_info(cr, fplog, "Using %d OpenMP thread%s %s\n", + modth.gnth,modth.gnth > 1 ? "s" : "", + cr->nnodes > 1 ? mpi_str : ""); } if (bSepPME && modth.gnth_pme != modth.gnth) { - fprintf(stderr, "Using %d OpenMP thread%s %s for PME\n", - modth.gnth_pme,modth.gnth_pme > 1 ? "s" : "", - cr->nnodes > 1 ? mpi_str : ""); + md_print_info(cr, fplog, "Using %d OpenMP thread%s %s for PME\n", + modth.gnth_pme,modth.gnth_pme > 1 ? "s" : "", + cr->nnodes > 1 ? mpi_str : ""); } } diff --git a/src/kernel/runner.c b/src/kernel/runner.c index be3ed6b310..d323bf65af 100644 --- a/src/kernel/runner.c +++ b/src/kernel/runner.c @@ -263,8 +263,6 @@ static t_commrec *mdrunner_start_threads(gmx_hw_opt_t *hw_opt, mda->deviceOptions=deviceOptions; mda->Flags=Flags; - fprintf(stderr, "Starting %d tMPI threads\n",hw_opt->nthreads_tmpi); - fflush(stderr); /* now spawn new threads that start mdrunner_start_fn(), while the main thread returns */ ret=tMPI_Init_fn(TRUE, hw_opt->nthreads_tmpi, @@ -1689,6 +1687,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt, cr->nnodes==1 ? "process" : "processes" #endif ); + fflush(stderr); #endif gmx_omp_nthreads_init(fplog, cr, diff --git a/src/mdlib/domdec.c b/src/mdlib/domdec.c index 2f19d21b3b..9d6bdc6c38 100644 --- a/src/mdlib/domdec.c +++ b/src/mdlib/domdec.c @@ -5345,7 +5345,7 @@ static void print_dd_load_av(FILE *fplog,gmx_domdec_t *dd) if (lossf >= DD_PERF_LOSS) { sprintf(buf, - "NOTE: %.1f %% performance was lost due to load imbalance\n" + "NOTE: %.1f %% of the available CPU time was lost due to load imbalance\n" " in the domain decomposition.\n",lossf*100); if (!comm->bDynLoadBal) { diff --git a/src/mdlib/gmx_wallcycle.c b/src/mdlib/gmx_wallcycle.c index 4b3c1ec4ec..324f17d884 100644 --- a/src/mdlib/gmx_wallcycle.c +++ b/src/mdlib/gmx_wallcycle.c @@ -725,7 +725,7 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme, double realtime, fprintf(fplog, "%s\n", hline); gpu_cpu_ratio = tot_gpu/tot_cpu_overlap; - fprintf(fplog, "\n Force evaluation time GPU/CPU: %.3f ms/%.3f ms = %.3f\n", + fprintf(fplog, "\nForce evaluation time GPU/CPU: %.3f ms/%.3f ms = %.3f\n", tot_gpu/gpu_t->nb_c, tot_cpu_overlap/wc->wcc[ewcFORCE].n, gpu_cpu_ratio); @@ -747,9 +747,9 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme, double realtime, * but we currently can't check that here. */ md_print_warn(NULL,fplog, - "NOTE: The GPU has >25%% less load than the CPU. This imbalance causes\n" + "\nNOTE: The GPU has >25%% less load than the CPU. This imbalance causes\n" " performance loss. Maybe the domain decomposition limits the PME tuning.\n" - " In that case, try setting the DD grid manually (-dd) or lowering -dds.\n"); + " In that case, try setting the DD grid manually (-dd) or lowering -dds."); } else { @@ -757,15 +757,15 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme, double realtime, * too small for increasing the cut-off for PME tuning. */ md_print_warn(NULL,fplog, - "NOTE: The GPU has >25%% less load than the CPU. This imbalance causes\n" - " performance loss.\n"); + "\nNOTE: The GPU has >25%% less load than the CPU. This imbalance causes\n" + " performance loss."); } } if (gpu_cpu_ratio > 1.2) { md_print_warn(NULL,fplog, - "NOTE: The GPU has >20%% more load than the CPU. This imbalance causes\n" - " performance loss, consider using a shorter cut-off and a finer PME grid.\n"); + "\nNOTE: The GPU has >20%% more load than the CPU. This imbalance causes\n" + " performance loss, consider using a shorter cut-off and a finer PME grid."); } } } -- 2.22.0