[mpich-discuss] How is MPI Initialization done ?

Krishna Chaitanya kris.c1986 at gmail.com
Tue Mar 11 07:24:31 CDT 2008


Hi,
        I have traced through the point to point module a few times. So, may
be I can share the flow of events :
MPI_Init does some basic error checking first and calls MPIR_Init_thread()
which primarily populates the MPIR_Process data structure, which also
includes the communicator structure. Apart from that, it also initialises
some other global variables and the channel interface.

> How the initial communication is established in order to exchange the
hostname+ port number details ?
         Suppose, you are using the standard blocking send mode, the bulk of
this work is done in the MPID_Send() function. Here, the library either
selects the eager mode or the rendezvous mode ,depending on the size of the
message that you intend to transfer. There is a cut-off size (
vc->eager_max_msg_sz )  upto which the library chooses the eager mode, for
data sizes beyond this, the rendezvous mode is selected.
         Suppose, the message is small and the data is contiguous,either the
MPIDI_CH3_EagerContigShortSend() function is invoked. Over here, the eager
packet is initialized and the data is copied from the buffer to the eager
packet and invokes the MPIDI_CH3_iStartMsg(). This function examines the
current connection state, since it is the first call, it is still
un-connected. It creates the request data structure and enqueues it. The
progress engine takes care of the request from here. The library now tries
to form a new connection to the node whose rank has been specified,by
invoking the MPIDI_CH3I_VC_post_connect() function. The destination is
already known to the library through the rank and the hostname( mpd.hosts).
This function gets the info related to the destination IP and the port
address.
         The library now invokes the progress engine, through the call to
MPIDI_CH3i_Progress_wait(). The actual connection establishment and the data
transfer takes place in this function through the calls to
MPIDI_CH3I_Progress_handle_sock_event() and MPIDU_Sock_wait(). It loops
around till the completion counter is set to 1.

>How is the hostname+port number details sent and received
         I remember Dave had once helped me out with this :
http://wiki.mcs.anl.gov/mpich2/index.php/Sock_conn_protocol

         Its quite copious in content. The best way to understand what is
happening is to actually trace through the entire progress engine.

> How is all-to-all communication is done? On which ports this will be done
?
         I am sure the other experienced members would help you on this. I
havent done much in this area.

         I just have a few months exposure to MPICH. If I have gone wrong
somewhere, please do correct me.

Best,
Krishna Chaitanya K,
Final Year B-Tech,
Dept. of Information Technology,
National Institute of Technology,Karnataka (NITK)





On Tue, Mar 11, 2008 at 3:15 AM, Ravi Thati <gotothati at gmail.com> wrote:

> Hello All,
>
>       I am working with MPICH-G2.
>        I came to know  (from mailing search) that  while MPI_Init is
> called , the initialization is being done.
>       All-to-all exchange of host+port details is done.
>
> My doubt is :
>
>  How the initial communication is established in order to exchange the
> hostname+ port number details ?
>  How is the hostname+port number details sent and received ? what are the
> destination IPs these packets?
>
>  How is all-to-all communication is done? On which ports this will be done
> ?
>  Only after the exchange , each process can communicate with other.
>
>    Thanks for any clarifications.
> --
> Regards,
> Ravi.Thati




-- 
In the middle of difficulty, lies opportunity
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20080311/23e253c4/attachment.htm>


More information about the mpich-discuss mailing list