{"action":"closed","issue":{"url":"https://api.github.com/repos/wesbland/mpi-forum-historic/issues/72","repository_url":"https://api.github.com/repos/wesbland/mpi-forum-historic","labels_url":"https://api.github.com/repos/wesbland/mpi-forum-historic/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/wesbland/mpi-forum-historic/issues/72/comments","events_url":"https://api.github.com/repos/wesbland/mpi-forum-historic/issues/72/events","html_url":"https://github.com/wesbland/mpi-forum-historic/issues/72","id":166696470,"number":72,"title":"Convenience function: MPI_CART_SHIFT_VECTOR","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":[{"url":"https://api.github.com/repos/wesbland/mpi-forum-historic/labels/rejected","name":"rejected","color":"ededed"}],"state":"closed","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/7","html_url":"https://github.com/wesbland/mpi-forum-historic/milestones/2009/06/08%20California","labels_url":"https://api.github.com/repos/wesbland/mpi-forum-historic/milestones/7/labels","id":1894747,"number":7,"title":"2009/06/08 California","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":0,"closed_issues":9,"state":"closed","created_at":"2016-07-20T18:12:54Z","updated_at":"2016-07-20T22:24:37Z","due_on":"2009-06-10T04:00:00Z","closed_at":"2016-07-20T18:12:54Z"},"comments":16,"created_at":"2016-07-20T22:24:01Z","updated_at":"2016-07-20T22:24:37Z","closed_at":"2016-07-20T22:24:37Z","body":"**Originally by _traff_ on 2008-12-15 16:15:55 -0600**\n\n___\n## Description\n\nCartesian topologies provide the convenience function `MPI_Cart_shift` for computing the ranks of processes lying along the coordinate dimensions of a Cartesian topology.\n\nThis is a limited functionality, and some applications do want to\ncommunicate also diagonally in Cartesian grids.\n\nIt is therefore proposed to add a fully general shift function, which instead of a shift in a particular dimension can take an arbitrary displacement vector and shift in that direction.\n\nWhile it is true that it may encourage the user to communitate in directions not well supported by the underlying topology, first it is a natural thing to do in Cartesian topologies (that is, communicating diagonally), second, the same argument goes for the\nlimited `MPI_Cart_shift` function already in MPI.\n\n## History\n\nNone.\n\n## Proposed Solution\n\np.243, line 30, replace:\n\n\"The function MPI_CART_SHIFT provides the information needed to\ncommunicate with neighbors in a Cartesian dimension.\"\n\nby:\n\n\"The function MPI_CART_SHIFT provides the information needed to\ncommunicate with neighbors in a Cartesian dimension, while MPI_CART_SHIFT_VECTOR makes it possible to determine the neighbors in \narbitrary directions in a Cartesian structure.\"\n\np.253, after line 2, add:\n\nThe more general `MPI_CART_SHIFT_VECTOR` function returns the source and destination ranks for a shift with an arbitrary displacement in the Cartesian structure. The displacement is specified by a vector which gives the distance (positive or negative) of the shift for each coordinate dimension.\n\n[[BR]]\n\np.254, after line 3, add:\n\n```\n#!c\nMPI_CART_SHIFT_VECTOR(comm, disp, rank_source, rank_dest)\n  IN  comm         communicator with Cartesian structure (handle)\n  IN  disp         displacement vector (array of integer) giving the\n                   distance of shift in each coordinate dimension\n  OUT rank_source  rank of source process (integer)\n  OUT rank_dest    rank of destination process (integer)\n```\n\n`MPI_Cart_shift_vector(MPI_Comm comm, int *disp, int *rank_source, int *rank_dest)`\n\n```\n#!c\nMPI_CART_SHIFT_VECTOR(COMM, DISP, RANK_SOURCE, RANK_DEST)\n  INTEGER COMM, DISP(*), RANK_SOURCE, RANK_DEST\n```\n\n`void MPI::Cartcomm::Shift_vector(const int disp[], int &rank_source, int& rank_dest) const`\n\nThe `disp` vector specifies the distance of the shift in each coordinate dimension of the Cartesian topology. The size of the vector must be the same as the number of dimensions in the Cartesian topology. For each dimension the entry in the `disp` vector can be positive or negative (or zero). Source and destination processes are determined by subtracting respectively adding the `disp` vector to the coordinates of the calling process. If in any dimension that is not periodic the resulting coordinate is either negative or greater than or equal to the size of the dimension `MPI_PROC_NULL` is returned. For each periodic dimension the resulting coordinate is computed modulo the size of the dimension.\n\n## Impact on Implementations\n\nAn example implementation on top of MPI is attached. It is trivial, but a bit tedious, and shows what the functionality can save the user. \nConstant overhead can of course be saved by having the functionality\nimplemented inside the MPI library.\n\n## Impact on Applications / Users\n\nHelpful to applications that do not only communicate along the deminesions in a Cartesian topology. Will cite such application.\n\n## Alternative Solutions\n\nCan be handcoded with existing functionality.\n\n## Entry for the Change Log\n\nSection 7.5.5 on p. 252\n\nNew function `MPI_Cart_shift_vector` added.\n"}}
{"actor":{"display_login":"wesbland"}}