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.Send cannot work with derived datatypes. #776

Closed
xwuupb opened this issue Oct 6, 2023 · 1 comment
Closed

MPI.Send cannot work with derived datatypes. #776

xwuupb opened this issue Oct 6, 2023 · 1 comment

Comments

@xwuupb
Copy link

xwuupb commented Oct 6, 2023

For example, the MPI C code shown in https://rookiehpc.org/mpi/docs/mpi_type_vector/index.html cannot be written in Julia with MPI.jl. To be specific, I cannot find a straightforward way to re-write the following C code in Julia, if buffer[3][3] is translated as buffer = Matrix{Int32}(undef, (3, 3)) etc, then no way to use MPI.Send in MPI.jl.

int buffer[3][3] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; // L69 in the above link
MPI_Send(&buffer[0][1], 1, column_type, RECEIVER, 0, MPI_COMM_WORLD); // L72 in the above link
@simonbyrne
Copy link
Member

You should be able to just do

buffer = reshape(Int32.(0:8), 3,3)
MPI.Send(view(buffer, 2, :), MPI.COMM_WORLD; dest=RECEIVER, tag=0)

@xwuupb xwuupb closed this as completed Oct 8, 2023
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

No branches or pull requests

2 participants