Re: [deal.II] Converting/viewing Vector objects as Tensor<1, dim> objects

2023-05-01 Thread Wolfgang Bangerth

On 5/1/23 18:20, Corbin Foucart wrote:


I have done some preliminary benchmarking of the code and indeed this 
operation is not anywhere close to a bottleneck--I was asking primarily out 
of curiosity, as I'm refactoring the code and was considering what return type 
of an abstract representation of the flux makes sense in terms of class 
design. In light of your answer it seems that a view-based design doesn't make 
a lot of sense, and I might as well return a Tensor object directly, as that's 
the easiest for user code to work with.


Indeed.

Tensors store their data as regular class members, rather than as pointers to 
the heap. They are relatively small objects, and it is generally very cheap to 
work with these kinds of objects because the compiler can either place them on 
the stack or, oftentimes, even in registers. It is probably 2 orders more 
expensive to operate on data that is dynamically allocated on the heap.


Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/


--
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/69589f55-2ed4-05e3-a169-14a19d719b8d%40colostate.edu.


Re: [deal.II] Converting/viewing Vector objects as Tensor<1, dim> objects

2023-05-01 Thread Corbin Foucart
Thanks for the fast reply, Wolfgang!

I have done some preliminary benchmarking of the code and indeed this 
operation is not anywhere close to a bottleneck--I was asking primarily out 
of curiosity, as I'm refactoring the code and was considering what return 
type of an abstract representation of the flux makes sense in terms of 
class design. In light of your answer it seems that a view-based design 
doesn't make a lot of sense, and I might as well return a Tensor object 
directly, as that's the easiest for user code to work with.

Best,
Corbin

On Monday, May 1, 2023 at 7:20:05 PM UTC-4 Wolfgang Bangerth wrote:

> On 5/1/23 16:15, Corbin Foucart wrote:
> > 
> > Is there an developer-intended way to view a Vector object with 
> > dim entries as a Tensor<1, dim> object for ease of multiplication with 
> > other Tensor<1, dim> instances such as normal vectors?
> > I can do something like:
> > 
> > // dim = 3
> > Vector vec({4,5,6});
> > ArrayView view([0], 3);
> > Tensor<1, 3, double> tensor(view);
> > 
> > but from the documentation this seems to make a copy, and I wondered if 
> > there was a deal.ii way to "view" the Vector as a Tensor object. 
> > This operation is the result of a numerical flux computation and is 
> > called many times during assembly.
>
> Correct, this makes a copy. There really isn't a different way (in 
> deal.II): Tensor objects own their data, they are not "views", and so 
> they cannot avoid the copy. Of course, if you don't want to do the copy, 
> then you can always write out the tensor operation you are interested in 
> from the original vector elements by hand.
>
> That said: It would greatly surprise me if the copying of elements is 
> limiting the speed of your program. Have you benchmarked this? Are you 
> sure that you aren't trying to optimize a part of the program that 
> doesn't actually need to be optimized?
>
> Best
> W.
>
>
> -- 
> 
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>

-- 
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/f0ef3b0e-34c0-45bf-aaff-0f0b0692266fn%40googlegroups.com.


Re: [deal.II] Converting/viewing Vector objects as Tensor<1, dim> objects

2023-05-01 Thread Wolfgang Bangerth

On 5/1/23 16:15, Corbin Foucart wrote:


Is there an developer-intended way to view a Vector object with 
dim entries as a Tensor<1, dim> object for ease of multiplication with 
other Tensor<1, dim> instances such as normal vectors?

I can do something like:

// dim = 3
Vector vec({4,5,6});
ArrayView view([0], 3);
Tensor<1, 3, double> tensor(view);

but from the documentation this seems to make a copy, and I wondered if 
there was a deal.ii way to "view" the Vector as a Tensor object. 
This operation is the result of a numerical flux computation and is 
called many times during assembly.


Correct, this makes a copy. There really isn't a different way (in 
deal.II): Tensor objects own their data, they are not "views", and so 
they cannot avoid the copy. Of course, if you don't want to do the copy, 
then you can always write out the tensor operation you are interested in 
from the original vector elements by hand.


That said: It would greatly surprise me if the copying of elements is 
limiting the speed of your program. Have you benchmarked this? Are you 
sure that you aren't trying to optimize a part of the program that 
doesn't actually need to be optimized?


Best
 W.


--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/

--
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/15c58c6f-f28a-47f6-304a-3259af3007a0%40colostate.edu.


[deal.II] Converting/viewing Vector objects as Tensor<1, dim> objects

2023-05-01 Thread Corbin Foucart
Hello everyone,

Is there an developer-intended way to view a Vector object with dim 
entries as a Tensor<1, dim> object for ease of multiplication with other 
Tensor<1, dim> instances such as normal vectors?
I can do something like:

// dim = 3
Vector vec({4,5,6});
ArrayView view([0], 3); 
Tensor<1, 3, double> tensor(view);

but from the documentation this seems to make a copy, and I wondered if 
there was a deal.ii way to "view" the Vector as a Tensor object. 
This operation is the result of a numerical flux computation and is called 
many times during assembly. 

Thank you,
Corbin

-- 
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/722fb438-322b-4b40-ac21-d76c9cf749d4n%40googlegroups.com.


[deal.II] deal.II Workshop in Hannover: Webpage online

2023-05-01 Thread Thomas WICK

Dear all,

the webpage of the deal.II Workshop in Hannover is now online:

https://dealii.org/workshop-2023/

For your convenience, we have linked a pre-filled registration email, as 
well as

a template for talk abstracts.

Also, the flyer is updated

https://thomaswick.org/Conference_dealii_Sep_2023/dealii-flyer_v3.pdf

If you have any questions, please do not hesitate to contact us via

dealii2...@conference.uni-hannover.de

Best regards,

Thomas (on behalf of all co-organizers)

--
---
+--+
Prof. Dr. Thomas Wick
Managing Director of the
Institut für Angewandte Mathematik (IfAM)

Leibniz Universität Hannover (LUH)
Welfengarten 1
30167 Hannover, Germany

Tel.:   +49 511 762 3360
Email:  thomas.w...@ifam.uni-hannover.de
www:https://ifam.uni-hannover.de/wick
www:https://thomaswick.org
+--+
---
--





Am 22.04.23 um 08:05 schrieb Thomas WICK:

Dear deal.II users and developers,

we are happy to announce that we will host the following workshop [1]:
  10th deal.II Users and Developers Workshop
  September 11-15, 2023
  Leibniz University Hannover, Germany

The workshop itself will start on Monday,
September 11 at 13:00 (1pm) and will feature talks and coding sessions.

It will be preceded by a deal.II crash course starting at 9:00 (9am) 
on Monday morning.

The social program has a conference dinner on Tuesday evening
and a small excursion to Herrenhausen Gardens on Thursday.

The conference email address for registration is
  dealii2...@conference.uni-hannover.de

The registration fee is 100 EUR. More details will follow once the 
registration has been done.


Deadlines, location, webpage, and further information will be 
announced soon.


Best regards,

Thomas Wick, Jan Philipp Thiele, Sebastian Kinnewig, Denis Khimin,
Julian Roth, Hendrik Fischer, Leon Kolditz, Lukas Dreyer
(local organizing committee)

[1] https://thomaswick.org/Conference_dealii_Sep_2023/dealii-flyer_v3.pdf



--
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/a8a4224a-ee6c-4a69-c20c-8e33a9d5e08b%40gmail.com.


[deal.II] Re: Problem compiling deal.II with CUDA

2023-05-01 Thread Bruno Turcksin
Hello,

It looks like the documentation is not up to date. We do not support GPU 
your GPU, deal.II requires compute capability of at least 6.0. Sorry about 
that. 

Best,

Bruno

On Saturday, April 29, 2023 at 1:46:44 PM UTC-4 sljoh...@gmail.com wrote:

> Hey everyone,
>
> Sorry I have been working on this problem for a few day. I believe the 
> problem is with the mating of deal.II and CUDA because after installing 
> CUDA it passed all the post installation tests. The error mentions the 
> atomicAdd() function for doubles which is only for compute capability 6.x+ 
> according to CUDA and my gpu is 5.0 but deal.II says it only needs compute 
> capability of 3.2+ so I figure the problem isn't that simple. Below is the 
> error code and attached are the log files.
>
> Thanks for any help ahead of time! And sorry if there is anything I missed 
> to include as this is my first post on here. I will correct it as soon as I 
> can when notified. Thank you again!
>
> Building CUDA object 
> source/lac/CMakeFiles/obj_lac_release.dir/cuda_kernels.cu.o
> nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 
> 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a 
> future release (Use -Wno-deprecated-gpu-targets to suppress warning).
> /home/sjohnson/Downloads/dealii-9.4.1/include/deal.II/lac/cuda_atomic.h(54): 
> error: no instance of overloaded function "atomicAdd" matches the argument 
> list
> argument types are: (double *, double)
>
> /home/sjohnson/Downloads/dealii-9.4.1/include/deal.II/lac/cuda_kernels.templates.h(96):
>  
> error: no instance of overloaded function "atomicAdd" matches the argument 
> list
> argument types are: (double *, const double)
>   detected during instantiation of "Number 
> dealii::LinearAlgebra::CUDAWrappers::kernel::ElemSum::atomic_op(Number
>  
> *, Number) [with Number=double]" 
> /home/sjohnson/Downloads/dealii-9.4.1/source/lac/cuda_kernels.cu(160): 
> here
>
> /home/sjohnson/Downloads/dealii-9.4.1/include/deal.II/lac/cuda_kernels.templates.h(132):
>  
> error: no instance of overloaded function "atomicAdd" matches the argument 
> list
> argument types are: (double *, const double)
>   detected during instantiation of "Number 
> dealii::LinearAlgebra::CUDAWrappers::kernel::L1Norm::atomic_op(Number 
> *, Number) [with Number=double]" 
> /home/sjohnson/Downloads/dealii-9.4.1/source/lac/cuda_kernels.cu(161): 
> here
>
> /home/sjohnson/Downloads/dealii-9.4.1/include/deal.II/lac/cuda_kernels.templates.h(272):
>  
> error: no instance of overloaded function "atomicAdd" matches the argument 
> list
> argument types are: (double *, const double)
>   detected during instantiation of "Number 
> dealii::LinearAlgebra::CUDAWrappers::kernel::DotProduct::atomic_op(Number
>  
> *, Number) [with Number=double]" 
> /home/sjohnson/Downloads/dealii-9.4.1/source/lac/cuda_kernels.cu(175): 
> here
>
> 4 errors detected in the compilation of 
> "/home/sjohnson/Downloads/dealii-9.4.1/source/lac/cuda_kernels.cu".
> make[2]: *** [source/lac/CMakeFiles/obj_lac_release.dir/build.make:583: 
> source/lac/CMakeFiles/obj_lac_release.dir/cuda_kernels.cu.o] Error 1
> make[1]: *** [CMakeFiles/Makefile2:3790: 
> source/lac/CMakeFiles/obj_lac_release.dir/all] Error 2
> make: *** [Makefile:130: all] Error 2
>

-- 
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/951549ca-06a0-48b0-954b-f6b4c3f15ca0n%40googlegroups.com.


Re: [deal.II] Problem compiling deal.II with CUDA

2023-05-01 Thread Daniel Arndt
Sean,

we removed the implementation for atomic add for doubles for nvcc < 8 and
compute capability < 6 in https://github.com/dealii/dealii/pull/10298
(maybe in error). I would expect that you could the code in that pull
request as a patch.

Best,
Daniel

On Sat, Apr 29, 2023 at 1:46 PM Sean Johnson  wrote:

> Hey everyone,
>
> Sorry I have been working on this problem for a few day. I believe the
> problem is with the mating of deal.II and CUDA because after installing
> CUDA it passed all the post installation tests. The error mentions the
> atomicAdd() function for doubles which is only for compute capability 6.x+
> according to CUDA and my gpu is 5.0 but deal.II says it only needs compute
> capability of 3.2+ so I figure the problem isn't that simple. Below is the
> error code and attached are the log files.
>
> Thanks for any help ahead of time! And sorry if there is anything I missed
> to include as this is my first post on here. I will correct it as soon as I
> can when notified. Thank you again!
>
> Building CUDA object
> source/lac/CMakeFiles/obj_lac_release.dir/cuda_kernels.cu.o
> nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35',
> 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a
> future release (Use -Wno-deprecated-gpu-targets to suppress warning).
> /home/sjohnson/Downloads/dealii-9.4.1/include/deal.II/lac/cuda_atomic.h(54):
> error: no instance of overloaded function "atomicAdd" matches the argument
> list
> argument types are: (double *, double)
>
> /home/sjohnson/Downloads/dealii-9.4.1/include/deal.II/lac/cuda_kernels.templates.h(96):
> error: no instance of overloaded function "atomicAdd" matches the argument
> list
> argument types are: (double *, const double)
>   detected during instantiation of "Number
> dealii::LinearAlgebra::CUDAWrappers::kernel::ElemSum::atomic_op(Number
> *, Number) [with Number=double]"
> /home/sjohnson/Downloads/dealii-9.4.1/source/lac/cuda_kernels.cu(160):
> here
>
> /home/sjohnson/Downloads/dealii-9.4.1/include/deal.II/lac/cuda_kernels.templates.h(132):
> error: no instance of overloaded function "atomicAdd" matches the argument
> list
> argument types are: (double *, const double)
>   detected during instantiation of "Number
> dealii::LinearAlgebra::CUDAWrappers::kernel::L1Norm::atomic_op(Number
> *, Number) [with Number=double]"
> /home/sjohnson/Downloads/dealii-9.4.1/source/lac/cuda_kernels.cu(161):
> here
>
> /home/sjohnson/Downloads/dealii-9.4.1/include/deal.II/lac/cuda_kernels.templates.h(272):
> error: no instance of overloaded function "atomicAdd" matches the argument
> list
> argument types are: (double *, const double)
>   detected during instantiation of "Number
> dealii::LinearAlgebra::CUDAWrappers::kernel::DotProduct::atomic_op(Number
> *, Number) [with Number=double]"
> /home/sjohnson/Downloads/dealii-9.4.1/source/lac/cuda_kernels.cu(175):
> here
>
> 4 errors detected in the compilation of
> "/home/sjohnson/Downloads/dealii-9.4.1/source/lac/cuda_kernels.cu".
> make[2]: *** [source/lac/CMakeFiles/obj_lac_release.dir/build.make:583:
> source/lac/CMakeFiles/obj_lac_release.dir/cuda_kernels.cu.o] Error 1
> make[1]: *** [CMakeFiles/Makefile2:3790:
> source/lac/CMakeFiles/obj_lac_release.dir/all] Error 2
> make: *** [Makefile:130: all] Error 2
>
> --
> 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/eb4eb66d-b139-4d5e-b33b-859e9838a119n%40googlegroups.com
> 
> .
>

-- 
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/CAOYDWbL8gv%3Dj7XR0rmHRySbS%3D79SFNh9UgaM%3DW9oLVVKcAnZDA%40mail.gmail.com.