Yaohui,

The whole infrastructure at the level where you're looking is similar to Active 
Messages. The register function is used to register callback for a specific 
tag. A tag is a uint8_t, and thus there are 256 callbacks possible. However, 
there are some rules regarding which level is allowed to register callbacks in 
a specific range, in order to avoid conflict between several modules loaded in 
same time.

Anyway, as far as I understood you're looking at writing a new BTL. Every time 
a message is drained from the network, the BTL is supposed to know that tag it 
was send to and trigger the corresponding callback (this only on the receiver 
side). How this "tag" is moved around depends on the BTL capabilities. Some 
will have to push it explicitly through the network (TCP as an example), while 
others have other means to move it around (for MX this tag is part of the 64 
bits key used for each message). Therefore, the first thing you should make 
sure is that you really have a way to retrieve this tag on the receiver side. 
Once you have the tag and the content of the message, you should call the 
callback corresponding to the tag (using the simple addition you noticed), and 
pass the correct arguments. This should at least let you start the eager 
protocol.

  george.

On Mar 16, 2010, at 23:22 , hu yaohui wrote:

> Hi Jeff & All
> Yes,you are right,i was just a little dizzy then. i need to modify the send 
> function of component self in btl framework.
> i just met a problem right now.
> when i browse the function 
> mca_btl_self_send(~/ompi/mca/btl/self/btl_self.c),i think it use this to send 
> the data
> <snip>
> 303    reg = mca_btl_base_active_message_trigger + tag;
> 304    reg->cbfunc( btl, tag, des, reg->cbdata );
> </snip>
> i trace through the "mca_btl_base_active_message_trigger" to the function 
> where it get its value ,then i find function 
> mca_bml_r2_register(~/ompi/mca/bml/bml_r2.c),it like this:
> <snip>
> 728    mca_btl_base_active_message_trigger[tag].cbfunc = cbfunc;
> 729    mca_btl_base_active_message_trigger[tag].cbdata = data;
> <snip>
> when i trace through mca_bml_r2_register ,in the same file,i get this 
> structure:
> <snip>
> mca_bml_r2_module_t mca_bml_r2 = {
>     {
>         &mca_bml_r2_component, 
>         mca_bml_r2_add_procs,
>         mca_bml_r2_del_procs,
>         mca_bml_r2_add_btl,
>         mca_bml_r2_del_btl,
>         mca_bml_r2_del_proc_btl,
>         mca_bml_r2_register, <------------------------------------
>         mca_bml_r2_register_error,
>         mca_bml_r2_finalize, 
>         mca_bml_r2_ft_event
>     }
>     
> };
> <snip>
> after this ,i find the place where mca_bml_r2 is initialized,but i cannt find 
> anything related to mca_bml_r2_register.i just want to know reg = 
> mca_btl_base_active_message_trigger + tag;
> really is.and i want to modify the send function of self ,is this the right 
> way? or you can tell me the right way to modify the send function of self 
> component.
>  
> Thanks & Regards
> Yaohui Hu
>  
> On Wed, Mar 17, 2010 at 12:52 AM, Jeff Squyres <jsquy...@cisco.com> wrote:
> On Mar 16, 2010, at 9:45 AM, hu yaohui wrote:
> 
> > it just said,i had a wrong command format,when i use mpirun --help,i really
> > didn't find the --mca parameter.why the tcp FAQ part list these command 
> > lines,
> > but it cann't execute successfully on my machine.Is there any another way 
> > to control the specific
> > btl components to be used?
> 
> Make sure you're using the right mpirun -- you might have multiple installed 
> on your machine.
> 
> OMPI's "mpirun --help" definitely includes a description of the --mca 
> parameter:
> 
>   -mca|--mca <arg0> <arg1>
>                         Pass context-specific MCA parameters; they are
>                         considered global if --gmca is not used and only
>                         one context is specified (arg0 is the parameter
>                         name; arg1 is the parameter value)
> 
> --
> Jeff Squyres
> jsquy...@cisco.com
> For corporate legal information go to:
> http://www.cisco.com/web/about/doing_business/legal/cri/
> 
> 
> _______________________________________________
> devel mailing list
> de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/devel
> 
> _______________________________________________
> devel mailing list
> de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/devel


Reply via email to