Dear PETSc development team,
My apologies for not noticing this mail before. I think the
problem only occured with the option --with-mpi=0.
Attached, please find the original patch and an additional patch that
should remedy the problem.
Regards,
Bas van 't Hof
On 20-03-19 13:28, PETSc checkBuilds wrote:
>
> Dear PETSc developer,
>
> This email contains listings of contributions attributed to you by
> `git blame` that caused compiler errors or warnings in PETSc automated
> testing. Follow the links to see the full log files. Please attempt to fix
> the issues promptly or let us know at petsc-dev@mcs.anl.gov if you are unable
> to resolve the issues.
>
> Thanks,
>The PETSc development team
>
>
>
> warnings attributed to commit
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbitbucket.org%2Fpetsc%2Fpetsc%2Fcommits%2F36763ca&data=02%7C01%7Cbas.vanthof%40vortech.nl%7C1292aa9a0cc84517157408d6ad2f83a6%7C5fe8f8070fe44cdf8dc636475a0b8555%7C0%7C0%7C636886816944597468&sdata=%2FFdweUCCJ5Ice89qhgzGiNR9KmHf9xDOZgfdADEmaDg%3D&reserved=0
> Sys: Extension to the XML logging system
>
>include/petscsys.h:1199
>
> [https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fftp.mcs.anl.gov%2Fpub%2Fpetsc%2Fnightlylogs%2Farchive%2F2019%2F03%2F20%2Fbuild_next_arch-linux-uni_crush.log&data=02%7C01%7Cbas.vanthof%40vortech.nl%7C1292aa9a0cc84517157408d6ad2f83a6%7C5fe8f8070fe44cdf8dc636475a0b8555%7C0%7C0%7C636886816944597468&sdata=9nPNLyx2QIMHgbPehVnoE%2FSxJ%2B%2FiBFOYrIwsgtRK9YI%3D&reserved=0]
>/sandbox/petsc/petsc.next-2/include/petscsys.h:1199:30: error:
> 'MPI_2DOUBLE_PRECISION' undeclared (first use in this function)
>
>
> To opt-out from receiving these messages - send a request to
> petsc-dev@mcs.anl.gov.
From d4095eb220d7b2355d351762b93fdaeb0c0ab1c9 Mon Sep 17 00:00:00 2001
From: Bas van 't Hof
Date: Mon, 18 Mar 2019 09:11:11 +0100
Subject: [PATCH 1/2] XMLLOGEVENT: more info in XML-timing output
added:
+ rank of minimum, maximum value
+ average time
in nested timers, and
+ rank of maximum value for global timers
---
include/petscsys.h| 3 +-
src/sys/logging/xmllogevent.c | 221 ++
2 files changed, 92 insertions(+), 132 deletions(-)
diff --git a/include/petscsys.h b/include/petscsys.h
index ecc1039d39..2e541fda74 100644
--- a/include/petscsys.h
+++ b/include/petscsys.h
@@ -1195,7 +1195,8 @@ PETSC_EXTERN PetscErrorCode PetscMallocClear(void);
PETSC_EXTERN PetscErrorCode PetscMallocSetDRAM(void);
PETSC_EXTERN PetscErrorCode PetscMallocResetDRAM(void);
-#define MPIU_PETSCLOGDOUBLE MPI_DOUBLE
+#define MPIU_PETSCLOGDOUBLE MPI_DOUBLE
+#define MPIU_2PETSCLOGDOUBLE MPI_2DOUBLE_PRECISION
/*
Routines for tracing memory corruption/bleeding with default PETSc memory allocation
diff --git a/src/sys/logging/xmllogevent.c b/src/sys/logging/xmllogevent.c
index 6308af5cc4..6118ee5898 100644
--- a/src/sys/logging/xmllogevent.c
+++ b/src/sys/logging/xmllogevent.c
@@ -500,18 +500,35 @@ static PetscErrorCode PetscPrintExeSpecs(PetscViewer viewer)
/* Print the global performance: max, max/min, average and total of
* time, objects, flops, flops/sec, memory, MPI messages, MPI message lengths, MPI reductions.
*/
-static PetscErrorCode PetscPrintXMLGlobalPerformanceElement(PetscViewer viewer, const char *name, const char *desc, PetscLogDouble max, PetscLogDouble ratio, PetscLogDouble avg, PetscLogDouble tot)
+static PetscErrorCode PetscPrintXMLGlobalPerformanceElement(PetscViewer viewer, const char *name, const char *desc, PetscLogDouble local_val, const PetscBool print_average, const PetscBool print_total)
{
- PetscErrorCode ierr;
-
+ PetscErrorCode ierr;
+ PetscLogDouble min, tot, ratio, avg;
+ MPI_Comm comm;
+ PetscMPIIntrank, size;
+ PetscLogDouble valrank[2], max[2];
PetscFunctionBegin;
+ ierr = PetscObjectGetComm((PetscObject)viewer,&comm);CHKERRQ(ierr);
+ ierr = MPI_Comm_size(PetscObjectComm((PetscObject)viewer),&size);CHKERRQ(ierr);
+ ierr = MPI_Comm_rank(comm, &rank);CHKERRQ(ierr);
+
+ valrank[0] = local_val;
+ valrank[1] = (PetscLogDouble) rank;
+ ierr = MPIU_Allreduce(&local_val, &min, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN,comm);CHKERRQ(ierr);
+ ierr = MPIU_Allreduce(valrank,&max, 1, MPIU_2PETSCLOGDOUBLE, MPI_MAXLOC, comm);CHKERRQ(ierr);
+ ierr = MPIU_Allreduce(&local_val, &tot, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM,comm);CHKERRQ(ierr);
+ avg = tot/((PetscLogDouble) size);
+ if (min != 0.0) ratio = max[0]/min;
+ else ratio = 0.0;
+
ierr = PetscViewerXMLStartSection(viewer, name, desc);CHKERRQ(ierr);
- ierr = PetscViewerXMLPutDouble(viewer, "max", NULL, max, "%e");CHKERRQ(ierr);
+ ierr = PetscViewerXMLPutDouble(viewer, "max", NULL, max[0], "%e");CHKERRQ(ierr);
+ ierr = PetscViewerXMLPutInt( viewer, "maxrank" , "rank at which max was found" , (PetscMPIInt) max[1] );CHKERRQ(ierr);
ierr = PetscViewerXMLPutDouble(viewer, "ratio", NULL, rati