On 7/17/06 12:37 AM, "Mahesh Barve" <barvemah...@yahoo.com> wrote:

>   Can anyone please enlighten us about what really
> happens in MPI_init() in openMPI?

This is quite a complicated question.  :-)

>   More specifically i am interested in knowing
> 1.Functions that needs to accomplished during
> MPI_init()
> 2.What has already been implemented in openMPI
> MPI_Init
> 2. The routines called/invoked that perform these
> functions

Many, many things happen in MPI_INIT.  Here's a sample:

- setup the lowest layer of the system (OPAL)
- setup the run-time environment (ORTE)
  - find out our rank in MPI_COMM_WORLD
  - find out how many peers we have and who they are
  - find out how to contact our peers
- setup the progression engine
- setup processor affinity (if desired)
- setup all the various component frameworks to implement much of the MPI
functionality
  - setup our MPI point-to-point channels
    - publish information on how peer processes can contact me
    - receive information on how to contact peer processes
  - setup MPI collectives
  - setup MPI topologies
  - ...etc.
- setup all the MPI handle processing (MPI_Comm, MPI_Datatype, etc.)
  - initialize pre-defined handles
  - create fortran translation tables
- ...etc.

I would suggest that you look through ompi/runtime/ompi_mpi_init.c.  It's
basically a big dispatch function of all the events that occur during
MPI_INIT (i.e., both MPI_INIT and MPI_INIT_THREAD -- ompi/mpi/c/init.c and
ompi/mpi/c/init_thread.c, respectively -- call this function to do all the
work).  

The list of things that it does is quite explicit.  Note that the ordering
of functions in this function is extremely important -- almost all the
functions are strictly ordered because of explicit or implicit dependencies.

Does that help?

-- 
Jeff Squyres
Server Virtualization Business Unit
Cisco Systems

Reply via email to