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

op: replace predefined datatype on input #5776

Merged
merged 1 commit into from
Feb 21, 2022
Merged

Conversation

hzhou
Copy link
Contributor

@hzhou hzhou commented Jan 19, 2022

Pull Request Description

We are supposed to support operations on some predefined datatype, such
as those from MPI_Type_create_f90_xxx. However, those types are in fact
derived types wraps around a basic type. Check and replace the input
datatype with the basic type if that is the case so the reduction can
work. Since the datatype in these case are all input only parameters,
there shouldn't be any side effects replacing them.

Fixes #1769

[skip warnings]

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
Copy link
Contributor Author

hzhou commented Jan 19, 2022

test:mpich/ch3/most
test:mpich/ch4/most

@hzhou hzhou requested a review from raffenet February 10, 2022 14:30
@hzhou
Copy link
Contributor Author

hzhou commented Feb 10, 2022

test:mpich/ch3/most
test:mpich/ch4/most

Comment on lines +99 to +105
if (dt_ptr && dt_ptr->contents) {
int combiner = dt_ptr->contents->combiner;
if (combiner == MPI_COMBINER_F90_REAL ||
combiner == MPI_COMBINER_F90_COMPLEX || combiner == MPI_COMBINER_F90_INTEGER) {
if (MPI_SUCCESS == (*MPIR_OP_HDL_TO_DTYPE_FN(op)) (dt_ptr->basic_type)) {
alt_dt = dt_ptr->basic_type;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason not to use MPIR_Datatype_get_basic_type instead of checking the combiner?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basic_type will not tell us whether it is one of the predefined F90 types, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raffenet Is this question resolved?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. Wasn't totally aware of these "predefined" types in the standard. Calls into question some of the code that identifies predefined datatypes in MPICH, but that's a separate story.

We are supposed to support operations on some predefined datatype, such
as those from MPI_Type_create_f90_xxx. However, those types are in fact
derived types wraps around a basic type. Check and replace the input
datatype with the basic type if that is the case so the reduction can
work. Since the datatype in these case are all input only parameters,
there shouldn't be any side effects replacing them.
@hzhou hzhou merged commit 908c021 into pmodels:main Feb 21, 2022
@hzhou hzhou deleted the 2201_op_predef branch February 21, 2022 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: datatypes created by MPI_Type_create_f90_real not usable in MPI operations
2 participants