[Dune] GMPField use

Oliver Sander oliver.sander at tu-dresden.de
Thu Jun 10 10:07:38 CEST 2021


Hi Kirill,

> The calls to storeMatrixMarket are easily fixed with the following template

thank you!  Would you consider submitting this as a merge request at

   https://gitlab.dune-project.org/core/dune-istl/-/merge_requests

> 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) ));

Apologies, I didn't realize there were further errors.

That's the SIMD code which I am not familiar with at all.

Christian, maybe you have an idea?

Best,
Oliver

> 
> 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 <mailto: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 <mailto:vol.kirill at gmail.com>>
>      > *Sent:* 09 June 2021 12:07
>      > *To:* Dedner, Andreas <A.S.Dedner at warwick.ac.uk <mailto: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> <mailto: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> <mailto: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> <mailto: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> <mailto: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> <mailto: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> <mailto: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> <mailto: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> <mailto: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 <mailto:Dune at lists.dune-project.org>
>      > https://lists.dune-project.org/mailman/listinfo/dune <https://lists.dune-project.org/mailman/listinfo/dune>
>      >
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5198 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20210610/b0f9c53b/attachment.bin>


More information about the Dune mailing list