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

Signal to noise ratio, Problem 1. Explain the TCP/IP Reference Model wi...

Problem 1. Explain the TCP/IP Reference Model with diagram 2. Describe the following Maximum Data Rate of a Channel Signal to Noise Ratio   3. Describe the

Describe the specific ip-qos schemes, State how the different IP-QoS needs ...

State how the different IP-QoS needs for controling traffic, data and voice applications can be supported in your technology choice from Q7. Describe the specific IP-QoS schemes -

Running netware 4.11 and you cant commune with your router, You are a syst...

You are a system administrator on a NetWare network, you are running  NetWare 4.11 and you cannot commune with your router. What do think what problem is? Ans)NetWare 4.11 defau

Prototype Web Site for the Computer Superstores, Overview Create a proto...

Overview Create a prototype web site for the "Computer Superstores" company. Your site should use effective navigation features and demonstrate good structure for  accessibility

Definition of csma/cd, Definition of CSMA/CD CSMA/CD (Carrier Sense Mu...

Definition of CSMA/CD CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is used to minimize collisions, coordinate traffic and maximize number of frames deliver

Networking services, Your Windows client failed to broadcast to all servers...

Your Windows client failed to broadcast to all servers that it has accepted an IP address offer. What step is this in the four-step DORA process? a. Discovery b. Offering c. Reques

Packet loss and retransmission in tcp, Packet loss and retransmission in TC...

Packet loss and retransmission in TCP TCP gets reliability by retransmission. An acknowledgement is used to check that data has arrived successfully. If acknowledgement does no

Explain dynamic domain name system, Q. Explain Dynamic Domain Name System? ...

Q. Explain Dynamic Domain Name System? DDNS - Dynamic Domain Name System automatically updates the DNS master file - Sent by DHCP to a primary DNS server; secondary se

Define the types of computer network, Define the Types of Computer Network ...

Define the Types of Computer Network Computer networks fall into three classes regarding the size, distance and the structure namely: LAN (Local Area Network), MAN (Metropolita

Synchronous tdm and statistical tdm, Difference between synchronous tdm and...

Difference between synchronous tdm and statistical tdm

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