<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.wiki.mohid.com/index.php?action=history&amp;feed=atom&amp;title=Pong</id>
		<title>Pong - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.wiki.mohid.com/index.php?action=history&amp;feed=atom&amp;title=Pong"/>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Pong&amp;action=history"/>
		<updated>2026-04-04T17:09:09Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Pong&amp;diff=7185&amp;oldid=prev</id>
		<title>Miranda ricardo at 18:25, 30 November 2014</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Pong&amp;diff=7185&amp;oldid=prev"/>
				<updated>2014-11-30T18:25:28Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 18:25, 30 November 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l57&quot; &gt;Line 57:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 57:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Compile:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Compile:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! mpif90 -o /myDirectory/projects/lang/fortran/MPI/pingPong/pong /myDirectory/projects/lang/fortran/MPI/pingPong/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;moduleMPImanagemnt&lt;/del&gt;.f90&amp;#160; /myDirectory/projects /lang/fortran/MPI/pingPong/pong.f90&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! mpif90 -o /myDirectory/projects/lang/fortran/MPI/pingPong/pong /myDirectory/projects/lang/fortran/MPI/pingPong/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;moduleMPImanagement&lt;/ins&gt;.f90&amp;#160; /myDirectory/projects /lang/fortran/MPI/pingPong/pong.f90&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;!&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Miranda ricardo</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Pong&amp;diff=7179&amp;oldid=prev</id>
		<title>Miranda ricardo: Created page with &quot;!------------------------------------------------------------------------------  !        IST/MARETEC, Water Modelling Group, Mohid modelling system  !---------------------------...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Pong&amp;diff=7179&amp;oldid=prev"/>
				<updated>2014-11-30T18:15:32Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;!------------------------------------------------------------------------------  !        IST/MARETEC, Water Modelling Group, Mohid modelling system  !---------------------------...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&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>

	</feed>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-56589921-5', 'auto');
  ga('send', 'pageview');
</script>