{"action":"created","issue":{"url":"https://api.github.com/repos/wesbland/mpi-forum-historic/issues/27","repository_url":"https://api.github.com/repos/wesbland/mpi-forum-historic","labels_url":"https://api.github.com/repos/wesbland/mpi-forum-historic/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/wesbland/mpi-forum-historic/issues/27/comments","events_url":"https://api.github.com/repos/wesbland/mpi-forum-historic/issues/27/events","html_url":"https://github.com/wesbland/mpi-forum-historic/issues/27","id":166646888,"number":27,"title":"Regular (non-vector) version of MPI_Reduce_scatter","user":{"login":"wesbland","id":1561207,"avatar_url":"https://avatars.githubusercontent.com/u/1561207?v=3","gravatar_id":"","url":"https://api.github.com/users/wesbland","html_url":"https://github.com/wesbland","followers_url":"https://api.github.com/users/wesbland/followers","following_url":"https://api.github.com/users/wesbland/following{/other_user}","gists_url":"https://api.github.com/users/wesbland/gists{/gist_id}","starred_url":"https://api.github.com/users/wesbland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesbland/subscriptions","organizations_url":"https://api.github.com/users/wesbland/orgs","repos_url":"https://api.github.com/users/wesbland/repos","events_url":"https://api.github.com/users/wesbland/events{/privacy}","received_events_url":"https://api.github.com/users/wesbland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"wesbland","id":1561207,"avatar_url":"https://avatars.githubusercontent.com/u/1561207?v=3","gravatar_id":"","url":"https://api.github.com/users/wesbland","html_url":"https://github.com/wesbland","followers_url":"https://api.github.com/users/wesbland/followers","following_url":"https://api.github.com/users/wesbland/following{/other_user}","gists_url":"https://api.github.com/users/wesbland/gists{/gist_id}","starred_url":"https://api.github.com/users/wesbland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesbland/subscriptions","organizations_url":"https://api.github.com/users/wesbland/orgs","repos_url":"https://api.github.com/users/wesbland/repos","events_url":"https://api.github.com/users/wesbland/events{/privacy}","received_events_url":"https://api.github.com/users/wesbland/received_events","type":"User","site_admin":false},"assignees":[{"login":"wesbland","id":1561207,"avatar_url":"https://avatars.githubusercontent.com/u/1561207?v=3","gravatar_id":"","url":"https://api.github.com/users/wesbland","html_url":"https://github.com/wesbland","followers_url":"https://api.github.com/users/wesbland/followers","following_url":"https://api.github.com/users/wesbland/following{/other_user}","gists_url":"https://api.github.com/users/wesbland/gists{/gist_id}","starred_url":"https://api.github.com/users/wesbland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesbland/subscriptions","organizations_url":"https://api.github.com/users/wesbland/orgs","repos_url":"https://api.github.com/users/wesbland/repos","events_url":"https://api.github.com/users/wesbland/events{/privacy}","received_events_url":"https://api.github.com/users/wesbland/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/wesbland/mpi-forum-historic/milestones/5","html_url":"https://github.com/wesbland/mpi-forum-historic/milestones/2009/02/09%20San%20Jose","labels_url":"https://api.github.com/repos/wesbland/mpi-forum-historic/milestones/5/labels","id":1894745,"number":5,"title":"2009/02/09 San Jose","description":"","creator":{"login":"wesbland","id":1561207,"avatar_url":"https://avatars.githubusercontent.com/u/1561207?v=3","gravatar_id":"","url":"https://api.github.com/users/wesbland","html_url":"https://github.com/wesbland","followers_url":"https://api.github.com/users/wesbland/followers","following_url":"https://api.github.com/users/wesbland/following{/other_user}","gists_url":"https://api.github.com/users/wesbland/gists{/gist_id}","starred_url":"https://api.github.com/users/wesbland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesbland/subscriptions","organizations_url":"https://api.github.com/users/wesbland/orgs","repos_url":"https://api.github.com/users/wesbland/repos","events_url":"https://api.github.com/users/wesbland/events{/privacy}","received_events_url":"https://api.github.com/users/wesbland/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"closed","created_at":"2016-07-20T18:12:53Z","updated_at":"2016-07-20T18:15:54Z","due_on":"2009-02-11T05:00:00Z","closed_at":"2016-07-20T18:12:53Z"},"comments":24,"created_at":"2016-07-20T18:15:28Z","updated_at":"2016-07-20T18:16:19Z","closed_at":null,"body":"**Originally by _traff@par.univie.ac.at_ on 2008-10-10 08:11:15 -0500**\n\n___\n# Regular (block, non-vector) version of MPI_Reduce_scatterSep 8 2008 straw vote:\n\n|| Yes || Maybe || No for 2.2 || Abstain ||\n|| 19 || 6 || 2 || 5 ||\n\nAuthor: Jesper Larsson Träff\n\n## Description\n\nA regular version of the MPI-Reduce_scatter collective operation is proposed. This variant has been shown useful in various contexts (file redundancy checking, implementation of MPI_Win_fence), and it seems an omission that it was not included in MPI-1.0 in the first place: Most other collectives exist in regular and irregular versions.\n\nThe present proposal is based on the comments of Adam Moody and Rolf Rabenseifner. \n\nSuggested changes in the description of the already existing `MPI_REDUCE_SCATTER` to make the two functions uniformly explained have been moved to ticket #124.\n\n## History\n\nHas been discussed since 2002.\n\n## Proposal\n\nReplace p.173, line 14-15:\n\nMPI includes a variant of the reduce operations where the result is scattered to all processes in a group on return. \n\nwith:\n\nMPI includes variants of the reduce operations where the result is scattered to all processes in a group on return. One variant scatters equal-sized blocks to all processes, while another variant scatters blocks that may vary in size for each process. \n\n5.10.1 MPI_Reduce_scatter_block \n\n```\n#!c\nMPI_Reduce_scatter_block(sendbuf,recvbuf,recvcount,datatype,op,comm)\n  IN  sendbuf    starting address of send buffer (choice)\n  OUT recvbuf    starting address of receive buffer (choice)\n  IN  recvcount  element count per block (non-negative integer)\n  IN  datatype   datatype of elements of send and receive buffers (handle)\n  IN  op         operation (handle)\n  IN  comm       communicator (handle)\n```\n\n`int MPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)`\n\n```\n#!c\nMPI_REDUCE_SCATTER_BLOCK(SENDBUF, RECVBUF, RECVCOUNT, DATATYPE, OP, COMM, IERROR)\n<type> SENDBUF(*), RECVBUF(*)\nINTEGER RECVCOUNT, DATATYPE, OP, COMM, IERROR\n```\n\n`void MPI::Comm::Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount, const MPI::Datatype& datatype, const MPI::Op& op) const = 0`\n\nIf `comm` is an intracommunicator, `MPI_REDUCE_SCATTER_BLOCK` first performs a global, element-wise reduction on vectors of `count = n*recvcount` elements in the send buffers defined by `sendbuf`, `count` and `datatype`, using the operation `op`, where `n` is the number of processes in the group of `comm`. All processes must give the same value for `recvcount`.\nThe resulting vector is treated as `n` consecutive blocks of `recvcount` elements that are scattered to the processes of the group. The `i`-th block is sent to process `i` and stored in the receive buffer defined\nby `recvbuf`, `recvcount`, and `datatype`. \n\nAdvice to implementors: The `MPI_REDUCE_SCATTER_BLOCK` routine is functionally equivalent to: an `MPI_REDUCE` collective operation with `count` equal to `recvcount*n`, followed by an `MPI_SCATTER` with `sendcount` equal to `recvcount`. However, a direct implementation may run faster. (End of advice to implementors.) \n\nThe \"in place\" option for intracommunictors is specified by passing `MPI_IN_PLACE` in the `sendbuf` argument on **all** processes. In this case, the input data is taken from the receive buffer.\n\nIf `comm` is an intercommunicator, then the result of the reduction of the data provided by processes in one group (group A) is scattered among processes in the other group (group B) and vice versa. The total number of elements, `recvcount*n`, of the two groups must be the same. \n\nRationale. The last restriction is needed so that the length of the send buffer of one group can be determined by the local recvcount argument of the other group. Otherwise, a communication is needed to figure out how many elements are reduced. (End of rationale.) \n\n5.10.2 MPI_Reduce_scatter \n\n`MPI_REDUCE_SCATTER` extends the functionality of `MPI_REDUCE_SCATTER_BLOCK` such that the scattered blocks can vary in size. Block sizes are determined by the `recvcounts` array, such that the `i`-th block contains `recvcounts[i]` elements. \n\n## Impact on Implementations\n\nMinor. For intracommunicators the new function can be trivially implemented by `MPI_Reduce` followed by `MPI_Scatter`. However, there is potential for (considerably) more efficient implementations. An implementation for intercommunicators can likewise easily be given in terms of `MPI_Reduce` and `MPI_Scatter` (example code can be provided).\n\n## Impact on Applications / Users\n\nSince it is a proposed addition there is no direct impact. However, in the case where the reduce-scatter problem to be solved by the user is regular, the new function is less complex, more convenient (no need to allocate and initalize a\ncounts vector, with idential entries), more scalable, and can be given a more efficient implementation than the irregular MPI_Reduce_scatter collective.\n\n## Use cases\n\n(Thanks to Mike Kirby): The canonical application of `MPI_Reduce_scatter` is probably matrix-vector multiply, Ax = y.\n\nAssume each process has some a,,j,,, a,,j+1,,, ... columns of the matrix\nand the corresponding rows x,,j,,, x,,j+1,,, ... of the vector. To produce rows y,,j,,, y,,j+1,,, ... of the result vector\n\n1. each process computes locally a vector [a,,ij,,x,,j,,+a,,i,(j+1),,x,,(j+1),,+...],,i,,\n\n2. by a `MPI_Reduce_scatter` the result columns y,,j,, = a,,j0,,x,,0,,+a,,j1,,x,,1,,+...+a,,jn,,x,,n,, are computed (adding the locally computed vectors) and scattered to the right process.\n\n`MPI_Reduce_scatter_block` can be used if the processes stores the *same* number of columns.\n\n`MPI_Reduce_scatter_block` is directly used\nin efficient implementation of `MPI_Win_fence` (Traff, EuroPVM/MPI 2005, pp. 129-137), and in efficient I/O redundancy checking (Gropp, Ross, Miller, EuroPVM/MPI 2004, pp. 77-86).\n\n## Implementation\n\nSee attachment.\n\n## Alternative Solutions\n\n## Entry for the Change Log\n\nSection 5.10.1 on page 174. \n\nNew collective function `MPI_REDUCE_SCATTER_BLOCK` must be added.\n"},"comment":{"url":"https://api.github.com/repos/wesbland/mpi-forum-historic/issues/comments/234034676","html_url":"https://github.com/wesbland/mpi-forum-historic/issues/27#issuecomment-234034676","issue_url":"https://api.github.com/repos/wesbland/mpi-forum-historic/issues/27","id":234034676,"user":{"login":"wesbland","id":1561207,"avatar_url":"https://avatars.githubusercontent.com/u/1561207?v=3","gravatar_id":"","url":"https://api.github.com/users/wesbland","html_url":"https://github.com/wesbland","followers_url":"https://api.github.com/users/wesbland/followers","following_url":"https://api.github.com/users/wesbland/following{/other_user}","gists_url":"https://api.github.com/users/wesbland/gists{/gist_id}","starred_url":"https://api.github.com/users/wesbland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesbland/subscriptions","organizations_url":"https://api.github.com/users/wesbland/orgs","repos_url":"https://api.github.com/users/wesbland/repos","events_url":"https://api.github.com/users/wesbland/events{/privacy}","received_events_url":"https://api.github.com/users/wesbland/received_events","type":"User","site_admin":false},"created_at":"2016-07-20T18:16:19Z","updated_at":"2016-07-20T18:16:19Z","body":"**Originally by _rabenseifner@hlrs.de_ on 2009-02-10 18:54:37 -0600**\n\n___\n1. Please, substitute\n\n All processes must give the same value for recvcount. \n\nby \n\n The routine is called by all group members using the same arguments for recvcount, \n datatype, op and comm.\n\n(This text is from p160:32-33.)\n\n2. Please substitute in the pargraph on intercomms:\n\n The total number of elements, recvcount*n, of the two groups must be the same.\n\nby\n\n Within each group, all processes provide the same recvcounts argument, and the sum \n of the recvcounts entries should be the same for the two groups, and which defines\n the count of the send buffer. \n\n3. Change-Log should be written in a descriptive way.\n\n New collective function MPI_REDUCE_SCATTER_BLOCK must be added. \n\nmay be substituted by\n\n The collective function MPI_REDUCE_SCATTER_BLOCK is added to the MPI standard. \n"}}
{"actor":{"display_login":"wesbland"}}