Re: [Mpi-forum] Ticket 125/126 PDF ready for review
Do we have any problem with existing applications that go with current syntax and examples, when we change the MPI library and examples into the other syntax? I expect no. Here a list of all location, and at the end my PROPOSAL: MPI-2.2 p24:7 MPI_Init((void *)0, (void *)0); MPI-2.2 p25:21-28 and p209:10-14, p209:27-32, p210:6-12, p210:31-39, p211:32-41, p212:23-29, p213:47-p214:15, p221:38-46, p222:46-p223:16, p326:40-48, p327:33-39 int main( int argc, char **argv ) { ... MPI_Init( &argc, &argv ); MPI-2.2 p290:42 int MPI_Init(int *argc, char ***argv) MPI-2.2 p291:7-9 int main(int argc, char **argv) { MPI_Init(&argc, &argv); MPI-2.2 p316:40-46, and p317:39-43 int main(int argc, char *argv[]) { ... MPI_Init(&argc, &argv); MPI-2.2 p384:27 int MPI_Init_thread(int *argc, char *((*argv)[]), int required, int *provided) PROPOSAL: Based on the number of locations and the history (MPI_Init is many years older), I would recommend to change only the definition of MPI_Init_thread to int MPI_Init_thread(... char ***argv ... and keep the three different usage examples with (1x) MPI_Init((void *)0, (void *)0); (13x) int main( int argc, char **argv ) MPI_Init(&argc, &argv); (2x) int main(int argc, char *argv[]) MPI_Init(&argc, &argv); We may add a short comment into the two major examples p25 and p291: p25:21 and p291:7 read int main(int argc, char **argv) but should read int main(int argc, char **argv) /* or int main(int argc, char *argv[]) */ I would say that this is a minimal change solving the problem to make clear that argv is an array of strings and to have consistent definitions of MPI_Init and MPI_Init_thread. Best regards Rolf ----- Original Message -----
From: "Fab Tillier" <[email protected]> To: "Main MPI Forum mailing list" <[email protected]> Sent: Saturday, January 28, 2012 9:51:08 PM Subject: Re: [Mpi-forum] Ticket 125/126 PDF ready for review Yeah, I don't care enough either, I just want someone to tell me which way to go and I'll make the LaTeX change accordingly.
-Fab
Jeff Squyres (jsquyres) wrote on Sat, 28 Jan 2012 at 10:50:37
I am secretary. I declare ***!
(...if only it were so easy...)
Regardless, I agree with the ultimate end goal: INIT and INIT-thread should be the same.
Sent from my phone. No type good.
On Jan 28, 2012, at 1:41 PM, "Jeff Hammond" <[email protected]> wrote:
I favor "int main(int argc, char *argv[]);" because it is clear that the second argument is an array of "char*". I believe that the standard uses this convention in some places (perhaps nonuniformly) to make it clear when the argument is an array, as opposed to a pointer to a scalar. However, I believe there is no good answer because C's handling of strings is stupid.
Ultimately, this is a religious question and cannot be reasoned about. I favor letting Bill or another equivalently Pope-like individual decide this question once and for all.
Jeff
On Sat, Jan 28, 2012 at 12:22 PM, Jeff Squyres (jsquyres) <[email protected]> wrote:
In C ** and *[] are the same, so I'd go with the simpler ***.
Sent from my phone. No type good.
On Jan 28, 2012, at 1:05 PM, "Fab Tillier" <[email protected]> wrote:
I dunno. I guess it depends on what you think the prototype for C main is.
int main(int argc, char *argv[]); or int main(int argc, char **argv);
I've mostly seen it as the former, so was trying to stay consistent with that. After all, argv is an array of char*, and in MPI_Init, it's a pointer to an array of char*...
I can't say I care really strongly about this one, I just think MPI_Init and MPI_Init_thread should be consistent, and the ticket was clarifying what parameters were arrays vs. pointers.
-Fab
Jeff Squyres wrote on Sat, 28 Jan 2012 at 05:03:29
I think it looks ok, meaning that I checked your changes. I did not check to see if you missed any.
That being said, I'm not a fan of the MPI_INIT_THREAD C declaration -- it seems to just be more confusing than using ***. Specifically, it's:
int MPI_Init_thread(int *argc, char *((*argv)[]), int required, int *provided)
Personally, I think *** is cleaner/easier to understand:
int MPI_Init_thread(int *argc, char ***argv, int required, int *provided)
I would advocate changing MPI_Init_thread to *** rather than changing MPI_Init to the complicated [] syntax.
On Jan 20, 2012, at 2:17 PM, Fab Tillier wrote:
Hi Folks,
I've implemented the changes to the standard document for tickets 125 and 126. The PDF is attached to the ticket, and available here: https://svn.mpi-forum.org/trac/mpi-forum-web/raw- attachment/ticket/125/ticket-125.pdf
A couple notes where I deviated from the tickets: - I didn't distinguish between input and output parameter changes, so all the changes are marked as ticket125 - I did not add 'const' for the input parameters, as that was already done by ticket 140 - I only updated the C bindings - I did not update MPI_Type_hindexed and MPI_Type_struct in the deprecated chapter. - I updated MPI_Init to match the parameter definition of MPI_Init_thread.
I'd appreciate if folks could take a look and comment, letting me know if I botched anything, or missed anything that should be changed.
Thanks, -Fab
_______________________________________________ mpi-forum mailing list [email protected] http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
_______________________________________________ mpi-forum mailing list [email protected] http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
_______________________________________________ mpi-forum mailing list [email protected] http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
-- Jeff Hammond Argonne Leadership Computing Facility University of Chicago Computation Institute [email protected] / (630) 252-5381 http://www.linkedin.com/in/jeffhammond https://wiki.alcf.anl.gov/old/index.php/User:Jhammond
_______________________________________________ mpi-forum mailing list [email protected] http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
_______________________________________________ mpi-forum mailing list [email protected] http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
_______________________________________________ mpi-forum mailing list [email protected] http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
-- Dr. Rolf Rabenseifner . . . . . . . . . .. email [email protected] High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530 University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832 Head of Dpmt Parallel Computing . . . www.hlrs.de/people/rabenseifner Nobelstr. 19, D-70550 Stuttgart, Germany . (Office: Allmandring 30)
participants (1)
-
Rolf Rabenseifner