MPI_AlltoAllv Function Outline int MPI_Alltoallv ( void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype sendtype, void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype recvtype, MPI_Comm comm ) Input Parameters sendbuf starting address of send buffer (choice) sendcounts integer array equal to the group size specifying the number of elements to send to each processor sdispls integer array (of length group size). Entry j specifies the displacement (relative to sendbuf from which to take the outgoing data destined for process j recvcounts integer array equal to the group size specifying the maximum number of elements that can be received from each processor rdispls integer array (of length group size). Entry i specifies the displacement (relative to recvbuf at which to place the incoming data from process i
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc 2 send buffer send count array send displacement array Each node in parallel community has
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index start at index 0
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index get next 2 elements
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index send to receive buffer of proc with same rank as index
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index send to receive buffer of proc with same rank as index this chunk of send buffer goes to receive buffer of proc 0
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index for this proc’s next send, start at index 2 of send buffer
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index get next 3 elements of send buffer
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index send to receive buffer of proc 1
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index for final send, start at index 5
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index get next 2 elements
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index send to receive buffer of proc 2
A 1B 2C 3D 4E 5F 6G Example of Send for Proc 0 Proc 0 send buffer sendcount Array sdispl Array index this process occurs for each node in the community
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc proc proc proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B proc proc proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B proc C 1D 2E proc proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B proc C 1D 2E proc F 1G proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B proc C 1D 2E proc F 1G proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B 2H 3I 4J proc C 1D 2E proc F 1G proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B 2H 3I 4J proc C 1D 2E 3K 4L 5M proc F 1G proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B 2H 3I 4J proc C 1D 2E 3K 4L 5M proc F 1G 2N proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B 2H 3I 4J proc C 1D 2E 3K 4L 5M proc F 1G 2N proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B 2H 3I 4J 5O proc C 1D 2E 3K 4L 5M proc F 1G 2N proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B 2H 3I 4J 5O proc C 1D 2E 3K 4L 5M 6P 7Q 8 proc F 1G 2N proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B 2H 3I 4J 5O proc C 1D 2E 3K 4L 5M 6P 7Q 8 proc F 1G 2N 3R 4S 5T 6U 7 8 proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
A 1B 2C 3D 4E 5F 6G 0H 1I 2J 3K 4L 5M 6N 0O 1P 2Q 3R 4S 5T 6U proc 0proc 1proc A 1B 2H 3I 4J 5O proc C 1D 2E 3K 4L 5M 6P 7Q 8 proc F 1G 2N 3R 4S 5T 6U 7 8 proc 2 SENDSEND RECEIVERECEIVE rcntrcnt rdsplrdspl rbufferrbuffer
Notes on AlltoAllv A receive buffer could potentially be as large as the sum of all send buffer sizes Care must be taken to coincide send counts with receive counts and displacements so data is not overwritten