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

Illustrate the term- search engine and surfing, Illustrate the term- Search...

Illustrate the term- Search Engine and Surfing Search Engine: Software used to find information on the Web. Examples are Google, Lycos and Yahoo. Server: A computer with

What is an object server, What is an Object server? With an object serv...

What is an Object server? With an object server, the Client/Server application is printed as a set of communicating objects. Client object converse with server objects using an

What is money laundering and how is money laundered, Question: a) (i)...

Question: a) (i) Describe the entire process of credit card processing, identifying the different steps and parties involved. (ii) What are the roles of the acquiring ban

Networking & computer architecture long question, Write discussion on Assoc...

Write discussion on Associative mapping - computer architecture.

the default settings of ipx delay number, The "ipx delay number" command w...

The "ipx delay number" command will permit an administrator to alter the default settings. Explain the default settings? Ans) For LAN interfaces, one tick; for WAN interfaces, s

Distance-vector routing, Local information is immediate hop routing table a...

Local information is immediate hop routing table and distance from every switch. The switches regularly broadcast topology information i.e. distance, destination. Other switches mo

What is topology, Q. What is Topology? - Physical/logical arrangement ...

Q. What is Topology? - Physical/logical arrangement - Topology of a network is the geometric depiction of the relationship of all the links and linking devices to one anothe

Computing shortest path in a graph, While calculating shortest path, first ...

While calculating shortest path, first we assume graph presentation of network at every node then we use Djikstra's algorithm to calculate shortest path from every node to other on

Determine the major advantages of ring topology, Point out the major advant...

Point out the major advantages of Ring Topology. The benefits of ring topologies are: a. They are very simple to troubleshoot because every device incorporates a repeater.

Ports, It is an additional 16-bit number which uniquely identifies the spec...

It is an additional 16-bit number which uniquely identifies the specific service on any given machine on the Internet. Port numbers are 16 bit wide, so each of the computers on the

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