allfem_builds ([info]allfem_builds) wrote,

Details behind Data-Map-View pattern

Memfem uses a powerful Data/Map paradigm to control its distributed vectors and matrcicies.

The Data object controlls data distribution across processors. Given N data items, it will split things so that the first 1...n_1 items are on the first processor, the n_1+1..n_1+n_2 items are on the second processor, etc. n_1..n_m are adjustable, but must sum to N.

The Data object can also create Petsc Vectors, and creates the vectors in such a way that it always has direct access to local elements.

The Map object maps indicies to indicies. It is mostly a virutal class whose behavior is totally determined by a few virtual functions
is_public - returns true if the value at the given index is known to all processors
is_combined - returns true if this index has been added to another index
combine_to - what new_index this index shoudl be combined to
process - takes a raw data element and converts it into what it should be. Useful for is_public nodes.
app_size - range of inputs

Using these functions, the mapping creates a onto mapping to a data object.
location - performs the mapping
data_size - returns the length of the data size


Using these two objects, I can do things like generalized gathers and scatters between vectors.

  • Post a new comment

    Error

    Your IP address will be recorded 

  • 0 comments
Create an Account
Forgot your login or password?
Facebook Twitter More login options
English • Español • Deutsch • Русский…