[petsc-dev] MPI_Exscan
Barry Smith
bsmith at mcs.anl.gov
Thu Jul 28 14:31:23 CDT 2011
Ideally code like
#if defined(PETSC_HAVE_MPI_EXSCAN)
cool C code that uses MPI_EXSCAN
#else
less cool C code that uses something else in MPI that is in MPI 1
#endif
less ideal but ok code
#if defined(PETSC_HAVE_MPI_EXSCAN)
cool C code that uses MPI_EXSCAN
#else
SETERRQ(..., "Sorry but this code requires MPI_EXSCAN that doesn't exist on your machine's version of MPI, install a MPI2 with PETSc to get this functionality")
#endif
Then to make sure PETSC_HAVE_MPI_EXSCAN gets defined when it can add a test for MPI_Exscan() to bottom of config/BuildSystem/config/packages/MPI.py with the other tests for MPI to functions
PETSc only requires MPI 1.1 support so any 2.0 or later stuff used needs this kind of protection.
Barry
On Jul 28, 2011, at 2:24 PM, Mark F. Adams wrote:
> Dumb question: How do you protect it?
> Mark
>
> On Jul 28, 2011, at 3:05 PM, Barry Smith wrote:
>
>>
>> On Jul 28, 2011, at 11:55 AM, Jose E. Roman wrote:
>>
>>> We are getting an undefined reference `MPI_Exscan'. This function is used in src/mat/impls/nest/matnest.c.
>>> If I am not wrong, MPI_Exscan was introduced in MPI-2 but was not available in the previous standard. Apparently, the machine where we are compiling is very old and has MPI-1 only.
>>>
>>> I guess there should be a PETSC_HAVE_MPI_EXSCAN test in configure.
>>
>> Correct, whoever used that MPI 2 function in PETSc is obligated to protect it.
>>
>> Barry
>>
>>
>>>
>>> Jose
>>>
>>
>>
>
More information about the petsc-dev
mailing list