<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.wiki.mohid.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Miranda+ricardo</id>
		<title>MohidWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.wiki.mohid.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Miranda+ricardo"/>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Special:Contributions/Miranda_ricardo"/>
		<updated>2026-04-04T17:25:27Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7243</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7243"/>
				<updated>2015-03-09T15:52:47Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Run the program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Run the program ==&lt;br /&gt;
Both Windows and *NIX systems run the same way. This application runs from the command line.&lt;br /&gt;
To run the program go to the directory where the file &amp;quot;Tree.dat&amp;quot; is. Most likely you will run on a single machine, the number of Parsers must be 1, the number of Workers can be any number greater then 1. There should be a balance between the number of available cores and the number of files to join. The application parses the &amp;quot;MPI_*_DecomposedFiles.dat&amp;quot; produced by Mohid. The consolidated files are placed in the same directory where the decomposed files are. The command to run the application is:&lt;br /&gt;
&lt;br /&gt;
* mpiexec.exe -localonly -n 1 DDCParser.exe : -n 2  DDCWorker.exe&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
[[File:Ddc.rcm.png|thumb|left|alt=Diagram of the architecture for the consolidation of domain decomposition HDF result files.]]There are 2 kinds of MPI processes running:&lt;br /&gt;
*a Parser; and&lt;br /&gt;
*any number of workers.&lt;br /&gt;
&lt;br /&gt;
The Parser identifies result files to be consolidated. It keeps a list of jobs to be done.&lt;br /&gt;
At the end, when all files are merged, a &amp;quot;poison pill&amp;quot; message will be broadcast notifying workers they must terminate.&lt;br /&gt;
The list of jobs works like this:&lt;br /&gt;
#a Worker is idle it sends a request to the Parser;&lt;br /&gt;
#the Parser sends the first unfinished job to the worker and moves it from the first to the last position of the list;&lt;br /&gt;
#when a Worker terminates a job sends a processed message to the Parser;&lt;br /&gt;
#the Parser removes the completed job from the list.&lt;br /&gt;
This strategy for the jobs list ensures fault tolerance. Suppose a job is sent to a Worker that, for some reason, does not complete it. That job will eventually be send to another Worker. It may occur that a job is executed twice but the program is idempotent so no harm occurs...&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7242</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7242"/>
				<updated>2015-03-09T15:52:32Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Run the program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Run the program ==&lt;br /&gt;
Both Windows and *NIX systems run the same way. This application runs from the command line.&lt;br /&gt;
To run the program go to the directory where the file &amp;quot;Tree.dat&amp;quot; is. Most likely you will run on a single machine, the number of Parsers must be 1, the number of Workers can be any number greater then 1. There should be a balance between the number of available cores and the number of files to join. The application parses the &amp;quot;MPI_*_DecomposedFiles.dat&amp;quot; produced by Mohid. The consolidated files are placed in the same directory where the decomposed files are. The command to run the application is:&lt;br /&gt;
&lt;br /&gt;
* mpiexec -localonly -n 1 DDCParser.exe : -n 2  DDCWorker.exe&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
[[File:Ddc.rcm.png|thumb|left|alt=Diagram of the architecture for the consolidation of domain decomposition HDF result files.]]There are 2 kinds of MPI processes running:&lt;br /&gt;
*a Parser; and&lt;br /&gt;
*any number of workers.&lt;br /&gt;
&lt;br /&gt;
The Parser identifies result files to be consolidated. It keeps a list of jobs to be done.&lt;br /&gt;
At the end, when all files are merged, a &amp;quot;poison pill&amp;quot; message will be broadcast notifying workers they must terminate.&lt;br /&gt;
The list of jobs works like this:&lt;br /&gt;
#a Worker is idle it sends a request to the Parser;&lt;br /&gt;
#the Parser sends the first unfinished job to the worker and moves it from the first to the last position of the list;&lt;br /&gt;
#when a Worker terminates a job sends a processed message to the Parser;&lt;br /&gt;
#the Parser removes the completed job from the list.&lt;br /&gt;
This strategy for the jobs list ensures fault tolerance. Suppose a job is sent to a Worker that, for some reason, does not complete it. That job will eventually be send to another Worker. It may occur that a job is executed twice but the program is idempotent so no harm occurs...&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7241</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7241"/>
				<updated>2015-03-09T15:52:08Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Run the program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Run the program ==&lt;br /&gt;
Both Windows and *NIX systems run the same way. This application runs from the command line.&lt;br /&gt;
To run the program go to the directory where the file &amp;quot;Tree.dat&amp;quot; is. Most likely you will run on a single machine, the number of Parsers must be 1, the number of Workers can be any number greater then 1. There should be a balance between the number of available cores and the number of files to join. The application parses the &amp;quot;MPI_*_DecomposedFiles.dat&amp;quot; produced by Mohid. The consolidated files are placed in the same directory where the decomposed files are. The command to run the application is:&lt;br /&gt;
&lt;br /&gt;
mpiexec -localonly -n 1 DDCParser.exe : -n 2  DDCWorker.exe&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
[[File:Ddc.rcm.png|thumb|left|alt=Diagram of the architecture for the consolidation of domain decomposition HDF result files.]]There are 2 kinds of MPI processes running:&lt;br /&gt;
*a Parser; and&lt;br /&gt;
*any number of workers.&lt;br /&gt;
&lt;br /&gt;
The Parser identifies result files to be consolidated. It keeps a list of jobs to be done.&lt;br /&gt;
At the end, when all files are merged, a &amp;quot;poison pill&amp;quot; message will be broadcast notifying workers they must terminate.&lt;br /&gt;
The list of jobs works like this:&lt;br /&gt;
#a Worker is idle it sends a request to the Parser;&lt;br /&gt;
#the Parser sends the first unfinished job to the worker and moves it from the first to the last position of the list;&lt;br /&gt;
#when a Worker terminates a job sends a processed message to the Parser;&lt;br /&gt;
#the Parser removes the completed job from the list.&lt;br /&gt;
This strategy for the jobs list ensures fault tolerance. Suppose a job is sent to a Worker that, for some reason, does not complete it. That job will eventually be send to another Worker. It may occur that a job is executed twice but the program is idempotent so no harm occurs...&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7240</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7240"/>
				<updated>2015-03-09T15:51:48Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Run the program ==&lt;br /&gt;
Both Windows and *NIX systems run the same way. This application runs from the command line.&lt;br /&gt;
To run the program go to the directory where the file &amp;quot;Tree.dat&amp;quot; is. Most likely you will run on a single machine, the number of Parsers must be 1, the number of Workers can be any number greater then 1. There should be a balance between the number of available cores and the number of files to join. The application parses the &amp;quot;MPI_*_DecomposedFiles.dat&amp;quot; produced by Mohid. The consolidated files are placed in the same directory where the decomposed files are. The command to run the application is:&lt;br /&gt;
mpiexec -localonly -n 1 DDCParser.exe : -n 2  DDCWorker.exe&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
[[File:Ddc.rcm.png|thumb|left|alt=Diagram of the architecture for the consolidation of domain decomposition HDF result files.]]There are 2 kinds of MPI processes running:&lt;br /&gt;
*a Parser; and&lt;br /&gt;
*any number of workers.&lt;br /&gt;
&lt;br /&gt;
The Parser identifies result files to be consolidated. It keeps a list of jobs to be done.&lt;br /&gt;
At the end, when all files are merged, a &amp;quot;poison pill&amp;quot; message will be broadcast notifying workers they must terminate.&lt;br /&gt;
The list of jobs works like this:&lt;br /&gt;
#a Worker is idle it sends a request to the Parser;&lt;br /&gt;
#the Parser sends the first unfinished job to the worker and moves it from the first to the last position of the list;&lt;br /&gt;
#when a Worker terminates a job sends a processed message to the Parser;&lt;br /&gt;
#the Parser removes the completed job from the list.&lt;br /&gt;
This strategy for the jobs list ensures fault tolerance. Suppose a job is sent to a Worker that, for some reason, does not complete it. That job will eventually be send to another Worker. It may occur that a job is executed twice but the program is idempotent so no harm occurs...&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7235</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7235"/>
				<updated>2015-02-03T11:37:13Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Topology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
[[File:Ddc.rcm.png|thumb|left|alt=Diagram of the architecture for the consolidation of domain decomposition HDF result files.]]There are 2 kinds of MPI processes running:&lt;br /&gt;
*a Parser; and&lt;br /&gt;
*any number of workers.&lt;br /&gt;
&lt;br /&gt;
The Parser identifies result files to be consolidated. It keeps a list of jobs to be done.&lt;br /&gt;
At the end, when all files are merged, a &amp;quot;poison pill&amp;quot; message will be broadcast notifying workers they must terminate.&lt;br /&gt;
The list of jobs works like this:&lt;br /&gt;
#a Worker is idle it sends a request to the Parser;&lt;br /&gt;
#the Parser sends the first unfinished job to the worker and moves it from the first to the last position of the list;&lt;br /&gt;
#when a Worker terminates a job sends a processed message to the Parser;&lt;br /&gt;
#the Parser removes the completed job from the list.&lt;br /&gt;
This strategy for the jobs list ensures fault tolerance. Suppose a job is sent to a Worker that, for some reason, does not complete it. That job will eventually be send to another Worker. It may occur that a job is executed twice but the program is idempotent so no harm occurs...&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7234</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7234"/>
				<updated>2015-02-03T11:34:03Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
[[File:Ddc.rcm.png|thumb|left|alt=Diagram of the architecture for the consolidation of domain decomposition HDF result files.]]There are 2 kinds of MPI processes running:&lt;br /&gt;
*a Parser; and&lt;br /&gt;
*any number of workers.&lt;br /&gt;
&lt;br /&gt;
The Parser identifies result files to be consolidated. It keeps 2 lists:&lt;br /&gt;
*a list of jobs to be done; and&lt;br /&gt;
*a list of workers.&lt;br /&gt;
The list of workers will be used in the end, when there are no more pending jobs. A message will be send to every worker notifying them that they should terminate.&lt;br /&gt;
The list of jobs works like this:&lt;br /&gt;
#a Worker is idle it sends a request to the Parser;&lt;br /&gt;
#the Parser sends the first unfinished job to the worker and moves it from the first to the last position of the list;&lt;br /&gt;
#when a Worker terminates a job sends a processed message to the Parser;&lt;br /&gt;
#the Parser removes the completed job from the list.&lt;br /&gt;
This strategy for the jobs list ensures fault tolerance. Suppose a job is sent to a Worker that, for some reason, does not complete it. That job will eventually be send to another Worker. It may occur that a job is executed twice but the program is idempotent so no harm occurs...&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7205</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7205"/>
				<updated>2014-11-30T19:41:09Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Topology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
[[File:Ddc.rcm.png|thumb|left|alt=Diagram of the architecture for the consolidation of domain decomposition HDF result files.]]There are 2 kinds of MPI processes running:&lt;br /&gt;
*a Parser; and&lt;br /&gt;
*2 workers.&lt;br /&gt;
&lt;br /&gt;
The Parser identifies result files to be consolidated. It keeps 2 lists:&lt;br /&gt;
*a list of jobs to be done; and&lt;br /&gt;
*a list of workers.&lt;br /&gt;
The list of workers will be used in the end, when there are no more pending jobs. A message will be send to every worker notifying them that they should terminate.&lt;br /&gt;
The list of jobs works like this:&lt;br /&gt;
#a Worker is idle it sends a request to the Parser;&lt;br /&gt;
#the Parser sends the first unfinished job to the worker and moves it from the first to the last position of the list;&lt;br /&gt;
#when a Worker terminates a job sends a processed message to the Parser;&lt;br /&gt;
#the Parser removes the completed job from the list.&lt;br /&gt;
This strategy for the jobs list ensures fault tolerance. Suppose a job is sent to a Worker that, for some reason, does not complete it. That job will eventually be send to another Worker. It may occur that a job is executed twice but the program is idempotent so no harm occurs...&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7204</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7204"/>
				<updated>2014-11-30T19:31:32Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Topology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
[[File:Ddc.rcm.png|thumb|left|alt=Diagram of the architecture for the consolidation of domain decomposition HDF result files.]]There are 2 kinds of MPI processes running:&lt;br /&gt;
*a Parser; and&lt;br /&gt;
*2 workers.&lt;br /&gt;
&lt;br /&gt;
The Parser identifies result files to be consolidated. It keeps 2 lists:&lt;br /&gt;
*a list of jobs to be done; and&lt;br /&gt;
*a list of workers.&lt;br /&gt;
The list of workers will be used in the end, when there are no more pending jobs. A message will be send to every worker notifying them that they should terminate.&lt;br /&gt;
The list of jobs works like this:&lt;br /&gt;
#a Worker is idle it sends a request to the Parser;&lt;br /&gt;
#the Parser sends the first unfinished job to the worker and moves it from the first to the last position of the list;&lt;br /&gt;
#when a Worker terminates a job sends a processed message to the Parser;&lt;br /&gt;
#the Parser removes the completed job from the list.&lt;br /&gt;
This strategy for the jobs list ensures fault tolerance.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7203</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7203"/>
				<updated>2014-11-30T19:21:17Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Topology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
[[File:Ddc.rcm.png|thumb|left|alt=Domain in decomposed in 3 subdomains creates 3 instances of MohidWater (MW1, MW2 and MW3).|Domain in decomposed in 3 subdomains.]]There are 2 kinds of MPI processes running:&lt;br /&gt;
*a parser; and&lt;br /&gt;
*2 workers.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7202</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7202"/>
				<updated>2014-11-30T19:20:12Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Topology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
[[File:Ddc.rcm.png|thumb|left|alt=Domain in decomposed in 3 subdomains creates 3 instances of MohidWater (MW1, MW2 and MW3).|Domain in decomposed in 3 subdomains.]] There are 2 kinds of MPI processes running:&lt;br /&gt;
*a parser; and&lt;br /&gt;
*2 workers.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=File:Ddc.rcm.png&amp;diff=7201</id>
		<title>File:Ddc.rcm.png</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=File:Ddc.rcm.png&amp;diff=7201"/>
				<updated>2014-11-30T19:18:32Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: Diagram of the architecture for the consolidation of domain decomposition HDF result files.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Diagram of the architecture for the consolidation of domain decomposition HDF result files.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7200</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7200"/>
				<updated>2014-11-30T19:14:30Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;br /&gt;
&lt;br /&gt;
== Topology ==&lt;br /&gt;
There are 2 kinds of MPI processes running:&lt;br /&gt;
*a parser; and&lt;br /&gt;
*2 workers.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7199</id>
		<title>Consolidate Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Consolidate_Domain_Decomposition&amp;diff=7199"/>
				<updated>2014-11-30T19:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: Created page with &amp;quot;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The program Consolidate Domain Decomposition uses the actor model to parallelize file processing tasks. For instance, suppose there are hydrodynamic and water quality files from 2 sub-domains:&lt;br /&gt;
*hyd_submod_1.hdf and wq_submod_1.hdf; and&lt;br /&gt;
*hyd_submod_2.hdf and wq_submod_2.hdf.&lt;br /&gt;
The desired consolidated files are hyd.hdf and  wq.hdf, resulting form the concatenation of:&lt;br /&gt;
*hyd_submod_1.hdf and hyd_submod_2.hdf to produce hyd.hdf; and&lt;br /&gt;
*wq_submod_1.hdf and wq_submod_2.hdf for the wq.hdf&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Actor_Model&amp;diff=7198</id>
		<title>Actor Model</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Actor_Model&amp;diff=7198"/>
				<updated>2014-11-30T19:03:33Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to the Wikipedia[http://en.wikipedia.org/wiki/Actor_model] &amp;quot;the actor model in computer science is a mathematical model of concurrent computation that treats &amp;quot;actors&amp;quot; as the universal primitives of concurrent digital computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and determine how to respond to the next message received&amp;quot; (changing state). The actor model is a special form of [[Reactive Programming]].&lt;br /&gt;
&lt;br /&gt;
There are several resources in the Internet explaining the Actor Model and Reactive Programing. Some videos and interesting interviews:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Hewitt, Meijer and Szyperski: The Actor Model (everything you wanted to know, but were afraid to ask)[http://channel9.msdn.com/Shows/Going+Deep/Hewitt-Meijer-and-Szyperski-The-Actor-Model-everything-you-wanted-to-know-but-were-afraid-to-ask];&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Francesco Cesarini and Viktor Klang on the Reactive Manifesto[http://www.infoq.com/interviews/cesarini-klang-reactive-manifesto]; and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Up And Out Scaling Software With Akka - Jonas Bonér[http://www.youtube.com/watch?v=t4KxWDqGfcs]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
To read on-line:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;The Reactive Manifesto[http://www.reactivemanifesto.org/]; and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Learn You Some Erlang for great good![http://learnyousomeerlang.com/content];&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The actor model makes it easier to reason about distributed programming. All MPI directives will be packed up in a set of well defined modules. Communication among actors takes place through clear and standard interfaces with well defined behaviors. This software architecture is proven to provide scalability, resilience and responsiveness. There is no central management and no points of synchronism so actors just react to events; this is a simpler way of reasoning about concurrency and parallelism.&lt;br /&gt;
&lt;br /&gt;
According to Carl Hewitts' definition (Carl Hewitt; Peter Bishop; Richard Steiger (1973). A Universal Modular Actor Formalism for Artificial Intelligence. IJCAI) an actor is the fundamental unit of computation that embodies:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;processing (the behavior, the executable code);&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;storage (its the state, the stuff on the heap, memory); and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;communication.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When an actor receives a message it reacts:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;sending messages to actors it knows (finite number);&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;creating new actors (finite number); and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;designating how it should handle the next message it receives (changing state).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here a [[Fortran implementation of the Actor Model using MPI]] is discussed.&lt;br /&gt;
&lt;br /&gt;
The program to consolidate results from [[Domain Decomposition]] runs, [[Consolidate Domain Decomposition]], is the first using the actor model approach. It is a simple and small program, the perfect test bed before expanding to Mohid. &lt;br /&gt;
&lt;br /&gt;
== Relevance of the Actor Model for the Mohid system ==&lt;br /&gt;
&lt;br /&gt;
Mohid is a large system with complex memory management. With the commoditization of multi-core machines and access to fast local networks MPI is becoming the de facto way of running Mohid. MPI (Message Passing Interface) is a very powerful, standardized and portable message-passing system. &lt;br /&gt;
&lt;br /&gt;
The way MPI is currently used in Mohid is difficult to implement, hard to understand and complex to maintain. It is essential to use MPI in such a way that it becomes easier to reason about:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;standardizing MPI's implementation in Mohid, embedding it in the programming framework;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;making explicit conventions on MPI usage of Mohid, for instance banning the use of semaphores and barriers;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;there will be a very limited number of modules where MPI directives are allowed; and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;MPI will be used to create explicit APIs (Application Programming Interface) that can be easily expanded and refactored according to Mohid's needs.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actor Model in Mohid ==&lt;br /&gt;
&lt;br /&gt;
[[File:am.01.png|thumb|left|alt=Domain in decomposed in 3 subdomains creates 3 instances of MohidWater (MW1, MW2 and MW3).|Domain in decomposed in 3 subdomains.]]Suppose a domain is decomposed in 3 sub-domains according to the first image. Each subdomain is an actor that sends messages to other actors and reacts to messages it receives. Each model has a Main Loop that progresses in time-steps. Each model sends messages with information (for example border conditions) to actors that need it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:am.04.png|thumb|right|alt=All actors are working.|(0) All actors are working.]]Lets take a look at the system in a moment all actors are computing the next time-step. Is is non-determined which actor will terminate first (even if we know each one work load, it is impossible to know when they will terminate their computations). Even while computing they are checking their mailboxes because there are messages they can react to (for instance if they are asked if their run has ended or not). Messages they can not process stay in the queue. Messages are not processed in the order of arrival.&lt;br /&gt;
&lt;br /&gt;
There is no need for a centralized controller, each actor has a state and reacts to the environment as a living organism. Inconsistencies or partial failures should be resolved in another layer, for instance with the help of supervisors (this is Erlang/OTP strategy).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:am.02.png|thumb|left|alt=Actor MW3 is the first actor to terminate its time-step.|(1) Actor MW3 is the first actor to terminate its time-step.]]Suppose Actor MW3 is the first actor to terminate its time-step. It sends messages to other actors with border conditions. MW3 has no messages in its mailbox so it is idle. Actor MW2 has a message in its mailbox but it can not process it yet so the message stays there. &lt;br /&gt;
MW3 will react when a message arrives to its mailbox. When it gathers enough information to start a new time-step it will react triggering some computations. There is no central authority ordering it to start, stay idle, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:am.05.png|thumb|right|alt=Actor MW2 terminates time-step.|(2) Actor MW2 terminates time-step.]]Now actor MW2 has terminated time-step computations. It now sends 2 different messages to MW1 and MW3 respectively. MW2 is checking its message box's queue but it has not enough information to start a new time-step so it stays idle.&lt;br /&gt;
MW1 received a message form MW2 and will react accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:am.03.png|thumb|left|alt=Actor MW1 terminates time-step.|(3) Actor MW1 terminates time-step.]]MW1 terminated the time-step. Meanwhile MW3 processed message M3 and is already computing the next time-step. &lt;br /&gt;
MW1 sends a message to MW2 and both actors have enough information to proceed (reacting to messages).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:am.04.png|thumb|right|alt=All actors are working.|(4) All actors are working.]]All actors are computing a new time-step.&lt;br /&gt;
&lt;br /&gt;
== Notes on the Actor Model ==&lt;br /&gt;
&lt;br /&gt;
There are some remarks to be done:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;each message is sent only once;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;the sender does not verify if the message reaches its destination;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;the order of arrival is independent of the order of sending;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;each message is processed separately;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;there is no central point of control; and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;messages in mailbox are not processed in the order of arrival, there is a loop over the queue checking which messages the actor can react upon.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Actor_Model&amp;diff=7197</id>
		<title>Actor Model</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Actor_Model&amp;diff=7197"/>
				<updated>2014-11-30T19:02:51Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to the Wikipedia[http://en.wikipedia.org/wiki/Actor_model] &amp;quot;the actor model in computer science is a mathematical model of concurrent computation that treats &amp;quot;actors&amp;quot; as the universal primitives of concurrent digital computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and determine how to respond to the next message received&amp;quot; (changing state). The actor model is a special form of [[Reactive Programming]].&lt;br /&gt;
&lt;br /&gt;
There are several resources in the Internet explaining the Actor Model and Reactive Programing. Some videos and interesting interviews:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Hewitt, Meijer and Szyperski: The Actor Model (everything you wanted to know, but were afraid to ask)[http://channel9.msdn.com/Shows/Going+Deep/Hewitt-Meijer-and-Szyperski-The-Actor-Model-everything-you-wanted-to-know-but-were-afraid-to-ask];&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Francesco Cesarini and Viktor Klang on the Reactive Manifesto[http://www.infoq.com/interviews/cesarini-klang-reactive-manifesto]; and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Up And Out Scaling Software With Akka - Jonas Bonér[http://www.youtube.com/watch?v=t4KxWDqGfcs]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
To read on-line:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;The Reactive Manifesto[http://www.reactivemanifesto.org/]; and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;Learn You Some Erlang for great good![http://learnyousomeerlang.com/content];&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The actor model makes it easier to reason about distributed programming. All MPI directives will be packed up in a set of well defined modules. Communication among actors takes place through clear and standard interfaces with well defined behaviors. This software architecture is proven to provide scalability, resilience and responsiveness. There is no central management and no points of synchronism so actors just react to events; this is a simpler way of reasoning about concurrency and parallelism.&lt;br /&gt;
&lt;br /&gt;
According to Carl Hewitts' definition (Carl Hewitt; Peter Bishop; Richard Steiger (1973). A Universal Modular Actor Formalism for Artificial Intelligence. IJCAI) an actor is the fundamental unit of computation that embodies:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;processing (the behavior, the executable code);&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;storage (its the state, the stuff on the heap, memory); and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;communication.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When an actor receives a message it reacts:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;sending messages to actors it knows (finite number);&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;creating new actors (finite number); and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;designating how it should handle the next message it receives (changing state).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here a [[Fortran implementation of the Actor Model using MPI]] is discussed.&lt;br /&gt;
&lt;br /&gt;
The program to consolidate results from [[Domain Decomposition]]runs, [[Consolidate Domain Decomposition]], is the first using the actor model approach. It is a simple and small program, the perfect test bed before expanding to Mohid. &lt;br /&gt;
&lt;br /&gt;
== Relevance of the Actor Model for the Mohid system ==&lt;br /&gt;
&lt;br /&gt;
Mohid is a large system with complex memory management. With the commoditization of multi-core machines and access to fast local networks MPI is becoming the de facto way of running Mohid. MPI (Message Passing Interface) is a very powerful, standardized and portable message-passing system. &lt;br /&gt;
&lt;br /&gt;
The way MPI is currently used in Mohid is difficult to implement, hard to understand and complex to maintain. It is essential to use MPI in such a way that it becomes easier to reason about:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;standardizing MPI's implementation in Mohid, embedding it in the programming framework;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;making explicit conventions on MPI usage of Mohid, for instance banning the use of semaphores and barriers;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;there will be a very limited number of modules where MPI directives are allowed; and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;MPI will be used to create explicit APIs (Application Programming Interface) that can be easily expanded and refactored according to Mohid's needs.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actor Model in Mohid ==&lt;br /&gt;
&lt;br /&gt;
[[File:am.01.png|thumb|left|alt=Domain in decomposed in 3 subdomains creates 3 instances of MohidWater (MW1, MW2 and MW3).|Domain in decomposed in 3 subdomains.]]Suppose a domain is decomposed in 3 sub-domains according to the first image. Each subdomain is an actor that sends messages to other actors and reacts to messages it receives. Each model has a Main Loop that progresses in time-steps. Each model sends messages with information (for example border conditions) to actors that need it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:am.04.png|thumb|right|alt=All actors are working.|(0) All actors are working.]]Lets take a look at the system in a moment all actors are computing the next time-step. Is is non-determined which actor will terminate first (even if we know each one work load, it is impossible to know when they will terminate their computations). Even while computing they are checking their mailboxes because there are messages they can react to (for instance if they are asked if their run has ended or not). Messages they can not process stay in the queue. Messages are not processed in the order of arrival.&lt;br /&gt;
&lt;br /&gt;
There is no need for a centralized controller, each actor has a state and reacts to the environment as a living organism. Inconsistencies or partial failures should be resolved in another layer, for instance with the help of supervisors (this is Erlang/OTP strategy).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:am.02.png|thumb|left|alt=Actor MW3 is the first actor to terminate its time-step.|(1) Actor MW3 is the first actor to terminate its time-step.]]Suppose Actor MW3 is the first actor to terminate its time-step. It sends messages to other actors with border conditions. MW3 has no messages in its mailbox so it is idle. Actor MW2 has a message in its mailbox but it can not process it yet so the message stays there. &lt;br /&gt;
MW3 will react when a message arrives to its mailbox. When it gathers enough information to start a new time-step it will react triggering some computations. There is no central authority ordering it to start, stay idle, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:am.05.png|thumb|right|alt=Actor MW2 terminates time-step.|(2) Actor MW2 terminates time-step.]]Now actor MW2 has terminated time-step computations. It now sends 2 different messages to MW1 and MW3 respectively. MW2 is checking its message box's queue but it has not enough information to start a new time-step so it stays idle.&lt;br /&gt;
MW1 received a message form MW2 and will react accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:am.03.png|thumb|left|alt=Actor MW1 terminates time-step.|(3) Actor MW1 terminates time-step.]]MW1 terminated the time-step. Meanwhile MW3 processed message M3 and is already computing the next time-step. &lt;br /&gt;
MW1 sends a message to MW2 and both actors have enough information to proceed (reacting to messages).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:am.04.png|thumb|right|alt=All actors are working.|(4) All actors are working.]]All actors are computing a new time-step.&lt;br /&gt;
&lt;br /&gt;
== Notes on the Actor Model ==&lt;br /&gt;
&lt;br /&gt;
There are some remarks to be done:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;each message is sent only once;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;the sender does not verify if the message reaches its destination;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;the order of arrival is independent of the order of sending;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;each message is processed separately;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;there is no central point of control; and&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;messages in mailbox are not processed in the order of arrival, there is a loop over the queue checking which messages the actor can react upon.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Domain_Decomposition&amp;diff=7196</id>
		<title>Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Domain_Decomposition&amp;diff=7196"/>
				<updated>2014-11-30T18:58:47Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Domaim Decomposition project aim is to enable Mohid's paralelization using MPI. Domain Decomposition divides a domain in a arbitrary number of subdomains that communicate among them. In the frontier between two subdomains border condtions are exchanged reciprocally between them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Subdomains ==&lt;br /&gt;
The domain decomposition project will start with the following subdomain charactistics:&lt;br /&gt;
# Subdomains are derived from a domain dividing it through straight lines in the indexes' directions (usually horizontal or vertical lines). Submodels inherit indexes from the initial domain.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Domain_Decomposition&amp;diff=7195</id>
		<title>Domain Decomposition</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Domain_Decomposition&amp;diff=7195"/>
				<updated>2014-11-30T18:57:48Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Domaim Decomposition project aim is to enable Mohid's paralelization using MPI. Domain Decomposition divides a domain in a arbitrary number of subdomains that communicate among them. In the frontier between two subdomains border condtions are exchanged reciprocally between them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Subdomains ==&lt;br /&gt;
The domail composition project will start with the following subdomain charactistics:&lt;br /&gt;
# Subdomains are derived from a domain dividing it through straight lines in the indexes' directions (usually horizontal or vertical lines). Submodels inherit indexes from the initial domain;&lt;br /&gt;
# Numerical schemes are explicit to facilitate data exchange.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7194</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7194"/>
				<updated>2014-11-30T18:54:17Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''[[moduleMPImanagement]]'' is necessary to compile both programs.&lt;br /&gt;
&lt;br /&gt;
If you examine the code there is no single MPI_BARRIER or any other explicit synchronization point. The main subroutine is:&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        call loop(pingPong) !This loop reads MPI messages&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
There is a call to an infinite loop. This routine reads the MPI message queue identifying messages to itself (MPI_PROBE). &lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
            if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall(pingPong, STATUS(MPI_TAG))&lt;br /&gt;
                if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then &lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
               if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            end if &lt;br /&gt;
        end if &lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;br /&gt;
&lt;br /&gt;
In the recursive subroutine loop 2 messages are processed: getMsgPlayBall3Tag and getMsgEndGameTag. As promised by the actor model:&lt;br /&gt;
*internal state is encapsulated; &lt;br /&gt;
*messages are processed one at a time; and &lt;br /&gt;
*communication is asynchronous.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7193</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7193"/>
				<updated>2014-11-30T18:52:44Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''[[moduleMPImanagement]]'' is necessary to compile both programs.&lt;br /&gt;
&lt;br /&gt;
If you examine the code there is no single MPI_BARRIER or any other explicit synchronization point. The main subroutine is:&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        call loop(pingPong) !This loop reads MPI messages&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
There is a call to an infinite loop. This routine reads the MPI message queue identifying messages to itself (MPI_PROBE). &lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
            if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall(pingPong, STATUS(MPI_TAG))&lt;br /&gt;
                if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then &lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
               if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            end if &lt;br /&gt;
        end if &lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;br /&gt;
&lt;br /&gt;
In the recursive subroutine loop 2 messages are processed: getMsgPlayBall3Tag and getMsgEndGameTag. As promised by the actor model:&lt;br /&gt;
*internal state is completely encapsulated; &lt;br /&gt;
*messages are processed one at a time; and &lt;br /&gt;
*communication is asynchronous.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7192</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7192"/>
				<updated>2014-11-30T18:51:28Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''[[moduleMPImanagement]]'' is necessary to compile both programs.&lt;br /&gt;
&lt;br /&gt;
If you examine the code there is no single MPI_BARRIER or any other explicit synchronization point. The main subroutine is:&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        call loop(pingPong) !This loop reads MPI messages&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
There is a call to an infinite loop. This routine reads the MPI message queue identifying messages to itself (MPI_PROBE). &lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
            if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall(pingPong, STATUS(MPI_TAG))&lt;br /&gt;
                if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then &lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
               if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            end if &lt;br /&gt;
        end if &lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;br /&gt;
&lt;br /&gt;
In the recursive subroutine loop 2 messages are processed: getMsgPlayBall3Tag and getMsgEndGameTag. As promised by the actor model:&lt;br /&gt;
#internal state is completely encapsulated; &lt;br /&gt;
#messages are processed one at a time; and &lt;br /&gt;
#communication is asynchronous.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7191</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7191"/>
				<updated>2014-11-30T18:46:15Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''[[moduleMPImanagement]]'' is necessary to compile both programs.&lt;br /&gt;
&lt;br /&gt;
If you examine the code there is no single MPI_BARRIER or any other explicit synchronization point. The main subroutine is:&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        call loop(pingPong) !This loop reads MPI messages&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
There is a call to an infinite loop. This routine reads the MPI message queue identifying messages to itself (MPI_PROBE). &lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
            if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall(pingPong, STATUS(MPI_TAG))&lt;br /&gt;
                if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then &lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
               if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            end if &lt;br /&gt;
        end if &lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;br /&gt;
&lt;br /&gt;
In the recursive subroutine loop 2 messages are processed: getMsgPlayBall3Tag and getMsgEndGameTag.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7190</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7190"/>
				<updated>2014-11-30T18:40:39Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''[[moduleMPImanagement]]'' is necessary to compile both programs.&lt;br /&gt;
&lt;br /&gt;
If you examine the code there is no single MPI_BARRIER or any other explicit synchronization point. The main routine is:&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        call loop(pingPong) !This loop reads MPI messages&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
There is a call to an infinite loop. This routine reads the MPI message queue identifying messages to itself. &lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
            if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall(pingPong, STATUS(MPI_TAG))&lt;br /&gt;
                if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then &lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
               if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            end if &lt;br /&gt;
        end if &lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7189</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7189"/>
				<updated>2014-11-30T18:40:06Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''[[moduleMPImanagement]]'' is necessary to compile both programs.&lt;br /&gt;
&lt;br /&gt;
If you examine the code there is no single MPI_BARRIER or any other explicit synchronization point. The main routine is:&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        call loop(pingPong) !This loop reads MPI messages&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
There is a call to an infinite loop. This routine reads the MPI message queue identifying messages to itself. &lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
&lt;br /&gt;
        if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
            if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall(pingPong, STATUS(MPI_TAG))&lt;br /&gt;
                if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then &lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
               if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if &lt;br /&gt;
            end if &lt;br /&gt;
        end if &lt;br /&gt;
&lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7188</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7188"/>
				<updated>2014-11-30T18:33:55Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''[[moduleMPImanagement]]'' is necessary to compile both programs.&lt;br /&gt;
&lt;br /&gt;
If you examine the code there is no single MPI_BARRIER or any other explicit synchronization point. The main routine is:&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
        call loop(pingPong)&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
    end subroutine main&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7187</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7187"/>
				<updated>2014-11-30T18:33:32Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''[[moduleMPImanagement]]'' is necessary to compile both programs.&lt;br /&gt;
&lt;br /&gt;
If you examine the code there is no single MPI_BARRIER or any other explicit synchronization point. The main routine is:&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
        if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if &lt;br /&gt;
&lt;br /&gt;
        call loop(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
&lt;br /&gt;
    end subroutine main&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7186</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7186"/>
				<updated>2014-11-30T18:30:19Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''[[moduleMPImanagement]]'' is necessary to compile both programs.&lt;br /&gt;
If you examine the code there is no single MPI_BARRIER or any other explicit synchronization point.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Pong&amp;diff=7185</id>
		<title>Pong</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Pong&amp;diff=7185"/>
				<updated>2014-11-30T18:25:28Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!        IST/MARETEC, Water Modelling Group, Mohid modelling system&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! TITLE         : pong&lt;br /&gt;
&lt;br /&gt;
! PROJECT       : Example of the actor model using Fortran and MPI&lt;br /&gt;
&lt;br /&gt;
! URL           : http://www.mohid.com&lt;br /&gt;
&lt;br /&gt;
! AFFILIATION   : IST/MARETEC, Marine Modelling Group&lt;br /&gt;
&lt;br /&gt;
! DATE          : Nov 2014&lt;br /&gt;
&lt;br /&gt;
! REVISION      : Rciardo Miranda - v1.0&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!This program is free software; you can redistribute it and/or&lt;br /&gt;
&lt;br /&gt;
!modify it under the terms of the GNU General Public License&lt;br /&gt;
&lt;br /&gt;
!version 2, as published by the Free Software Foundation.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!This program is distributed in the hope that it will be useful,&lt;br /&gt;
&lt;br /&gt;
!but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
&lt;br /&gt;
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
&lt;br /&gt;
!GNU General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!You should have received a copy of the GNU General Public License&lt;br /&gt;
&lt;br /&gt;
!along with this program; if not, write to the Free Software&lt;br /&gt;
&lt;br /&gt;
!Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! Compile:&lt;br /&gt;
&lt;br /&gt;
! mpif90 -o /myDirectory/projects/lang/fortran/MPI/pingPong/pong /myDirectory/projects/lang/fortran/MPI/pingPong/moduleMPImanagement.f90  /myDirectory/projects /lang/fortran/MPI/pingPong/pong.f90&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! Run:&lt;br /&gt;
&lt;br /&gt;
! /opt/mpich/bin/mpiexec -n 1 /myDirectory/projects/lang/fortran/MPI/pingPong/ping : -n 1 /myDirectory/projects/lang/fortran/MPI/pingPong/pong&lt;br /&gt;
&lt;br /&gt;
program pong&lt;br /&gt;
    use mpi&lt;br /&gt;
    use moduleMPImanagemnt&lt;br /&gt;
&lt;br /&gt;
    implicit none&lt;br /&gt;
&lt;br /&gt;
    integer, parameter :: UNDEFINED   =-99&lt;br /&gt;
    integer, parameter :: SUCCESS     = 0&lt;br /&gt;
    integer, parameter :: NULL_INT    =-999999&lt;br /&gt;
&lt;br /&gt;
    type T_pingPong&lt;br /&gt;
        integer :: myMPI_id      = NULL_INT&lt;br /&gt;
        logical :: hasBall       =.FALSE.&lt;br /&gt;
        logical :: gameON        =.TRUE.&lt;br /&gt;
        integer :: counting      = NULL_INT&lt;br /&gt;
        integer :: otherCounting = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        integer :: otherMPI_id   = NULL_INT&lt;br /&gt;
    end type T_pingPong&lt;br /&gt;
&lt;br /&gt;
    call main()&lt;br /&gt;
&lt;br /&gt;
    contains&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call loop(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    function constructPingPong()&lt;br /&gt;
        type(T_pingPong), pointer   :: constructPingPong&lt;br /&gt;
        type(T_pingPong), pointer   :: newPingPong&lt;br /&gt;
&lt;br /&gt;
        allocate(newPingPong)&lt;br /&gt;
        newPingPong%myMPI_id = startMPI(newPingPong)&lt;br /&gt;
&lt;br /&gt;
        constructPingPong =&amp;gt; newPingPong&lt;br /&gt;
    end function constructPingPong&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer,dimension(8)        :: values&lt;br /&gt;
        integer                     :: sec, rand, aux, I&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call DATE_AND_TIME(VALUES=values)&lt;br /&gt;
        sec = values(7)&lt;br /&gt;
        call SRAND(sec)&lt;br /&gt;
&lt;br /&gt;
        aux = rand(0)&lt;br /&gt;
do1 :   do I = -1, aux&lt;br /&gt;
            counting  = MAX(5, rand(0) / 100000)&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setCounting(pingPong, counting = counting)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startGame, error calling setCounting, ERR01&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = sendBall(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startGame, error calling sendBall, ERR02&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        startGame = SUCCESS&lt;br /&gt;
    end function startGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startMPI(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL, myMPI_id, numprocs&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        myMPI_id  = NULL_INT&lt;br /&gt;
        numprocs  = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_INIT(IERROR = STAT_CALL)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_INIT, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_RANK(MPI_COMM_WORLD,                             &amp;amp;&lt;br /&gt;
                           myMPI_id,                                   &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_RANK, ERR02.1&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
if21 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling setMyMPI_id, ERR02.2&amp;quot;&lt;br /&gt;
        end if if21&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_SIZE(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                           numprocs,                                     &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_SIZE, ERR03&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        print *, 'Process ', myMPI_id, ' of ', numprocs, ' is alive'&lt;br /&gt;
&lt;br /&gt;
if5 :   if (getMyMPI_id(pingPong) .EQ. 0) then&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 1)&lt;br /&gt;
if51 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR05&amp;quot;&lt;br /&gt;
            end if if51&lt;br /&gt;
        else if (getMyMPI_id(pingPong) .EQ. 1) then if5&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 0)&lt;br /&gt;
if52 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR06&amp;quot;&lt;br /&gt;
            end if if52&lt;br /&gt;
        else if5&lt;br /&gt;
            stop &amp;quot;function startMPI, ERR07&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        startMPI = myMPI_id&lt;br /&gt;
    end function startMPI&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getCounting = pingPong%counting&lt;br /&gt;
    end function getCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherCounting = pingPong%otherCounting&lt;br /&gt;
    end function getOtherCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getMyMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getMyMPI_id = pingPong%myMPI_id&lt;br /&gt;
    end function getMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherMPI_id = pingPong%otherMPI_id&lt;br /&gt;
    end function getOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherCounting(pingPong, otherCounting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherCounting&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherCounting = otherCounting&lt;br /&gt;
&lt;br /&gt;
        setOtherCounting = SUCCESS&lt;br /&gt;
    end function setOtherCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setCounting(pingPong, counting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: counting&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = counting&lt;br /&gt;
&lt;br /&gt;
        setCounting = SUCCESS&lt;br /&gt;
    end function setCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function decreaseCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = getCounting(pingPong)-1&lt;br /&gt;
&lt;br /&gt;
        decreaseCounting = SUCCESS&lt;br /&gt;
    end function decreaseCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: myMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%myMPI_id = myMPI_id&lt;br /&gt;
&lt;br /&gt;
        setMyMPI_id = SUCCESS&lt;br /&gt;
    end function setMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherMPI_id(pingPong, otherMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherMPI_id = otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        setOtherMPI_id = SUCCESS&lt;br /&gt;
    end function setOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.TRUE.&lt;br /&gt;
&lt;br /&gt;
        setHasBall = SUCCESS&lt;br /&gt;
    end function setHasBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasNoBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setHasNoBall = SUCCESS&lt;br /&gt;
    end function setHasNoBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setGameOFF(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%gameON =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setGameOFF = SUCCESS&lt;br /&gt;
    end function setGameOFF&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
if25 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if if25&lt;br /&gt;
&lt;br /&gt;
if41 :  if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
if42 :      if (STATUS(MPI_TAG) .EQ. getMsgPlayBall1Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall1(pingPong)&lt;br /&gt;
&lt;br /&gt;
if4 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall1, ERR02&amp;quot;&lt;br /&gt;
                end if if4&lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgPlayBall2Tag()) then if42&lt;br /&gt;
                STAT_CALL = receiveBall2(pingPong)&lt;br /&gt;
&lt;br /&gt;
if44 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall2, ERR02&amp;quot;&lt;br /&gt;
                end if if44&lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then if42&lt;br /&gt;
                STAT_CALL = receiveBall3(pingPong)&lt;br /&gt;
&lt;br /&gt;
if45 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall3, ERR02&amp;quot;&lt;br /&gt;
                end if if45&lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then if42&lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if if2&lt;br /&gt;
            end if if42&lt;br /&gt;
        end if if41&lt;br /&gt;
&lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function receiveBall1(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: i1, i2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
        counting   = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_RECV(counting,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall1Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STATUS,                                                   &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if35 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall1, error calling MPI_RECV, ERR01&amp;quot;&lt;br /&gt;
        end if if35&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setOtherCounting(pingPong, otherCounting = counting)&lt;br /&gt;
if62 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall1, error calling setOtherCounting, ERR04&amp;quot;&lt;br /&gt;
        end if if62&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;pong, receiveBall1 getMyMPI_id =&amp;quot;, getMyMPI_id(pingPong), &amp;quot;getCounting =&amp;quot;, getCounting(pingPong), &amp;amp;&lt;br /&gt;
                &amp;quot;getOtherCounting =&amp;quot;, getOtherCounting(pingPong)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        call sleep(2)&lt;br /&gt;
        call doSomething()&lt;br /&gt;
&lt;br /&gt;
if71 :  if (getCounting(pingPong) .GT. 0) then&lt;br /&gt;
            STAT_CALL = sendBall(pingPong)&lt;br /&gt;
if7 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function receiveBall, error calling sendBall, ERR01&amp;quot;&lt;br /&gt;
            end if if7&lt;br /&gt;
&lt;br /&gt;
        else if71&lt;br /&gt;
            ! Program terminates because there are no more plays&lt;br /&gt;
            STAT_CALL = sendKillGame(pingPong)&lt;br /&gt;
if3 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
            end if if3&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR03&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
        end if if71&lt;br /&gt;
&lt;br /&gt;
        call sleep(5)&lt;br /&gt;
        call doSomething()&lt;br /&gt;
        call doSomething()&lt;br /&gt;
&lt;br /&gt;
        receiveBall1 = SUCCESS&lt;br /&gt;
    end function receiveBall1&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function receiveBall2(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: i1, i2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
        counting   = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_RECV(counting,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall2Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STATUS,                                                   &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if25 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall2, error calling MPI_RECV, ERR01a&amp;quot;&lt;br /&gt;
        end if if25&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = setOtherCounting(pingPong, otherCounting = counting)&lt;br /&gt;
if61 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall2, error calling setOtherCounting, ERR04&amp;quot;&lt;br /&gt;
        end if if61&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;pong, receiveBall2 getMyMPI_id =&amp;quot;, getMyMPI_id(pingPong), &amp;quot;getCounting =&amp;quot;, getCounting(pingPong), &amp;amp;&lt;br /&gt;
                &amp;quot;getOtherCounting =&amp;quot;, getOtherCounting(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call sleep(2)&lt;br /&gt;
        call doSomething()&lt;br /&gt;
&lt;br /&gt;
if71 :  if (getCounting(pingPong) .GT. 0) then&lt;br /&gt;
            STAT_CALL = sendBall(pingPong)&lt;br /&gt;
if7 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function receiveBall, error calling sendBall, ERR01&amp;quot;&lt;br /&gt;
            end if if7&lt;br /&gt;
&lt;br /&gt;
        else if71&lt;br /&gt;
            ! Program terminates because there are no more plays&lt;br /&gt;
            STAT_CALL = sendKillGame(pingPong)&lt;br /&gt;
if3 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
            end if if3&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR03&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
        end if if71&lt;br /&gt;
&lt;br /&gt;
        receiveBall2 = SUCCESS&lt;br /&gt;
    end function receiveBall2&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function receiveBall3(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: i1, i2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
        counting   = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_RECV(counting,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STATUS,                                                   &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
        if5 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall3, error calling MPI_RECV, ERR01b&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setOtherCounting(pingPong, otherCounting = counting)&lt;br /&gt;
        if6 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall3, error calling setOtherCounting, ERR04&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;pong, receiveBall3 getMyMPI_id =&amp;quot;, getMyMPI_id(pingPong), &amp;quot;getCounting =&amp;quot;, getCounting(pingPong), &amp;amp;&lt;br /&gt;
                &amp;quot;getOtherCounting =&amp;quot;, getOtherCounting(pingPong)&lt;br /&gt;
&lt;br /&gt;
if71 :  if (getCounting(pingPong) .GT. 0) then&lt;br /&gt;
            STAT_CALL = sendBall(pingPong)&lt;br /&gt;
if7 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function receiveBall, error calling sendBall, ERR01&amp;quot;&lt;br /&gt;
            end if if7&lt;br /&gt;
&lt;br /&gt;
        else if71&lt;br /&gt;
            ! Program terminates because there are no more plays&lt;br /&gt;
            STAT_CALL = sendKillGame(pingPong)&lt;br /&gt;
if3 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
            end if if3&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR03&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
        end if if71&lt;br /&gt;
&lt;br /&gt;
        receiveBall3 = SUCCESS&lt;br /&gt;
    end function receiveBall3&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine doSomething&lt;br /&gt;
        integer                     :: i,j,k, res1, res2, res3&lt;br /&gt;
&lt;br /&gt;
do1 :   do i=1,1000000000&lt;br /&gt;
do2 :   do j=1,1000000000&lt;br /&gt;
do3 :   do k=1,1000000000&lt;br /&gt;
            res1=i*j+j/(k**2)*(-1.0)&lt;br /&gt;
            res2=i*j+j/(k**2)*(-21.0)&lt;br /&gt;
            res3=MAX(res1, res2)&lt;br /&gt;
        end do do3&lt;br /&gt;
        end do do2&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
    end subroutine doSomething&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall, error calling MPI_SEND, ERR02&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        sendBall = SUCCESS&lt;br /&gt;
    end function sendBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendKillGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(NULL_INT,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgEndGameTag(),                                       &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendKillGame, error calling MPI_SEND, ERR01&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendKillGame = SUCCESS&lt;br /&gt;
    end function sendKillGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function killPingPong(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = stopMPI()&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling stopMPI, ERR01&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;Ping Pong Terminated, pong&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setGameOFF(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling setGameOFF, ERR01&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        killPingPong = SUCCESS&lt;br /&gt;
    end function killPingPong&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function stopMPI()&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_BARRIER(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                         IERROR = STAT_CALL)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_BARRIER, ERR01&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        call MPI_FINALIZE(STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_FINALIZE, ERR02&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        stopMPI =  SUCCESS&lt;br /&gt;
    end function stopMPI&lt;br /&gt;
end program pong&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Ping&amp;diff=7184</id>
		<title>Ping</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Ping&amp;diff=7184"/>
				<updated>2014-11-30T18:25:05Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!        IST/MARETEC, Water Modelling Group, Mohid modelling system&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! TITLE         : ping&lt;br /&gt;
&lt;br /&gt;
! PROJECT       : Example of the actor model using Fortran and MPI&lt;br /&gt;
&lt;br /&gt;
! URL           : http://www.mohid.com&lt;br /&gt;
&lt;br /&gt;
! AFFILIATION   : IST/MARETEC, Marine Modelling Group&lt;br /&gt;
&lt;br /&gt;
! DATE          : Nov 2014&lt;br /&gt;
&lt;br /&gt;
! REVISION      : Rciardo Miranda - v1.0&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!This program is free software; you can redistribute it and/or&lt;br /&gt;
&lt;br /&gt;
!modify it under the terms of the GNU General Public License&lt;br /&gt;
&lt;br /&gt;
!version 2, as published by the Free Software Foundation.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!This program is distributed in the hope that it will be useful,&lt;br /&gt;
&lt;br /&gt;
!but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
&lt;br /&gt;
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
&lt;br /&gt;
!GNU General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!You should have received a copy of the GNU General Public License&lt;br /&gt;
&lt;br /&gt;
!along with this program; if not, write to the Free Software&lt;br /&gt;
&lt;br /&gt;
!Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! Compile:&lt;br /&gt;
&lt;br /&gt;
! mpif90 -o /myDirectory/projects/lang/fortran/MPI/pingPong/ping  /myDirectory/projects/lang/fortran/MPI/pingPong/moduleMPImanagement.f90  /myDirectory/projects/lang/fortran/MPI/pingPong/ping.f90&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! Run:&lt;br /&gt;
&lt;br /&gt;
! /opt/mpich/bin/mpiexec -n 1 /myDirectory/projects/lang/fortran/MPI/pingPong/pong : -n  /myDirectory/projects/lang/fortran/MPI/pingPong/ping&lt;br /&gt;
&lt;br /&gt;
program ping&lt;br /&gt;
    use mpi&lt;br /&gt;
    use moduleMPImanagemnt&lt;br /&gt;
&lt;br /&gt;
    implicit none&lt;br /&gt;
&lt;br /&gt;
    integer, parameter :: UNDEFINED   =-99&lt;br /&gt;
    integer, parameter :: SUCCESS     = 0&lt;br /&gt;
    integer, parameter :: NULL_INT    =-999999&lt;br /&gt;
&lt;br /&gt;
    type T_pingPong&lt;br /&gt;
        integer :: myMPI_id      = NULL_INT&lt;br /&gt;
        logical :: hasBall       =.FALSE.&lt;br /&gt;
        logical :: gameON        =.TRUE.&lt;br /&gt;
        integer :: counting      = NULL_INT&lt;br /&gt;
        integer :: otherCounting = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        integer :: otherMPI_id   = NULL_INT&lt;br /&gt;
    end type T_pingPong&lt;br /&gt;
&lt;br /&gt;
    call main()&lt;br /&gt;
&lt;br /&gt;
    contains&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call loop(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    function constructPingPong()&lt;br /&gt;
        type(T_pingPong), pointer   :: constructPingPong&lt;br /&gt;
        type(T_pingPong), pointer   :: newPingPong&lt;br /&gt;
&lt;br /&gt;
        allocate(newPingPong)&lt;br /&gt;
        newPingPong%myMPI_id = startMPI(newPingPong)&lt;br /&gt;
&lt;br /&gt;
        constructPingPong =&amp;gt; newPingPong&lt;br /&gt;
    end function constructPingPong&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer,dimension(8)        :: values&lt;br /&gt;
        integer                     :: sec, rand, aux, I&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call DATE_AND_TIME(VALUES=values)&lt;br /&gt;
        sec = values(7)&lt;br /&gt;
        call SRAND(sec)&lt;br /&gt;
&lt;br /&gt;
        aux = rand(0)&lt;br /&gt;
do1 :   do I = -10, aux&lt;br /&gt;
            counting  = MAX(5, rand(0) / 100000)&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setCounting(pingPong, counting = counting)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startGame, error calling setCounting, ERR01&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = sendBall1(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startGame, error calling sendBall1, ERR02&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        startGame = SUCCESS&lt;br /&gt;
    end function startGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startMPI(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL, myMPI_id, numprocs&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        myMPI_id  = NULL_INT&lt;br /&gt;
        numprocs  = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_INIT(IERROR = STAT_CALL)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_INIT, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_RANK(MPI_COMM_WORLD,                             &amp;amp;&lt;br /&gt;
                           myMPI_id,                                   &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_RANK, ERR02.1&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
if21 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling setMyMPI_id, ERR02.2&amp;quot;&lt;br /&gt;
        end if if21&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_SIZE(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                           numprocs,                                     &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_SIZE, ERR03&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        print *, 'Process ', myMPI_id, ' of ', numprocs, ' is alive'&lt;br /&gt;
&lt;br /&gt;
if5 :   if (getMyMPI_id(pingPong) .EQ. 0) then&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 1)&lt;br /&gt;
if51 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR05&amp;quot;&lt;br /&gt;
            end if if51&lt;br /&gt;
        else if (getMyMPI_id(pingPong) .EQ. 1) then if5&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 0)&lt;br /&gt;
if52 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR06&amp;quot;&lt;br /&gt;
            end if if52&lt;br /&gt;
        else if5&lt;br /&gt;
            stop &amp;quot;function startMPI, ERR07&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        startMPI = myMPI_id&lt;br /&gt;
    end function startMPI&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getCounting = pingPong%counting&lt;br /&gt;
    end function getCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherCounting = pingPong%otherCounting&lt;br /&gt;
    end function getOtherCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getMyMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getMyMPI_id = pingPong%myMPI_id&lt;br /&gt;
    end function getMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherMPI_id = pingPong%otherMPI_id&lt;br /&gt;
    end function getOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherCounting(pingPong, otherCounting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherCounting&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherCounting = otherCounting&lt;br /&gt;
&lt;br /&gt;
        setOtherCounting = SUCCESS&lt;br /&gt;
    end function setOtherCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setCounting(pingPong, counting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: counting&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = counting&lt;br /&gt;
&lt;br /&gt;
        setCounting = SUCCESS&lt;br /&gt;
    end function setCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function decreaseCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = getCounting(pingPong)-1&lt;br /&gt;
&lt;br /&gt;
        decreaseCounting = SUCCESS&lt;br /&gt;
    end function decreaseCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: myMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%myMPI_id = myMPI_id&lt;br /&gt;
&lt;br /&gt;
        setMyMPI_id = SUCCESS&lt;br /&gt;
    end function setMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherMPI_id(pingPong, otherMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherMPI_id = otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        setOtherMPI_id = SUCCESS&lt;br /&gt;
    end function setOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.TRUE.&lt;br /&gt;
&lt;br /&gt;
        setHasBall = SUCCESS&lt;br /&gt;
    end function setHasBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasNoBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setHasNoBall = SUCCESS&lt;br /&gt;
    end function setHasNoBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setGameOFF(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%gameON =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setGameOFF = SUCCESS&lt;br /&gt;
    end function setGameOFF&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
if25 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if if25&lt;br /&gt;
&lt;br /&gt;
if41 :  if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
if42 :      if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall(pingPong, STATUS(MPI_TAG))&lt;br /&gt;
if4 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall, ERR02&amp;quot;&lt;br /&gt;
                end if if4&lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then if42&lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if if2&lt;br /&gt;
            end if if42&lt;br /&gt;
        end if if41&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function receiveBall(pingPong, msgTag)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: msgTag&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: i1, i2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
        counting   = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_RECV(counting,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STATUS,                                                   &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if5 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall, error calling MPI_RECV, ERR01b&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setOtherCounting(pingPong, otherCounting = counting)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall, error calling setOtherCounting, ERR04&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;ping, receiveBall getMyMPI_id =&amp;quot;, getMyMPI_id(pingPong), &amp;amp;&lt;br /&gt;
                &amp;quot;getCounting =&amp;quot;, getCounting(pingPong),                   &amp;amp;&lt;br /&gt;
                &amp;quot;getOtherCounting =&amp;quot;, getOtherCounting(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call doSomething()&lt;br /&gt;
&lt;br /&gt;
if71 :  if (getCounting(pingPong) .GT. 0) then&lt;br /&gt;
if70 :      if      ( mod(getCounting(pingPong), 2) .EQ. 0) then&lt;br /&gt;
                STAT_CALL = sendBall1(pingPong)&lt;br /&gt;
if7 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall1, ERR01&amp;quot;&lt;br /&gt;
                end if if7&lt;br /&gt;
&lt;br /&gt;
            else if ((mod(getCounting(pingPong), 3) .EQ. 0) .AND.         &amp;amp;&lt;br /&gt;
                     (mod(getCounting(pingPong), 2) .NE. 0)) then if70&lt;br /&gt;
                STAT_CALL = sendBall2(pingPong)&lt;br /&gt;
if75 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall2, ERR01&amp;quot;&lt;br /&gt;
                end if if75&lt;br /&gt;
&lt;br /&gt;
            else if70&lt;br /&gt;
                STAT_CALL = sendBall3(pingPong)&lt;br /&gt;
if76 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall3, ERR01&amp;quot;&lt;br /&gt;
                end if if76&lt;br /&gt;
            end if if70&lt;br /&gt;
        else if71&lt;br /&gt;
            ! Program terminates because there are no more plays&lt;br /&gt;
            STAT_CALL = sendKillGame(pingPong)&lt;br /&gt;
if3 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
            end if if3&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR03&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
        end if if71&lt;br /&gt;
&lt;br /&gt;
        receiveBall = SUCCESS&lt;br /&gt;
    end function receiveBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine doSomething&lt;br /&gt;
        integer                     :: i,j,k, res1, res2, res3&lt;br /&gt;
&lt;br /&gt;
        call sleep(10)&lt;br /&gt;
&lt;br /&gt;
do1 :   do i=1,1000&lt;br /&gt;
do2 :   do j=1,1000&lt;br /&gt;
do3 :   do k=1,1000&lt;br /&gt;
            res1=i*j+j/(k**2)*(-1.0)&lt;br /&gt;
            res2=i*j+j/(k**2)*(-21.0)&lt;br /&gt;
            res3=MAX(res1, res2)&lt;br /&gt;
        end do do3&lt;br /&gt;
        end do do2&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
    end subroutine doSomething&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall1(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall1, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall1Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall1, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall1 = SUCCESS&lt;br /&gt;
    end function sendBall1&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall2(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall2, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall2Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall2, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall2 = SUCCESS&lt;br /&gt;
    end function sendBall2&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall3(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall3, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall3, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall3 = SUCCESS&lt;br /&gt;
    end function sendBall3&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendKillGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(NULL_INT,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgEndGameTag(),                                       &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendKillGame, error calling MPI_SEND, ERR01&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendKillGame = SUCCESS&lt;br /&gt;
    end function sendKillGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function killPingPong(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = stopMPI()&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling stopMPI, ERR01&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;Ping Pong Terminated, ping&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setGameOFF(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling setGameOFF, ERR01&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        killPingPong = SUCCESS&lt;br /&gt;
    end function killPingPong&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function stopMPI()&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_BARRIER(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                         IERROR = STAT_CALL)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_BARRIER, ERR01&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        call MPI_FINALIZE(STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_FINALIZE, ERR02&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        stopMPI =  SUCCESS&lt;br /&gt;
    end function stopMPI&lt;br /&gt;
end program ping&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=ModuleMPImanagement&amp;diff=7183</id>
		<title>ModuleMPImanagement</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=ModuleMPImanagement&amp;diff=7183"/>
				<updated>2014-11-30T18:24:22Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: Created page with &amp;quot;!------------------------------------------------------------------------------ !        IST/MARETEC, Water Modelling Group, Mohid modelling system !-----------------------------...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!------------------------------------------------------------------------------&lt;br /&gt;
!        IST/MARETEC, Water Modelling Group, Mohid modelling system&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! TITLE         : moduleMPImanagement&lt;br /&gt;
&lt;br /&gt;
! PROJECT       : Example of the actor model using Fortran and MPI&lt;br /&gt;
&lt;br /&gt;
! URL           : http://www.mohid.com&lt;br /&gt;
&lt;br /&gt;
! AFFILIATION   : IST/MARETEC, Marine Modelling Group&lt;br /&gt;
&lt;br /&gt;
! DATE          : Nov 2014&lt;br /&gt;
&lt;br /&gt;
! REVISION      : Rciardo Miranda - v1.0&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!This program is free software; you can redistribute it and/or&lt;br /&gt;
&lt;br /&gt;
!modify it under the terms of the GNU General Public License&lt;br /&gt;
&lt;br /&gt;
!version 2, as published by the Free Software Foundation.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!This program is distributed in the hope that it will be useful,&lt;br /&gt;
&lt;br /&gt;
!but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
&lt;br /&gt;
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
&lt;br /&gt;
!GNU General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!You should have received a copy of the GNU General Public License&lt;br /&gt;
&lt;br /&gt;
!along with this program; if not, write to the Free Software&lt;br /&gt;
&lt;br /&gt;
!Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
module moduleMPImanagement&lt;br /&gt;
&lt;br /&gt;
    implicit none&lt;br /&gt;
&lt;br /&gt;
    private&lt;br /&gt;
&lt;br /&gt;
    integer, parameter :: msgPlayBall1Tag = 11111&lt;br /&gt;
    integer, parameter :: msgPlayBall2Tag = 11122&lt;br /&gt;
    integer, parameter :: msgPlayBall3Tag = 33333&lt;br /&gt;
    integer, parameter :: msgPlayBall4Tag = 44444&lt;br /&gt;
    integer, parameter :: msgMyMPITag     = 22222&lt;br /&gt;
    integer, parameter :: msgEndGameTag   = 34232&lt;br /&gt;
    integer, parameter :: msgMsgIDTag     = 34555&lt;br /&gt;
&lt;br /&gt;
    !Subroutines---------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    public  :: getMsgPlayBall1Tag&lt;br /&gt;
    public  :: getMsgPlayBall2Tag&lt;br /&gt;
    public  :: getMsgPlayBall3Tag&lt;br /&gt;
    public  :: getMsgPlayBall4Tag&lt;br /&gt;
    public  :: getMsgMyMPITag&lt;br /&gt;
    public  :: getMsgEndGameTag&lt;br /&gt;
    public  :: getMsgIDTag&lt;br /&gt;
&lt;br /&gt;
    contains&lt;br /&gt;
&lt;br /&gt;
    integer function getMsgPlayBall1Tag()&lt;br /&gt;
        getMsgPlayBall1Tag = msgPlayBall1Tag&lt;br /&gt;
    end function getMsgPlayBall1Tag&lt;br /&gt;
&lt;br /&gt;
    integer function getMsgPlayBall2Tag()&lt;br /&gt;
        getMsgPlayBall2Tag = msgPlayBall2Tag&lt;br /&gt;
    end function getMsgPlayBall2Tag&lt;br /&gt;
&lt;br /&gt;
    integer function getMsgPlayBall3Tag()&lt;br /&gt;
        getMsgPlayBall3Tag = msgPlayBall3Tag&lt;br /&gt;
    end function getMsgPlayBall3Tag&lt;br /&gt;
&lt;br /&gt;
    integer function getMsgPlayBall4Tag()&lt;br /&gt;
        getMsgPlayBall4Tag = msgPlayBall4Tag&lt;br /&gt;
    end function getMsgPlayBall4Tag&lt;br /&gt;
&lt;br /&gt;
    integer function getMsgMyMPITag()&lt;br /&gt;
        getMsgMyMPITag = msgMyMPITag&lt;br /&gt;
    end function getMsgMyMPITag&lt;br /&gt;
&lt;br /&gt;
    integer function getMsgEndGameTag()&lt;br /&gt;
        getMsgEndGameTag = msgEndGameTag&lt;br /&gt;
    end function getMsgEndGameTag&lt;br /&gt;
&lt;br /&gt;
    integer function getMsgIDTag()&lt;br /&gt;
        getMsgIDTag = msgMsgIDTag&lt;br /&gt;
    end function getMsgIDTag&lt;br /&gt;
&lt;br /&gt;
end module moduleMPImanagement&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7182</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7182"/>
				<updated>2014-11-30T18:23:26Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''[[moduleMPImanagement]]'' is necessary to compile both programs.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7181</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7181"/>
				<updated>2014-11-30T18:23:13Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File ''moduleMPImanagement'' is necessary to compile both programs.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7180</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7180"/>
				<updated>2014-11-30T18:22:57Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself. File moduleMPImanagement is necessary to compile both programs.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Pong&amp;diff=7179</id>
		<title>Pong</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Pong&amp;diff=7179"/>
				<updated>2014-11-30T18:15:32Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: Created page with &amp;quot;!------------------------------------------------------------------------------  !        IST/MARETEC, Water Modelling Group, Mohid modelling system  !---------------------------...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!        IST/MARETEC, Water Modelling Group, Mohid modelling system&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! TITLE         : pong&lt;br /&gt;
&lt;br /&gt;
! PROJECT       : Example of the actor model using Fortran and MPI&lt;br /&gt;
&lt;br /&gt;
! URL           : http://www.mohid.com&lt;br /&gt;
&lt;br /&gt;
! AFFILIATION   : IST/MARETEC, Marine Modelling Group&lt;br /&gt;
&lt;br /&gt;
! DATE          : Nov 2014&lt;br /&gt;
&lt;br /&gt;
! REVISION      : Rciardo Miranda - v1.0&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!This program is free software; you can redistribute it and/or&lt;br /&gt;
&lt;br /&gt;
!modify it under the terms of the GNU General Public License&lt;br /&gt;
&lt;br /&gt;
!version 2, as published by the Free Software Foundation.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!This program is distributed in the hope that it will be useful,&lt;br /&gt;
&lt;br /&gt;
!but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
&lt;br /&gt;
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
&lt;br /&gt;
!GNU General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!You should have received a copy of the GNU General Public License&lt;br /&gt;
&lt;br /&gt;
!along with this program; if not, write to the Free Software&lt;br /&gt;
&lt;br /&gt;
!Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! Compile:&lt;br /&gt;
&lt;br /&gt;
! mpif90 -o /myDirectory/projects/lang/fortran/MPI/pingPong/pong /myDirectory/projects/lang/fortran/MPI/pingPong/moduleMPImanagemnt.f90  /myDirectory/projects /lang/fortran/MPI/pingPong/pong.f90&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! Run:&lt;br /&gt;
&lt;br /&gt;
! /opt/mpich/bin/mpiexec -n 1 /myDirectory/projects/lang/fortran/MPI/pingPong/ping : -n 1 /myDirectory/projects/lang/fortran/MPI/pingPong/pong&lt;br /&gt;
&lt;br /&gt;
program pong&lt;br /&gt;
    use mpi&lt;br /&gt;
    use moduleMPImanagemnt&lt;br /&gt;
&lt;br /&gt;
    implicit none&lt;br /&gt;
&lt;br /&gt;
    integer, parameter :: UNDEFINED   =-99&lt;br /&gt;
    integer, parameter :: SUCCESS     = 0&lt;br /&gt;
    integer, parameter :: NULL_INT    =-999999&lt;br /&gt;
&lt;br /&gt;
    type T_pingPong&lt;br /&gt;
        integer :: myMPI_id      = NULL_INT&lt;br /&gt;
        logical :: hasBall       =.FALSE.&lt;br /&gt;
        logical :: gameON        =.TRUE.&lt;br /&gt;
        integer :: counting      = NULL_INT&lt;br /&gt;
        integer :: otherCounting = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        integer :: otherMPI_id   = NULL_INT&lt;br /&gt;
    end type T_pingPong&lt;br /&gt;
&lt;br /&gt;
    call main()&lt;br /&gt;
&lt;br /&gt;
    contains&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call loop(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    function constructPingPong()&lt;br /&gt;
        type(T_pingPong), pointer   :: constructPingPong&lt;br /&gt;
        type(T_pingPong), pointer   :: newPingPong&lt;br /&gt;
&lt;br /&gt;
        allocate(newPingPong)&lt;br /&gt;
        newPingPong%myMPI_id = startMPI(newPingPong)&lt;br /&gt;
&lt;br /&gt;
        constructPingPong =&amp;gt; newPingPong&lt;br /&gt;
    end function constructPingPong&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer,dimension(8)        :: values&lt;br /&gt;
        integer                     :: sec, rand, aux, I&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call DATE_AND_TIME(VALUES=values)&lt;br /&gt;
        sec = values(7)&lt;br /&gt;
        call SRAND(sec)&lt;br /&gt;
&lt;br /&gt;
        aux = rand(0)&lt;br /&gt;
do1 :   do I = -1, aux&lt;br /&gt;
            counting  = MAX(5, rand(0) / 100000)&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setCounting(pingPong, counting = counting)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startGame, error calling setCounting, ERR01&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = sendBall(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startGame, error calling sendBall, ERR02&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        startGame = SUCCESS&lt;br /&gt;
    end function startGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startMPI(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL, myMPI_id, numprocs&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        myMPI_id  = NULL_INT&lt;br /&gt;
        numprocs  = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_INIT(IERROR = STAT_CALL)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_INIT, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_RANK(MPI_COMM_WORLD,                             &amp;amp;&lt;br /&gt;
                           myMPI_id,                                   &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_RANK, ERR02.1&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
if21 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling setMyMPI_id, ERR02.2&amp;quot;&lt;br /&gt;
        end if if21&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_SIZE(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                           numprocs,                                     &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_SIZE, ERR03&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        print *, 'Process ', myMPI_id, ' of ', numprocs, ' is alive'&lt;br /&gt;
&lt;br /&gt;
if5 :   if (getMyMPI_id(pingPong) .EQ. 0) then&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 1)&lt;br /&gt;
if51 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR05&amp;quot;&lt;br /&gt;
            end if if51&lt;br /&gt;
        else if (getMyMPI_id(pingPong) .EQ. 1) then if5&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 0)&lt;br /&gt;
if52 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR06&amp;quot;&lt;br /&gt;
            end if if52&lt;br /&gt;
        else if5&lt;br /&gt;
            stop &amp;quot;function startMPI, ERR07&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        startMPI = myMPI_id&lt;br /&gt;
    end function startMPI&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getCounting = pingPong%counting&lt;br /&gt;
    end function getCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherCounting = pingPong%otherCounting&lt;br /&gt;
    end function getOtherCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getMyMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getMyMPI_id = pingPong%myMPI_id&lt;br /&gt;
    end function getMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherMPI_id = pingPong%otherMPI_id&lt;br /&gt;
    end function getOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherCounting(pingPong, otherCounting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherCounting&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherCounting = otherCounting&lt;br /&gt;
&lt;br /&gt;
        setOtherCounting = SUCCESS&lt;br /&gt;
    end function setOtherCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setCounting(pingPong, counting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: counting&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = counting&lt;br /&gt;
&lt;br /&gt;
        setCounting = SUCCESS&lt;br /&gt;
    end function setCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function decreaseCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = getCounting(pingPong)-1&lt;br /&gt;
&lt;br /&gt;
        decreaseCounting = SUCCESS&lt;br /&gt;
    end function decreaseCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: myMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%myMPI_id = myMPI_id&lt;br /&gt;
&lt;br /&gt;
        setMyMPI_id = SUCCESS&lt;br /&gt;
    end function setMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherMPI_id(pingPong, otherMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherMPI_id = otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        setOtherMPI_id = SUCCESS&lt;br /&gt;
    end function setOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.TRUE.&lt;br /&gt;
&lt;br /&gt;
        setHasBall = SUCCESS&lt;br /&gt;
    end function setHasBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasNoBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setHasNoBall = SUCCESS&lt;br /&gt;
    end function setHasNoBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setGameOFF(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%gameON =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setGameOFF = SUCCESS&lt;br /&gt;
    end function setGameOFF&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
if25 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if if25&lt;br /&gt;
&lt;br /&gt;
if41 :  if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
if42 :      if (STATUS(MPI_TAG) .EQ. getMsgPlayBall1Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall1(pingPong)&lt;br /&gt;
&lt;br /&gt;
if4 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall1, ERR02&amp;quot;&lt;br /&gt;
                end if if4&lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgPlayBall2Tag()) then if42&lt;br /&gt;
                STAT_CALL = receiveBall2(pingPong)&lt;br /&gt;
&lt;br /&gt;
if44 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall2, ERR02&amp;quot;&lt;br /&gt;
                end if if44&lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then if42&lt;br /&gt;
                STAT_CALL = receiveBall3(pingPong)&lt;br /&gt;
&lt;br /&gt;
if45 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall3, ERR02&amp;quot;&lt;br /&gt;
                end if if45&lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then if42&lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if if2&lt;br /&gt;
            end if if42&lt;br /&gt;
        end if if41&lt;br /&gt;
&lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function receiveBall1(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: i1, i2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
        counting   = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_RECV(counting,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall1Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STATUS,                                                   &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if35 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall1, error calling MPI_RECV, ERR01&amp;quot;&lt;br /&gt;
        end if if35&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setOtherCounting(pingPong, otherCounting = counting)&lt;br /&gt;
if62 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall1, error calling setOtherCounting, ERR04&amp;quot;&lt;br /&gt;
        end if if62&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;pong, receiveBall1 getMyMPI_id =&amp;quot;, getMyMPI_id(pingPong), &amp;quot;getCounting =&amp;quot;, getCounting(pingPong), &amp;amp;&lt;br /&gt;
                &amp;quot;getOtherCounting =&amp;quot;, getOtherCounting(pingPong)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        call sleep(2)&lt;br /&gt;
        call doSomething()&lt;br /&gt;
&lt;br /&gt;
if71 :  if (getCounting(pingPong) .GT. 0) then&lt;br /&gt;
            STAT_CALL = sendBall(pingPong)&lt;br /&gt;
if7 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function receiveBall, error calling sendBall, ERR01&amp;quot;&lt;br /&gt;
            end if if7&lt;br /&gt;
&lt;br /&gt;
        else if71&lt;br /&gt;
            ! Program terminates because there are no more plays&lt;br /&gt;
            STAT_CALL = sendKillGame(pingPong)&lt;br /&gt;
if3 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
            end if if3&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR03&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
        end if if71&lt;br /&gt;
&lt;br /&gt;
        call sleep(5)&lt;br /&gt;
        call doSomething()&lt;br /&gt;
        call doSomething()&lt;br /&gt;
&lt;br /&gt;
        receiveBall1 = SUCCESS&lt;br /&gt;
    end function receiveBall1&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function receiveBall2(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: i1, i2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
        counting   = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_RECV(counting,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall2Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STATUS,                                                   &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if25 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall2, error calling MPI_RECV, ERR01a&amp;quot;&lt;br /&gt;
        end if if25&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = setOtherCounting(pingPong, otherCounting = counting)&lt;br /&gt;
if61 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall2, error calling setOtherCounting, ERR04&amp;quot;&lt;br /&gt;
        end if if61&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;pong, receiveBall2 getMyMPI_id =&amp;quot;, getMyMPI_id(pingPong), &amp;quot;getCounting =&amp;quot;, getCounting(pingPong), &amp;amp;&lt;br /&gt;
                &amp;quot;getOtherCounting =&amp;quot;, getOtherCounting(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call sleep(2)&lt;br /&gt;
        call doSomething()&lt;br /&gt;
&lt;br /&gt;
if71 :  if (getCounting(pingPong) .GT. 0) then&lt;br /&gt;
            STAT_CALL = sendBall(pingPong)&lt;br /&gt;
if7 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function receiveBall, error calling sendBall, ERR01&amp;quot;&lt;br /&gt;
            end if if7&lt;br /&gt;
&lt;br /&gt;
        else if71&lt;br /&gt;
            ! Program terminates because there are no more plays&lt;br /&gt;
            STAT_CALL = sendKillGame(pingPong)&lt;br /&gt;
if3 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
            end if if3&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR03&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
        end if if71&lt;br /&gt;
&lt;br /&gt;
        receiveBall2 = SUCCESS&lt;br /&gt;
    end function receiveBall2&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function receiveBall3(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: i1, i2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
        counting   = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_RECV(counting,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STATUS,                                                   &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
        if5 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall3, error calling MPI_RECV, ERR01b&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setOtherCounting(pingPong, otherCounting = counting)&lt;br /&gt;
        if6 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall3, error calling setOtherCounting, ERR04&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;pong, receiveBall3 getMyMPI_id =&amp;quot;, getMyMPI_id(pingPong), &amp;quot;getCounting =&amp;quot;, getCounting(pingPong), &amp;amp;&lt;br /&gt;
                &amp;quot;getOtherCounting =&amp;quot;, getOtherCounting(pingPong)&lt;br /&gt;
&lt;br /&gt;
if71 :  if (getCounting(pingPong) .GT. 0) then&lt;br /&gt;
            STAT_CALL = sendBall(pingPong)&lt;br /&gt;
if7 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function receiveBall, error calling sendBall, ERR01&amp;quot;&lt;br /&gt;
            end if if7&lt;br /&gt;
&lt;br /&gt;
        else if71&lt;br /&gt;
            ! Program terminates because there are no more plays&lt;br /&gt;
            STAT_CALL = sendKillGame(pingPong)&lt;br /&gt;
if3 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
            end if if3&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR03&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
        end if if71&lt;br /&gt;
&lt;br /&gt;
        receiveBall3 = SUCCESS&lt;br /&gt;
    end function receiveBall3&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine doSomething&lt;br /&gt;
        integer                     :: i,j,k, res1, res2, res3&lt;br /&gt;
&lt;br /&gt;
do1 :   do i=1,1000000000&lt;br /&gt;
do2 :   do j=1,1000000000&lt;br /&gt;
do3 :   do k=1,1000000000&lt;br /&gt;
            res1=i*j+j/(k**2)*(-1.0)&lt;br /&gt;
            res2=i*j+j/(k**2)*(-21.0)&lt;br /&gt;
            res3=MAX(res1, res2)&lt;br /&gt;
        end do do3&lt;br /&gt;
        end do do2&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
    end subroutine doSomething&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall, error calling MPI_SEND, ERR02&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        sendBall = SUCCESS&lt;br /&gt;
    end function sendBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendKillGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(NULL_INT,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgEndGameTag(),                                       &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendKillGame, error calling MPI_SEND, ERR01&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendKillGame = SUCCESS&lt;br /&gt;
    end function sendKillGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function killPingPong(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = stopMPI()&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling stopMPI, ERR01&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;Ping Pong Terminated, pong&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setGameOFF(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling setGameOFF, ERR01&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        killPingPong = SUCCESS&lt;br /&gt;
    end function killPingPong&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function stopMPI()&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_BARRIER(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                         IERROR = STAT_CALL)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_BARRIER, ERR01&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        call MPI_FINALIZE(STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_FINALIZE, ERR02&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        stopMPI =  SUCCESS&lt;br /&gt;
    end function stopMPI&lt;br /&gt;
end program pong&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7178</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7178"/>
				<updated>2014-11-30T18:13:14Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''[[pong]]'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Ping&amp;diff=7177</id>
		<title>Ping</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Ping&amp;diff=7177"/>
				<updated>2014-11-30T18:12:13Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!        IST/MARETEC, Water Modelling Group, Mohid modelling system&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! TITLE         : ping&lt;br /&gt;
&lt;br /&gt;
! PROJECT       : Example of the actor model using Fortran and MPI&lt;br /&gt;
&lt;br /&gt;
! URL           : http://www.mohid.com&lt;br /&gt;
&lt;br /&gt;
! AFFILIATION   : IST/MARETEC, Marine Modelling Group&lt;br /&gt;
&lt;br /&gt;
! DATE          : Nov 2014&lt;br /&gt;
&lt;br /&gt;
! REVISION      : Rciardo Miranda - v1.0&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!This program is free software; you can redistribute it and/or&lt;br /&gt;
&lt;br /&gt;
!modify it under the terms of the GNU General Public License&lt;br /&gt;
&lt;br /&gt;
!version 2, as published by the Free Software Foundation.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!This program is distributed in the hope that it will be useful,&lt;br /&gt;
&lt;br /&gt;
!but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
&lt;br /&gt;
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
&lt;br /&gt;
!GNU General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!You should have received a copy of the GNU General Public License&lt;br /&gt;
&lt;br /&gt;
!along with this program; if not, write to the Free Software&lt;br /&gt;
&lt;br /&gt;
!Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! Compile:&lt;br /&gt;
&lt;br /&gt;
! mpif90 -o /myDirectory/projects/lang/fortran/MPI/pingPong/ping  /myDirectory/projects/lang/fortran/MPI/pingPong/moduleMPImanagemnt.f90  /myDirectory/projects/lang/fortran/MPI/pingPong/ping.f90&lt;br /&gt;
&lt;br /&gt;
!&lt;br /&gt;
&lt;br /&gt;
! Run:&lt;br /&gt;
&lt;br /&gt;
! /opt/mpich/bin/mpiexec -n 1 /myDirectory/projects/lang/fortran/MPI/pingPong/pong : -n  /myDirectory/projects/lang/fortran/MPI/pingPong/ping&lt;br /&gt;
&lt;br /&gt;
program ping&lt;br /&gt;
    use mpi&lt;br /&gt;
    use moduleMPImanagemnt&lt;br /&gt;
&lt;br /&gt;
    implicit none&lt;br /&gt;
&lt;br /&gt;
    integer, parameter :: UNDEFINED   =-99&lt;br /&gt;
    integer, parameter :: SUCCESS     = 0&lt;br /&gt;
    integer, parameter :: NULL_INT    =-999999&lt;br /&gt;
&lt;br /&gt;
    type T_pingPong&lt;br /&gt;
        integer :: myMPI_id      = NULL_INT&lt;br /&gt;
        logical :: hasBall       =.FALSE.&lt;br /&gt;
        logical :: gameON        =.TRUE.&lt;br /&gt;
        integer :: counting      = NULL_INT&lt;br /&gt;
        integer :: otherCounting = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        integer :: otherMPI_id   = NULL_INT&lt;br /&gt;
    end type T_pingPong&lt;br /&gt;
&lt;br /&gt;
    call main()&lt;br /&gt;
&lt;br /&gt;
    contains&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call loop(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    function constructPingPong()&lt;br /&gt;
        type(T_pingPong), pointer   :: constructPingPong&lt;br /&gt;
        type(T_pingPong), pointer   :: newPingPong&lt;br /&gt;
&lt;br /&gt;
        allocate(newPingPong)&lt;br /&gt;
        newPingPong%myMPI_id = startMPI(newPingPong)&lt;br /&gt;
&lt;br /&gt;
        constructPingPong =&amp;gt; newPingPong&lt;br /&gt;
    end function constructPingPong&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer,dimension(8)        :: values&lt;br /&gt;
        integer                     :: sec, rand, aux, I&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call DATE_AND_TIME(VALUES=values)&lt;br /&gt;
        sec = values(7)&lt;br /&gt;
        call SRAND(sec)&lt;br /&gt;
&lt;br /&gt;
        aux = rand(0)&lt;br /&gt;
do1 :   do I = -10, aux&lt;br /&gt;
            counting  = MAX(5, rand(0) / 100000)&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setCounting(pingPong, counting = counting)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startGame, error calling setCounting, ERR01&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = sendBall1(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startGame, error calling sendBall1, ERR02&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        startGame = SUCCESS&lt;br /&gt;
    end function startGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startMPI(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL, myMPI_id, numprocs&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        myMPI_id  = NULL_INT&lt;br /&gt;
        numprocs  = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_INIT(IERROR = STAT_CALL)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_INIT, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_RANK(MPI_COMM_WORLD,                             &amp;amp;&lt;br /&gt;
                           myMPI_id,                                   &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_RANK, ERR02.1&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
if21 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling setMyMPI_id, ERR02.2&amp;quot;&lt;br /&gt;
        end if if21&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_SIZE(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                           numprocs,                                     &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_SIZE, ERR03&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        print *, 'Process ', myMPI_id, ' of ', numprocs, ' is alive'&lt;br /&gt;
&lt;br /&gt;
if5 :   if (getMyMPI_id(pingPong) .EQ. 0) then&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 1)&lt;br /&gt;
if51 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR05&amp;quot;&lt;br /&gt;
            end if if51&lt;br /&gt;
        else if (getMyMPI_id(pingPong) .EQ. 1) then if5&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 0)&lt;br /&gt;
if52 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR06&amp;quot;&lt;br /&gt;
            end if if52&lt;br /&gt;
        else if5&lt;br /&gt;
            stop &amp;quot;function startMPI, ERR07&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        startMPI = myMPI_id&lt;br /&gt;
    end function startMPI&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getCounting = pingPong%counting&lt;br /&gt;
    end function getCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherCounting = pingPong%otherCounting&lt;br /&gt;
    end function getOtherCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getMyMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getMyMPI_id = pingPong%myMPI_id&lt;br /&gt;
    end function getMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherMPI_id = pingPong%otherMPI_id&lt;br /&gt;
    end function getOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherCounting(pingPong, otherCounting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherCounting&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherCounting = otherCounting&lt;br /&gt;
&lt;br /&gt;
        setOtherCounting = SUCCESS&lt;br /&gt;
    end function setOtherCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setCounting(pingPong, counting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: counting&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = counting&lt;br /&gt;
&lt;br /&gt;
        setCounting = SUCCESS&lt;br /&gt;
    end function setCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function decreaseCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = getCounting(pingPong)-1&lt;br /&gt;
&lt;br /&gt;
        decreaseCounting = SUCCESS&lt;br /&gt;
    end function decreaseCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: myMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%myMPI_id = myMPI_id&lt;br /&gt;
&lt;br /&gt;
        setMyMPI_id = SUCCESS&lt;br /&gt;
    end function setMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherMPI_id(pingPong, otherMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherMPI_id = otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        setOtherMPI_id = SUCCESS&lt;br /&gt;
    end function setOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.TRUE.&lt;br /&gt;
&lt;br /&gt;
        setHasBall = SUCCESS&lt;br /&gt;
    end function setHasBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasNoBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setHasNoBall = SUCCESS&lt;br /&gt;
    end function setHasNoBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setGameOFF(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%gameON =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setGameOFF = SUCCESS&lt;br /&gt;
    end function setGameOFF&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
if25 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if if25&lt;br /&gt;
&lt;br /&gt;
if41 :  if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
if42 :      if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall(pingPong, STATUS(MPI_TAG))&lt;br /&gt;
if4 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall, ERR02&amp;quot;&lt;br /&gt;
                end if if4&lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then if42&lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if if2&lt;br /&gt;
            end if if42&lt;br /&gt;
        end if if41&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function receiveBall(pingPong, msgTag)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: msgTag&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: i1, i2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
        counting   = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_RECV(counting,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STATUS,                                                   &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if5 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall, error calling MPI_RECV, ERR01b&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setOtherCounting(pingPong, otherCounting = counting)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall, error calling setOtherCounting, ERR04&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;ping, receiveBall getMyMPI_id =&amp;quot;, getMyMPI_id(pingPong), &amp;amp;&lt;br /&gt;
                &amp;quot;getCounting =&amp;quot;, getCounting(pingPong),                   &amp;amp;&lt;br /&gt;
                &amp;quot;getOtherCounting =&amp;quot;, getOtherCounting(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call doSomething()&lt;br /&gt;
&lt;br /&gt;
if71 :  if (getCounting(pingPong) .GT. 0) then&lt;br /&gt;
if70 :      if      ( mod(getCounting(pingPong), 2) .EQ. 0) then&lt;br /&gt;
                STAT_CALL = sendBall1(pingPong)&lt;br /&gt;
if7 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall1, ERR01&amp;quot;&lt;br /&gt;
                end if if7&lt;br /&gt;
&lt;br /&gt;
            else if ((mod(getCounting(pingPong), 3) .EQ. 0) .AND.         &amp;amp;&lt;br /&gt;
                     (mod(getCounting(pingPong), 2) .NE. 0)) then if70&lt;br /&gt;
                STAT_CALL = sendBall2(pingPong)&lt;br /&gt;
if75 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall2, ERR01&amp;quot;&lt;br /&gt;
                end if if75&lt;br /&gt;
&lt;br /&gt;
            else if70&lt;br /&gt;
                STAT_CALL = sendBall3(pingPong)&lt;br /&gt;
if76 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall3, ERR01&amp;quot;&lt;br /&gt;
                end if if76&lt;br /&gt;
            end if if70&lt;br /&gt;
        else if71&lt;br /&gt;
            ! Program terminates because there are no more plays&lt;br /&gt;
            STAT_CALL = sendKillGame(pingPong)&lt;br /&gt;
if3 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
            end if if3&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR03&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
        end if if71&lt;br /&gt;
&lt;br /&gt;
        receiveBall = SUCCESS&lt;br /&gt;
    end function receiveBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine doSomething&lt;br /&gt;
        integer                     :: i,j,k, res1, res2, res3&lt;br /&gt;
&lt;br /&gt;
        call sleep(10)&lt;br /&gt;
&lt;br /&gt;
do1 :   do i=1,1000&lt;br /&gt;
do2 :   do j=1,1000&lt;br /&gt;
do3 :   do k=1,1000&lt;br /&gt;
            res1=i*j+j/(k**2)*(-1.0)&lt;br /&gt;
            res2=i*j+j/(k**2)*(-21.0)&lt;br /&gt;
            res3=MAX(res1, res2)&lt;br /&gt;
        end do do3&lt;br /&gt;
        end do do2&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
    end subroutine doSomething&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall1(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall1, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall1Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall1, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall1 = SUCCESS&lt;br /&gt;
    end function sendBall1&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall2(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall2, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall2Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall2, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall2 = SUCCESS&lt;br /&gt;
    end function sendBall2&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall3(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall3, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall3, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall3 = SUCCESS&lt;br /&gt;
    end function sendBall3&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendKillGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(NULL_INT,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgEndGameTag(),                                       &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendKillGame, error calling MPI_SEND, ERR01&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendKillGame = SUCCESS&lt;br /&gt;
    end function sendKillGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function killPingPong(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = stopMPI()&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling stopMPI, ERR01&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;Ping Pong Terminated, ping&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setGameOFF(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling setGameOFF, ERR01&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        killPingPong = SUCCESS&lt;br /&gt;
    end function killPingPong&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function stopMPI()&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_BARRIER(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                         IERROR = STAT_CALL)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_BARRIER, ERR01&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        call MPI_FINALIZE(STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_FINALIZE, ERR02&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        stopMPI =  SUCCESS&lt;br /&gt;
    end function stopMPI&lt;br /&gt;
end program ping&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Ping&amp;diff=7176</id>
		<title>Ping</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Ping&amp;diff=7176"/>
				<updated>2014-11-30T18:10:50Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
!        IST/MARETEC, Water Modelling Group, Mohid modelling system&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
!&lt;br /&gt;
! TITLE         : ping&lt;br /&gt;
! PROJECT       : Example of the actor model using Fortran and MPI&lt;br /&gt;
! URL           : http://www.mohid.com&lt;br /&gt;
! AFFILIATION   : IST/MARETEC, Marine Modelling Group&lt;br /&gt;
! DATE          : Nov 2014&lt;br /&gt;
! REVISION      : Rciardo Miranda - v1.0&lt;br /&gt;
!&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
!&lt;br /&gt;
!This program is free software; you can redistribute it and/or&lt;br /&gt;
!modify it under the terms of the GNU General Public License&lt;br /&gt;
!version 2, as published by the Free Software Foundation.&lt;br /&gt;
!&lt;br /&gt;
!This program is distributed in the hope that it will be useful,&lt;br /&gt;
!but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
!GNU General Public License for more details.&lt;br /&gt;
!&lt;br /&gt;
!You should have received a copy of the GNU General Public License&lt;br /&gt;
!along with this program; if not, write to the Free Software&lt;br /&gt;
!Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.&lt;br /&gt;
!&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
!&lt;br /&gt;
! Compile:&lt;br /&gt;
! mpif90 -o /myDirectory/projects/lang/fortran/MPI/pingPong/ping  /myDirectory/projects/lang/fortran/MPI/pingPong/moduleMPImanagemnt.f90  /myDirectory/projects/lang/fortran/MPI/pingPong/ping.f90&lt;br /&gt;
!&lt;br /&gt;
! Run:&lt;br /&gt;
! /opt/mpich/bin/mpiexec -n 1 /myDirectory/projects/lang/fortran/MPI/pingPong/pong : -n  /myDirectory/projects/lang/fortran/MPI/pingPong/ping&lt;br /&gt;
&lt;br /&gt;
program ping&lt;br /&gt;
    use mpi&lt;br /&gt;
    use moduleMPImanagemnt&lt;br /&gt;
&lt;br /&gt;
    implicit none&lt;br /&gt;
&lt;br /&gt;
    integer, parameter :: UNDEFINED   =-99&lt;br /&gt;
    integer, parameter :: SUCCESS     = 0&lt;br /&gt;
    integer, parameter :: NULL_INT    =-999999&lt;br /&gt;
&lt;br /&gt;
    type T_pingPong&lt;br /&gt;
        integer :: myMPI_id      = NULL_INT&lt;br /&gt;
        logical :: hasBall       =.FALSE.&lt;br /&gt;
        logical :: gameON        =.TRUE.&lt;br /&gt;
        integer :: counting      = NULL_INT&lt;br /&gt;
        integer :: otherCounting = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        integer :: otherMPI_id   = NULL_INT&lt;br /&gt;
    end type T_pingPong&lt;br /&gt;
&lt;br /&gt;
    call main()&lt;br /&gt;
&lt;br /&gt;
    contains&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call loop(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    function constructPingPong()&lt;br /&gt;
        type(T_pingPong), pointer   :: constructPingPong&lt;br /&gt;
        type(T_pingPong), pointer   :: newPingPong&lt;br /&gt;
&lt;br /&gt;
        allocate(newPingPong)&lt;br /&gt;
        newPingPong%myMPI_id = startMPI(newPingPong)&lt;br /&gt;
&lt;br /&gt;
        constructPingPong =&amp;gt; newPingPong&lt;br /&gt;
    end function constructPingPong&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer,dimension(8)        :: values&lt;br /&gt;
        integer                     :: sec, rand, aux, I&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call DATE_AND_TIME(VALUES=values)&lt;br /&gt;
        sec = values(7)&lt;br /&gt;
        call SRAND(sec)&lt;br /&gt;
&lt;br /&gt;
        aux = rand(0)&lt;br /&gt;
do1 :   do I = -10, aux&lt;br /&gt;
            counting  = MAX(5, rand(0) / 100000)&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setCounting(pingPong, counting = counting)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startGame, error calling setCounting, ERR01&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = sendBall1(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startGame, error calling sendBall1, ERR02&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        startGame = SUCCESS&lt;br /&gt;
    end function startGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startMPI(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL, myMPI_id, numprocs&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        myMPI_id  = NULL_INT&lt;br /&gt;
        numprocs  = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_INIT(IERROR = STAT_CALL)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_INIT, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_RANK(MPI_COMM_WORLD,                             &amp;amp;&lt;br /&gt;
                           myMPI_id,                                   &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_RANK, ERR02.1&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
if21 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling setMyMPI_id, ERR02.2&amp;quot;&lt;br /&gt;
        end if if21&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_SIZE(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                           numprocs,                                     &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_SIZE, ERR03&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        print *, 'Process ', myMPI_id, ' of ', numprocs, ' is alive'&lt;br /&gt;
&lt;br /&gt;
if5 :   if (getMyMPI_id(pingPong) .EQ. 0) then&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 1)&lt;br /&gt;
if51 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR05&amp;quot;&lt;br /&gt;
            end if if51&lt;br /&gt;
        else if (getMyMPI_id(pingPong) .EQ. 1) then if5&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 0)&lt;br /&gt;
if52 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR06&amp;quot;&lt;br /&gt;
            end if if52&lt;br /&gt;
        else if5&lt;br /&gt;
            stop &amp;quot;function startMPI, ERR07&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        startMPI = myMPI_id&lt;br /&gt;
    end function startMPI&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getCounting = pingPong%counting&lt;br /&gt;
    end function getCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherCounting = pingPong%otherCounting&lt;br /&gt;
    end function getOtherCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getMyMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getMyMPI_id = pingPong%myMPI_id&lt;br /&gt;
    end function getMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherMPI_id = pingPong%otherMPI_id&lt;br /&gt;
    end function getOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherCounting(pingPong, otherCounting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherCounting&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherCounting = otherCounting&lt;br /&gt;
&lt;br /&gt;
        setOtherCounting = SUCCESS&lt;br /&gt;
    end function setOtherCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setCounting(pingPong, counting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: counting&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = counting&lt;br /&gt;
&lt;br /&gt;
        setCounting = SUCCESS&lt;br /&gt;
    end function setCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function decreaseCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = getCounting(pingPong)-1&lt;br /&gt;
&lt;br /&gt;
        decreaseCounting = SUCCESS&lt;br /&gt;
    end function decreaseCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: myMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%myMPI_id = myMPI_id&lt;br /&gt;
&lt;br /&gt;
        setMyMPI_id = SUCCESS&lt;br /&gt;
    end function setMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherMPI_id(pingPong, otherMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherMPI_id = otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        setOtherMPI_id = SUCCESS&lt;br /&gt;
    end function setOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.TRUE.&lt;br /&gt;
&lt;br /&gt;
        setHasBall = SUCCESS&lt;br /&gt;
    end function setHasBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasNoBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setHasNoBall = SUCCESS&lt;br /&gt;
    end function setHasNoBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setGameOFF(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%gameON =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setGameOFF = SUCCESS&lt;br /&gt;
    end function setGameOFF&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
if25 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if if25&lt;br /&gt;
&lt;br /&gt;
if41 :  if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
if42 :      if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall(pingPong, STATUS(MPI_TAG))&lt;br /&gt;
if4 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall, ERR02&amp;quot;&lt;br /&gt;
                end if if4&lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then if42&lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if if2&lt;br /&gt;
            end if if42&lt;br /&gt;
        end if if41&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function receiveBall(pingPong, msgTag)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: msgTag&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: i1, i2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
        counting   = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_RECV(counting,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STATUS,                                                   &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if5 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall, error calling MPI_RECV, ERR01b&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setOtherCounting(pingPong, otherCounting = counting)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall, error calling setOtherCounting, ERR04&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;ping, receiveBall getMyMPI_id =&amp;quot;, getMyMPI_id(pingPong), &amp;amp;&lt;br /&gt;
                &amp;quot;getCounting =&amp;quot;, getCounting(pingPong),                   &amp;amp;&lt;br /&gt;
                &amp;quot;getOtherCounting =&amp;quot;, getOtherCounting(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call doSomething()&lt;br /&gt;
&lt;br /&gt;
if71 :  if (getCounting(pingPong) .GT. 0) then&lt;br /&gt;
if70 :      if      ( mod(getCounting(pingPong), 2) .EQ. 0) then&lt;br /&gt;
                STAT_CALL = sendBall1(pingPong)&lt;br /&gt;
if7 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall1, ERR01&amp;quot;&lt;br /&gt;
                end if if7&lt;br /&gt;
&lt;br /&gt;
            else if ((mod(getCounting(pingPong), 3) .EQ. 0) .AND.         &amp;amp;&lt;br /&gt;
                     (mod(getCounting(pingPong), 2) .NE. 0)) then if70&lt;br /&gt;
                STAT_CALL = sendBall2(pingPong)&lt;br /&gt;
if75 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall2, ERR01&amp;quot;&lt;br /&gt;
                end if if75&lt;br /&gt;
&lt;br /&gt;
            else if70&lt;br /&gt;
                STAT_CALL = sendBall3(pingPong)&lt;br /&gt;
if76 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall3, ERR01&amp;quot;&lt;br /&gt;
                end if if76&lt;br /&gt;
            end if if70&lt;br /&gt;
        else if71&lt;br /&gt;
            ! Program terminates because there are no more plays&lt;br /&gt;
            STAT_CALL = sendKillGame(pingPong)&lt;br /&gt;
if3 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
            end if if3&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR03&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
        end if if71&lt;br /&gt;
&lt;br /&gt;
        receiveBall = SUCCESS&lt;br /&gt;
    end function receiveBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine doSomething&lt;br /&gt;
        integer                     :: i,j,k, res1, res2, res3&lt;br /&gt;
&lt;br /&gt;
        call sleep(10)&lt;br /&gt;
&lt;br /&gt;
do1 :   do i=1,1000&lt;br /&gt;
do2 :   do j=1,1000&lt;br /&gt;
do3 :   do k=1,1000&lt;br /&gt;
            res1=i*j+j/(k**2)*(-1.0)&lt;br /&gt;
            res2=i*j+j/(k**2)*(-21.0)&lt;br /&gt;
            res3=MAX(res1, res2)&lt;br /&gt;
        end do do3&lt;br /&gt;
        end do do2&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
    end subroutine doSomething&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall1(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall1, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall1Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall1, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall1 = SUCCESS&lt;br /&gt;
    end function sendBall1&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall2(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall2, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall2Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall2, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall2 = SUCCESS&lt;br /&gt;
    end function sendBall2&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall3(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall3, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall3, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall3 = SUCCESS&lt;br /&gt;
    end function sendBall3&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendKillGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(NULL_INT,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgEndGameTag(),                                       &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendKillGame, error calling MPI_SEND, ERR01&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendKillGame = SUCCESS&lt;br /&gt;
    end function sendKillGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function killPingPong(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = stopMPI()&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling stopMPI, ERR01&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;Ping Pong Terminated, ping&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setGameOFF(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling setGameOFF, ERR01&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        killPingPong = SUCCESS&lt;br /&gt;
    end function killPingPong&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function stopMPI()&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_BARRIER(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                         IERROR = STAT_CALL)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_BARRIER, ERR01&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        call MPI_FINALIZE(STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_FINALIZE, ERR02&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        stopMPI =  SUCCESS&lt;br /&gt;
    end function stopMPI&lt;br /&gt;
end program ping&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Ping&amp;diff=7175</id>
		<title>Ping</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Ping&amp;diff=7175"/>
				<updated>2014-11-30T18:09:49Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: Created page with &amp;quot;!------------------------------------------------------------------------------ !        IST/MARETEC, Water Modelling Group, Mohid modelling system !-----------------------------...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;!------------------------------------------------------------------------------&lt;br /&gt;
!        IST/MARETEC, Water Modelling Group, Mohid modelling system&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
!&lt;br /&gt;
! TITLE         : ping&lt;br /&gt;
! PROJECT       : Example of the actor model using Fortran and MPI&lt;br /&gt;
! URL           : http://www.mohid.com&lt;br /&gt;
! AFFILIATION   : IST/MARETEC, Marine Modelling Group&lt;br /&gt;
! DATE          : Nov 2014&lt;br /&gt;
! REVISION      : Rciardo Miranda - v1.0&lt;br /&gt;
!&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
!&lt;br /&gt;
!This program is free software; you can redistribute it and/or&lt;br /&gt;
!modify it under the terms of the GNU General Public License&lt;br /&gt;
!version 2, as published by the Free Software Foundation.&lt;br /&gt;
!&lt;br /&gt;
!This program is distributed in the hope that it will be useful,&lt;br /&gt;
!but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
!GNU General Public License for more details.&lt;br /&gt;
!&lt;br /&gt;
!You should have received a copy of the GNU General Public License&lt;br /&gt;
!along with this program; if not, write to the Free Software&lt;br /&gt;
!Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.&lt;br /&gt;
!&lt;br /&gt;
!------------------------------------------------------------------------------&lt;br /&gt;
!&lt;br /&gt;
! Compile:&lt;br /&gt;
! mpif90 -o /myDirectory/projects/lang/fortran/MPI/pingPong/ping  /myDirectory/projects/lang/fortran/MPI/pingPong/moduleMPImanagemnt.f90  /myDirectory/projects/lang/fortran/MPI/pingPong/ping.f90&lt;br /&gt;
!&lt;br /&gt;
! Run:&lt;br /&gt;
! /opt/mpich/bin/mpiexec -n 1 /myDirectory/projects/lang/fortran/MPI/pingPong/pong : -n  /myDirectory/projects/lang/fortran/MPI/pingPong/ping&lt;br /&gt;
&lt;br /&gt;
program ping&lt;br /&gt;
    use mpi&lt;br /&gt;
    use moduleMPImanagemnt&lt;br /&gt;
&lt;br /&gt;
    implicit none&lt;br /&gt;
&lt;br /&gt;
    integer, parameter :: UNDEFINED   =-99&lt;br /&gt;
    integer, parameter :: SUCCESS     = 0&lt;br /&gt;
    integer, parameter :: NULL_INT    =-999999&lt;br /&gt;
&lt;br /&gt;
    type T_pingPong&lt;br /&gt;
        integer :: myMPI_id      = NULL_INT&lt;br /&gt;
        logical :: hasBall       =.FALSE.&lt;br /&gt;
        logical :: gameON        =.TRUE.&lt;br /&gt;
        integer :: counting      = NULL_INT&lt;br /&gt;
        integer :: otherCounting = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        integer :: otherMPI_id   = NULL_INT&lt;br /&gt;
    end type T_pingPong&lt;br /&gt;
&lt;br /&gt;
    call main()&lt;br /&gt;
&lt;br /&gt;
    contains&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine main()&lt;br /&gt;
        type(T_pingPong), pointer :: pingPong&lt;br /&gt;
        integer :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        pingPong =&amp;gt; constructPingPong()&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = startGame(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine main, error calling startGame, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call loop(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call EXIT(SUCCESS)&lt;br /&gt;
&lt;br /&gt;
    end subroutine main&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    function constructPingPong()&lt;br /&gt;
        type(T_pingPong), pointer   :: constructPingPong&lt;br /&gt;
        type(T_pingPong), pointer   :: newPingPong&lt;br /&gt;
&lt;br /&gt;
        allocate(newPingPong)&lt;br /&gt;
        newPingPong%myMPI_id = startMPI(newPingPong)&lt;br /&gt;
&lt;br /&gt;
        constructPingPong =&amp;gt; newPingPong&lt;br /&gt;
    end function constructPingPong&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer,dimension(8)        :: values&lt;br /&gt;
        integer                     :: sec, rand, aux, I&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call DATE_AND_TIME(VALUES=values)&lt;br /&gt;
        sec = values(7)&lt;br /&gt;
        call SRAND(sec)&lt;br /&gt;
&lt;br /&gt;
        aux = rand(0)&lt;br /&gt;
do1 :   do I = -10, aux&lt;br /&gt;
            counting  = MAX(5, rand(0) / 100000)&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setCounting(pingPong, counting = counting)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startGame, error calling setCounting, ERR01&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = sendBall1(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startGame, error calling sendBall1, ERR02&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        startGame = SUCCESS&lt;br /&gt;
    end function startGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function startMPI(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL, myMPI_id, numprocs&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
        myMPI_id  = NULL_INT&lt;br /&gt;
        numprocs  = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_INIT(IERROR = STAT_CALL)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_INIT, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_RANK(MPI_COMM_WORLD,                             &amp;amp;&lt;br /&gt;
                           myMPI_id,                                   &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_RANK, ERR02.1&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
if21 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling setMyMPI_id, ERR02.2&amp;quot;&lt;br /&gt;
        end if if21&lt;br /&gt;
&lt;br /&gt;
        call MPI_COMM_SIZE(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                           numprocs,                                     &amp;amp;&lt;br /&gt;
                           IERROR = STAT_CALL)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function startMPI, error calling MPI_COMM_SIZE, ERR03&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        print *, 'Process ', myMPI_id, ' of ', numprocs, ' is alive'&lt;br /&gt;
&lt;br /&gt;
if5 :   if (getMyMPI_id(pingPong) .EQ. 0) then&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 1)&lt;br /&gt;
if51 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR05&amp;quot;&lt;br /&gt;
            end if if51&lt;br /&gt;
        else if (getMyMPI_id(pingPong) .EQ. 1) then if5&lt;br /&gt;
            STAT_CALL = setOtherMPI_id(pingPong, otherMPI_id = 0)&lt;br /&gt;
if52 :      if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;function startMPI, error calling setOtherMPI_id, ERR06&amp;quot;&lt;br /&gt;
            end if if52&lt;br /&gt;
        else if5&lt;br /&gt;
            stop &amp;quot;function startMPI, ERR07&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        startMPI = myMPI_id&lt;br /&gt;
    end function startMPI&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getCounting = pingPong%counting&lt;br /&gt;
    end function getCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherCounting = pingPong%otherCounting&lt;br /&gt;
    end function getOtherCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getMyMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getMyMPI_id = pingPong%myMPI_id&lt;br /&gt;
    end function getMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function getOtherMPI_id(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        getOtherMPI_id = pingPong%otherMPI_id&lt;br /&gt;
    end function getOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherCounting(pingPong, otherCounting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherCounting&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherCounting = otherCounting&lt;br /&gt;
&lt;br /&gt;
        setOtherCounting = SUCCESS&lt;br /&gt;
    end function setOtherCounting&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setCounting(pingPong, counting)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: counting&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = counting&lt;br /&gt;
&lt;br /&gt;
        setCounting = SUCCESS&lt;br /&gt;
    end function setCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function decreaseCounting(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%counting = getCounting(pingPong)-1&lt;br /&gt;
&lt;br /&gt;
        decreaseCounting = SUCCESS&lt;br /&gt;
    end function decreaseCounting&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setMyMPI_id(pingPong, myMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: myMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%myMPI_id = myMPI_id&lt;br /&gt;
&lt;br /&gt;
        setMyMPI_id = SUCCESS&lt;br /&gt;
    end function setMyMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setOtherMPI_id(pingPong, otherMPI_id)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        pingPong%otherMPI_id = otherMPI_id&lt;br /&gt;
&lt;br /&gt;
        setOtherMPI_id = SUCCESS&lt;br /&gt;
    end function setOtherMPI_id&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.TRUE.&lt;br /&gt;
&lt;br /&gt;
        setHasBall = SUCCESS&lt;br /&gt;
    end function setHasBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setHasNoBall(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%hasBall =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setHasNoBall = SUCCESS&lt;br /&gt;
    end function setHasNoBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function setGameOFF(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
&lt;br /&gt;
        pingPong%gameON =.FALSE.&lt;br /&gt;
&lt;br /&gt;
        setGameOFF = SUCCESS&lt;br /&gt;
    end function setGameOFF&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    recursive subroutine loop(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_PROBE(MPI_ANY_SOURCE,                                          &amp;amp;&lt;br /&gt;
                       MPI_ANY_TAG,                                             &amp;amp;&lt;br /&gt;
                       MPI_COMM_WORLD,                                          &amp;amp;&lt;br /&gt;
                       STATUS,                                                  &amp;amp;&lt;br /&gt;
                       STAT_CALL)&lt;br /&gt;
if25 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;subroutine loop, error calling MPI_PROBE, ERR01&amp;quot;&lt;br /&gt;
        end if if25&lt;br /&gt;
&lt;br /&gt;
if41 :  if (STATUS(MPI_SOURCE) .EQ. getOtherMPI_id(pingPong)) then&lt;br /&gt;
if42 :      if (STATUS(MPI_TAG) .EQ. getMsgPlayBall3Tag()) then&lt;br /&gt;
                STAT_CALL = receiveBall(pingPong, STATUS(MPI_TAG))&lt;br /&gt;
if4 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine loop, error calling receiveBall, ERR02&amp;quot;&lt;br /&gt;
                end if if4&lt;br /&gt;
&lt;br /&gt;
            else if (STATUS(MPI_TAG) .EQ. getMsgEndGameTag()) then if42&lt;br /&gt;
                STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
                end if if2&lt;br /&gt;
            end if if42&lt;br /&gt;
        end if if41&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        if (pingPong%gameON) call loop(pingPong)&lt;br /&gt;
    end subroutine loop&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function receiveBall(pingPong, msgTag)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer, intent(IN)         :: msgTag&lt;br /&gt;
        integer                     :: STATUS(MPI_STATUS_SIZE)&lt;br /&gt;
        integer                     :: counting&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
        integer                     :: i1, i2&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
        counting   = NULL_INT&lt;br /&gt;
&lt;br /&gt;
        call MPI_RECV(counting,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STATUS,                                                   &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if5 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall, error calling MPI_RECV, ERR01b&amp;quot;&lt;br /&gt;
        end if if5&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setOtherCounting(pingPong, otherCounting = counting)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function receiveBall, error calling setOtherCounting, ERR04&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;ping, receiveBall getMyMPI_id =&amp;quot;, getMyMPI_id(pingPong), &amp;amp;&lt;br /&gt;
                &amp;quot;getCounting =&amp;quot;, getCounting(pingPong),                   &amp;amp;&lt;br /&gt;
                &amp;quot;getOtherCounting =&amp;quot;, getOtherCounting(pingPong)&lt;br /&gt;
&lt;br /&gt;
        call doSomething()&lt;br /&gt;
&lt;br /&gt;
if71 :  if (getCounting(pingPong) .GT. 0) then&lt;br /&gt;
if70 :      if      ( mod(getCounting(pingPong), 2) .EQ. 0) then&lt;br /&gt;
                STAT_CALL = sendBall1(pingPong)&lt;br /&gt;
if7 :           if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall1, ERR01&amp;quot;&lt;br /&gt;
                end if if7&lt;br /&gt;
&lt;br /&gt;
            else if ((mod(getCounting(pingPong), 3) .EQ. 0) .AND.         &amp;amp;&lt;br /&gt;
                     (mod(getCounting(pingPong), 2) .NE. 0)) then if70&lt;br /&gt;
                STAT_CALL = sendBall2(pingPong)&lt;br /&gt;
if75 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall2, ERR01&amp;quot;&lt;br /&gt;
                end if if75&lt;br /&gt;
&lt;br /&gt;
            else if70&lt;br /&gt;
                STAT_CALL = sendBall3(pingPong)&lt;br /&gt;
if76 :          if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                    print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                    stop &amp;quot;function receiveBall, error calling sendBall3, ERR01&amp;quot;&lt;br /&gt;
                end if if76&lt;br /&gt;
            end if if70&lt;br /&gt;
        else if71&lt;br /&gt;
            ! Program terminates because there are no more plays&lt;br /&gt;
            STAT_CALL = sendKillGame(pingPong)&lt;br /&gt;
if3 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR02&amp;quot;&lt;br /&gt;
            end if if3&lt;br /&gt;
&lt;br /&gt;
            STAT_CALL = killPingPong(pingPong)&lt;br /&gt;
if2 :       if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
                print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
                stop &amp;quot;subroutine main, error calling killPingPong, ERR03&amp;quot;&lt;br /&gt;
            end if if2&lt;br /&gt;
        end if if71&lt;br /&gt;
&lt;br /&gt;
        receiveBall = SUCCESS&lt;br /&gt;
    end function receiveBall&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    subroutine doSomething&lt;br /&gt;
        integer                     :: i,j,k, res1, res2, res3&lt;br /&gt;
&lt;br /&gt;
        call sleep(10)&lt;br /&gt;
&lt;br /&gt;
do1 :   do i=1,1000&lt;br /&gt;
do2 :   do j=1,1000&lt;br /&gt;
do3 :   do k=1,1000&lt;br /&gt;
            res1=i*j+j/(k**2)*(-1.0)&lt;br /&gt;
            res2=i*j+j/(k**2)*(-21.0)&lt;br /&gt;
            res3=MAX(res1, res2)&lt;br /&gt;
        end do do3&lt;br /&gt;
        end do do2&lt;br /&gt;
        end do do1&lt;br /&gt;
&lt;br /&gt;
    end subroutine doSomething&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall1(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall1, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall1Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall1, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall1 = SUCCESS&lt;br /&gt;
    end function sendBall1&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall2(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall2, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall2Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall2, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall2 = SUCCESS&lt;br /&gt;
    end function sendBall2&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendBall3(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = decreaseCounting(pingPong)&lt;br /&gt;
if1 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall3, error calling decreaseCounting, ERR01&amp;quot;&lt;br /&gt;
        end if if1&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(getCounting(pingPong),                                    &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgPlayBall3Tag(),                                     &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendBall3, error calling MPI_SEND, ERR012&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendBall3 = SUCCESS&lt;br /&gt;
    end function sendBall3&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function sendKillGame(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL  = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_SEND(NULL_INT,                                                 &amp;amp;&lt;br /&gt;
                      1,                                                        &amp;amp;&lt;br /&gt;
                      MPI_INTEGER,                                              &amp;amp;&lt;br /&gt;
                      getOtherMPI_id(pingPong),                                 &amp;amp;&lt;br /&gt;
                      getMsgEndGameTag(),                                       &amp;amp;&lt;br /&gt;
                      MPI_COMM_WORLD,                                           &amp;amp;&lt;br /&gt;
                      STAT_CALL)&lt;br /&gt;
if16 :  if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function sendKillGame, error calling MPI_SEND, ERR01&amp;quot;&lt;br /&gt;
        end if if16&lt;br /&gt;
&lt;br /&gt;
        sendKillGame = SUCCESS&lt;br /&gt;
    end function sendKillGame&lt;br /&gt;
&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function killPingPong(pingPong)&lt;br /&gt;
        type(T_pingPong), pointer   :: pingPong&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = stopMPI()&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling stopMPI, ERR01&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        print*, &amp;quot;Ping Pong Terminated, ping&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = setGameOFF(pingPong)&lt;br /&gt;
if3 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function killPingPong, error calling setGameOFF, ERR01&amp;quot;&lt;br /&gt;
        end if if3&lt;br /&gt;
&lt;br /&gt;
        killPingPong = SUCCESS&lt;br /&gt;
    end function killPingPong&lt;br /&gt;
    !---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    integer function stopMPI()&lt;br /&gt;
        integer                     :: STAT_CALL&lt;br /&gt;
&lt;br /&gt;
        STAT_CALL = UNDEFINED&lt;br /&gt;
&lt;br /&gt;
        call MPI_BARRIER(MPI_COMM_WORLD,                               &amp;amp;&lt;br /&gt;
                         IERROR = STAT_CALL)&lt;br /&gt;
if6 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_BARRIER, ERR01&amp;quot;&lt;br /&gt;
        end if if6&lt;br /&gt;
&lt;br /&gt;
        call MPI_FINALIZE(STAT_CALL)&lt;br /&gt;
if2 :   if (STAT_CALL .NE. SUCCESS) then&lt;br /&gt;
            print*, &amp;quot;STAT_CALL = &amp;quot;, STAT_CALL&lt;br /&gt;
            stop &amp;quot;function stopMPI, error calling MPI_FINALIZE, ERR02&amp;quot;&lt;br /&gt;
        end if if2&lt;br /&gt;
&lt;br /&gt;
        stopMPI =  SUCCESS&lt;br /&gt;
    end function stopMPI&lt;br /&gt;
end program ping&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7174</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7174"/>
				<updated>2014-11-30T18:02:39Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''[[ping]]'' and ''pong'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7173</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7173"/>
				<updated>2014-11-30T17:49:27Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple ping-pong program is shown here. There are 2 programs, ''ping'' and ''pong'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7172</id>
		<title>Fortran implementation of the Actor Model using MPI</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Fortran_implementation_of_the_Actor_Model_using_MPI&amp;diff=7172"/>
				<updated>2014-11-30T17:48:55Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple pingpong program is shown here. There are 2 programs, ''ping'' and ''pong'', that shoot messages among them, starting each with a random number of plays. The first program reaching 0 will send a message for the other program to stop and stops itself.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7163</id>
		<title>Reactive Programming</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7163"/>
				<updated>2014-10-14T21:54:39Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Asynchronous dataflow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, in an '''imperative programming setting''', &amp;lt;math&amp;gt;a := b + c&amp;lt;/math&amp;gt; would mean that &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is being assigned the result of &amp;lt;math&amp;gt;b + c&amp;lt;/math&amp;gt; in the instant the expression is evaluated. Later, the values of &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; can be changed with no effect on the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In '''reactive programming''', the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; would be automatically updated based on the new values.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MS Excel is a reactive programming environment ==&lt;br /&gt;
Continuing from Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;A modern spreadsheet program is an example of reactive programming. Spreadsheet cells can contain literal values, or formulas such as &amp;quot;=&amp;lt;math&amp;gt;B1+C1&amp;lt;/math&amp;gt;&amp;quot; that are evaluated based on other cells. Whenever the value of the other cells change, the value of the formula is automatically updated.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Decoupling data from operations on data ==&lt;br /&gt;
To have a data flow between nodes it is necessary to decouple data from operations on data. Messages, tokens in data flow parlance, are send from node to node through arcs. &lt;br /&gt;
Dut to the non-deterministic nature of a large system like Mohid, a asynchronous approach was chosen, using the Hollywood principle (stated as &amp;quot;don't call us, we'll call you.&amp;quot;[http://en.wikipedia.org/wiki/Hollywood_principle]). Here we will focus on asynchronous reactive dataflow systems, focusing on the actor model. Reactive dataflow systems can be:&lt;br /&gt;
*asynchronous; or&lt;br /&gt;
*synchronous.&lt;br /&gt;
&lt;br /&gt;
=== Asynchronous dataflow ===&lt;br /&gt;
According to Matt Carcki[https://leanpub.com/dataflowbook] &amp;quot;Asynchronous execution is when a node fires any time that its activation preconditions are met, possibly at the same time as other nodes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Synchronous dataflow ===&lt;br /&gt;
Still according to Matt Carcki[https://leanpub.com/dataflowbook] &amp;quot;Synchronous execution is when the nodes fires on a pre-calculated, fixed schedule. This implies that the program has to be compiled first to build the schedule. The schedule determines which nodes have to fire before others, how often they have to fire and which nodes can fire simultaneously&amp;quot;. Synchronous dataflow requires the token rate to be known at design time.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7162</id>
		<title>Reactive Programming</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7162"/>
				<updated>2014-10-14T21:54:17Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Synchronous dataflow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, in an '''imperative programming setting''', &amp;lt;math&amp;gt;a := b + c&amp;lt;/math&amp;gt; would mean that &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is being assigned the result of &amp;lt;math&amp;gt;b + c&amp;lt;/math&amp;gt; in the instant the expression is evaluated. Later, the values of &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; can be changed with no effect on the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In '''reactive programming''', the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; would be automatically updated based on the new values.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MS Excel is a reactive programming environment ==&lt;br /&gt;
Continuing from Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;A modern spreadsheet program is an example of reactive programming. Spreadsheet cells can contain literal values, or formulas such as &amp;quot;=&amp;lt;math&amp;gt;B1+C1&amp;lt;/math&amp;gt;&amp;quot; that are evaluated based on other cells. Whenever the value of the other cells change, the value of the formula is automatically updated.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Decoupling data from operations on data ==&lt;br /&gt;
To have a data flow between nodes it is necessary to decouple data from operations on data. Messages, tokens in data flow parlance, are send from node to node through arcs. &lt;br /&gt;
Dut to the non-deterministic nature of a large system like Mohid, a asynchronous approach was chosen, using the Hollywood principle (stated as &amp;quot;don't call us, we'll call you.&amp;quot;[http://en.wikipedia.org/wiki/Hollywood_principle]). Here we will focus on asynchronous reactive dataflow systems, focusing on the actor model. Reactive dataflow systems can be:&lt;br /&gt;
*asynchronous; or&lt;br /&gt;
*synchronous.&lt;br /&gt;
&lt;br /&gt;
=== Asynchronous dataflow ===&lt;br /&gt;
According to Matt Carcki[https://leanpub.com/dataflowbook] &amp;quot;Asynchronous execution is when a node fires any time that its activation preconditions are met, possibly at the same time as other nodes.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Synchronous dataflow ===&lt;br /&gt;
Still according to Matt Carcki[https://leanpub.com/dataflowbook] &amp;quot;Synchronous execution is when the nodes fires on a pre-calculated, fixed schedule. This implies that the program has to be compiled first to build the schedule. The schedule determines which nodes have to fire before others, how often they have to fire and which nodes can fire simultaneously&amp;quot;. Synchronous dataflow requires the token rate to be known at design time.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7161</id>
		<title>Reactive Programming</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7161"/>
				<updated>2014-10-14T16:45:21Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Decoupling data from operations on data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, in an '''imperative programming setting''', &amp;lt;math&amp;gt;a := b + c&amp;lt;/math&amp;gt; would mean that &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is being assigned the result of &amp;lt;math&amp;gt;b + c&amp;lt;/math&amp;gt; in the instant the expression is evaluated. Later, the values of &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; can be changed with no effect on the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In '''reactive programming''', the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; would be automatically updated based on the new values.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MS Excel is a reactive programming environment ==&lt;br /&gt;
Continuing from Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;A modern spreadsheet program is an example of reactive programming. Spreadsheet cells can contain literal values, or formulas such as &amp;quot;=&amp;lt;math&amp;gt;B1+C1&amp;lt;/math&amp;gt;&amp;quot; that are evaluated based on other cells. Whenever the value of the other cells change, the value of the formula is automatically updated.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Decoupling data from operations on data ==&lt;br /&gt;
To have a data flow between nodes it is necessary to decouple data from operations on data. Messages, tokens in data flow parlance, are send from node to node through arcs. &lt;br /&gt;
Dut to the non-deterministic nature of a large system like Mohid, a asynchronous approach was chosen, using the Hollywood principle (stated as &amp;quot;don't call us, we'll call you.&amp;quot;[http://en.wikipedia.org/wiki/Hollywood_principle]). Here we will focus on asynchronous reactive dataflow systems, focusing on the actor model. Reactive dataflow systems can be:&lt;br /&gt;
*asynchronous; or&lt;br /&gt;
*synchronous.&lt;br /&gt;
&lt;br /&gt;
=== Asynchronous dataflow ===&lt;br /&gt;
According to Matt Carcki[https://leanpub.com/dataflowbook] &amp;quot;Asynchronous execution is when a node fires any time that its activation preconditions are met, possibly at the same time as other nodes.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Synchronous dataflow ===&lt;br /&gt;
Still according to Matt Carcki[https://leanpub.com/dataflowbook] &amp;quot;Synchronous execution is when the nodes fires on a pre-calculated, fixed schedule. This implies that the program has to be compiled first to build the schedule. The schedule determines which nodes have to fire before others, how often they have to fire and which nodes can fire simultaneously.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Synchronous dataflow requires the token rate to be known at design time.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7160</id>
		<title>Reactive Programming</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7160"/>
				<updated>2014-10-14T16:31:02Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Decoupling data from operations on data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, in an '''imperative programming setting''', &amp;lt;math&amp;gt;a := b + c&amp;lt;/math&amp;gt; would mean that &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is being assigned the result of &amp;lt;math&amp;gt;b + c&amp;lt;/math&amp;gt; in the instant the expression is evaluated. Later, the values of &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; can be changed with no effect on the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In '''reactive programming''', the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; would be automatically updated based on the new values.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MS Excel is a reactive programming environment ==&lt;br /&gt;
Continuing from Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;A modern spreadsheet program is an example of reactive programming. Spreadsheet cells can contain literal values, or formulas such as &amp;quot;=&amp;lt;math&amp;gt;B1+C1&amp;lt;/math&amp;gt;&amp;quot; that are evaluated based on other cells. Whenever the value of the other cells change, the value of the formula is automatically updated.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Decoupling data from operations on data ==&lt;br /&gt;
To have a data flow between nodes it is necessary to decouple data from operations on data. Messages, tokens in data flow parlance, are send from node to node through arcs. &lt;br /&gt;
Dut to the non-deterministic nature of a large system like Mohid, a asynchronous approach was chosen, using the Hollywood principle (stated as &amp;quot;don't call us, we'll call you.&amp;quot;[http://en.wikipedia.org/wiki/Hollywood_principle]). Here we will focus on asynchronous reactive dataflow systems, focusing on the actor model. Reactive dataflow systems can be:&lt;br /&gt;
*asynchronous; or&lt;br /&gt;
*synchronous.&lt;br /&gt;
&lt;br /&gt;
=== Asynchronous dataflow ===&lt;br /&gt;
According to Matt Carcki[https://leanpub.com/dataflowbook] &amp;quot;Asynchronous execution is when a node fires any time that its activation preconditions are met, possibly at the same time as other nodes.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Synchronous dataflow ===&lt;br /&gt;
Still according to Matt Carcki[https://leanpub.com/dataflowbook] &amp;quot;Synchronous execution is when the nodes fires on a pre-calculated, fixed schedule. This implies that the program has to be compiled first to build the schedule. The schedule determines which nodes have to fire before others, how often they have to fire and which nodes can fire simultaneously.&amp;quot;&lt;br /&gt;
Synchronous dataflow requires the token rate to be known at design time.&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7159</id>
		<title>Reactive Programming</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7159"/>
				<updated>2014-10-14T16:23:42Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Decoupling data from operations on data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, in an '''imperative programming setting''', &amp;lt;math&amp;gt;a := b + c&amp;lt;/math&amp;gt; would mean that &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is being assigned the result of &amp;lt;math&amp;gt;b + c&amp;lt;/math&amp;gt; in the instant the expression is evaluated. Later, the values of &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; can be changed with no effect on the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In '''reactive programming''', the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; would be automatically updated based on the new values.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MS Excel is a reactive programming environment ==&lt;br /&gt;
Continuing from Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;A modern spreadsheet program is an example of reactive programming. Spreadsheet cells can contain literal values, or formulas such as &amp;quot;=&amp;lt;math&amp;gt;B1+C1&amp;lt;/math&amp;gt;&amp;quot; that are evaluated based on other cells. Whenever the value of the other cells change, the value of the formula is automatically updated.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Decoupling data from operations on data ==&lt;br /&gt;
To have a data flow between nodes it is necessary to decouple data from operations on data. Messages, tokens in data flow parlance, are send from node to node through arcs. &lt;br /&gt;
Dut to the non-deterministic nature of a large system like Mohid, a asynchronous approach was choosen, using the Hollywood principle (stated as &amp;quot;don't call us, we'll call you.&amp;quot;[http://en.wikipedia.org/wiki/Hollywood_principle]). Here we will focus on asynchronous reactive dataflow systems, focusing on the actor model. Reactive daflow systems can be:&lt;br /&gt;
*asynchronous; or&lt;br /&gt;
*synchronous.&lt;br /&gt;
&lt;br /&gt;
=== Asynchronous dataflow ===&lt;br /&gt;
&lt;br /&gt;
=== Synchronous dataflow ===&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7158</id>
		<title>Reactive Programming</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7158"/>
				<updated>2014-10-14T11:46:22Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Decoupling data from operations on data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, in an '''imperative programming setting''', &amp;lt;math&amp;gt;a := b + c&amp;lt;/math&amp;gt; would mean that &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is being assigned the result of &amp;lt;math&amp;gt;b + c&amp;lt;/math&amp;gt; in the instant the expression is evaluated. Later, the values of &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; can be changed with no effect on the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In '''reactive programming''', the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; would be automatically updated based on the new values.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MS Excel is a reactive programming environment ==&lt;br /&gt;
Continuing from Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;A modern spreadsheet program is an example of reactive programming. Spreadsheet cells can contain literal values, or formulas such as &amp;quot;=&amp;lt;math&amp;gt;B1+C1&amp;lt;/math&amp;gt;&amp;quot; that are evaluated based on other cells. Whenever the value of the other cells change, the value of the formula is automatically updated.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Decoupling data from operations on data ==&lt;br /&gt;
To have a data flow between nodes it is necessary to decouple data from operations on data. Messages, tokens in data flow parlance, are send from node to node. To have a more robust design inherently non-deterministic, the system should be asynchronous, using the Hollywood principle (stated as &amp;quot;don't call us, we'll call you.&amp;quot;[http://en.wikipedia.org/wiki/Hollywood_principle]).&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7157</id>
		<title>Reactive Programming</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7157"/>
				<updated>2014-10-14T11:44:20Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: /* Decoupling data from operations on data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, in an '''imperative programming setting''', &amp;lt;math&amp;gt;a := b + c&amp;lt;/math&amp;gt; would mean that &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is being assigned the result of &amp;lt;math&amp;gt;b + c&amp;lt;/math&amp;gt; in the instant the expression is evaluated. Later, the values of &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; can be changed with no effect on the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In '''reactive programming''', the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; would be automatically updated based on the new values.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MS Excel is a reactive programming environment ==&lt;br /&gt;
Continuing from Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;A modern spreadsheet program is an example of reactive programming. Spreadsheet cells can contain literal values, or formulas such as &amp;quot;=&amp;lt;math&amp;gt;B1+C1&amp;lt;/math&amp;gt;&amp;quot; that are evaluated based on other cells. Whenever the value of the other cells change, the value of the formula is automatically updated.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Decoupling data from operations on data ==&lt;br /&gt;
To have a data flow between nodes it is necessary to decouple data from operations on data. Messages, tokens in dataflow parlance, are send from node to node. To have a more roubust design inherentely non-deterministic, the system should be assynchronous, using the Hollywood principle is stated as &amp;quot;don't call us, we'll call you.&amp;quot;[http://en.wikipedia.org/wiki/Hollywood_principle].&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7156</id>
		<title>Reactive Programming</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7156"/>
				<updated>2014-10-14T11:36:42Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, in an '''imperative programming setting''', &amp;lt;math&amp;gt;a := b + c&amp;lt;/math&amp;gt; would mean that &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is being assigned the result of &amp;lt;math&amp;gt;b + c&amp;lt;/math&amp;gt; in the instant the expression is evaluated. Later, the values of &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; can be changed with no effect on the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In '''reactive programming''', the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; would be automatically updated based on the new values.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MS Excel is a reactive programming environment ==&lt;br /&gt;
Continuing from Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;A modern spreadsheet program is an example of reactive programming. Spreadsheet cells can contain literal values, or formulas such as &amp;quot;=&amp;lt;math&amp;gt;B1+C1&amp;lt;/math&amp;gt;&amp;quot; that are evaluated based on other cells. Whenever the value of the other cells change, the value of the formula is automatically updated.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Decoupling data from operations on data ==&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7155</id>
		<title>Reactive Programming</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7155"/>
				<updated>2014-10-14T11:29:21Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, in an '''imperative programming setting''', &amp;lt;math&amp;gt;a := b + c&amp;lt;/math&amp;gt; would mean that &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is being assigned the result of &amp;lt;math&amp;gt;b + c&amp;lt;/math&amp;gt; in the instant the expression is evaluated. Later, the values of &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; can be changed with no effect on the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In '''reactive programming''', the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; would be automatically updated based on the new values.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MS Excel is a reactive programming environment ==&lt;br /&gt;
Continuing from Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;A modern spreadsheet program is an example of reactive programming. Spreadsheet cells can contain literal values, or formulas such as &amp;quot;=&amp;lt;math&amp;gt;B1+C1&amp;lt;/math&amp;gt;&amp;quot; that are evaluated based on other cells. Whenever the value of the other cells change, the value of the formula is automatically updated.&amp;quot;&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7154</id>
		<title>Reactive Programming</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Reactive_Programming&amp;diff=7154"/>
				<updated>2014-10-14T11:28:12Z</updated>
		
		<summary type="html">&lt;p&gt;Miranda ricardo: Created page with &amp;quot;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;According to Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;(...) reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;For example, in an '''imperative programming setting''', &amp;lt;math&amp;gt;a := b + c&amp;lt;/math&amp;gt; would mean that &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is being assigned the result of &amp;lt;math&amp;gt;b + c&amp;lt;/math&amp;gt; in the instant the expression is evaluated. Later, the values of &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; can be changed with no effect on the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In '''reactive programming''', the value of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; would be automatically updated based on the new values.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== MS Excel is a reactive programming environement ==&lt;br /&gt;
Continuing from Wikipedia[http://en.wikipedia.org/wiki/Reactive_programming] &amp;quot;A modern spreadsheet program is an example of reactive programming. Spreadsheet cells can contain literal values, or formulas such as &amp;quot;=&amp;lt;math&amp;gt;B1+C1&amp;lt;/math&amp;gt;&amp;quot; that are evaluated based on other cells. Whenever the value of the other cells change, the value of the formula is automatically updated.&amp;quot;&lt;/div&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	</feed>