{"action":"created","issue":{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/80","repository_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic","labels_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/80/comments","events_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/80/events","html_url":"https://github.com/mpiforumbot/mpi-forum-historic/issues/80","id":167219121,"number":80,"title":"Misleading discussion of thread ordering","user":{"login":"mpiforumbot","id":20617676,"avatar_url":"https://avatars.githubusercontent.com/u/20617676?v=3","gravatar_id":"","url":"https://api.github.com/users/mpiforumbot","html_url":"https://github.com/mpiforumbot","followers_url":"https://api.github.com/users/mpiforumbot/followers","following_url":"https://api.github.com/users/mpiforumbot/following{/other_user}","gists_url":"https://api.github.com/users/mpiforumbot/gists{/gist_id}","starred_url":"https://api.github.com/users/mpiforumbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpiforumbot/subscriptions","organizations_url":"https://api.github.com/users/mpiforumbot/orgs","repos_url":"https://api.github.com/users/mpiforumbot/repos","events_url":"https://api.github.com/users/mpiforumbot/events{/privacy}","received_events_url":"https://api.github.com/users/mpiforumbot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/labels/Enhancements%20to%20standard","name":"Enhancements to standard","color":"fbca04"},{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/labels/Forum%20feedback%20requested","name":"Forum feedback requested","color":"f9d0c4"},{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/labels/MPI%202%5C.2","name":"MPI 2\\.2","color":"ededed"},{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/labels/Withdrawn","name":"Withdrawn","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"mpiforumbot","id":20617676,"avatar_url":"https://avatars.githubusercontent.com/u/20617676?v=3","gravatar_id":"","url":"https://api.github.com/users/mpiforumbot","html_url":"https://github.com/mpiforumbot","followers_url":"https://api.github.com/users/mpiforumbot/followers","following_url":"https://api.github.com/users/mpiforumbot/following{/other_user}","gists_url":"https://api.github.com/users/mpiforumbot/gists{/gist_id}","starred_url":"https://api.github.com/users/mpiforumbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpiforumbot/subscriptions","organizations_url":"https://api.github.com/users/mpiforumbot/orgs","repos_url":"https://api.github.com/users/mpiforumbot/repos","events_url":"https://api.github.com/users/mpiforumbot/events{/privacy}","received_events_url":"https://api.github.com/users/mpiforumbot/received_events","type":"User","site_admin":false},"assignees":[{"login":"mpiforumbot","id":20617676,"avatar_url":"https://avatars.githubusercontent.com/u/20617676?v=3","gravatar_id":"","url":"https://api.github.com/users/mpiforumbot","html_url":"https://github.com/mpiforumbot","followers_url":"https://api.github.com/users/mpiforumbot/followers","following_url":"https://api.github.com/users/mpiforumbot/following{/other_user}","gists_url":"https://api.github.com/users/mpiforumbot/gists{/gist_id}","starred_url":"https://api.github.com/users/mpiforumbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpiforumbot/subscriptions","organizations_url":"https://api.github.com/users/mpiforumbot/orgs","repos_url":"https://api.github.com/users/mpiforumbot/repos","events_url":"https://api.github.com/users/mpiforumbot/events{/privacy}","received_events_url":"https://api.github.com/users/mpiforumbot/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/milestones/6","html_url":"https://github.com/mpiforumbot/mpi-forum-historic/milestones/2009/04/06%20Chicago","labels_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/milestones/6/labels","id":1900467,"number":6,"title":"2009/04/06 Chicago","description":"","creator":{"login":"mpiforumbot","id":20617676,"avatar_url":"https://avatars.githubusercontent.com/u/20617676?v=3","gravatar_id":"","url":"https://api.github.com/users/mpiforumbot","html_url":"https://github.com/mpiforumbot","followers_url":"https://api.github.com/users/mpiforumbot/followers","following_url":"https://api.github.com/users/mpiforumbot/following{/other_user}","gists_url":"https://api.github.com/users/mpiforumbot/gists{/gist_id}","starred_url":"https://api.github.com/users/mpiforumbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpiforumbot/subscriptions","organizations_url":"https://api.github.com/users/mpiforumbot/orgs","repos_url":"https://api.github.com/users/mpiforumbot/repos","events_url":"https://api.github.com/users/mpiforumbot/events{/privacy}","received_events_url":"https://api.github.com/users/mpiforumbot/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":6,"state":"closed","created_at":"2016-07-23T22:09:07Z","updated_at":"2016-07-24T05:58:41Z","due_on":"2009-04-08T04:00:00Z","closed_at":"2016-07-23T22:09:07Z"},"comments":7,"created_at":"2016-07-24T05:58:38Z","updated_at":"2016-07-24T06:03:46Z","closed_at":null,"body":"**Originally by _gropp_ on 2008-12-19 17:06:19 -0600**\n\n___\n## Description\nOn page 42, lines 10-17, there is a description of ordering of point to point operations in multi-threaded MPI applications that can be read to imply that send operations, in separate threads, may not preserve order even if there is a well-defined order (enforced, for example, with a pthread_barrier).  This is a proposal to more precisely word this paragraph to make it clear under what cases a multithreaded code must preserve order.  E.g., In the case:\n\n\n```\n   thread a                thread b\n   MPI_Send()\n   pthread_barrier_wait    pthread_barrier_wait\n                           MPI_Send()\n```\n\nAre the sends ordered or not?  Note that there is no valid interleaving that puts the MPI_Send in thread b before the MPI_Send in thread a.\n\n## History\n\nThere is/was another ticket (#144) that proposed a similar fix.  This ticket combines the two.\n\n## Proposed Solution\n\nPage 42, lines 10-17:  Replace\n\n  If a process has a single thread of execution, then any two communications executed  by this process are ordered. On the other hand, if the process is multi-threaded, then the semantics of thread execution may not deﬁne a relative order between two send operations executed by two distinct threads. The operations are logically concurrent, even if one physically precedes the other. In such a case, the two messages sent can be received in any order. Similarly, if two receive operations that are logically concurrent receive two successively sent messages, then the two messages can match the two receives in either order. \n\nwith \n\nIf a process has a single thread of execution, then any two communications executed by this process are ordered. On the other hand, if the process is multi-threaded, then the semantics of thread execution **might** not deﬁne a relative order between two send operations executed by two distinct threads.  **However, it may be possible to define such an order by using  operations defined between threads, such as the use of pthread_barrier_wait when using POSIX threads.  If an order is *not* defined,** the operations are logically concurrent, even if one physically precedes the other. In such a case, the two messages sent can be received in any order. Similarly, if two receive operations that are logically concurrent receive two successively sent messages, then the two messages can match the two receives in either order. \n\n## Impact on Implementations\n\nImplementations would have to enforce the ordering of sends and receives on different threads.  Since the MPI implementation cannot tell whether there was explicit synchronization, it would have to assume that there was explicit synchronization between any two sends (or receives) that do not overlap, i.e., two sends do not overlap if the first MPI_Send() returns before the second MPI_Send() is called.\n\nIt is possible than an implementation interpreted the standard to say that sends/receives are **never** ordered between threads, and so, for performance reasons, allows each thread to have it's own send path (separate queues, DMA, network injection port, etc) and receive path (to perform sending and matching from different threads in parallel).  Such an implementation would need to be changed.\n\n## Impact on Applications / Users\n\nUsers would have a way to enforce ordering between sends on different threads.  I suspect that many users are already using barriers to do this.\n\n## Alternative Solutions\n\nnone\n\n## Entry for the Change Log\n\nSection 3.5 on page 42.\n\nOrdering guarantees of send or receive operations on different threads have been clarified.\n"},"comment":{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/comments/234759830","html_url":"https://github.com/mpiforumbot/mpi-forum-historic/issues/80#issuecomment-234759830","issue_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/80","id":234759830,"user":{"login":"mpiforumbot","id":20617676,"avatar_url":"https://avatars.githubusercontent.com/u/20617676?v=3","gravatar_id":"","url":"https://api.github.com/users/mpiforumbot","html_url":"https://github.com/mpiforumbot","followers_url":"https://api.github.com/users/mpiforumbot/followers","following_url":"https://api.github.com/users/mpiforumbot/following{/other_user}","gists_url":"https://api.github.com/users/mpiforumbot/gists{/gist_id}","starred_url":"https://api.github.com/users/mpiforumbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpiforumbot/subscriptions","organizations_url":"https://api.github.com/users/mpiforumbot/orgs","repos_url":"https://api.github.com/users/mpiforumbot/repos","events_url":"https://api.github.com/users/mpiforumbot/events{/privacy}","received_events_url":"https://api.github.com/users/mpiforumbot/received_events","type":"User","site_admin":false},"created_at":"2016-07-24T06:03:45Z","updated_at":"2016-07-24T06:03:45Z","body":"**Originally by _schulzm_ on 2009-04-07 12:44:30 -0500**\n\n___\nAdded myself as a reviewer\n\nSomeone should check if pthread_barrier_wait is really a call defined by the POSIX\nstandard (at least ~10 years ago it was not). If it is not, the reference to POSIX\nshould be removed in the text or pthread_barrier should be replaced with \"a thread\nbarrier operation\". If it is, the text should say pthread_barrier_wait() instead of\npthread_barrier.\n\nBesides that, this ticket looks good to me"}}
{"actor":{"display_login":"mpiforumbot"}}