NXS Message-Passing Library
The NXS library is a small subset of the NX library provided by
Intel Corporation for their parallel computers.
The NXS library was developed for use with the
UNH C* system.
However, it can also be used for "directly" programming the
Galaxy
cluster.
The NXS library provides the following primitives:
- long numnodes(void): returns the number of processors
participating in the parallel computation.
- long mynode(void): returns the logical number
(0 ... numnodes()-1) of the processor executing the
call.
- void csend(long type, char *buf, long len, long node,
long pid): sends a message to another processor. This is
a non-blocking send: the message will be copied and queued for
transmission; return of this function does not imply the message
has been received at the destination processor.
A description of the parameters follows:
- type - user specified message type that can be used by the receiver to
selectively receive messages.
- buf - source of message, which must be a string of contiguous bytes.
- len - length of the message, which must not exceed NXS_MESSAGE_LIMIT.
- node - logical number of the destination processor.
- pid - should always be set to zero.
Note: It is considered an error for a node to send
a message to itself.
- void crecv(long typesel, char *buf, long len): receive
a message. This is a blocking send: the function will not return until
a message with the matching type is received and copied to the given
buffer.
A type selector of -1 matches any message.
A description of the parameters follows:
- typesel - message type selector.
- buf - buffer in which to place the message.
- len - length of the buffer.
Note: it is an error to receive a message that is longer than the length
of the buffer.
- long iprobe(long typesel): check for the availability
of a message matching the given type selector. Returns 1 is a matching
message is available; returns 0 otherwise. A type selector of -1 matches
any message.
- long infocount(void): returns the length of the last
message received by crecv or detected by iprobe.
- long infonode(void): returns the node that sent the last
message received by crecv or detected by iprobe.
- long infotype(void): returns the type of the last
message received by crecv or detected by iprobe.
- void gsync(void): the function synchronizes all processors
participating in the parallel computation. All processors must call this
function together, otherwise the computation will block forever.
IMPORTANT: Either numnodes() or
mynode() must be called before any other NXS primitive.
These routines will initialize the message-passing library, if it is not
already initialized.
You should include nxs.h in any source file using the
NXS library.
Programs using NXS should be linked with both the NXS library (-lnxs)
and with the "dedicated buffers" library (-lded).
NXS programs should be executed using the pshell utility.
See the Galaxy
cluster webpage for details.
Last modified on October 6, 1997.
Comments and questions should be directed to
pjh@cs.unh.edu