Feimi,

it's picking the wrong overload.

Utilities::MPI::sum(local_vector, mpi_communicator, local_vector);

works as well as

Utilities::MPI::sum<int>(my_view, mpi_communicator, my_view);

Best,
Daniel



Am Di., 28. Jan. 2020 um 12:57 Uhr schrieb Feimi Yu <yufe...@gmail.com>:

> Hi Bruno,
>
> Thanks for your reply!
> That's not true. The input and output arrays may be the same as described
> in the documentation. The template instatiation error does not check
> whether they are the same, either.
> In addition, two different arrays give the same error.
>
> Feimi
>
> On Tuesday, January 28, 2020 at 12:09:38 PM UTC-5, Bruno Turcksin wrote:
>>
>> Feimi,
>>
>> You need to have two different ArrayView. It won't work with a single
>> ArrayView. The input one (values) need to be an ArrayView<const int> and
>> the output one (sum) an ArrayView<int>.
>>
>> Best,
>>
>> Bruno
>>
>> On Tuesday, January 28, 2020 at 11:40:03 AM UTC-5, Feimi Yu wrote:
>>>
>>> I uploaded a minimal code to reproduce the problem I encountered.
>>>
>>> Thanks!
>>> Feimi
>>>
>>> On Monday, January 27, 2020 at 1:42:18 PM UTC-5, Feimi Yu wrote:
>>>>
>>>> Hi,
>>>>
>>>> I was trying to use the the function Utilities::MPI::sum
>>>> <https://www.dealii.org/current/doxygen/deal.II/namespaceUtilities_1_1MPI.html#afaf69c2cc054b615707da05e05239b1c>
>>>> (const ArrayView
>>>> <https://www.dealii.org/current/doxygen/deal.II/classArrayView.html><
>>>> const T > &values, const MPI_Comm &mpi_communicator, const ArrayView
>>>> <https://www.dealii.org/current/doxygen/deal.II/classArrayView.html><
>>>> T > &sums)
>>>> for an std::vector<int>. I created an ArrayView<int> to pack the vector
>>>> and passed it into this function. However, the compiler keeps telling me:
>>>>
>>>> undefined reference to 'void
>>>> dealii::Utilities::MPI::sum<dealii::ArrayView<int>, dealii::ArrayView<int>
>>>> >(dealii::ArrayView<int> const&, ompi_communicator_t* const&,
>>>> dealii::ArrayView<int>&)'
>>>>
>>>> I checked base/mpi.inst.in and cmake/config/template-arguments.in. Int
>>>> type should be included in the instantiation list, but I could not figure
>>>> out why this does not work for me.
>>>>
>>>> Thanks!
>>>> Feimi
>>>>
>>>> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/e35102aa-3f62-4371-8cb6-474ea4c5fd69%40googlegroups.com
> <https://groups.google.com/d/msgid/dealii/e35102aa-3f62-4371-8cb6-474ea4c5fd69%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAOYDWbLAodVgEqNM%3DuAJW%3DQSam1JhsA2T-RXDVa--tfb7KX9mQ%40mail.gmail.com.

Reply via email to