Explain the use of functions in parallel programming, Computer Engineering

Assignment Help:

Q. Explain the Use of functions in parallel programming?

include "pvm3.h"

main()

{

   int cc, tid, msgtag;

   char buf[100];

   printf("%x\n", pvm_mytid());

   cc = pvm_spawn("hello_other", (char**)0, 0, "", 1, &tid);

   if (cc == 1) {

        msgtag = 1;

      pvm_recv(tid, msgtag);

      pvm_upkstr(buf);

      printf("from t%x: %s\n", tid, buf);

   } else

      printf("can't start hello_other\n");

   pvm_exit();

}

In this program, pvm_mytid( ) returns TID of running program (In this case task id of the program hello.c). This program is designed to be invoked manually after printing its task id (attained with pvm_mytid()), it starts a copy of other program called hello_other using pvm_spawn() function. A successful spawn makes the program to execute a blocking receive using pvm_recv. After receiving the message program prints message sent by its counterpart as well its task id the buffer is extracted from the message using pvm_upkstr. The final pvm_exit call dissociates the program from PVM system.


Related Discussions:- Explain the use of functions in parallel programming

more data items and methods, Create a class called ticket that records the...

Create a class called ticket that records the information of a performance ticket.The class should include at least six data items: performanceId, seatRow, seatNo, class, price, da

Functions of header files ctype.h and string.h, What are the functions of ...

What are the functions of the following header files:  (i)  ctype.h (ii)  string.h   (i)   ctype.h: It is a header file that having character tes

Explain the parallel data storage - application of flip flop, Explain the P...

Explain the Parallel Data Storage - application of flip flops? In digital systems, data are usually stored in groups of bits that represent numbers, codes, or other information

IEEE802.4 Token Bus Network, en a five station token bus LAN with station a...

en a five station token bus LAN with station addresses of 3000, 500, 100, 70, and 50. Stations with addresses of 5000, 4000, 400, 90, and 60 are waiting to enter the ring. Assume a

Programming a 64-bit processor, You are to write a C program called big_mul...

You are to write a C program called big_mult.c that multiplies two unsigned 64-bit integers, x and y, read from the command line. The output is a pair of unsigned 64-bit integers r

Explain about hamming error correcting code, Q. Explain about Hamming error...

Q. Explain about Hamming error correcting code? Richard Hamming at Bell Laboratories worked out this code. We will only introduce this code with help of an illustration for 4 b

Programming with parallel virtual machine, Q. Programming with parallel vir...

Q. Programming with parallel virtual machine? The general method for writing a program with PVM is like this:  A user writes one or more sequential programs in C++, C or FOR

Networking, compare 2g , 3g , and 4g also with advantage of 3g and 4g.

compare 2g , 3g , and 4g also with advantage of 3g and 4g.

What is meant by bitwise operations, What is meant by bitwise operations? ...

What is meant by bitwise operations? C has distinction of supporting special operators known as bit wise operators for manipulation of data at bit level. These operators are us

Computer architecture, 6.How can we improve the performance of pipeline pro...

6.How can we improve the performance of pipeline processing

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