[petsc-dev] Hijacked MPI calls...

Eric Chamberland Eric.Chamberland at giref.ulaval.ca
Mon Sep 12 15:56:41 CDT 2016


I just discovered that all my calls to MPI are replaced by PETSc #define 

I don't really care, but I now have this warning with clang 3.9.0:

warning: possible misuse of comma operator here [-Wcomma]
        int lErreurMPI = ((petsc_wait_ct++,petsc_sum_of_waits_ct++,0) || 
note: cast expression to void to silence warning
        int lErreurMPI = ((petsc_wait_ct++,petsc_sum_of_waits_ct++,0) || 
                          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 

The "offending" macros are all in petsclog.h which is included by 



More information about the petsc-dev mailing list