Re: [deal.II] Re: Optimization of Laplacea Equation Solver

2019-12-15 Thread Oleg Kmechak
Thank You for answer!

With best, 
Oleg

On Wednesday, 11 December 2019 15:56:35 UTC+1, Wolfgang Bangerth wrote:
>
> On 12/10/19 7:16 PM, Oleg Kmechak wrote: 
> > Can You describe please, why algebraic multigrid algorithm may be better 
> in 
> > this situation? Is it somehow opitmal for Laplacea equation or to my 
> irregular 
> > mesh? 
>
> That's a long of difficult question -- there's a reason why I recorded 
> four 
> video lectures on preconditioning :-) But in short, yes, the algebraic 
> multigrid method is one of very few algorithms that we know is optimal for 
> the 
> Laplace equation. That is, at least, true for the cases where your problem 
> becomes large -- several hundred thousand or millions of unknowns. For 
> small 
> problems, a direct solver is probably faster. 
>
> 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/416b586e-c1ca-471f-8322-04e67a4def3e%40googlegroups.com.


Re: [deal.II] Re: Optimization of Laplacea Equation Solver

2019-12-11 Thread Wolfgang Bangerth
On 12/10/19 7:16 PM, Oleg Kmechak wrote:
> Can You describe please, why algebraic multigrid algorithm may be better in 
> this situation? Is it somehow opitmal for Laplacea equation or to my 
> irregular 
> mesh?

That's a long of difficult question -- there's a reason why I recorded four 
video lectures on preconditioning :-) But in short, yes, the algebraic 
multigrid method is one of very few algorithms that we know is optimal for the 
Laplace equation. That is, at least, true for the cases where your problem 
becomes large -- several hundred thousand or millions of unknowns. For small 
problems, a direct solver is probably faster.

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/39d2d01f-9447-f17a-7bd4-d9248fed9823%40colostate.edu.


[deal.II] Re: Optimization of Laplacea Equation Solver

2019-12-10 Thread Oleg Kmechak
Can You describe please, why algebraic multigrid algorithm may be better in 
this situation? Is it somehow opitmal for Laplacea equation or to my 
irregular mesh?

On Thursday, 5 December 2019 17:15:11 UTC+1, Bruno Turcksin wrote:
>
> Oleg,
>
> The first thing to do if you want to speed up you code is to profile your 
> code. How do you know which part of the code is slow? Right now, it sounds 
> that you are assuming that it is in the solver which may be true but it may 
> not be. If you want to speed up your solver, you can 1) get a better 
> preconditioner (maybe using algebraic multigrid) 2) make you code parallel. 
> deal.II is multithreaded by default but not every operation is. On top of 
> that multithreading does not work if the processors need to communicate 
> through the network (which might be the case on the cluster you are 
> testing). In that case, you will need to use MPI. Take a look at step-40 
>  
> It solves the Laplace equation with 52 millions DoFs in less than 10 
> seconds on 4000 processors.
>
> Best
>
> Bruno
>
> On Thursday, December 5, 2019 at 9:10:19 AM UTC-5, Oleg Kmechak wrote:
>>
>> Dear All, 
>>
>> I am working on RiverSIM program(https://github.com/okmechak/RiverSim/) 
>>
>> This program solves laplace equation on river network geometry, 
>> then makes some computaion(integration over these dence points on picture 
>> and other processing) which result in river network evolution step by step.
>>
>> [image: test.jpg]
>>
>>
>> Program is quite big, but all Deal.II dependencies are encapsulated into 
>> Solver class(
>> https://github.com/okmechak/RiverSim/blob/master/source/river/solver.hpp)
>>
>> which is adaptation of step-6 from tutorials(
>> https://www.dealii.org/current/doxygen/deal.II/step_6.html)
>>
>>
>> It works very well, but I need as much perfomance as it is possible :) 
>>
>>
>> Mesh, as you can see, is very irregular and very dence at some points(see 
>> picture above).
>>
>> On my laptop i5 from wsl(windows subsystem for linux) it takes ~8-10 
>> seconds on DoF with 250,000 degrees(65,000 active cells)
>>
>> And on cluster with 40 processors even longer - 10-13 seconds
>>
>>
>> Also is the solver already(by default) multithread or I should somehow 
>> configure the Deal.II?
>>
>> Regards,
>> Oleg Kmecahk
>>
>>
>>

-- 
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/5719d611-c8f3-4cdc-b8f6-cb31a3a8fdd1%40googlegroups.com.


Re: [deal.II] Re: Optimization of Laplacea Equation Solver

2019-12-06 Thread Oleg Kmechak
Thank You clarification

On Friday, 6 December 2019 14:48:24 UTC+1, Bruno Turcksin wrote:
>
> Oleg, 
>
> Le ven. 6 déc. 2019 à 08:21, Oleg Kmechak  > a écrit : 
> > So I still have to use MPI to make program multihread, even if it is a 
> single machine, with 40 processors inside? 
> > Maybe it is rough understanding, but I always thought that for 
> multicomputer processing is used MPI and for multiprocessor(on single 
> machine) - OpenMP(Which is embedded in deal.ii as far as I know). 
> MPI and multithreading are different things. I am not sure what you 
> mean by multicomputer but you need to use MPI if you have more than 
> one node. You can use multithreading if all the processors are on the 
> same motherboard (there are exception to this though). deal.II does 
> not use OpenMP for multithreading instead it uses TBB but it doesn't 
> really matter. Also while many operations are multithreaded in deal.II 
> not all of them are, so if you really want to use all the processors, 
> you will need to use MPI. 
>
> Best, 
>
> Bruno 
>

-- 
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/de95f88a-0e4f-4979-9c30-ba928e4c9d21%40googlegroups.com.


Re: [deal.II] Re: Optimization of Laplacea Equation Solver

2019-12-06 Thread Bruno Turcksin
Oleg,

Le ven. 6 déc. 2019 à 08:21, Oleg Kmechak  a écrit :
> So I still have to use MPI to make program multihread, even if it is a single 
> machine, with 40 processors inside?
> Maybe it is rough understanding, but I always thought that for multicomputer 
> processing is used MPI and for multiprocessor(on single machine) - 
> OpenMP(Which is embedded in deal.ii as far as I know).
MPI and multithreading are different things. I am not sure what you
mean by multicomputer but you need to use MPI if you have more than
one node. You can use multithreading if all the processors are on the
same motherboard (there are exception to this though). deal.II does
not use OpenMP for multithreading instead it uses TBB but it doesn't
really matter. Also while many operations are multithreaded in deal.II
not all of them are, so if you really want to use all the processors,
you will need to use MPI.

Best,

Bruno

-- 
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/CAGVt9ePyLhSASDZoProvMoe3q2UL8fNgZk7EwucR0bNFvkdsEg%40mail.gmail.com.


[deal.II] Re: Optimization of Laplacea Equation Solver

2019-12-06 Thread Oleg Kmechak


> The first thing to do if you want to speed up you code is to profile your 
> code. How do you know which part of the code is slow?
>
 
Thank you for this advice, it is a good point to look forward. 
Till this moment I was looking on console log to understand perfomance.
 

> In that case, you will need to use MPI.
>

So I still have to use MPI to make program multihread, even if it is a 
single machine, with 40 processors inside? 
Maybe it is rough understanding, but I always thought that for 
multicomputer processing is used MPI and for multiprocessor(on single 
machine) - OpenMP(Which is embedded in deal.ii as far as I know).

Regards,
Oleg

-- 
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/94911b78-65cc-4318-b4cc-0c90ad442cd2%40googlegroups.com.


[deal.II] Re: Optimization of Laplacea Equation Solver

2019-12-05 Thread Bruno Turcksin
Oleg,

The first thing to do if you want to speed up you code is to profile your 
code. How do you know which part of the code is slow? Right now, it sounds 
that you are assuming that it is in the solver which may be true but it may 
not be. If you want to speed up your solver, you can 1) get a better 
preconditioner (maybe using algebraic multigrid) 2) make you code parallel. 
deal.II is multithreaded by default but not every operation is. On top of 
that multithreading does not work if the processors need to communicate 
through the network (which might be the case on the cluster you are 
testing). In that case, you will need to use MPI. Take a look at step-40 
 
It solves the Laplace equation with 52 millions DoFs in less than 10 
seconds on 4000 processors.

Best

Bruno

On Thursday, December 5, 2019 at 9:10:19 AM UTC-5, Oleg Kmechak wrote:
>
> Dear All, 
>
> I am working on RiverSIM program(https://github.com/okmechak/RiverSim/) 
>
> This program solves laplace equation on river network geometry, 
> then makes some computaion(integration over these dence points on picture 
> and other processing) which result in river network evolution step by step.
>
> [image: test.jpg]
>
>
> Program is quite big, but all Deal.II dependencies are encapsulated into 
> Solver class(
> https://github.com/okmechak/RiverSim/blob/master/source/river/solver.hpp)
>
> which is adaptation of step-6 from tutorials(
> https://www.dealii.org/current/doxygen/deal.II/step_6.html)
>
>
> It works very well, but I need as much perfomance as it is possible :) 
>
>
> Mesh, as you can see, is very irregular and very dence at some points(see 
> picture above).
>
> On my laptop i5 from wsl(windows subsystem for linux) it takes ~8-10 
> seconds on DoF with 250,000 degrees(65,000 active cells)
>
> And on cluster with 40 processors even longer - 10-13 seconds
>
>
> Also is the solver already(by default) multithread or I should somehow 
> configure the Deal.II?
>
> Regards,
> Oleg Kmecahk
>
>
>

-- 
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/d1595f6a-206f-4350-9c65-7b39feeafc25%40googlegroups.com.