Skip to content

Rework intro tutorial reduction examples #37

@rhornung67

Description

@rhornung67

Currently, intro example 5, 6, 7, 8 are pretty similar. Each does the same simple reduction, which gives the same result in serial or parallel because there is no potential non-determinism. Then, each example differs from the others by Umpire memory usage and RAJA exec policies.

I think it would be better to change the examples a bit and interleave them with a slide or two that sets the context and what is to be shown by each example. For example,

  • Introduce the notion of a parallel (sum) reduction and how the result could be non-repeatable due to parallel operation ordering
  • Change example 5 to initialize the arrays in a way that can introduce non-determinism in the reduction result and use an OpenMP parallel for reduction. The code changes I have in mind are in a PR I submitted Example comment edits, rework example #41 Run the reduction code a few times to show that the results are close but not exactly the same.
  • Remove example 6 as system UM is really not a good thing to get people started on. Instead, I would add a slide and describe how it works and some of its pitfalls (actual allocation size does not match requested size in most cases, and transfers are triggered through system page faults, etc.)
  • Introduce the notion of host-device memory spaces and the need to copy data between them to initialize data on the host, for example, and execute a kernel.
  • Change reduction code in example 7 to follow the change for example 5 described above. Then, walk through example 7 (rename to example 6) illustrating the use of host and device Umpire allocators and the memory copies in the code.
  • Use example 8 to show things about the Umpire memory pool. As it is now, it is just a small code change from the others and doesn't help me understand what a memory pool is or why I would want to use one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions