0

I'd like to ask how can I create MPI distributed array of integers in C with access by global indexing. I means, I'd like to create MPI array over for example 5 processor with for example 3 block size of first process, 4 block size of second process etc and I'd like to access to element value by global indexing.

1 Answer 1

2

So there's two ways you can do this:

  • First, you can use MPI RMA to allocate memory on a group of processes and use MPI_PUT and MPI_GET to access the memory appropriately. This won't give you the directly accessible memory that you seem to want when you say "global indexing", but it's the best way to do this with MPI directly.

  • The other, and perhaps better option is to use a programming model purpose built for this use, like Global Arrays, UPC, or Co-array FORTRAN. All of these can give you the distributed memory with global indexing that you seem to be looking for and some of them are even built (or can be built) on MPI under the hood.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.