Class jPVM

java.lang.Object
   |
   +----jPVM

public abstract class jPVM
extends Object
wrapper class for PVM C library


Variable Index

 o PVM_BYTE
 o PVM_CPLX
 o PVM_DCPLX
 o PVM_DOUBLE
 o PVM_FLOAT
 o PVM_INT
 o PVM_LONG
 o PVM_SHORT
 o PVM_STR
 o PVM_UINT
 o PVM_ULONG
 o PVM_USHORT
 o PvmAllowDirect
 o PvmAlready
 o PvmAutoErr
 o PvmBadMsg
 o PvmBadParam
 o PvmBadVersion
 o PvmCantStart
 o PvmDataDefault
 o PvmDataFoo
 o PvmDataInPlace
 o PvmDataRaw
 o PvmDebugMask
 o PvmDontRoute
 o PvmDSysErr
 o PvmDupEntry
 o PvmDupGroup
 o PvmDupHost
 o PvmFragSize
 o PvmHostAdd
 o PvmHostCompl
 o PvmHostDelete
 o PvmHostFail
 o PvmMismatch
 o PvmMppFront
 o PvmNoBuf
 o PvmNoData
 o PvmNoEntry
 o PvmNoFile
 o PvmNoGroup
 o PvmNoHost
 o PvmNoInst
 o PvmNoMem
 o PvmNoParent
 o PvmNoSuchBuf
 o PvmNoTask
 o PvmNotImpl
 o PvmNotInGroup
 o PvmNullGroup
 o PvmOk
 o PvmOutOfRes
 o PvmOutputCode
 o PvmOutputTid
 o PvmOverflow
 o PvmPollConstant
 o PvmPollSleep
 o PvmPollTime
 o PvmPollType
 o PvmPvmTaskChild
 o PvmResvTids
 o PvmRoute
 o PvmRouteDirect
 o PvmSelfOutputCode
 o PvmSelfOutputTid
 o PvmSelfTraceCode
 o PvmSelfTraceTid
 o PvmShowTids
 o PvmSysErr
 o PvmTaskArch
 o PvmTaskDebug
 o PvmTaskDefault
 o PvmTaskExit
 o PvmTaskHost
 o PvmTaskSelf
 o PvmTaskTrace
 o PvmTraceCode
 o PvmTraceTid

Constructor Index

 o jPVM()

Method Index

 o addhosts(String[], int[])
Adds the computers named in hosts to the configuration of computers making up the virtual machine.
 o barrier(String, int)
Blocks the calling process until count members of the group have called barrier().
 o bcast(String, int)
Broadcasts a message stored in the active send buffer to all members of group.
 o bufinfo(int, Integer, Integer, Integer)
Returns information about the requested message buffer.
 o delete(String, int)
Deletes entry <name, index> from the pvmd database.
 o delhosts(String[], int[])
Deletes the computers named in hosts from the existing virtual machine configuration.
 o exit()
Tells the local pvmd that this process is leaving PVM.
 o freebuf(int)
Frees the memory associated with the specified message buffer, bufid.
 o getinst(String, int)
Returns the unique instance number corresponding to the task identified by tid in the group identified by group.
 o getopt(int)
Returns value of libpvm options.
 o getrbuf()
Returns the message buffer identifier bufid for the active receive buffer, or 0 if there is no current buffer.
 o getsbuf()
Returns the message buffer identifier bufid for the active send buffer, or 0 if there is no current buffer.
 o gettid(String, int)
Returns the tid of the PVM process identified by the group name group and the instance number inum.
 o gsize(String)
k
 o halt()
 o initsend(int)
 o joingroup(String)
 o kill(int)
 o lvgroup(String)
 o mcast(int[], int)
 o mkbuf(int)
 o mstat(String)
 o mytid()
 o notify(int, int, int[])
 o nrecv(int, int)
 o parent()
 o perror(String)
 o pkboolean(boolean[], int, int)
 o pkbyte(byte[], int, int)
 o pkcplx(float[], int, int)
 o pkdcplx(double[], int, int)
 o pkdouble(double[], int, int)
 o pkfloat(float[], int, int)
 o pkint(int[], int, int)
 o pklong(long[], int, int)
 o pkshort(short[], int, int)
 o pkstr(String)
 o precv(int, int, byte[], int, int, Integer, Integer, Integer)
 o probe(int, int)
 o psend(int, int, byte[], int, int)
 o pstat(int)
 o recv(int, int)
 o reg_hoster()
 o reg_tasker()
 o send(int, int)
 o sendsig(int, int)
 o setopt(int, int)
 o setrbuf(int)
 o setsbuf(int)
 o spawn(String, String[], int, String, int[])
 o start_pvmd(int, String[], int)
 o tidtohost(int)
 o trecv(int, int, int, int)
 o upkboolean(boolean[], int, int)
 o upkbyte(byte[], int, int)
 o upkcplx(float[], int, int)
 o upkdcplx(double[], int, int)
 o upkdouble(double[], int, int)
 o upkfloat(float[], int, int)
 o upkint(int[], int, int)
 o upklong(long[], int, int)
 o upkshort(short[], int, int)
 o upkstr()
Same as jPVM.upkstr(int), but with default character array size of 256 characters (sufficient for most applications).
 o upkstr(char[])
 o upkstr(int)
Allocates an internal character array of size characters, calls native method jPVM.

Variables

 o PvmDataDefault
 public static final int PvmDataDefault
 o PvmDataRaw
 public static final int PvmDataRaw
 o PvmDataInPlace
 public static final int PvmDataInPlace
 o PvmDataFoo
 public static final int PvmDataFoo
 o PvmTaskDefault
 public static final int PvmTaskDefault
 o PvmTaskHost
 public static final int PvmTaskHost
 o PvmTaskArch
 public static final int PvmTaskArch
 o PvmTaskDebug
 public static final int PvmTaskDebug
 o PvmTaskTrace
 public static final int PvmTaskTrace
 o PvmMppFront
 public static final int PvmMppFront
 o PvmHostCompl
 public static final int PvmHostCompl
 o PvmTaskExit
 public static final int PvmTaskExit
 o PvmHostDelete
 public static final int PvmHostDelete
 o PvmHostAdd
 public static final int PvmHostAdd
 o PvmRoute
 public static final int PvmRoute
 o PvmDontRoute
 public static final int PvmDontRoute
 o PvmAllowDirect
 public static final int PvmAllowDirect
 o PvmRouteDirect
 public static final int PvmRouteDirect
 o PvmDebugMask
 public static final int PvmDebugMask
 o PvmAutoErr
 public static final int PvmAutoErr
 o PvmOutputTid
 public static final int PvmOutputTid
 o PvmOutputCode
 public static final int PvmOutputCode
 o PvmTraceTid
 public static final int PvmTraceTid
 o PvmTraceCode
 public static final int PvmTraceCode
 o PvmFragSize
 public static final int PvmFragSize
 o PvmResvTids
 public static final int PvmResvTids
 o PvmSelfOutputTid
 public static final int PvmSelfOutputTid
 o PvmSelfOutputCode
 public static final int PvmSelfOutputCode
 o PvmSelfTraceTid
 public static final int PvmSelfTraceTid
 o PvmSelfTraceCode
 public static final int PvmSelfTraceCode
 o PvmShowTids
 public static final int PvmShowTids
 o PvmPollType
 public static final int PvmPollType
 o PvmPollConstant
 public static final int PvmPollConstant
 o PvmPollSleep
 public static final int PvmPollSleep
 o PvmPollTime
 public static final int PvmPollTime
 o PvmTaskSelf
 public static final int PvmTaskSelf
 o PvmPvmTaskChild
 public static final int PvmPvmTaskChild
 o PvmOk
 public static final int PvmOk
 o PvmBadParam
 public static final int PvmBadParam
 o PvmMismatch
 public static final int PvmMismatch
 o PvmOverflow
 public static final int PvmOverflow
 o PvmNoData
 public static final int PvmNoData
 o PvmNoHost
 public static final int PvmNoHost
 o PvmNoFile
 public static final int PvmNoFile
 o PvmNoMem
 public static final int PvmNoMem
 o PvmBadMsg
 public static final int PvmBadMsg
 o PvmSysErr
 public static final int PvmSysErr
 o PvmNoBuf
 public static final int PvmNoBuf
 o PvmNoSuchBuf
 public static final int PvmNoSuchBuf
 o PvmNullGroup
 public static final int PvmNullGroup
 o PvmDupGroup
 public static final int PvmDupGroup
 o PvmNoGroup
 public static final int PvmNoGroup
 o PvmNotInGroup
 public static final int PvmNotInGroup
 o PvmNoInst
 public static final int PvmNoInst
 o PvmHostFail
 public static final int PvmHostFail
 o PvmNoParent
 public static final int PvmNoParent
 o PvmNotImpl
 public static final int PvmNotImpl
 o PvmDSysErr
 public static final int PvmDSysErr
 o PvmBadVersion
 public static final int PvmBadVersion
 o PvmOutOfRes
 public static final int PvmOutOfRes
 o PvmDupHost
 public static final int PvmDupHost
 o PvmCantStart
 public static final int PvmCantStart
 o PvmAlready
 public static final int PvmAlready
 o PvmNoTask
 public static final int PvmNoTask
 o PvmNoEntry
 public static final int PvmNoEntry
 o PvmDupEntry
 public static final int PvmDupEntry
 o PVM_STR
 public static final int PVM_STR
 o PVM_BYTE
 public static final int PVM_BYTE
 o PVM_SHORT
 public static final int PVM_SHORT
 o PVM_INT
 public static final int PVM_INT
 o PVM_FLOAT
 public static final int PVM_FLOAT
 o PVM_CPLX
 public static final int PVM_CPLX
 o PVM_DOUBLE
 public static final int PVM_DOUBLE
 o PVM_DCPLX
 public static final int PVM_DCPLX
 o PVM_LONG
 public static final int PVM_LONG
 o PVM_USHORT
 public static final int PVM_USHORT
 o PVM_UINT
 public static final int PVM_UINT
 o PVM_ULONG
 public static final int PVM_ULONG

Constructors

 o jPVM
 public jPVM()

Methods

 o addhosts
 public static native int addhosts(String hosts[],
                                   int infos[])
Adds the computers named in hosts to the configuration of computers making up the virtual machine. The names should have the same syntax as lines of a pvmd hostfile (see man page for pvmd3): A host name followed by options of the form xx=y.

Parameters:
hosts - An array of Strings naming the hosts to be added. Pvmd must already be installed and the user must have an account on the specified hosts.
infos - An integer array of length equal to hosts which returns the status for each host. Values less than zero indicate an error, while positive values are TIDS of the new hosts.
Returns:
status code. If addhosts() is successfull, info will be equal to hosts.length. Partial success if indicated by 0 < info < hosts.length and total failure by info < 1. The array infos can be checked to determine which host caused the error.
See Also:
mstat, config
 o barrier
 public static native int barrier(String group,
                                  int count)
Blocks the calling process until count members of the group have called barrier(). The count argument is required because processes could be joining the given group after other processes have called barrier(). Thus, PVM doesn't know how many group member to wait for at any given instant. Although count can be set less, it is typically the total number of members of the group. So, the logical function of the barrier() call is to provide a group synchronization. During any given barrier call, all participating group members must call barrier() with the same count value. Once a given barrier has been successfully passed, barrier() may be called again by the same group using the same group name.

Parameters:
group - Character string group name. The group must exist and the calling process must be a member of the group.
count - Integer specifying the number of group members that must call barrier() before they are all released. Though not required, count is expected to be the total number of members of the specified group.
Returns:
status code. If barrier() is successful, info will be 0. If some error occurs, then info will be < 0.
See Also:
joingroup
 o bcast
 public static native int bcast(String group,
                                int msgtag)
Broadcasts a message stored in the active send buffer to all members of group. The broadcast messages is not sent back to the sender. Any PVM task can call bcast(), it need not be a member of the group. The content of the message can be distinguished by msgtag.

bcast() is asynchronoous. Computation on the sending processor resumes as soon as the message is safely on its way to the receiving processors. This is in contrast to synchronous communication, during which computation on the sending processor halts until a matching receive is executed by all the receiving processors.

bcast() first determines the tids of the group members by checking the group data base. A multicast is performed to these tids. If the group is changed during a broadcast, the change will not be reflected in the broadcast. Multicasting is not supported by most multiprocessor vendors. Typically, their native calls only support broadcasting to all the user's processes on a multiprocessor. Because of this omission, bcast() may not be an efficient communication method on some multiprocessors.

Parameters:
group - Character string group name of an existing group
msgtag - Integer message tag supplied by user. msgage tag should be >=0. It allows the user's program to distinguish between different kinds of messages.
Returns:
status code. Values less than zero indicate an error.
See Also:
joingroup
 o bufinfo
 public static native int bufinfo(int bufid,
                                  Integer bytes,
                                  Integer msgtag,
                                  Integer tid)
Returns information about the requested message buffer. Typically it is used to determing facts about the last received messages such as its size of source. bufinfo() is especially useful when an application is able to receive an incoming message, and the action taken depends on the source tid and the msgtag associated with the message that comes in first.

jPVM note: Note that the parameters bytes, msgtag, and tid are all passed as Integers. Upon succesful completion, use their intValue() method to get the actual values for those parameters.

Parameters:
bufid - int specifying a particular message buffer identifier.
bytes - Integer return the length in byts of the entire message.
msgtag - Integer returning the message label. Useful when the message was received with a wildcard msgtag (-1).
tid - Integer returning the source of the message. Useful when the message was received with a wildcard tid (-1).
Returns:
Status code: Values less than zero indicate an error.
 o delete
 public static native int delete(String name,
                                 int index)
Deletes entry <name, index> from the pvmd database.

Parameters:
name - The class name, a null-terminated string
index - The class index, >=0.
Returns:
Status code: If successful, delete() returns PvmOk, otherwise it returns a negative error code.
See Also:
insert, lookup
 o delhosts
 public static native int delhosts(String hosts[],
                                   int infos[])
Deletes the computers named in hosts from the existing virtual machine configuration. All PVM processses and the pvmd running on these computers are killed as the computer is deleted. If a host failes, PVM will continue to function and will automatically delete the host from the virtual machine. An application can be notified of a host failure through notify(). It is still the responsibility of the application developer to make an application tolerant of host failure.

Parameters:
hosts - An array of Strings containing the names of the machines to be deleted.
infos - int array of same length as hosts which contains the status code returned by the router for the individual hosts. Values less than zero in this array indicate an error.
Returns:
Status code: If delhosts() is successful, return value info will equal hosts.length. Partial success is indicated by 1<=info<hosts.length, and total failure by info<1. The array infos can be checked to determine which host caused the error.
See Also:
addhosts, notify
 o exit
 public static native int exit()
Tells the local pvmd that this process is leaving PVM. This routine does not kill the process, which can continue to perform tasks just like any other serial process.

jPVM.exit() should be called by all PVM processes before they stop or exit for good. It must be called by processes that were not started with jPVM.spawn().

Returns:
Status code: Values less than zero indicate an error.
 o freebuf
 public static native int freebuf(int bufid)
Frees the memory associated with the specified message buffer, bufid. Message buffers are created using mkbuf(), initsend(), and recv(). See PVM version for full discussion of buffer use.

Returns:
Status code: Values less than 0 indicate an erro.
See Also:
mkbuf, initsend, recv
 o getinst
 public static native int getinst(String group,
                                  int tid)
Returns the unique instance number corresponding to the task identified by tid in the group identified by group.

Returns:
Status code: Values less than zero indicate an error.
See Also:
joingroup, gettid
 o getopt
 public static native int getopt(int what)
Returns value of libpvm options. what defines which option value to return. See PVM description for full details.

See Also:
setopt
 o getrbuf
 public static native int getrbuf()
Returns the message buffer identifier bufid for the active receive buffer, or 0 if there is no current buffer.

See Also:
getsbuf
 o getsbuf
 public static native int getsbuf()
Returns the message buffer identifier bufid for the active send buffer, or 0 if there is no current buffer.

See Also:
getrbuf
 o gettid
 public static native int gettid(String group,
                                 int inum)
Returns the tid of the PVM process identified by the group name group and the instance number inum.

Returns:
Status code: 0 if succesful, less than zero for errors.
See Also:
joingroup, getinst
 o gsize
 public static native int gsize(String group)
k

 o halt
 public static native int halt()
 o initsend
 public static native int initsend(int format)
 o joingroup
 public static native int joingroup(String group)
 o kill
 public static native int kill(int tid)
 o lvgroup
 public static native int lvgroup(String group)
 o mcast
 public static native int mcast(int tids[],
                                int msgtag)
 o mkbuf
 public static native int mkbuf(int encoding)
 o mstat
 public static native int mstat(String host)
 o mytid
 public static native int mytid()
 o notify
 public static native int notify(int what,
                                 int msgtag,
                                 int tids[])
 o nrecv
 public static native int nrecv(int tid,
                                int msgtag)
 o parent
 public static native int parent()
 o pkboolean
 public static native int pkboolean(boolean xp[],
                                    int nitem,
                                    int stride)
 o pkbyte
 public static native int pkbyte(byte xp[],
                                 int nitem,
                                 int stride)
 o pkcplx
 public static native int pkcplx(float cp[],
                                 int nitem,
                                 int stride)
 o pkdcplx
 public static native int pkdcplx(double zp[],
                                  int nitem,
                                  int stride)
 o pkdouble
 public static native int pkdouble(double dp[],
                                   int nitem,
                                   int stride)
 o pkfloat
 public static native int pkfloat(float fp[],
                                  int nitem,
                                  int stride)
 o pkint
 public static native int pkint(int ip[],
                                int nitem,
                                int stride)
 o pklong
 public static native int pklong(long ip[],
                                 int nitem,
                                 int stride)
 o pkshort
 public static native int pkshort(short jp[],
                                  int nitem,
                                  int stride)
 o pkstr
 public static native int pkstr(String sp)
 o perror
 public static native int perror(String msg)
 o precv
 public static native int precv(int tid,
                                int msgtag,
                                byte buf[],
                                int len,
                                int datatype,
                                Integer atid,
                                Integer atag,
                                Integer alen)
 o probe
 public static native int probe(int tid,
                                int msgtag)
 o psend
 public static native int psend(int tid,
                                int msgtag,
                                byte buf[],
                                int len,
                                int datatype)
 o pstat
 public static native int pstat(int tid)
 o recv
 public static native int recv(int tid,
                               int msgtag)
 o reg_hoster
 public static native int reg_hoster()
 o reg_tasker
 public static native int reg_tasker()
 o send
 public static native int send(int tid,
                               int msgtag)
 o sendsig
 public static native int sendsig(int tid,
                                  int signum)
 o setopt
 public static native int setopt(int what,
                                 int val)
 o setrbuf
 public static native int setrbuf(int bufid)
 o setsbuf
 public static native int setsbuf(int bufid)
 o spawn
 public static native int spawn(String task,
                                String argv[],
                                int flag,
                                String where,
                                int tids[])
 o start_pvmd
 public static native int start_pvmd(int argc,
                                     String argv[],
                                     int block)
 o tidtohost
 public static native int tidtohost(int tid)
 o trecv
 public static native int trecv(int tid,
                                int msgtag,
                                int sec,
                                int usec)
 o upkboolean
 public static native int upkboolean(boolean xp[],
                                     int nitem,
                                     int stride)
 o upkbyte
 public static native int upkbyte(byte xp[],
                                  int nitem,
                                  int stride)
 o upkcplx
 public static native int upkcplx(float xp[],
                                  int nitem,
                                  int stride)
 o upkdcplx
 public static native int upkdcplx(double xp[],
                                   int nitem,
                                   int stride)
 o upkdouble
 public static native int upkdouble(double xp[],
                                    int nitem,
                                    int stride)
 o upkfloat
 public static native int upkfloat(float xp[],
                                   int nitem,
                                   int stride)
 o upkint
 public static native int upkint(int xp[],
                                 int nitem,
                                 int stride)
 o upklong
 public static native int upklong(long xp[],
                                  int nitem,
                                  int stride)
 o upkshort
 public static native int upkshort(short xp[],
                                   int nitem,
                                   int stride)
 o upkstr
 public static native int upkstr(char sp[])
 o upkstr
 public static String upkstr(int size)
Allocates an internal character array of size characters, calls native method jPVM. upkstr(char[]), and converts the resulting contents of the character array to a String with excess white-space trimmed off.

If you can live with a default size of 256 characters in the character array, you can simply call jPVM.upkstr().

If you want complete control over the character array allocation (e.g., you want to use one array over and over for String unpacking, use jPVM.upkstr(char[]).

Parameters:
size - - Size of character array to use for unpacking from PVM buffer. Should be greater than or equal to length of maximum expected string (including null terminator).
Returns:
String allocated from character array with excess trailing white space trimmed off.
See Also:
upkstr, upkstr
 o upkstr
 public static String upkstr()
Same as jPVM.upkstr(int), but with default character array size of 256 characters (sufficient for most applications).

If you want greater control over the amount of memory allocated for Strings (e.g., you need larger Strings, or know you'll never need Strings that large, use jPVM.upkstr(int).

If you want complete control over the character array allocation (e.g., you want to use one array over and over for String unpacking), use jPVM.upkstr(char[]).

Returns:
String allocated from character array with excess trailing white space trimmed off.
See Also:
upkstr, upkstr