{"action":"created","issue":{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/294","repository_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic","labels_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/294/labels{/name}","comments_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/294/comments","events_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/294/events","html_url":"https://github.com/mpiforumbot/mpi-forum-historic/issues/294","id":167243323,"number":294,"title":"MPI_UNWEIGHTED should not be NULL","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/Correction%20to%20standard%20%5C(for%20upcoming%20release%5C)","name":"Correction to standard \\(for upcoming release\\)","color":"ededed"},{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/labels/MPI%203%5C.0","name":"MPI 3\\.0","color":"ededed"},{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/labels/Text%20committed","name":"Text committed","color":"d93f0b"},{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/labels/Waiting%20for%20PDF%20reviews","name":"Waiting for PDF reviews","color":"fef2c0"}],"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/27","html_url":"https://github.com/mpiforumbot/mpi-forum-historic/milestones/2012/07/16%20Chicago,%20USA","labels_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/milestones/27/labels","id":1900488,"number":27,"title":"2012/07/16 Chicago, USA","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":5,"state":"closed","created_at":"2016-07-23T22:09:13Z","updated_at":"2016-07-24T17:47:34Z","due_on":"2012-07-19T19:00:00Z","closed_at":"2016-07-23T22:09:13Z"},"comments":27,"created_at":"2016-07-24T17:17:07Z","updated_at":"2016-07-24T17:47:38Z","closed_at":null,"body":"**Originally by _goodell_ on 2011-09-15 15:49:54 -0500**\n\n___\n## Description\n\nThe MPI-2.2, p.255 l.38, the standard recommends that in the C bindings the value of `MPI_UNWEIGHTED` should be `NULL`.  This implementation choice makes the OUT value returned by `MPI_Dist_graph_neighbors_count` ambiguous for certain graphs.\n\nFor example, the implementation is unable to distinguish between these two logically distinct function calls:\n\n```\n/* prototype for your reference */\nint MPI_Dist_graph_create(MPI_Comm comm_old, int n, int sources[],\n                        int degrees[], int destinations[], int\n                        weights[],\n                        MPI_Info info, int reorder, MPI_Comm\n                        -comm_dist_graph)\n\n/* case 1 */\nMPI_Dist_graph_create(MPI_COMM_WORLD, 0, NULL, NULL, NULL, NULL, MPI_INFO_NULL, 0, &comm);\n\n/* case 2 */\nMPI_Dist_graph_create(MPI_COMM_WORLD, 0, NULL, NULL, NULL, MPI_UNWEIGHTED, MPI_INFO_NULL, 0, &comm);\n```\n\nThus NULL is not a reasonable implementation choice for MPI_UNWEIGHTED in the C bindings.\n\n## History\n\nNone.\n\n## Proposed Solution (newest proposal, based on discussion below)\n\n - **MPI-2.2, Section 2.5.4 (Named Constants), page 15, lines 16-25 read**\n\n    The constants that cannot be used in initialization \n    expressions or assignments in Fortran are:\n      MPI_BOTTOM[[BR]]\n      MPI_STATUS_IGNORE[[BR]]\n      MPI_STATUSES_IGNORE[[BR]]\n      MPI_ERRCODES_IGNORE[[BR]]\n      MPI_IN_PLACE[[BR]]\n      MPI_ARGV_NULL[[BR]]\n      MPI_ARGVS_NULL[[BR]]\n      MPI_UNWEIGHTED\n\n -*but should read**\n \n    The constants that cannot be used in initialization \n    expressions or assignments in Fortran are:\n      MPI_BOTTOM[[BR]]\n      MPI_STATUS_IGNORE[[BR]]\n      MPI_STATUSES_IGNORE[[BR]]\n      MPI_ERRCODES_IGNORE[[BR]]\n      MPI_IN_PLACE[[BR]]\n      MPI_ARGV_NULL[[BR]]\n      MPI_ARGVS_NULL[[BR]]\n      MPI_UNWEIGHTED[[BR]]\n      __MPI_WEIGHTS_EMPTY__\n\n - **MPI-2.2, Section 7.5.4 (Distributed (Graph) Constructor, Routine MPI_DIST_GRAPH_CREATE_ADJACENT, arguments `indegree & sourceweights` and `outdegree & destweights`, page 253 line 43 - page 254 line 3 reads**\n\n    In C or Fortran, an application can supply\n    the special value MPI_UNWEIGHTED for the weight array\n    to indicate that all edges have the same (effectively no)\n    weight. \n    In C++, this constant does not exist and the weight \n    arguments may be omitted from the argument list. \n    It is erroneous to supply MPI_UNWEIGHTED, or in C++ omit \n    the weight arrays, for some but not all processes \n    of `comm_old.`\n    Note that MPI_UNWEIGHTED is not a special weight value; \n    rather it is a special value for the total array argument.\n    In C, one would expect it to be NULL. \n    In Fortran, MPI_UNWEIGHTED is an object like MPI_BOTTOM\n    (not usable for initialization or assignment). \n    See Section 2.5.4.\n\n -*but should read**\n\n    In C or Fortran, an application can supply\n    the special value MPI_UNWEIGHTED for the weight array__s__\n    to indicate that all edges have the same (effectively no)\n    weight. \n    In C++, this constant does not exist and the weight \n    arguments may be omitted from the argument list. \n    It is erroneous to supply MPI_UNWEIGHTED, or in C++ omit \n    the weight arrays, for some but not all processes \n    of `comm_old.`\n    __If the graph is weighted but `indegree` or `outdegree`\n    is zero, then MPI_WEIGHTS_EMPTY or any arbitrary array may be \n    passed to `sourceweights` or `destweights` respectively.__ \n    Note that MPI_UNWEIGHTED __and MPI_WEIGHTS_EMPTY are__ ~~is~~ \n    not ~~a~~ special weight value__s__; \n    rather __they are__ ~~it is a~~ special value__s__ \n    for the total array argument.\n    ~~In C, one would expect it to be NULL.~~ \n    In Fortran, MPI_UNWEIGHTED __and MPI_WEIGHTS_EMPTY are__ ~~is \n    an~~ object__s__ like MPI_BOTTOM\n    (not usable for initialization or assignment). \n    See Section 2.5.4.\n\n    __*Advice to users.*\n    In the case of an empty weights array argument passed while\n    constructing a weighted graph, one should not pass NULL because the\n    value of MPI_UNWEIGHTED may be equal to NULL.\n    The value of this argument would then be indistinguishable\n    from MPI_UNWEIGHTED to the implementation.\n    In this case MPI_WEIGHTS_EMPTY should be used instead.\n    -(End of advice to users.)*__\n\n    __*Advice to implementors.*\n    It is recommended that MPI_UNWEIGHTED not be implemented as NULL.\n    -(End of advice to implementors.)*__\n\n    __*Rationale.*\n    For backward compatibility reasons, it is still valid that MPI_UNWEIGHTED \n    may be implemented as NULL, see Annex B.1*) on page 593. \n    -(End of rationale.)*__ \n\n '''^*)^ Remark: B.1 is the new change-log from 2.2 to 3.0, which contains the sentence:[[BR]]\n -The recommended C implementation value for MPI_UNWEIGHTED was changed from NULL to non-NULL.* ''' \n\n - **MPI-2.2, Section 7.5.4 (Distributed (Graph) Constructor, Routine MPI_DIST_GRAPH_CREATE, arguments `n & weights`, page 255 lines 32 - 39 read**\n\n\n    In C or Fortran, an application can supply the special value \n    MPI_UNWEIGHTED for the weight array to indicate that all edges\n    have the same (effectively no) weight. \n    In C++, this constant does not exist and the weights argument\n    may be omitted from the argument list. \n    It is erroneous to supply MPI_UNWEIGHTED, or in C++ omit the\n    weight arrays, for some but not all processes of `comm_old`. \n    Note that MPI_UNWEIGHTED is not a special weight value; \n    rather it is a special value for the total array argument. \n    In C, one would expect it to be NULL. \n    In Fortran, MPI_UNWEIGHTED is an object like MPI_BOTTOM \n    (not usable for initialization or assignment). \n    See Section 2.5.4\n\n -*but should read**\n\n    In C or Fortran, an application can supply the special value \n    MPI_UNWEIGHTED for the weight array to indicate that all edges\n    have the same (effectively no) weight. \n    In C++, this constant does not exist and the weights argument\n    may be omitted from the argument list. \n    It is erroneous to supply MPI_UNWEIGHTED, or in C++ omit the\n    weight arrays, for some but not all processes of `comm_old`. \n    __If the graph is weighted but `n = 0`, \n    then MPI_WEIGHTS_EMPTY or any arbitrary array may be \n    passed to `weights`.__ \n    Note that MPI_UNWEIGHTED __and MPI_WEIGHTS_EMPTY are__ ~~is~~ \n    not ~~a~~ special weight value__s__; \n    rather __they are__ ~~it is a~~ special value__s__ \n    for the total array argument.\n    ~~In C, one would expect it to be NULL.~~ \n    In Fortran, MPI_UNWEIGHTED __and MPI_WEIGHTS_EMPTY are__ ~~is \n    an~~ object__s__ like MPI_BOTTOM\n    (not usable for initialization or assignment). \n    See Section 2.5.4.\n\n    __*Advice to users.*\n    In the case of an empty weights array argument passed while\n    constructing a weighted graph, one should not pass NULL because the\n    value of MPI_UNWEIGHTED may be equal to NULL.\n    The value of this argument would then be indistinguishable\n    from MPI_UNWEIGHTED to the implementation.\n    In this case MPI_WEIGHTS_EMPTY should be used instead.\n    -(End of advice to users.)*__\n\n    __*Advice to implementors.*\n    It is recommended that MPI_UNWEIGHTED not be implemented as NULL.\n    -(End of advice to implementors.)*__\n\n    __*Rationale.*\n    For backward compatibility reasons, it is still valid to implement \n    MPI_UNWEIGHTED as NULL, see Annex B.1^*)^ on page 593.\n    -(End of rationale.)*__ \n\n '''^*)^ Remark: B.1 is the new change-log from 2.2 to 3.0, which contains the sentence:[[BR]]\n -The recommended C implementation value for MPI_UNWEIGHTED was changed from NULL to non-NULL.* ''' \n\n     \n - **MPI-2.2, A.1, page 523 line 36 reads**\n\n    ||MPI_UNWEIGHTED ||Not defined for C++||\n\n -*but should read**\n\n    ||||MPI_UNWEIGHTED        ||Not defined for C++||\n    || ||int* / INTEGER array ||                   ||\n    ||||MPI_WEIGHTS_EMPTY     ||Not defined for C++||\n    || ||int* / INTEGER array ||                   ||\n\n - **MPI-2.2, Section 16.2.2 (Problems with Fortran Bindings for MPI), page 481, lines 26-30 read**\n\n      5. Several named \"constants\" such as MPI_BOTTOM, MPI_IN_PLACE,\n      MPI_STATUS_IGNORE, MPI_STATUSES_IGNORE, MPI_ERRCODES_IGNORE,\n      MPI_UNWEIGHTED, \n      MPI_ARGV_NULL, and MPI_ARGVS_NULL are not ordinary Fortran\n      constants and require a special implementation. \n      See Section 2.5.4 on page 14 for more information.\n\n -*but should read**\n\n      5. Several named \"constants\" such as MPI_BOTTOM, MPI_IN_PLACE,\n      MPI_STATUS_IGNORE, MPI_STATUSES_IGNORE, MPI_ERRCODES_IGNORE,\n      MPI_UNWEIGHTED, __MPI_WEIGHTS_EMPTY,__\n      MPI_ARGV_NULL, and MPI_ARGVS_NULL are not ordinary Fortran\n      constants and require a special implementation. \n      See Section 2.5.4 on page 14 for more information.\n\n\n## Impact on Implementations\n\nThe value constant MPI_UNWEIGHTED may be changed if it\nis currently implemented as NULL.\nThis is only a recommendation and not mandatory.\nTherefore, this enhancement is source code and binary (ABI)\nbackward compatible.\n\nThe new constant MPI_WEIGHTS_EMPTY must be implemented.\n\n\n## Impact on Applications / Users\n\nNone for correct applications.\nIf an application currently implements an empty weight array\nwith NULL and uses an MPI library with MPI_UNWEIGHTED <> NULL\nthen this bug in the application is healed with MPI-3.0.\n\n## Alternative Solution (withdrawn)\n\nRequiring MPI_UNWEIGHTED <> NULL and using NULL instead of MPI_WEIGHTS_EMPTY.\nThis would be source code backward compatible, but not ABI backward compatible.\n\n## Alternative Solution (former proposal, already formally read, but now withdrawn)\n\n(all page/line numbers are given relative to MPI-2.2)\n\nPage 254, line 2:\nDelete \"In C, one would expect it to be NULL.\"\n\nPage 255, line 38:\nDelete \"In C, one would expect it to be NULL.\"\n\nAdd the following AtoI after line 39: (in TeX format, based on text suggested by Rolf Rabenseifner)\n```\n\\begin{implementors}\n\nIn the C bindings the constant \\const{MPI\\_UNWEIGHTED} should not be\nimplemented with the C constant \\ctype{NULL}.  Otherwise the weight\narguments to the distributed graph interface may be ambiguous.\n\nAn application may pass \\ctype{0} for \\mpiarg{n} and \\ctype{NULL} for\n\\mpiarg{sources} in calls to \\mpifunc{MPI\\_DIST\\_GRAPH\\_CREATE} on a\nprocess if that process specifies no edges in the topology constructor\ncall.  Similarly, an application may pass \\ctype{0} for\n\\mpiarg{indegree} and \\mpiarg{outdegree} and \\ctype{NULL} for\n\\mpiarg{sourceweights} and \\mpiarg{destweights} in calls to\n\\mpifunc{MPI\\_DIST\\_GRAPH\\_CREATE\\_ADJACENT}.  Other processes\nparticipating in the call may still contribute edges with weights to the\ngraph.\n\nIf the graph is unweighted, then the application must pass\n\\const{MPI\\_UNWEIGHTED} at all processes, even those that contribute no\nedges locally.\n\nThe \\MPI/ library must be able to distinguish between the aforementioned\nweighted scenarios and scenarios where no edges are contributed locally\nyet MPI\\_UNWEIGHTED is passed globally.  Furthermore\n\\mpifunc{MPI\\_DIST\\_GRAPH\\_NEIGHBORS\\_COUNT} requires the \\MPI/\nimplementation to distinguish whether or not \\const{MPI\\_UNWEIGHTED} was\npassed when a graph is constructed with zero edges.  Satisfying both\nrequirements is not possible if \\ctype{MPI\\_UNWEIGHTED==NULL}.\n\n\\end{implementors}\n```\n\n## Entry for the Change Log\n\nSection 2.5.4 on page 14, and Section 7.5.4 on page 252.[[BR]]\nThe recommended C implementation value for MPI_UNWEIGHTED was changed from NULL \nto non-NULL. An additional weight array constant (MPI_WEIGHTS_EMPTY) was introduced.\n\n"},"comment":{"url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/comments/234791141","html_url":"https://github.com/mpiforumbot/mpi-forum-historic/issues/294#issuecomment-234791141","issue_url":"https://api.github.com/repos/mpiforumbot/mpi-forum-historic/issues/294","id":234791141,"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-24T17:47:38Z","updated_at":"2016-07-24T17:47:38Z","body":"**Originally by _jsquyres_ on 2012-07-17 17:49:24 -0500**\n\n___\nReviewd T&C and Bindings chapters ok."}}
{"actor":{"display_login":"mpiforumbot"}}