Mpi functions and environment, Computer Networking

Assignment Help:

MPI contains hundreds of functions, a small subset of which is enough for most practical purposes. We shall talk about some of them in this unit.

Functions for MPI Environment:

int MPI_Init ( int *argc, char ** argv)

    It initializes the MPI environment. By that, No MPI function can be called before MPI_Init.

int MPI_Finalize (void)

It stops the MPI environment.  No MPI function can be called after MPI_Finalize. Each MPI process belongs to one or more groups (also known as communicator). Every process is recognized by its rank (0 to group size -1) within the given group. Initially, all processes belong to a default group known as MPI_COMM_WORLD group. Additional groups can be produced by the user as and when needed.  Now, we shall learn some functions related to communicators.

int MPI_Comm_size (MPI_Comm comm,  int *size)

returns variable size that have number of processes in group comm.

int MPI_Comm_rank (MPI_Comm comm,  int *rank)

returns rank of calling process in group comm.

Functions for Message Passing:

MPI processes cannot share memory space and single process cannot directly access other process's variables. Therefore, they need some type of communication between themselves. In MPI environment this communication is in the kind of message passing. A message in MPI has the following fields:

msgaddr: It can be each address in the sender's address space and refers to location in memory where message data begins.

count:  Number of occurrence of data items of message datatype obtained in message.

datatype:  Type of data in message. This field is beneficial in the sense that MPI supports heterogeneous computing and the different nodes may interpret count field differently. For example, if the message have a strings of 2n characters (count =2n), some machines may interpret it have 2n characters and some containing n characters depending upon the storage allocated per character (1 or 2). The basic datatype in MPI having of all basic parts in C and Fortran with two additional types namely MPI_BYTE and MPI_PACKED. MPI_BYTE denotes a byte of 8 bits.

dest or source : Receiving process or Rank of sending in communicator.

tag: Identifier for definite message or type of message. It let the programmer to deal with the arrival of message in an orderly way, even if the arrival of the message is not orderly.

comm.: Communicator. It is an group of a process and object wrapping context .It is allocated by system instead of user.

The functions used for messaging passing are:

int MPI_Send(void *msgaddr, int count,  MPI_Datatype datatype, int dest, int tag, MPI_Comm comm.)

on return, msg can be reused instantly.

int MPI_Recv(void *msgaddr, int count,  MPI_Datatype datatype, int dest, int tag, MPI_Comm comm.)

on return, msg contains requested message.

MPI message passing may be either collective or point-to-point.


Related Discussions:- Mpi functions and environment

network consultant, Network Consultant, My name is Jason Long. I am th...

Network Consultant, My name is Jason Long. I am the CEO of IL Corporation. IL is an investment firm that performs financial services to many organizations. We currently have a

Client-server , We need to design and implement a secure conference system....

We need to design and implement a secure conference system. The system will allow users to connect to a conference server and to participate in a shared conversation. The conversat

Name the two types of oltp, a) TP lite , based on stored procedures. b)...

a) TP lite , based on stored procedures. b) TP heavy , based on the TP monitors.

What is the attenuation, In communication weakening or loss of signal energ...

In communication weakening or loss of signal energy, typically caused by distance

Explain the changes to the ip stack, After powering up his PC, Bob notices ...

After powering up his PC, Bob notices the PC was not able to properly connect to network devices. He obtained the following information from his workstation: C:\>ipconfig Win

What is network architecture, What is Network Architecture? When two o...

What is Network Architecture? When two or more computer are linked with one another for the purpose of communicating data electronically, besides physical connection of comput

Show the steps used at sender end by check sum, Q. Show the steps used at s...

Q. Show the steps used at sender end by check sum? The sender follows these steps: The data unit is divided into "k" sections, each off "n" bits All sections ar

What is network server, What is Network Server? Network Server is a com...

What is Network Server? Network Server is a computer in Network that is designated to give one or more network service. For instance file server, database server etc.

Explain in brief about crc, What is CRC The CRC is computed while trans...

What is CRC The CRC is computed while transmission and appended to output stream as soon as last bit goes out onto wire. If the CRC were in header, it will be necessary to make

What is error detection, What is Error Detection? What are its methods? ...

What is Error Detection? What are its methods? Data can be corrupted during transmission. For reliable communication errors must be deducted and corrected. Error Detection uses

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd