Much better would be to use the MPI macros introduced to deal with exactly this 
problem. Then no addition tests are necessary.
Bill

Connected by DROID on Verizon Wireless


-----Original message-----
From: Barry Smith <[email protected]>
To: For users of the development version of PETSc <petsc-dev at mcs.anl.gov>
Sent: Thu, Jul 28, 2011 20:40:59 GMT+00:00
Subject: Re: [petsc-dev] MPI_Exscan


On Jul 28, 2011, at 3:37 PM, Mark F. Adams wrote:

> I could not fine PETSC_HAVE_MPI_EXSCAN in the tags file.
>
> Am I missing something?

   Why would it ever be in the tags file until someone uses it?   Like I said 
below you need to use it (where needed) and make sure it gets defined by adding 
code to MPI.py

   Barry

>
> Mark
>
> On Jul 28, 2011, at 3:31 PM, Barry Smith wrote:
>
>>
>> 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
>>>>>
>>>>
>>>>
>>>
>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110729/483c1e05/attachment.html>

Reply via email to