Presentation is loading. Please wait.

Presentation is loading. Please wait.

PVM: Parallel Virtual Machine anonymous ftp ftp ftp.netlib.org cd pvm3/book get pvm-book.ps quit

Similar presentations


Presentation on theme: "PVM: Parallel Virtual Machine anonymous ftp ftp ftp.netlib.org cd pvm3/book get pvm-book.ps quit"— Presentation transcript:

1 PVM: Parallel Virtual Machine anonymous ftp ftp ftp.netlib.org cd pvm3/book get pvm-book.ps quit http://www.netlib.org/pvm3/book/pvm-book.html

2 PVM System PVM is an integrated set of software tools and libraries that emulates a general-purpose, flexible, heterogeneous concurrent computing framework on interconnected computers of varied architecture. User-configured host pool : Translucent access to hardware: Process-based computation: Explicit message-passing model: Heterogeneity support: Multiprocessor support:

3 PVM System The PVM system is composed of two parts. The first part is a daemon, called pvmd3 and sometimes abbreviated pvmd, that resides on all the computers making up the virtual machine. The second part of the system is a library of PVM interface routines. It contains a functionally complete repertoire of primitives that are needed for cooperation between tasks of an application. This library contains user-callable routines for message passing, spawning processes, coordinating tasks, and modifying the virtual machine.

4 PVM computing model The PVM computing model is based on the notion that an application consists of several tasks. Each task is responsible for a part of the application's computational workload. functional parallelism data parallelism

5 PVM Programming Languages The PVM system currently supports C, C++, and Fortran languages. This set of language interfaces have been included based on the observation that the predominant majority of target applications are written in C and Fortran, with an emerging trend in experimenting with object-based languages and methodologies.

6 Hello Program tnum=pvm_spawn(char * task, char** argv, int flag, char* where, int ntask, int* tid); start new PVM process task - executable file name argv - pointer to an array of arguments flag - integer specifying options : PvmTaskDefault 0 PVM can choose any machine to start task PvmTaskHost 1 where specifies a particular host PvmTaskArch 2 where specifies a type of architecture where - string specifying where to start the PVM process. “ SUN4 ”, “ hpds32.ee.ncku.edu.tw ” ntask – interger specifying the number of copies of the executable to start up tid – integer array of length at least ntask tnum – integer returning the actual number of tasks starts.

7 Hello Program Receive a message int bufid = pvm_recv(int tid, int msgtag); tid - integer task identifier of sending process supplied by the user msgtag – integer message tag supplied by the user. It allow user ’ s program to distinguish between different kinds of messages. bufid – integer returns the value of the new active receive buffer identifier. values less than zero indicate an error. If tid=-1, then pvm_recv will accept a message from any process, which has a matching msgtag. If msgtag=-1, pvm_recv will accept any message that is sent from process tid. If tid=-1 and magtag=-1, pvm_recv will accept any message from any process.

8 Hello Program Send a message int info = pvm_send(int tid, int msgtag); tid - integer task identifier of destination process msgtag – integer message tag supplied by the user. info – integer status code returned by the routine. values less than zero indicate an error. PvmBadParam giving an invalid tid or msgtag PvmSysErr pvmd not responding PvmNoBuf no active send buffer. Try calling pvm_initsend() before sending

9 Hello Program Clears default send buffer and specifies message encoding int bufid = pvm_initsend(int encoding); encoding - integer specifying the next messages encoding scheme. bufid – integer message buffer identifier. Values less than zero indicate an error. PvmBadParam 0 XDR PvmDataRaw 1 no encoding PvmDataInPlance 2 data left in place

10 Hello Program Packs the active message buffer with arrays of prescribed data type int info = pvm_pkstr(char* sp); int info = pvm_pkint(int* ip, int nitem, int stride); int info = pvm_pkfloat(float* fp, nitem, int stride); int info = pvm_pkdouble(double* dp, nitem, int stride); Unpacks the active message buffer with arrays of prescribed data type int info = pvm_upkstr(char* sp); int info = pvm_upkint(int* ip, int nitem, int stride); int info = pvm_upkfloat(float* fp, nitem, int stride); int info = pvm_upkdouble(double* dp, nitem, int stride);

11 Hello Program Return the tid of the process int tid = pvm_mytid(void); tid – integer task identifier of the calling PVM process is returned Return the tid of the process that spawned the calling process int tid = pvm_parent(void); tid – integer returns the task identifier of the parent of the calling process

12 Master & Slave Program P0 P1P2P3P4 1. Data, nproc, tid 2. sum 3. result

13 SPMD program P0 P1P2P3P4 token


Download ppt "PVM: Parallel Virtual Machine anonymous ftp ftp ftp.netlib.org cd pvm3/book get pvm-book.ps quit"

Similar presentations


Ads by Google