Parallelization of two step method

17 views
Skip to first unread message

Mustafa Aggul

unread,
Dec 10, 2017, 4:06:21 PM12/10/17
to dea...@googlegroups.com
Hello,

I have a two-step method to be run in parallel. It gives an approximation in the first step (FS), and solves for a correction step (CS). I have read a lot about shared memory parallelization, but I couldn't figure out how to do it. 

The corresponding part in my current code looks as follows: 


namespace ADM_deferred_correction
{
  using namespace dealii;

  template <int dim>
  class ADM_deferred_correction_original
  {
  public:
    ADM_deferred_correction_original(const double viscosity,
             const double delta_t,
const double final_time);
    void run(const unsigned int n_refinements);

  private:
   ... other pieces
    void run_FS(const unsigned int n_time_steps);
    void run_CS(const unsigned int n_time_steps);
    ... other pieces
}

  template <int dim>
  void ADM_deferred_correction_original<dim>::run(const unsigned int n_refinements)
  {
    setup_dofs();
    initial_construction();
    .
            .
            .
    run_FS(n_time_steps);
    run_CS(n_time_steps);
  }


Here, run_FS(n_time_steps) is independent from CS, so I can run it a little bit earlier but parallel to run_CS(n_time_steps). I think I can take care of running it earlier part with mutex, but I couldn't create a working thread for these two different runs. This might be an easy task but I just couldn't figure out for some reason. Any reference, or a piece of code would be greatly appreciated. 

Thanks,

Mustafa.

Bruno Turcksin

unread,
Dec 10, 2017, 6:03:43 PM12/10/17
to deal.II User Group
Mustafa,


On Sunday, December 10, 2017 at 4:06:21 PM UTC-5, Mustafa Aggul wrote:
Here, run_FS(n_time_steps) is independent from CS, so I can run it a little bit earlier but parallel to run_CS(n_time_steps). I think I can take care of running it earlier part with mutex, but I couldn't create a working thread for these two different runs. This might be an easy task but I just couldn't figure out for some reason. Any reference, or a piece of code would be greatly appreciated. 

Mustafa Aggul

unread,
Dec 10, 2017, 7:31:13 PM12/10/17
to dea...@googlegroups.com
I have seen this page already and followed the same idea there in my code but couldn't figured out what was wrong earlier. Hopefully, I have changed couple of thing, and it works now. 

Thanks a lot Bruno,

Mustafa.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mustafa Aggul
Department of Mathematics
Michigan Technological University
1400 Townsend Drive
Houghton, Michigan 49931-1295
Reply all
Reply to author
Forward
0 new messages