Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

From: Brian Barrett (bbarrett_at_[hidden])
Date: 2007-07-26 14:18:21


On Jul 26, 2007, at 12:00 PM, Mohamad Chaarawi wrote:

>> 2) I think it would be better to always have the flags and macros
>> available (like OMPI_GROUP_SPORADIC and OMPI_GROUP_IS_SPORADIC) even
>> when sparse groups are disabled. They dont' take up any space, and
>> mean less #ifs in the general code base
>>
> That's what i actually was proposing.. keep the flags (there are no
> macros, just the GROUP_GET_PROC_POINTER) and the sparse parameters
> in the
> group strucutre, and this will mean, only 1 maybe 2 #ifs..

Why would this mean having the sparse parameters in the group structure?

>> 3) Instead of the GROU_GET_PROC_POINTER macro, why not just change
>> the behavior of the ompi_group_peer_lookup() function, so that there
>> is symmetry with how you get a proc from a communicator? static
>> inline functions (especially short ones like that) are basically
>> free. We'll still have to fix all the places in the code where the
>> macro is used or people poke directly at the group structure, but I
>> like static inline over macros whenever possible. So much easier t
>> debug.
>
> Actually i never knew till this morning that this function was in the
> code.. I have an inline function ompi_group_lookup (which does the
> same
> thing), that actually checks if the group is dense or not and act
> accordingly.. but to use the inline function instead of the macro,
> means
> again that we need to compile in all the sparse parameters/code,
> which im
> for..

No, it doesn't. Just have something like:

static inline ompi_proc_t*
ompi_group_lookup(ompi_group_t *group, int peer)
{
#if OMPI_GROUP_SPARSE
     /* big long lookup function for sparse groups here */
#else
     return group->grp_proc_pointers[peer]
#endif
}

Brian