[Dune] GMPField use

Kirill Volyanskiy vol.kirill at gmail.com
Thu Jun 10 09:32:16 CEST 2021


Hi Oliver,

The calls to storeMatrixMarket are easily fixed with the following template
template<>
struct MatrixMarketImpl::mm_numeric_type<precise> {
  enum {
    is_numeric=true
  };
  static std::string str()  {
    return "GMPField";
  }
};

But other errors require more effort.

dune-istl-2.7.1/dune/istl/ilu.hh:203:30: error: invalid cast from type
‘__gmp_expr<__mpf_struct [1], __gmp_unary_expr<__gmp_expr<__mpf_struct [1],
__mpf_struct [1]>, __gmp_abs_function> >’ to type ‘int’
             int generation = (int) Simd::lane(0,abs(
firstmatrixelement(*kj) ));

dune-istl-2.7.1/dune/istl/solver.hh:481:26: error: invalid static_cast from
type ‘Dune::Simd::Scalar<__gmp_expr<__mpf_struct [1],
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, __gmp_binary_divides> > >’
{aka ‘__gmp_expr<__mpf_struct [1],
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, __gmp_binary_divides> >’}
to type ‘double’
         _res.reduction = static_cast<double>(Simd::max(_def/_def0));

dune/common/simd/defaults.hh:134:15: error: use of deleted function
‘__gmp_expr<__mpf_struct [1], __gmp_binary_expr<__gmp_expr<__mpf_struct
[1], __mpf_struct [1]>, __gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_binary_divides> >& __gmp_expr<__mpf_struct [1],
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, __gmp_binary_divides>
>::operator=(const __gmp_expr<__mpf_struct [1],
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, __gmp_binary_divides> >&)’
             m = Simd::lane(l, v);

/usr/local/include/gmpxx.h:2391:7: note: ‘__gmp_expr<__mpf_struct [1],
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, __gmp_binary_divides> >&
__gmp_expr<__mpf_struct [1], __gmp_binary_expr<__gmp_expr<__mpf_struct [1],
__mpf_struct [1]>, __gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_binary_divides> >::operator=(const __gmp_expr<__mpf_struct [1],
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, __gmp_binary_divides> >&)’
is implicitly deleted because the default definition would be ill-formed:
 class __gmp_expr
       ^~~~~~~~~~
 <T, __gmp_binary_expr<__gmp_expr<T, T>, __gmp_expr<T, T>, Op> >

/usr/local/include/gmpxx.h:2391:7: error: use of deleted function
‘__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, __gmp_binary_divides>&
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_binary_divides>::operator=(const
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, __gmp_binary_divides>&)’
/usr/local/include/gmpxx.h:1470:8: note:
‘__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, __gmp_binary_divides>&
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_binary_divides>::operator=(const
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, __gmp_binary_divides>&)’ is
implicitly deleted because the default definition would be ill-formed:
 struct __gmp_binary_expr
        ^~~~~~~~~~~~~~~~~
/usr/local/include/gmpxx.h:1470:8: error: non-static reference member
‘const __gmp_expr<__mpf_struct [1], __mpf_struct [1]>&
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_binary_divides>::val1’, can’t use default assignment operator
/usr/local/include/gmpxx.h:1470:8: error: non-static reference member
‘const __gmp_expr<__mpf_struct [1], __mpf_struct [1]>&
__gmp_binary_expr<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_expr<__mpf_struct [1], __mpf_struct [1]>,
__gmp_binary_divides>::val2’, can’t use default assignment operator

Best,
Kirill

чт, 10 июн. 2021 г. в 06:44, Oliver Sander <oliver.sander at tu-dresden.de>:

> Hi Kirill,
>
> so the problem are the calls to storeMatrixMarket?  They are not needed
> for the example program to work, and you can simply remove them.
>
> The example program has these calls because later examples in the book
> need the Poisson matrix and rhs as MatrixMarket files, and I wanted to
> show the readers how to write such files.
>
> Best,
> Oliver
>
> On 10.06.21 00:12, Dedner, Andreas wrote:
> > Not sure which solver package might work 'out of the box'. The issue you
> encountered in dune-istl seems quite small -
> > I'm not an expert but probably the issue with the missing 'str' can be
> easily fixed. Perhaps someone with more insight can
> > give a hint. Of course there might be more difficult issues later in the
> code.
> >
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > *From:* Kirill Volyanskiy <vol.kirill at gmail.com>
> > *Sent:* 09 June 2021 12:07
> > *To:* Dedner, Andreas <A.S.Dedner at warwick.ac.uk>
> > *Subject:* Re: [Dune] GMPField use
> > Thank you. Could you recommend another solver library compatible with
> GMPField?
> >
> > ср, 9 июн. 2021 г. в 12:54, Dedner, Andreas <A.S.Dedner at warwick.ac.uk
> <mailto:A.S.Dedner at warwick.ac.uk>>:
> >
> >     The issue is that the class
> >     `mm_numeric_type` in dune/istl/matrixmarket.hh is overloaded for a
> number of types, i.e., int/double etc. There is no overload for GMPField
> and default implementation of the class doesn't have a 'str' method.
> >
>  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> >     *From:* Kirill Volyanskiy <vol.kirill at gmail.com <mailto:
> vol.kirill at gmail.com>>
> >     *Sent:* 09 June 2021 10:17
> >     *To:* Dedner, Andreas <A.S.Dedner at warwick.ac.uk <mailto:
> A.S.Dedner at warwick.ac.uk>>
> >     *Subject:* Re: [Dune] GMPField use
> >     Hi.
> >     Thank you for your reply.
> >     I am using DUNE 2.7.1, GMP 6.2.1.
> >     I've taken the program from sander-getting-started-with-dune-2-7.pdf
> and changed some types to GMPField<128> (see in the attached file).
> >     The compilation results are in the errors.txt file.
> >
> >     Best
> >     Kirill
> >
> >     ср, 9 июн. 2021 г. в 10:41, Dedner, Andreas <
> A.S.Dedner at warwick.ac.uk <mailto:A.S.Dedner at warwick.ac.uk>>:
> >
> >         Hi.
> >         Happy to help but we need a bit more information about what you
> are trying to do.
> >         Where are you using the GMPField, perhaps you could provide a
> bit of code showing the errors or at least attach the errors you are
> getting. I don't have any idea why a 'str' function would be needed for a
> 'Field' class.
> >
> >         The GMPField has been used in a very specific context so far and
> I would imaging that using it in for example the istl AMG solver will cause
> problems with some missing functionality.
> >         Best
> >         Andreas
> >
>  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> >         *From:* Dune <dune-bounces at lists.dune-project.org <mailto:
> dune-bounces at lists.dune-project.org>> on behalf of Kirill Volyanskiy <
> vol.kirill at gmail.com <mailto:vol.kirill at gmail.com>>
> >         *Sent:* 08 June 2021 08:39
> >         *To:* dune at lists.dune-project.org <mailto:
> dune at lists.dune-project.org> <dune at lists.dune-project.org <mailto:
> dune at lists.dune-project.org>>
> >         *Subject:* [Dune] GMPField use
> >         Hello,
> >         Is there any guide on using the GMPField? I've tried to use it
> but got many errors in some modules like absence of str() function etc.
> >
> >         Best regards,
> >         Kirill
> >
> >
> > _______________________________________________
> > Dune mailing list
> > Dune at lists.dune-project.org
> > https://lists.dune-project.org/mailman/listinfo/dune
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20210610/be966e32/attachment.htm>


More information about the Dune mailing list