[petsc-dev] Hijacked MPI calls...

Satish Balay balay at mcs.anl.gov
Mon Sep 12 16:32:33 CDT 2016


Do you get these warnings with PETSc library build aswell?

The logging code tries to log all messages in library and in
application - and prints a summary with -info.

You can disable logging in your build with configure option: --with-log=0

Or you can define the PETSC_HAVE_BROKEN_RECURSIVE_MACRO in your
code/compile - and the wrappers will be skipped..

Satish

On Mon, 12 Sep 2016, Eric Chamberland wrote:

> Hi,
> 
> I just discovered that all my calls to MPI are replaced by PETSc #define
> macros...
> 
> I don't really care, but I now have this warning with clang 3.9.0:
> 
> 
> /pmi/cmpbib/compilation_BIB_gcc_redhat_squash/COMPILE_AUTO/GIREF/src/commun/Parallele/PABroadcast.icc:324:41:
> warning: possible misuse of comma operator here [-Wcomma]
>        int lErreurMPI = ((petsc_wait_ct++,petsc_sum_of_waits_ct++,0) ||
> MPI_Wait(&(aIdComm[0]),&lStatus));
>                                         ^
> 
> /pmi/cmpbib/compilation_BIB_gcc_redhat_squash/COMPILE_AUTO/GIREF/src/commun/Parallele/PABroadcast.icc:324:26:
> note: cast expression to void to silence warning
>        int lErreurMPI = ((petsc_wait_ct++,petsc_sum_of_waits_ct++,0) ||
> MPI_Wait(&(aIdComm[0]),&lStatus));
>                          ^~~~~~~~~~~~~~~
>                          static_cast<void>( )
> 
> I have many files to modify in my code if I want to silence this warning (with
> pragmas)...
> 
> But before doing so, I have 2 questions:
> 
> - Would you consider doing static_cast<void>( ) as suggested by clang to
> silence the warnings?
> - Does PETSc lib really wants to count *my* calls to MPI functions?
> 
> I don't have a strong opinion if PETSc should #define or not all MPI calls,
> but about -Wcomma warnings, I do: I want this warning to be signaled into my
> code because all the ones I have found where unwanted uses of coma operator...
> and I want to keep the code clean into the future...
> 
> The "offending" macros are all in petsclog.h which is included by petscsys.h.
> 
> thanks,
> 
> Eric
> 
> 




More information about the petsc-dev mailing list