S-Lang PVM Module Reference: PVM Module Function Reference

Next Previous Contents

## 5. PVM Module Function Reference

## 5.1 pvm_send_obj

Synopsis

  Pack and send data objects

Usage

  `pvm_send (Int_Type tid, Int_Type msgid, object [,...])`

Description

  This function is much like `pvm_psend` except that it sends additional type information with each object. Using this function paired with `pvm_recv_obj` simplifies sending aggregate data objects such as structures and removes the need for the receiver to specify datatypes explicitly.

Example

  To send a S-lang structure to another process:

  > `

  >       variable obj = struct {name, x, y, data};
  >       ...
  >       pvm_send_obj (tid, msgid, obj);

  > `

See Also

  `pvm_recv_obj, pvm_psend, pvm_unpack`

## 5.2 pvm_recv_obj

Synopsis

  Receive data objects from `pvm_send_obj`

Usage

  `obj = pvm_recv_obj ()`

Description

  This function receives an object sent by `pvm_send_obj` and returns a slang object of the same type that was sent. It simplifies sending aggregate data types such as structures.

Example

  To receive a S-lang object sent by another process via `pvm_send_obj`:

  > `

  >       obj = pvm_recv_obj ();

  > `

See Also

  `pvm_send_obj, pvm_psend, pvm_unpack`

## 5.3 pvm_config

Synopsis

  Returns information about the present virtual machine configuration

Usage

  `Struct_Type = pvm_config ()`

Description

  See the PVM documentation.

Example

  > `

  >       h = pvm_config ();

  > `

See Also

  `pvm_kill`

## 5.4 pvm_kill

Synopsis

  Terminates a specified PVM process

Usage

  `pvm_kill (Int_Type tid)`

Description

  See the PVM documentation.

Example

  > `

  >       pvm_kill (tid);

  > `

See Also

  `pvm_config`

## 5.5 pvm_initsend

Synopsis

  Clear default send buffer and specify message encoding

Usage

  `bufid = pvm_initsend (Int_Type encoding)`

Description

  See the PVM documentation.

Example

  > `

  >       bufid = pvm_initsend (PvmDataDefault);

  > `

See Also

  `pvm_send`

## 5.6 pvm_pack

Synopsis

  Pack the active message buffer with arrays of prescribed data type

Usage

  `pvm_pack (object)`

Description

  See the PVM documentation.

Example

  > `

  >       pvm_pack (x);

  > `

See Also

  `pvm_unpack`

## 5.7 pvm_send

Synopsis

  Immediately sends the data in the active message buffer

Usage

  `pvm_send (Int_Type, tid, Int_Type msgid)`

Description

  See the PVM documentation.

Example

  > `

  >       pvm_send (tid, msgid);

  > `

See Also

  `pvm_recv`

## 5.8 pvm_recv

Synopsis

  Receive a message

Usage

  `bufid = pvm_recv (Int_Type tid, Int_Type msgtag)`

Description

  See the PVM documentation.

Example

  > `

  >        bufid = pvm_recv (tid, msgtag);

  > `

See Also

  `pvm_send`

## 5.9 pvm_unpack

Synopsis

  Unpack the active message buffer into arrays of prescribed data type

Usage

  `item = pvm_unpack (Int_Type type_id, Int_Type num)`

Description

  See the PVM documentation.

Example

  > `

  >       item = pvm_unpack (type, num);

  > `

See Also

  `pvm_pack`

## 5.10 pvm_psend

Synopsis

  Pack and send data

Usage

  `pvm_psend (Int_Type tid, Int_Type msgid, object [,...])`

Description

  See the PVM documentation.

Example

  > `

  >       pvm_psend (tid, msgid, data);

  > `

Notes

  Unlike the `pvm_send` function in the PVM library, this function does not operate asynchronously.

See Also

  `pvm_send, pvm_initsend, pvm_pack, pvm_recv`

## 5.11 pvm_addhosts

Synopsis

  Add one or more hosts to the PVM server

Usage

  `Int_Type[] = pvm_addhosts (String_Type[] hosts)`

Description

  See the PVM documentation.

Example

  > `

  >       tids = pvm_addhosts (["vex", "verus", "aluche"]);

  > `

See Also

  `pvm_addhosts, pvm_config, pvm_delhosts`

## 5.12 pvm_delhosts

Synopsis

  Delete one or more hosts from the PVM server

Usage

  `pvm_delhosts (String_Type[] hosts)`

Description

  See the PVM documentation.

Example

  > `

  >       pvm_delhosts (["vex", "verus"]);

  > `

See Also

  `pvm_delhosts, pvm_config, pvm_kill`

Next Previous Contents