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

MPI_ORDER_FORTRAN for MPI subarrays #5

Open
cwpearson opened this issue Apr 9, 2021 · 1 comment
Open

MPI_ORDER_FORTRAN for MPI subarrays #5

cwpearson opened this issue Apr 9, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@cwpearson
Copy link
Owner

cwpearson commented Apr 9, 2021

Some interest in supporting MPI_ORDER_FORTRAN in MPI_Type_create_subarray calls from the Exascale Computing Project.

@cwpearson cwpearson self-assigned this Apr 9, 2021
@cwpearson
Copy link
Owner Author

First modifications will principally happen here:

if (order != MPI_ORDER_C) {
LOG_ERROR("unhandled order in subarray type");
return Type();
}
MPI_Datatype oldtype = datatypes[0];
MPI_Aint oldLb, oldExtent;
int oldSize;
MPI_Type_get_extent(oldtype, &oldLb, &oldExtent);
MPI_Type_size(oldtype, &oldSize);
for (int i = 0; i < ndims; ++i) {
// int size = integers[1 + ndims * 0 + i];
int subsize = integers[1 + ndims * 1 + i]; // subsize[i]
int start = integers[1 + ndims * 2 + i];
StreamData data{};
data.off = start * oldExtent;
data.stride = oldExtent;
for (int j = i + 1; j < ndims; ++j) {
data.stride *= integers[1 + ndims * 0 + j]; // size[j]
data.off *= integers[1 + ndims * 0 + j]; // size[j]
}
data.count = subsize;
datas.push_back(data);
}
std::reverse(datas.begin(), datas.end());

@cwpearson cwpearson added the enhancement New feature or request label Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant