[Mpi3-tools] MPI handles debugging interface
John DelSignore
jdelsign at totalviewtech.com
Wed Jun 3 08:40:56 CDT 2009
IMHO, type safety is extremely important and any solution that is not type safe is a non-starter.
Cheers, John D.
Jeff Squyres wrote:
> In chatting with David Lecomber while we're working on revising the MPI3
> handle debugging interface per the recent discussions in this group
> (moving away from the One Big Struct approach), David asked a me a
> question that I thought might be appropriate for the larger group.
>
> Why use a bunch of individual query functions when we could have a
> single, much more general form that is more easily extensible? The
> query function would essentially be driven by an enum indicating the
> specific request, and the OUT arguments could be varargs. Perhaps
> something like this:
>
> =====
> int mpidbg_comm_query_element(mpidbg_comm_handle_t handle,
> enum mpidbg_comm_query_element_t element,
> ...);
> =====
>
> Here's a sample use case:
>
> =====
> /* initial query to allow the DLL to bundle up *all* the data into a
> handle */
> mpidbg_comm_query(image, image_info, ..., mpi_communicator, &handle);
>
> /* Query the "basic" communicator info from the handle */
> mpidbg_comm_query_element(handle, MPIDBG_COMM_QUERY_BASIC, &flags,
> &rank, &size, ...etc.);
>
> /* Query the communicator process info from the handle */
> mpidbg_comm_query_element(handle, MPIDBG_COMM_QUERY_PROCS,
> &num_local_procs, &local_procs,
> &num_remote_procs, &remote_procs);
> =====
>
> +++ Advantage: this one function can be extended simply by adding new
> enum values, possibly in an MPI implementation-specific way (e.g., have
> some non-standard / value-add functions)
>
> --- Disadvantage: lose compiler type safety checking when
> building/debugging tools that use this interface.
>
> I don't have strong feelings either way. I think I'm marginally in
> favor of individual functions just because it gives type safety for
> tools authors. But I could be convinced to go the enum/varargs route if
> people feel strongly.
>
> Comments?
>
> --Jeff Squyres
> Cisco Systems
>
> _______________________________________________
> Mpi3-tools mailing list
> Mpi3-tools at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-tools
>
>
More information about the mpiwg-tools
mailing list