[MPICH] Replacing collective routines

Darius Buntinas buntinas at mcs.anl.gov
Wed Jul 18 10:18:52 CDT 2007


Hi Georg,

The communicator struct has a field called coll_fns which points to a 
table of collective functions (MPID_Collops which is defined in 
mpiimpl.h).  By default this field is NULL, so the default collective 
functions are used.  In order to override one or more collective 
functions for a communicator, create an instance of the MPID_Collops 
table, and set the function pointers to your new functions.  Then in 
each communicator for which you want to override the functions, set 
coll->coll_fns to point to that table.  If any entry in MPID_Collops is 
NULL, the default collective function will be used, so you need only 
specify the functions you want to override.

In order to set the coll_fns function when the communicator is created, 
define MPID_Dev_comm_create_hook() to set it (or define it to a function 
which sets it).  There's also a MPID_Dev_comm_destroy_hook() if you need it.

If you're looking for an example, look in 
src/mpid/ch3/channels/nemesis/src/ch3i_comm.c .  Here I override the 
default barrier function.  I defined the comm create and destroy hooks 
in src/mpid/ch3/channels/nemesis/include/mpidi_ch3_pre.h .

Does this make sense?

Darius

On 07/18/2007 01:54 AM, Georg Wassen wrote:
> Hello all,
> 
> In the developer's section, a document about replacing collective 
> routines is announced to come soon. Can somebody tell me the time frame?
> Or is this document already available in some sort of beta stage?
> 
> Otherwise, can someone point me to the files, I should look at?
> 
> Kind regards,
> Georg.
> 




More information about the mpich-discuss mailing list