Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenMP algebra and operations #6

Open
neapel opened this issue Jun 11, 2013 · 5 comments
Open

OpenMP algebra and operations #6

neapel opened this issue Jun 11, 2013 · 5 comments
Assignees

Comments

@neapel
Copy link

neapel commented Jun 11, 2013

No description provided.

@ghost ghost assigned neapel Jun 11, 2013
neapel pushed a commit that referenced this issue Jun 14, 2013
Use it manually with a Random Access Container. #6
@neapel
Copy link
Author

neapel commented Jun 14, 2013

I made a BOOST_ODEINT_GEN_FOR_EACH macro to generate the for_eachN functions for the algebra since it turned out to be quite error-prone and tedious to manually write them (and there will be changes I don't want to have to copy manually). The downside is that these don't work in C++03 with #pragma omp since there's no _Pragma yet, so they will eventually have to be unrolled again. But the macros might be useful for the other algebras/operations? Currently not all of them support all sizes, the helper macros allow easily setting a maximum size to generate…

@headmyshoulder
Copy link
Member

This looks like a very good enhancement of odeints algebras and
operations. Where can I see the code? I have looked a bit around but I
could not find it.

Btw. should we pack this in a separate branch? Just in case we merge
this very soon in odeint's master it might be good to do this separately
from the OpenMP and MPI stuff.

On 06/14/2013 11:55 PM, neapel wrote:

I made a |BOOST_ODEINT_GEN_FOR_EACH| macro to generate the |for_eachN|
functions for the algebra since it turned out to be quite error-prone
and tedious to manually write them (and there will be changes I don't
want to have to copy manually). The downside is that these don't work in
C++03 with |#pragma omp| since there's no |_Pragma| yet, so they will
eventually have to be unrolled again. But the macros might be useful for
the other algebras/operations? Currently not all of them support all
sizes, the helper macros allow easily setting a maximum size to generate…


Reply to this email directly or view it on GitHub
#6 (comment).

@neapel
Copy link
Author

neapel commented Jun 15, 2013

The macros are in n_ary_helper.hpp, but I'll split the commits and I put the macros into boost/numeric/odeint/util/ in master and branch openmp from there

neapel pushed a commit that referenced this issue Jun 15, 2013
@mariomulansky
Copy link

I think we should add schedule( runtime ) to the omp pragmas in the algebra. then the user can configure the scheduling with omp_set_schedule in the beginning of his program.

@headmyshoulder
Copy link
Member

On 15.06.2013 16:01, neapel wrote:

The macros are in n_ary_helper.hpp
https://github.com/BoostGSoC/odeint-v2/blob/1725e45ac5a41b14ae0e43902e6a091beebfd095/boost/numeric/odeint/external/openmp/n_ary_helper.hpp,
but I'll split the commits and I put the macros into
|boost/numeric/odeint/util/| in |master| and branch |openmp| from there

Maybe it is better to put it into algebra/detail. Unfortunately, there
is no clear definition what should be in utils, but I think the
n_ary_helpers will only be used from the algebras.


Reply to this email directly or view it on GitHub
#6 (comment).

neapel pushed a commit that referenced this issue Jun 18, 2013
State splits a given Range into an InnerState, one for each thread. The algebra's for_eachN calls for_eachN in parallel on each part, using the InnerState's algebra. There's an openmp_wrapper to parallelize the system function; this needs a way to pass on the offset.

The idea was that this design should allow using OpenMP on each MPI node with a single-threaded inner_state: mpi_state< openmp_state< inner_state > > with mpi_wrapper(openmp_wrapper(system_function))
neapel pushed a commit that referenced this issue Jun 18, 2013
State splits a given Range into an InnerState, one for each thread. The algebra's for_eachN calls for_eachN in parallel on each part, using the InnerState's algebra. There's an openmp_wrapper to parallelize the system function; this needs a way to pass on the offset.

The idea was that this design should allow using OpenMP on each MPI node with a single-threaded inner_state: mpi_state< openmp_state< inner_state > > with mpi_wrapper(openmp_wrapper(system_function))
neapel pushed a commit that referenced this issue Jul 19, 2013
openmp_range_algebra: parallel for over a random access container.
openmp_nested_algebra: processs parts of a split container in parallel.
openmp_state: a split container based on vector<vector<>>.
openmp_algebra: use a range_algebra on each part of that container.
neapel pushed a commit that referenced this issue Aug 6, 2013
neapel pushed a commit that referenced this issue Aug 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants