SlideShare a Scribd company logo
Submitted by,
s.aarthi
Task creation
 A task in PVM(parallel virtual machice) can be started
manually or can be spawned from another task.
 The initiating task is always activated manually by simply
running its executable code on one of the hots.
 Other PVM task can be created dynamic task in other task.
 Dynamic task creation function used
Pvm_spawn()
 Pvm_spawn() refered to as the parent and newly
created task are called children.
The create child from a running parent programmer
must at least specify the following:
1. The machine on which the child will be
started.
2. A path to the executable file on the specified
machine.
3. The number of copies of the child to be
created.
4. An array of arguments to the child task(S).
 As all PVM task are identified by an integer Task
Identifier(TID).
 Task identification can be used to identify sender and
receivers communication.
Task identifier reterival
 Parallel virtual machine provides a number of
functions to retrieve TID values so that a particular
task can identify itself, its parent, and other tasks in
the system.
Task’s TID
 A running task can retrieve its own TID by calling the
PVM function.
pvm_myid() as follows:
mytid=pvm_mytid(); /* get my own tid */
Child’s TID
When a task calls the function pvm_spawn(), an array
containing the TIDs of the children created by this call will be
returned.
For example,
The array tid in the following pvm_spawn() call will
have the TIDs of all the children.
pvm_spawn(...,...,...,...,...,&tid)
/* The TIDs of the children created by this call are saved in the
array tid */
Parent’s TID
A task can retrieve the TID of its parent by
calling the function pvm_parent() as follows:
my_parent_tid=pvm_parent(); /* get my parent’s tid*/
•The value PvmNoParent will be returned if the
calling task is the one that was created manually and
does not have a parent.
•This is an easy way to distinguish the supervisor
from the workers in an application.
Daemon’s TID
A task can retrieve the TID of the daemon running on
the same host as another task whose TID is id by
calling the function pvm_tidtohost() as follows:
daemon_tid =pvm_tidtohost(id);
* get tid of daemon running on the same host as the
task whose TID is id*/
•This function is useful for determining on which host
a given task is running.
Dynamic Task Creation
The pvm_spawn() function is used to create one task or
more on the same or a different machine in the PVM
configuration.
The format of this function is given as follows:
num=pvm_spawn(Child,Arguments,Flag,Where,HowMany,&Tids)
•This function has six parameters and returns the actual
number of the successfully created tasks in the variable
num.
• The first two parameters are the executable file name of
the program to be activated and the arguments to be passed
to the executable .
•The next two parameters specify where to start the
process. The Flag parameter controls the target of the
spawn operation.
• A value of zero lets PVM decides on the appropriate
machine on which to start the task.
•Other values specify that the where parameter signifies a
machine name, or an architecture type.
• Specifying an architecture type may be more appropriate in
some cases.
•Especially when the virtual machine is configured from a
widely dispersed set of architectures.
•One of the requirements of the spawn command is that the
executable must already existon whatever machine it is to run
on.
•The final two parameters contain control information, such as
the number of processes to spawn with this call.
•An array in which to return information, such as task identifiers
and error codes.
The different parameters and their meanings are summarized in
Table 8.1
PARAMETER MEANING
Child The executable file name of the program to be started. The
executable must reside on the host on which it will run.
Arguments A pointer to an array of arguments to the program. If the
program takes no arguments this pointer should be NULL.
Flag A flag value of zero lets the PVM system decides what
machine will run the spawned task(s). Other values signify
that a particular host name or architecture type will be
specified to run the spawned tasks
Where A host name or an architecture type to run the created tasks
depending on the value of the above flag.
HowMany The number of identical children to be started.
Tids The TIDs of the children created by this call.
THANKYOU

More Related Content

What's hot

C++ Function
C++ FunctionC++ Function
C++ Function
PingLun Liao
 
C and C++ functions
C and C++ functionsC and C++ functions
C and C++ functions
kavitha muneeshwaran
 
Wrapping java in awesomeness aka condensator
Wrapping java in awesomeness aka condensatorWrapping java in awesomeness aka condensator
Wrapping java in awesomeness aka condensator
Flowa Oy
 
C# p7
C# p7C# p7
Inline function
Inline functionInline function
Inline functionTech_MX
 
Kojak Metrics Explained
Kojak Metrics ExplainedKojak Metrics Explained
Kojak Metrics Explained
Bart Wood
 
03 function overloading
03 function overloading03 function overloading
03 function overloading
Jasleen Kaur (Chandigarh University)
 
C++ functions presentation by DHEERAJ KATARIA
C++ functions presentation by DHEERAJ KATARIAC++ functions presentation by DHEERAJ KATARIA
C++ functions presentation by DHEERAJ KATARIA
Dheeraj Kataria
 
Inline Functions and Default arguments
Inline Functions and Default argumentsInline Functions and Default arguments
Inline Functions and Default arguments
Nikhil Pandit
 
C++ programming function
C++ programming functionC++ programming function
C++ programming function
Vishalini Mugunen
 
Function in c++
Function in c++Function in c++
Function in c++Kumar
 
Asynchronous Python at Kumparan
Asynchronous Python at KumparanAsynchronous Python at Kumparan
Asynchronous Python at Kumparan
Bayu Aldi Yansyah
 
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
Pôle Systematic Paris-Region
 
16717 functions in C++
16717 functions in C++16717 functions in C++
16717 functions in C++
LPU
 
Cpp functions
Cpp functionsCpp functions
Cpp functions
NabeelaNousheen
 
Inline function in C++
Inline function in C++Inline function in C++
Inline function in C++
Learn By Watch
 
C++ Events
C++ EventsC++ Events
C++ Events
Aaron Nielsen
 
Inline and lambda function
Inline and lambda functionInline and lambda function
Inline and lambda function
Jawad Khan
 
Python functions and loops
Python functions and loopsPython functions and loops
Python functions and loops
thirumurugan133
 
Stephan Ewen - Scaling to large State
Stephan Ewen - Scaling to large StateStephan Ewen - Scaling to large State
Stephan Ewen - Scaling to large State
Flink Forward
 

What's hot (20)

C++ Function
C++ FunctionC++ Function
C++ Function
 
C and C++ functions
C and C++ functionsC and C++ functions
C and C++ functions
 
Wrapping java in awesomeness aka condensator
Wrapping java in awesomeness aka condensatorWrapping java in awesomeness aka condensator
Wrapping java in awesomeness aka condensator
 
C# p7
C# p7C# p7
C# p7
 
Inline function
Inline functionInline function
Inline function
 
Kojak Metrics Explained
Kojak Metrics ExplainedKojak Metrics Explained
Kojak Metrics Explained
 
03 function overloading
03 function overloading03 function overloading
03 function overloading
 
C++ functions presentation by DHEERAJ KATARIA
C++ functions presentation by DHEERAJ KATARIAC++ functions presentation by DHEERAJ KATARIA
C++ functions presentation by DHEERAJ KATARIA
 
Inline Functions and Default arguments
Inline Functions and Default argumentsInline Functions and Default arguments
Inline Functions and Default arguments
 
C++ programming function
C++ programming functionC++ programming function
C++ programming function
 
Function in c++
Function in c++Function in c++
Function in c++
 
Asynchronous Python at Kumparan
Asynchronous Python at KumparanAsynchronous Python at Kumparan
Asynchronous Python at Kumparan
 
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
 
16717 functions in C++
16717 functions in C++16717 functions in C++
16717 functions in C++
 
Cpp functions
Cpp functionsCpp functions
Cpp functions
 
Inline function in C++
Inline function in C++Inline function in C++
Inline function in C++
 
C++ Events
C++ EventsC++ Events
C++ Events
 
Inline and lambda function
Inline and lambda functionInline and lambda function
Inline and lambda function
 
Python functions and loops
Python functions and loopsPython functions and loops
Python functions and loops
 
Stephan Ewen - Scaling to large State
Stephan Ewen - Scaling to large StateStephan Ewen - Scaling to large State
Stephan Ewen - Scaling to large State
 

Similar to parallel programming in the PVM- task creation-Advanced system architecture

System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - Introduction
To Sum It Up
 
Os lab final
Os lab finalOs lab final
Os lab final
LakshmiSarvani6
 
Parallel Programming With Dot Net
Parallel Programming With Dot NetParallel Programming With Dot Net
Parallel Programming With Dot Net
Neeraj Kaushik
 
Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPI
yaman dua
 
Project02 wit
Project02 witProject02 wit
Project02 wit
PeaceFul Tranquility
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
Borland star team to tfs simple migration
Borland star team to tfs simple migrationBorland star team to tfs simple migration
Borland star team to tfs simple migration
Shreesha Rao
 
Manage all the things, small and big, with open source LwM2M implementations ...
Manage all the things, small and big, with open source LwM2M implementations ...Manage all the things, small and big, with open source LwM2M implementations ...
Manage all the things, small and big, with open source LwM2M implementations ...
Benjamin Cabé
 
A framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediationA framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediation
Jürgen Etzlstorfer
 
remote method invocation
remote method invocationremote method invocation
remote method invocationArun Nair
 
Please look at the attach See.doc. I am getting this error all th.docx
Please look at the attach See.doc. I am getting this error all th.docxPlease look at the attach See.doc. I am getting this error all th.docx
Please look at the attach See.doc. I am getting this error all th.docx
randymartin91030
 
MPI
MPIMPI
Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2Max Kleiner
 
Module 1 Introduction
Module 1   IntroductionModule 1   Introduction
Module 1 Introductionleminhvuong
 
Self scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsSelf scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloads
Bram Vogelaar
 
WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows
WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows
WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows
T.Rob Wyatt
 

Similar to parallel programming in the PVM- task creation-Advanced system architecture (20)

System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - Introduction
 
Os lab final
Os lab finalOs lab final
Os lab final
 
Parallel Programming With Dot Net
Parallel Programming With Dot NetParallel Programming With Dot Net
Parallel Programming With Dot Net
 
Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPI
 
Project02 wit
Project02 witProject02 wit
Project02 wit
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
 
Borland star team to tfs simple migration
Borland star team to tfs simple migrationBorland star team to tfs simple migration
Borland star team to tfs simple migration
 
Manage all the things, small and big, with open source LwM2M implementations ...
Manage all the things, small and big, with open source LwM2M implementations ...Manage all the things, small and big, with open source LwM2M implementations ...
Manage all the things, small and big, with open source LwM2M implementations ...
 
A framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediationA framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediation
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
 
Please look at the attach See.doc. I am getting this error all th.docx
Please look at the attach See.doc. I am getting this error all th.docxPlease look at the attach See.doc. I am getting this error all th.docx
Please look at the attach See.doc. I am getting this error all th.docx
 
MPI
MPIMPI
MPI
 
Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2
 
Call Back
Call BackCall Back
Call Back
 
Call Back
Call BackCall Back
Call Back
 
Call Back
Call BackCall Back
Call Back
 
Call Back
Call BackCall Back
Call Back
 
Module 1 Introduction
Module 1   IntroductionModule 1   Introduction
Module 1 Introduction
 
Self scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsSelf scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloads
 
WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows
WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows
WMQ Toolbox: 20 Scripts, One-liners, & Utilities for UNIX & Windows
 

Recently uploaded

June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 

Recently uploaded (20)

June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 

parallel programming in the PVM- task creation-Advanced system architecture

  • 2. Task creation  A task in PVM(parallel virtual machice) can be started manually or can be spawned from another task.  The initiating task is always activated manually by simply running its executable code on one of the hots.  Other PVM task can be created dynamic task in other task.  Dynamic task creation function used Pvm_spawn()
  • 3.  Pvm_spawn() refered to as the parent and newly created task are called children. The create child from a running parent programmer must at least specify the following: 1. The machine on which the child will be started. 2. A path to the executable file on the specified machine. 3. The number of copies of the child to be created. 4. An array of arguments to the child task(S).
  • 4.  As all PVM task are identified by an integer Task Identifier(TID).  Task identification can be used to identify sender and receivers communication.
  • 5. Task identifier reterival  Parallel virtual machine provides a number of functions to retrieve TID values so that a particular task can identify itself, its parent, and other tasks in the system. Task’s TID  A running task can retrieve its own TID by calling the PVM function. pvm_myid() as follows: mytid=pvm_mytid(); /* get my own tid */
  • 6. Child’s TID When a task calls the function pvm_spawn(), an array containing the TIDs of the children created by this call will be returned. For example, The array tid in the following pvm_spawn() call will have the TIDs of all the children. pvm_spawn(...,...,...,...,...,&tid) /* The TIDs of the children created by this call are saved in the array tid */
  • 7. Parent’s TID A task can retrieve the TID of its parent by calling the function pvm_parent() as follows: my_parent_tid=pvm_parent(); /* get my parent’s tid*/ •The value PvmNoParent will be returned if the calling task is the one that was created manually and does not have a parent. •This is an easy way to distinguish the supervisor from the workers in an application.
  • 8. Daemon’s TID A task can retrieve the TID of the daemon running on the same host as another task whose TID is id by calling the function pvm_tidtohost() as follows: daemon_tid =pvm_tidtohost(id); * get tid of daemon running on the same host as the task whose TID is id*/ •This function is useful for determining on which host a given task is running.
  • 9.
  • 10.
  • 11. Dynamic Task Creation The pvm_spawn() function is used to create one task or more on the same or a different machine in the PVM configuration. The format of this function is given as follows: num=pvm_spawn(Child,Arguments,Flag,Where,HowMany,&Tids)
  • 12. •This function has six parameters and returns the actual number of the successfully created tasks in the variable num. • The first two parameters are the executable file name of the program to be activated and the arguments to be passed to the executable . •The next two parameters specify where to start the process. The Flag parameter controls the target of the spawn operation. • A value of zero lets PVM decides on the appropriate machine on which to start the task. •Other values specify that the where parameter signifies a machine name, or an architecture type.
  • 13. • Specifying an architecture type may be more appropriate in some cases. •Especially when the virtual machine is configured from a widely dispersed set of architectures. •One of the requirements of the spawn command is that the executable must already existon whatever machine it is to run on. •The final two parameters contain control information, such as the number of processes to spawn with this call. •An array in which to return information, such as task identifiers and error codes. The different parameters and their meanings are summarized in Table 8.1
  • 14. PARAMETER MEANING Child The executable file name of the program to be started. The executable must reside on the host on which it will run. Arguments A pointer to an array of arguments to the program. If the program takes no arguments this pointer should be NULL. Flag A flag value of zero lets the PVM system decides what machine will run the spawned task(s). Other values signify that a particular host name or architecture type will be specified to run the spawned tasks Where A host name or an architecture type to run the created tasks depending on the value of the above flag. HowMany The number of identical children to be started. Tids The TIDs of the children created by this call.