Skip to content

Add typemap routines#10

Closed
hzhou wants to merge 6 commits intomainfrom
2103_typemap
Closed

Add typemap routines#10
hzhou wants to merge 6 commits intomainfrom
2103_typemap

Conversation

@hzhou
Copy link
Copy Markdown
Owner

@hzhou hzhou commented Apr 18, 2021

Pull Request Description

Provide two internal utility functions:

  1. struct typemap *MPIR_type_get_typemap(MPI_Datatype dt)
  2. struct typesig *MPIR_type_get_typesig(MPI_Datatype dt)

with

struct typemap {
    MPI_Aint n;
    MPI_Datatype *types;
    MPI_Aint *disps;
};

struct typesig {
    MPI_Aint n;
    MPI_Datatype *types;
    MPI_Aint *counts;
};

These two function returns an internal data structure with allocated memory, so it is difficult to expose to the user. So we also provide two user functions that just prints to stdout (I know, not ideal):

  1. MPIX_Type_dump_typemap(MPI_Datatype datatype)
  2. MPIX_Type_dump_typesig(MPI_Datatype datatype)

Author Checklist

  • Provide Description
    Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
  • Commits Follow Good Practice
    Commits are self-contained and do not do two things at once.
    Commit message is of the form: module: short description
    Commit message explains what's in the commit.
  • Passes All Tests
    Whitespace checker. Warnings test. Additional tests via comments.
  • Contribution Agreement
    For non-Argonne authors, check contribution agreement.
    If necessary, request an explicit comment from your companies PR approval manager.

@hzhou hzhou force-pushed the 2103_typemap branch 2 times, most recently from 36ed4ec to 74e22a2 Compare April 27, 2021 22:39
Even though a struct may have heterogenous basic datatypes, the
builtin-elements count is still meaningful. For example, it is the
number of entries in the typemap.

This commit prepares for typemap utilitis. Typemap is useful for
debugging datatype issues and simplify algorithms.
@hzhou hzhou force-pushed the 2103_typemap branch 2 times, most recently from 743d3fb to 2c38a75 Compare April 27, 2021 22:44
hzhou added 5 commits April 27, 2021 17:47
Handle MPI_2INT correctly for n_builtin_elements, builtin_element_size,
and basic_type.
Adds type map and type signature routines. These routines are useful for
debugging and datatype functions such as type matching and external32
packing/unpacking.
Add MPIX_Type_dump_typemap and MPIX_Type_dump_typesig. These functions
allows datatype debugging and testing.
The typemap routines are very complex to maintain. The MyDef sources
allow higher level code organizations.
@hzhou
Copy link
Copy Markdown
Owner Author

hzhou commented May 27, 2021

Replace by #17

@hzhou hzhou closed this May 27, 2021
@hzhou hzhou deleted the 2103_typemap branch November 26, 2024 23:24
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

Successfully merging this pull request may close these issues.

1 participant