ptME: Message-passing utilities.

ptMEinit,ptMEinitSrvrs,ptMEinitCons,ptMEsend,ptMErecv,ptMEclose, ptMEtest,ptMEtestWrkrR Documentation

Message-passing utilities.

Description

Simple MPI-like functions.

Usage

ptMEinit(cls)
ptMEinitSrvrs()
ptMEinitCons(srvr)
ptMEsend(obj,dest)
ptMErecv(dest)

Arguments

cls

A cluster for the parallel package.

srvr

A server, one of the worker nodes.

src

A worker node from which to receive a message.

dest

A worker node to which a message is to be sent.

obj

An R object.

Details

This system of functions implements a message-passing system, similar to MPI/Rmpi but much simpler and without the need for configuration.

Functions:

  • ptMEinit: General system initialization.

  • ptMEinitSrvrs: Called by ptMEinit. Sets up socket connections for each pair of worker nodes. Each worker node hosts a server for use by all nodes having partoolsenv$myid less than the server. Returns the server port.

  • ptMEinitCons: Also called by ptMEinit. Each worker node, acting as a client, makes a connection with all servers having partoolsenv$myid greater than the client.

  • ptMEsend: Send the given object to the given destination.

  • ptMErecv: Receive an object from the given source. Returns the received object.

  • ptMEclose: Close all worker-worker connections.

Value

The function ptMErecv() returns the received value. The intermediate function ptMEinitSrvrs returns a randomly chosen server port number.

Author(s)

Robin Yancey, Norm Matloff


matloff/partools documentation built on Oct. 20, 2022, 2:52 p.m.