Closed mpiforumbot closed 8 years ago
Originally by goodell on 2011-09-15 15:53:53 -0500
(add Rolf, Jesper, and Torsten to the CC list)
Originally by moody20 on 2011-10-25 14:45:10 -0500
When a user calls MPI_DIST_GRAPH_CREATE with n==0, we do not specify what value a user should pass when weights is not MPI_UNWEIGHTED. The user may happen to pick a value equal to MPI_UNWEIGHTED. We should provide another constant that should be specified when n==0 and weights != MPI_UNWEIGHTED.
Originally by moody20 on 2011-10-25 14:46:11 -0500
Rolf pointed out to me that this constant cannot be NULL, because it won't work for Fortran, so we need something like MPI_WEIGHTS_NULL.
Originally by RolfRabenseifner on 2011-10-25 15:35:21 -0500
No, it is not needed, because it is expected that the user passes any variable or array address in C or any variable or array in Fortran. The content of the storage is untouched if n==0.
Therefore no special value is needed.
Originally by goodell on 2012-01-19 14:21:54 -0600
I think Adam has a point here (not sure how I missed this correspondence until now). Rolf's comment is incorrect, since we do attempt to read the storage even if n==0. It might not be a big deal if we only had C bindings (since NULL is very natural for this), but the Fortran bindings cause a problem here.
The best fix would have been a separate boolean parameter for weighted/unweighted, but that's not backwards compatible with MPI-2.2. So something like MPI_WEIGHTS_NULL probably makes more sense. Maybe call it MPI_WEIGHTS_EMPTY to match up better with our other EMPTY/NULL conventions?
Torsten, what do you think about adding MPI_WEIGHTS_NULL/EMPTY? If you're OK with it too then I'll write up the appropriate text instead of what we have in the ticket right now.
Also, we should consider taking this modification out of the ticket process. It seems like exactly the sort of thing that can and should be handled by the chapter committee.
Originally by htor on 2012-01-21 20:19:53 -0600
Replying to goodell:
I think Adam has a point here (not sure how I missed this correspondence until now). Rolf's comment is incorrect, since we do attempt to read the storage even if n==0. It might not be a big deal if we only had C bindings (since NULL is very natural for this), but the Fortran bindings cause a problem here. Why would we attempt to read the storage if n==0? I would understand that we check for weighted/unweighted? But I see the issue and agree (see below).
The best fix would have been a separate boolean parameter for weighted/unweighted, but that's not backwards compatible with MPI-2.2. So something like MPI_WEIGHTS_NULL probably makes more sense. Maybe call it MPI_WEIGHTS_EMPTY to match up better with our other EMPTY/NULL conventions?
Torsten, what do you think about adding MPI_WEIGHTS_NULL/EMPTY? If you're OK with it too then I'll write up the appropriate text instead of what we have in the ticket right now. That sounds good, however, I'd see it as an extension to what we have right now. MPI_UNWEIGHTED would still remain valid.
Also, we should consider taking this modification out of the ticket process. It seems like exactly the sort of thing that can and should be handled by the chapter committee. Yes but I'm not sure if we should have a telecon for this small change. We should be able to involve the chapter committee via email once we have a fix. We will need to reset this ticket anyway.
Torsten
Originally by RolfRabenseifner on 2012-01-22 12:30:36 -0600
Replying to htor:
Replying to goodell:
I think Adam has a point here (not sure how I missed this correspondence until now). Rolf's comment is incorrect, since we do attempt to read the storage even if n==0. It might not be a big deal if we only had C bindings (since NULL is very natural for this), but the Fortran bindings cause a problem here. Why would we attempt to read the storage if n==0? I would understand that we check for weighted/unweighted? But I see the issue and agree (see below).
For n > 0 the weights argument is the address-value MPI_UNWEIGHTED or an array with weights in Fortran or C. In Fortran and C, MPI_UNWEIGHTED must be implemented in a way that it address value is different from any array that can be supplied.
For n=0, the weights argument can be the address-value MPI_UNWEIGHTED or any other address value, which may or may not point to an array. The array-vlues are not read. The address-value itself is read.
The two questions are only,
For the 1st question, the old MPI-2.2 recommended MPI_UNWEIGHTED=NULL, this ticket proposes to forbid the use of NULL for MPI_UNWEIGHTED.
For the 2nd question, the user can use any dummy/scratch array in C and Fortran. In C, he/she can also use the address of a dummy/scratch variable and he/she might want to use NULL. He/she must not use any other address-value that might be identical to MPI_UNWEIGHTED.
Implication A: With MPI_2.2, the user was not allowed to use NULL in question 2.
This means that this proposal additionally allows now the use of NULL for question 2. This is helpful, because this is natural in C.
The best fix would have been a separate boolean parameter for weighted/unweighted, but that's not backwards compatible with MPI-2.2. So something like MPI_WEIGHTS_NULL probably makes more sense. Maybe call it MPI_WEIGHTS_EMPTY to match up better with our other EMPTY/NULL conventions?
Torsten, what do you think about adding MPI_WEIGHTS_NULL/EMPTY? If you're OK with it too then I'll write up the appropriate text instead of what we have in the ticket right now. That sounds good, however, I'd see it as an extension to what we have right now. MPI_UNWEIGHTED would still remain valid.
Also, we should consider taking this modification out of the ticket process. It seems like exactly the sort of thing that can and should be handled by the chapter committee. Yes but I'm not sure if we should have a telecon for this small change. We should be able to involve the chapter committee via email once we have a fix. We will need to reset this ticket anyway.
Torsten
We should answer question 2 for the user to guarantee that there is never the same value as MPI_UNWEIGHTED.
Yes, MPI_WEIGHTS_EMPTY would be a meaningful input in a weighted graph in a process with n=0. But for me, it seems to be a too heavy soultion. For n=0, it is enough to add the following sentence after p255:39 and before the advice defined in this ticket:
In a weighted graph, a process with n==0 may specify the weights argument with a scratch array (in C or Fortran), or NULL in C.
The total solution can be done also very different:
I would recommend to put both solutions into this ticket and to make a vote, which one should be used in MPI-3.0. The ticket should have the full form, because
The change-log should reflect this too.
Originally by RolfRabenseifner on 2012-01-23 09:27:16 -0600
Based on the discussion above, I would like to withdraw my original proposal (Had 1st Reading) by a new proposal that is a compromise between simple and solving all problems and being source code and ABI backward compatible.
To speed up the process, added it already to the ticket body, but I kept the old proposal for the case that somebody still wants to keep it for voting.
If all agree, then I would like to withdraw the old proposal and run only with the new one. And returning the priority to "Scheduled".
Originally by goodell on 2012-01-23 13:05:10 -0600
minor text improvements
Originally by goodell on 2012-01-23 13:05:48 -0600
I'm now happy enough with Rolf's counter proposal and am happy to support it in place of my original proposal.
Originally by RolfRabenseifner on 2012-01-24 02:54:04 -0600
Your wording of the advices is better. Thank you.
I detected and corrected another small bug: rather it is a special value for the total array argument. changed into rather they are special values for the total array argument.
Originally by RolfRabenseifner on 2012-01-24 03:05:25 -0600
Torsten and Adam,
please can you (as topology chapter author and committee member) take 15 minutes and review the new text as shown in "Proposed Solution (new alternative based on discussion below)".
If it is okay with you both, then we can withdraw/remove the first proposal and reset the priority to "scheduled" for "March 2012, Chicago".
Thanks and best regards[[BR]] Rolf
Originally by htor on 2012-02-01 21:52:13 -0600
I am mostly ok with the recommended change. Some comments:
1) We should really not refer back to MPI-2.2, i.e., remove the statement (twice) "(as was erroneously recommended in MPI-2.2)"
2) The ticket needs to be cleaned up (i.e., replace the old proposed change with the new one) to ensure everybody knows what we are voting on.
3) The clock will likely be reset :-)
Thanks, Torsten
Originally by RolfRabenseifner on 2012-02-05 02:00:35 -0600
Replying to htor:
I am mostly ok with the recommended change. Some comments:
1) We should really not refer back to MPI-2.2, i.e., remove the statement (twice) "(as was erroneously recommended in MPI-2.2)"
I'll remove this sentence from the advice to users because it is a rationale. I'll add the following rationale:
Rationale. For backward compatibility reasons, it is not mandatory that MPIUNWEIGHTED not be implemented as NULL, see Annex B.1^)^ on page 593. -(End of rationale.)_
An alternative text without the ... not ... not ... may be:
Rationale. For backward compatibility reasons, it is still valid that MPIUNWEIGHTED may be implemented as NULL, see Annex B.1^)^ on page 593. -(End of rationale.)_
^_)^ Remark: B.1 is the new change-log from 2.2 to 3.0, which contains the sentence:[[BR]] *The recommended C implementation value for MPIUNWEIGHTED was changed from NULL to non-NULL.
2) The ticket needs to be cleaned up (i.e., replace the old proposed change with the new one) to ensure everybody knows what we are voting on.
Yes, but I wannted to wait until more than Dave and me replied positive. The ticket has only a reporter, not an owner. Therefore I feel free to do it now, after Dave and you returned support for the new text. I'll keep the old text (because it is already formally read [people may remember that they already agreed with its content] and because it's Dave's text), but telling that it is withdrawn.
3) The clock will likely be reset :-)
Yes, of course.
Thanks, Torsten
Thank you for your review.
Originally by RolfRabenseifner on 2012-02-05 02:26:22 -0600
I implemented all the changes I proposed in the previous comment.
Please tell in your review, whether you prefer the
I prefer the first version.
Originally by htor on 2012-02-05 11:36:17 -0600
Replying to RolfRabenseifner:
Replying to htor:
I am mostly ok with the recommended change. Some comments:
1) We should really not refer back to MPI-2.2, i.e., remove the statement (twice) "(as was erroneously recommended in MPI-2.2)"
I'll remove this sentence from the advice to users because it is a rationale. I'll add the following rationale:
*Rationale. For backward compatibility reasons, it is not mandatory that MPIUNWEIGHTED not be implemented as NULL, see Annex B.1^)^ on page 593. (End of rationale.)_**
An alternative text without the ... not ... not ... may be:
*Rationale. For backward compatibility reasons, it is still valid that MPIUNWEIGHTED may be implemented as NULL, see Annex B.1^)^ on page 593. (End of rationale.)_**
^_)^ Remark: B.1 is the new change-log from 2.2 to 3.0, which contains the sentence:[[BR]] *The recommended C implementation value for MPIUNWEIGHTED was changed from NULL to non-NULL. I don't see the reason for the text being there. The statement in MPI-2.2 was non-binding and thus, strictly seen, not part of the API anyway. Adding this rationale is just cluttering the standard. I'm against both versions.
2) The ticket needs to be cleaned up (i.e., replace the old proposed change with the new one) to ensure everybody knows what we are voting on.
Yes, but I wannted to wait until more than Dave and me replied positive. The ticket has only a reporter, not an owner. Therefore I feel free to do it now, after Dave and you returned support for the new text. I'll keep the old text (because it is already formally read [people may remember that they already agreed with its content] and because it's Dave's text), but telling that it is withdrawn. I see.
Best, Torsten
Originally by RolfRabenseifner on 2012-02-06 03:28:07 -0600
Replying to htor:
Replying to RolfRabenseifner:
Replying to htor:
...
1) We should really not refer back to MPI-2.2, i.e., remove the statement (twice) "(as was erroneously recommended in MPI-2.2)"
I'll remove this sentence from the advice to users because it is a rationale. I'll add the following rationale:
*Rationale. For backward compatibility reasons, it is not mandatory that MPIUNWEIGHTED not be implemented as NULL, see Annex B.1^)^ on page 593. (End of rationale.)_**
An alternative text without the ... not ... not ... may be:
*Rationale. For backward compatibility reasons, it is still valid that MPIUNWEIGHTED may be implemented as NULL, see Annex B.1^)^ on page 593. (End of rationale.)_**
^_)^ Remark: B.1 is the new change-log from 2.2 to 3.0, which contains the sentence:[[BR]] *The recommended C implementation value for MPIUNWEIGHTED was changed from NULL to non-NULL. I don't see the reason for the text being there. The statement in MPI-2.2 was non-binding and thus, strictly seen, not part of the API anyway. Adding this rationale is just cluttering the standard. I'm against both versions.
The idea behind such a rationale is that the standard is the Forum's memory. We have seen this in the past with one other bug in the standard, the wrong C binding of MPI_Cancel. The discussion came up again and again after some years. To stop this we added the rationale MPI-2.2 p68 lines 29-32.
To prevent further discussions in the future on this topic or that reviewers in such a discussion do not oversee backward compatible issues coming from MPI-2.2, such a rationale may be helpful.
...
Originally by goodell on 2012-02-06 15:01:44 -0600
Replying to RolfRabenseifner:
I implemented all the changes I proposed in the previous comment.
Please tell in your review, whether you prefer the
- first ("it is not mandatory that MPI_UNWEIGHTED not be implemented as NULL")
- or second ("it is still valid that MPI_UNWEIGHTED may be implemented as NULL") version of the Rationale.
I prefer the first version.
The first version sounds quite bad to my ear, please don't use that one. The second one can be slightly improved:
-Rationale.* For backward compatibility reasons, it is still valid to implement MPI_UNWEIGHTED as NULL, see Annex B.1 on page 593. *(End of rationale.)*
Originally by RolfRabenseifner on 2012-02-16 10:14:04 -0600
I changed the text and removed the first version of the rationale and changed the second one into Dave Goodell's text.
Originally by RolfRabenseifner on 2012-02-18 13:47:50 -0600
I changed the Fortran type for MPI_UNWEIGHTED and MPI_WEIGHTS_EMPTY from "INTEGER, DIMENSION(*)" to "INTEGER array".
Reasons: to be consistent with the definition of MPI_ERRCODES_IGNORE and ticket #172.
Originally by RolfRabenseifner on 2012-02-21 13:19:56 -0600
I removed the ugly alternative rationale version with "not ... not ...".
Originally by RolfRabenseifner on 2012-03-06 13:03:00 -0600
Changes from formal reading in March 2012 Chicago meeting.
Originally by RolfRabenseifner on 2012-03-06 15:03:59 -0600
Had formal reading in the Chicago meeting, March 2012.
Originally by goodell on 2012-07-17 09:51:14 -0500
Wording improvement suggested by Jim Dinan. Change:
Rationale. For backward compatibility reasons, it is still valid that MPI_UNWEIGHTED may be implemented as NULL, see Annex B.1*) on page 593. (End of rationale.)
to:
Rationale. To ensure backward compatibility, MPI_UNWEIGHTED may still be implemented as NULL. See Annex B.1*) on page 593. (End of rationale.)
Don't forget to change both rationales.
Originally by htor on 2012-07-17 10:05:14 -0500
Committed in approved/topol. Please review! Keep in mind that this ticket touches two more chapters.
http://www.unixer.de/sec/mpi-report.pdf
Torsten
Originally by RolfRabenseifner on 2012-07-17 15:24:41 -0500
Committed in approved/chap-term (r1345, by Bill) and approved/chap-appLang (r1362).
Originally by RolfRabenseifner on 2012-07-17 15:35:03 -0500
Committed in approved/chap-binding (r1364).
With this, all shozuld be done and it can be move to "Waiting for PDF Reviews"
Originally by jsquyres on 2012-07-17 17:49:24 -0500
Reviewd T&C and Bindings chapters ok.
Originally by goodell on 2012-07-18 14:32:48 -0500
Topo chapter review:
OK in r1417.
Originally by goodell on 2011-09-15 15:49:54 -0500
Description
The MPI-2.2, p.255 l.38, the standard recommends that in the C bindings the value of
MPI_UNWEIGHTED
should beNULL
. This implementation choice makes the OUT value returned byMPI_Dist_graph_neighbors_count
ambiguous for certain graphs.For example, the implementation is unable to distinguish between these two logically distinct function calls:
Thus NULL is not a reasonable implementation choice for MPI_UNWEIGHTED in the C bindings.
History
None.
Proposed Solution (newest proposal, based on discussion below)
MPI-2.2, Section 2.5.4 (Named Constants), page 15, lines 16-25 read
The constants that cannot be used in initialization expressions or assignments in Fortran are: MPI_BOTTOM[[BR]] MPI_STATUS_IGNORE[[BR]] MPI_STATUSES_IGNORE[[BR]] MPI_ERRCODES_IGNORE[[BR]] MPI_IN_PLACE[[BR]] MPI_ARGV_NULL[[BR]] MPI_ARGVS_NULL[[BR]] MPI_UNWEIGHTED
-but should read*
The constants that cannot be used in initialization expressions or assignments in Fortran are: MPI_BOTTOM[[BR]] MPI_STATUS_IGNORE[[BR]] MPI_STATUSES_IGNORE[[BR]] MPI_ERRCODES_IGNORE[[BR]] MPI_IN_PLACE[[BR]] MPI_ARGV_NULL[[BR]] MPI_ARGVS_NULL[[BR]] MPI_UNWEIGHTED[[BR]] MPI_WEIGHTS_EMPTY
MPI-2.2, Section 7.5.4 (Distributed (Graph) Constructor, Routine MPI_DIST_GRAPH_CREATE_ADJACENT, arguments
indegree & sourceweights
andoutdegree & destweights
, page 253 line 43 - page 254 line 3 readsIn C or Fortran, an application can supply the special value MPI_UNWEIGHTED for the weight array to indicate that all edges have the same (effectively no) weight. In C++, this constant does not exist and the weight arguments may be omitted from the argument list. It is erroneous to supply MPI_UNWEIGHTED, or in C++ omit the weight arrays, for some but not all processes of
comm_old.
Note that MPI_UNWEIGHTED is not a special weight value; rather it is a special value for the total array argument. In C, one would expect it to be NULL. In Fortran, MPI_UNWEIGHTED is an object like MPI_BOTTOM (not usable for initialization or assignment). See Section 2.5.4.-but should read*
In C or Fortran, an application can supply the special value MPI_UNWEIGHTED for the weight arrays to indicate that all edges have the same (effectively no) weight. In C++, this constant does not exist and the weight arguments may be omitted from the argument list. It is erroneous to supply MPI_UNWEIGHTED, or in C++ omit the weight arrays, for some but not all processes of
comm_old.
If the graph is weighted butindegree
oroutdegree
is zero, then MPI_WEIGHTS_EMPTY or any arbitrary array may be passed tosourceweights
ordestweights
respectively. Note that MPI_UNWEIGHTED and MPI_WEIGHTS_EMPTY areisnotaspecial weight values; rather they areit is aspecial values for the total array argument.In C, one would expect it to be NULL.In Fortran, MPI_UNWEIGHTED and MPI_WEIGHTS_EMPTY are ~~is an~~ objects like MPI_BOTTOM (not usable for initialization or assignment). See Section 2.5.4.**Advice to users. In the case of an empty weights array argument passed while constructing a weighted graph, one should not pass NULL because the value of MPI_UNWEIGHTED may be equal to NULL. The value of this argument would then be indistinguishable from MPI_UNWEIGHTED to the implementation. In this case MPI_WEIGHTS_EMPTY should be used instead. -(End of advice to users.)***
**Advice to implementors. It is recommended that MPI_UNWEIGHTED not be implemented as NULL. -(End of advice to implementors.)***
Rationale. For backward compatibility reasons, it is still valid that MPIUNWEIGHTED may be implemented as NULL, see Annex B.1) on page 593. -(End of rationale.)_
'''^_)^ Remark: B.1 is the new change-log from 2.2 to 3.0, which contains the sentence:[[BR]] -The recommended C implementation value for MPIUNWEIGHTED was changed from NULL to non-NULL. '''
MPI-2.2, Section 7.5.4 (Distributed (Graph) Constructor, Routine MPI_DIST_GRAPH_CREATE, arguments
n & weights
, page 255 lines 32 - 39 readIn C or Fortran, an application can supply the special value MPI_UNWEIGHTED for the weight array to indicate that all edges have the same (effectively no) weight. In C++, this constant does not exist and the weights argument may be omitted from the argument list. It is erroneous to supply MPI_UNWEIGHTED, or in C++ omit the weight arrays, for some but not all processes of
comm_old
. Note that MPI_UNWEIGHTED is not a special weight value; rather it is a special value for the total array argument. In C, one would expect it to be NULL. In Fortran, MPI_UNWEIGHTED is an object like MPI_BOTTOM (not usable for initialization or assignment). See Section 2.5.4-but should read*
In C or Fortran, an application can supply the special value MPI_UNWEIGHTED for the weight array to indicate that all edges have the same (effectively no) weight. In C++, this constant does not exist and the weights argument may be omitted from the argument list. It is erroneous to supply MPI_UNWEIGHTED, or in C++ omit the weight arrays, for some but not all processes of
comm_old
. If the graph is weighted butn = 0
, then MPI_WEIGHTS_EMPTY or any arbitrary array may be passed toweights
. Note that MPI_UNWEIGHTED and MPI_WEIGHTS_EMPTY areisnotaspecial weight values; rather they areit is aspecial values for the total array argument.In C, one would expect it to be NULL.In Fortran, MPI_UNWEIGHTED and MPI_WEIGHTS_EMPTY are ~~is an~~ objects like MPI_BOTTOM (not usable for initialization or assignment). See Section 2.5.4.**Advice to users. In the case of an empty weights array argument passed while constructing a weighted graph, one should not pass NULL because the value of MPI_UNWEIGHTED may be equal to NULL. The value of this argument would then be indistinguishable from MPI_UNWEIGHTED to the implementation. In this case MPI_WEIGHTS_EMPTY should be used instead. -(End of advice to users.)***
**Advice to implementors. It is recommended that MPI_UNWEIGHTED not be implemented as NULL. -(End of advice to implementors.)***
Rationale. For backward compatibility reasons, it is still valid to implement MPIUNWEIGHTED as NULL, see Annex B.1^)^ on page 593. -(End of rationale.)_
'''^_)^ Remark: B.1 is the new change-log from 2.2 to 3.0, which contains the sentence:[[BR]] -The recommended C implementation value for MPIUNWEIGHTED was changed from NULL to non-NULL. '''
MPI-2.2, A.1, page 523 line 36 reads
||MPI_UNWEIGHTED ||Not defined for C++||
-but should read*
||||MPI_UNWEIGHTED ||Not defined for C++|| || ||int* / INTEGER array || || ||||MPI_WEIGHTS_EMPTY ||Not defined for C++|| || ||int* / INTEGER array || ||
MPI-2.2, Section 16.2.2 (Problems with Fortran Bindings for MPI), page 481, lines 26-30 read
-but should read*
Impact on Implementations
The value constant MPI_UNWEIGHTED may be changed if it is currently implemented as NULL. This is only a recommendation and not mandatory. Therefore, this enhancement is source code and binary (ABI) backward compatible.
The new constant MPI_WEIGHTS_EMPTY must be implemented.
Impact on Applications / Users
None for correct applications. If an application currently implements an empty weight array with NULL and uses an MPI library with MPI_UNWEIGHTED <> NULL then this bug in the application is healed with MPI-3.0.
Alternative Solution (withdrawn)
Requiring MPI_UNWEIGHTED <> NULL and using NULL instead of MPI_WEIGHTS_EMPTY. This would be source code backward compatible, but not ABI backward compatible.
Alternative Solution (former proposal, already formally read, but now withdrawn)
(all page/line numbers are given relative to MPI-2.2)
Page 254, line 2: Delete "In C, one would expect it to be NULL."
Page 255, line 38: Delete "In C, one would expect it to be NULL."
Add the following AtoI after line 39: (in TeX format, based on text suggested by Rolf Rabenseifner)
Entry for the Change Log
Section 2.5.4 on page 14, and Section 7.5.4 on page 252.[[BR]] The recommended C implementation value for MPI_UNWEIGHTED was changed from NULL to non-NULL. An additional weight array constant (MPI_WEIGHTS_EMPTY) was introduced.