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.