On Thu, July 26, 2007 1:18 pm, Brian Barrett wrote: > 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?
not sure if i understood your question right, but in the group struct we added 5 integers and 3 pointer.. if we want to compile these out, we would then need all the #ifs around the code where we use these parameters.. > >>> 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 > } > ok, i guess i can do that... > Brian > _______________________________________________ > devel mailing list > de...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/devel > -- Mohamad Chaarawi Instructional Assistant http://www.cs.uh.edu/~mschaara Department of Computer Science University of Houston 4800 Calhoun, PGH Room 526 Houston, TX 77204, USA