ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc program mplworker ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c This is the worker program corresponding to the manager program: c c mplmanager.f c c It receives an integer message from the manager, prints it, c modifies it by adding 100, and then sends the results back c to the manager. ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc implicit none c integer nbuf(4), dontcare, allgrp integer nprocs, nodeid, msgid, i, hostnm_, rc character*7 my_hostname, manager_name c c Call mp_environ to return this node's id: c call MP_ENVIRON(nprocs,nodeid) c c Learn value of allgrp and dontcare, for use with broadcast. c call MP_TASK_QUERY(nbuf, 4, 3) dontcare = nbuf(1) allgrp = nbuf(4) c c get node name: c rc = hostnm_(my_hostname) c c Participate in broadcast to get manager's hostname... c call MP_BCAST(manager_name, 7, 0, allgrp) c c Receive the start-up value from the manager... c call MP_BRECV(i,4,0,100,msgid) write(6,100) nodeid, my_hostname, i, manager_name 100 format('Stdout from node ',I9,' (',A,'): Received ',I3, * ' from host ', A ,'.') c Now, perform a trivial computation on the integer value: i = i + 100 c c Send the computed information back to the manager. c call MP_SEND(i, 4, 0, 200, msgid) stop end