Chapter 2. PVM Functionality

This chapter describes the Message Passing Toolkit (MPT) implementation of the Parallel Virtual Machine (PVM) software. The following concepts are discussed:

Multiple Computer Systems As a Virtual Machine

PVM is a software system that enables a collection of heterogeneous computer systems to be used as a coherent and flexible concurrent computation resource. The individual systems can be shared-memory or local-memory multiprocessors, vector supercomputers, specialized graphics engines, or scalar workstations interconnected by a variety of networks. From the user's point of view, the combination of these different systems can be treated as a single virtual machine when using PVM. The term host refers to one of the member computer systems.

PVM support software executes on each system in a user-configurable pool and presents a unified, general, and powerful computational environment for concurrent applications. User programs, written in C or Fortran programming languages, gain access to PVM in the form of library routines for functions such as the following:

  • Process or task initiation

  • Message transmission and reception

  • Synchronization through the use of barriers or rendezvous

Optionally, users can control the execution location of specific application components; the PVM system transparently handles message routing, data conversion for incompatible architectures, and other tasks that are necessary for operation in a heterogeneous, networked environment.

Applications and Environments

PVM is ideally suited for concurrent applications composed of many interrelated subalgorithms, although performance is good even for traditional parallel applications. PVM is particularly effective for heterogeneous applications that exploit specific strengths of individual systems on a network. As a loosely coupled, concurrent supercomputing environment, PVM is a viable scientific computing platform.

PVM has been used for molecular dynamics simulations, superconductivity studies, distributed fractal computations, matrix algorithms, and as the basis for teaching concurrent programming.

PVM Program Development

To develop a program that uses PVM, you must perform the following steps:

Procedure 2-1.

  1. Add PVM function calls to your application for process initiation, communications, and synchronization. For syntax descriptions of these functions, see Chapter 4, “Functions and Subroutines”.

  2. Build executable files for the systems that you will use, as described in “Building PVM Executable Files”.

  3. Create a host file to define the virtual machine, as described in “Creating Host Files”.

  4. If your program is in distributed mode, execute the PVM daemon and your application in one of the following ways:

  5. If your application is in stand-alone mode, execute it as described in “Running PVM in Stand-alone Mode on UNICOS Systems”, or Chapter 3, “UNICOS/mk Implementation”.

  6. Troubleshoot the application, if necessary. For information on PVM troubleshooting, see “Troubleshooting PVM”.

  7. Optimize the application as described in “Optimizing Use of PVM”.

Building PVM Executable Files

After you have added PVM function calls, a simple UNICOS PVM code can be linked as follows:

cc -o compute -lpvm3 compute.o

This command links the compute.o object code with the PVM library and creates an executable file named compute.

For IRIX systems, if you begin with the source file, you must specify the -I (include) option and the Application Binary Interface (ABI) of the application development library (N32 or 64 ABIs), as follows:

cc -I /usr/array/PVM/include -64 -o compute compute.c -lpvm3

For IRIX systems, if you begin with an object file, the code can be linked as follows:

cc -64 -o compute compute.o -lpvm3

If you have the optional IRIX mpt module loaded, use the following command:

cc -64 -o compute compute.c -lpvm3

After the code is linked, you can install the executable files on the Silicon Graphics systems you will be using. If you specified the ep option in the host file for a system, install the file in the specified directory. Otherwise, install it in the following directory:

$HOME/pvm3/bin/$PVM_ARCH

Creating Host Files

Each system in the PVM virtual machine must have a separate entry in the host file. Lines that begin with a hash symbol (#), possibly preceded by white space, are ignored.

If you do not want PVM to start a host immediately, but you might start it later by using the pvm_addhosts(3) function or the PVM console add command, you do not need to include the host in the host file. However, if you need to set any of the options described in Table 2-1, you should include the specified system in the host file, preceded by the ampersand (&) character.

A simple host file can be created automatically on UNICOS systems if NQE load balancing is available. Start the PVM daemon with the following command:

pvmd3 -h &

This command starts the PVM daemon in the background and tells it that automatic host file selection should be used. On UNICOS systems, the PVM daemon queries the load balancing server for available hosts and includes all available hosts in your virtual machine. Available hosts are determined by the PVM policy in NQE or by a policy specified in the PVM_POLICY environment variable. Hosts can be excluded based on many different resources. For more information on NQE policies, see NQE Administration. If a host file is also specified, PVM uses the options specified in the host file. A host specified in the host file will be included in the virtual machine only if that host is available, as determined by the NQE policy.

Example 2-1, is an example of a host file that contains the names of systems, which is the basic information necessary in a host file.

Example 2-1. Simple Host File

# my first host file
thud
fred
wilma
gust.cray.com
rain 

You should verify that no system is listed more than once, and that the system on which the master pvmd3(1) daemon will run (the master host) is included in the host file (see “Starting and Stopping the PVM Daemon”, for information on starting the pvmd3 daemon). Automatic host file selection always includes the host running the master pvmd3(1) daemon.

The $PVM_ROOT and $PVM_ARCH environment variables are set for you automatically when you load the mpt module to access the Message Passing Toolkit software. To customize your environment, you can specify the options listed in Table 2-1, after any system name in the host file.

Table 2-1. Host File Options

Option

Description

bx= dpath

Specifies the debugger path. You can also set this path by using the PVM_DEBUGGER environment variable. The default debugger path is $PVM_ROOT/lib/debugger.

dx= loc

Specifies a location for pvmd3 other than the default, $PVM_ROOT/lib/$PVM_ARCH/pvmd3. This option is useful in debugging new versions of PVM. The loc variable may be a simple file name, an absolute path name, or a path relative to the user's home directory on the remote system.

 

The pvmd3 daemon is installed in $PVM_ROOT/lib/$PVM_ARCH/pvmd3 when the MPT version is installed on Silicon Graphics systems.

ep= paths

Specifies a series of paths to search for application tasks. A percent sign (%) in the path expands to the architecture of the remote system. Multiple paths are separated by a colon (:). By default, PVM looks for application tasks in the following directories: $HOME/pvm3/bin/$PVM_ARCH:$PVM_ROOT/bin/$PVM_ARCH

ip= network_name

Specifies the network name to be used for communication. The default is determined by the network routing, as shown by the netstat -i command. You can use this option to specify HIPPI or another specific device.

lo= userid

Specifies an alternative login name for the system. The default is the login name on the master system.

so=ms

Causes the master pvmd3 daemon to request that you manually start a pvmd3 daemon on a slave system when the rsh(1) and rexec(1) network services are disabled but IP connectivity exists. The default is no request. You cannot start the master system from the PVM console or background when you specify this option. (This option is rarely used.)

so=pw

Causes PVM to prompt for a password on the remote system. This option is useful when you have a different login name and password on a remote system. The master host prompts you for your password, as in the following example:

 

Password(honk.cs.utk.edu:manchek):

 

Type your password for the remote system. The startup will then continue as normal. You cannot start the master host from the PVM console or background when you specify this option.

sp= value

Specifies the relative computational speed of this system compared to other systems in the configuration. value is an integer in the range 1 through 1,000,000. The default is 1000. (This option currently has no effect on PVM operation.)

wd= path

Specifies the path name of a working directory in which all spawned tasks on the host will execute. The default is $HOME.

A dollar sign ($) in an option introduces an environment variable name, for example, $PVM_ARCH. Each PVM daemon expands names from environment variables.

The simple host file in Example 2-1, works well if both of the following conditions are met:

  • You have a login with the same name on all of the systems in your host file.

  • The local system is listed in the .rhosts file on each of the remote systems.

To supply an alternative login name for the thud system, add the lo option to its host file entry, as follows:

thud lo=NAME 

To be queried for your password on a system named cyclone, add so=pw to its host file entry, as follows:

cyclone so=pw

To specify the path of the daemon executable file for a system named sun114, add the dx option, as follows:

sun114 dx=/usr/fred/pvm3/lib/Sun/pvmd3


Note: By default, the MPT version of pvmd3 is installed in $PVM_ROOT/lib/$PVM_ARCH/pvmd3 on Silicon Graphics systems, where $PVM_ROOT and $PVM_ARCH are set for you automatically when you load the mpt module.


The string specified in the previous example is passed to a shell so that variable expansion works. Following is another example that uses variable expansion:

sun114 dx=bin/$MYBIN/pvmd3

You can change the default value of any option for all hosts in a host file by specifying them on a line with an asterisk (*) in the host field, as in the following example:

thud.cs.utk.edu
gust.cray.com
sun114 dx=/tmp/pvmd3
* lo=afriend so=pw

The preceding example sets the default login name (on remote systems) to afriend and queries for a password on each system. Defaults set in this way are effective forward from the location at which they occur in the host file. They can be changed with another * line.

You can override the location of executable files by adding the ep option to your host file entries, as in the following example:

ep=$HOME/pvm3/bin

Unlike the dx option, which names the daemon file, the ep option names a directory.

Example 2-2 shows a more complex host file in which host names are followed by options.

Example 2-2. Sample Host File with Host Name Options

# host file for testing on various platforms
# default to my executable
*                  dx=pvm/SUN4/pvmd3
fonebone
refuge
sigi.cs            dx=pvm/PMAX/pvmd3
# reset default for other systems
*                  dx=$PVM_ROOT/lib/$PVM_ARCH/pvmd3
# do not start this system, but define ep in case we add it later
& rain.cray.com  ep=$(HOME)/bin ip=rain-hippi
# borrowed accts, "guest", don't trust fonebone
*                  lo=guest  so=pw
sn666.jrandom.com  ep=$(HOME)/bin
cubie.misc.edu     ep=pvm/IPSC/pvmd3


Specifying Architecture Types

Before you run a PVM executable file on an IRIX system, you must specify the architecture type by setting the PVM_ARCH environment variable. Four architecture types are supported for IRIX systems. With the software installed in the default locations, you must also set the PVM_ROOT environment variable to /usr/array/PVM and the PATH environment variable to $PVM_ROOT/lib/$PVM_ARCH. The following C shell example shows the setting of all three variables:

setenv PVM_ARCH SGIMP64
setenv PVM_ROOT /usr/array/PVM
setenv PATH ${PATH}:${PVM_ROOT}/lib/$PVM_ARCH

The architecture types shown in the following list are arranged in an approximate order of lowest to highest performance types:

Architecture type 

Description

SGI32 

N32 ABI/MIPS III version using sockets

SGI32mips4 

N32 ABI/MIPS IV version using sockets

SGIMP64mips3 

64 ABI/MIPS III version using POSIX shared memory and sockets

SGIMP64 

64 ABI/MIPS IV version using POSIX shared memory and sockets

Starting and Stopping the PVM Daemon

After you have written a host file, you can start up the master pvmd3(1) daemon by passing it the host file as an argument. You must specify the appropriate path for pvmd3(1). On a Silicon Graphics system, for example, you can enter one of the following:

pvmd3 hostfile &orpvm [hostfile]

If you do not specify a host file when starting the PVM console, the PVM daemon found in the default location will be started on the local machine.

The ampersand (&) in the first line tells the operating system to run pvmd3(1) in the background, which is what you will normally want to do.

You should not run pvmd3(1) in the background if you have to enter passwords for any of the slave systems (that is, if you included the so=pw option for one or more systems). In this case, run pvmd3(1) in the foreground and then stop it (by pressing CONTROL-Z) and put it in the background (by entering bg at the prompt) after all systems have started up.

To shut off PVM, enter halt at a PVM console prompt. For detailed information on using console prompts, see “Using Console Commands”.

If the master pvmd3(1) daemon has trouble starting a slave pvmd3(1) daemon on a system, the error message written to the PVM log file from the master pvmd3(1) may indicate the problem.

Running PVM Applications

When the pvmd3(1) daemon is running successfully, you can start your application. PVM provides the following methods of starting applications:

  • Start the application from the shell command line.

    With this method, you start the application as any command or application would be started. For example, if the application is named a.out, enter the following command at the shell command line prompt:

    ./a.out

  • Start the application from the PVM console by using the spawn command.

    With this method, you first start the console. After the pvm> prompt has appeared, enter the spawn command followed by the application name or path, as needed. For example, to run an application named cannon, enter the following command at the console command line prompt:

    spawn cannon

You can obtain help for the spawn command by typing help spawn at the console command line prompt.

Once the application has started, it displays standard output and standard error information for the initial task, but not for the other tasks in the application. PVM captures this output information and sends it to the master daemon. The daemon, in turn, prefaces each line with a PVM task identifier that identifies its source, and writes it to the PVM log file.

The log file can contain very useful information about the virtual machine and its tasks. By default, the log file contains output from the PVM daemon, including error messages and output from tasks. Optionally, the log file can contain debugging output from the daemon.

When PVM is run without NQS, the log file is located in /tmp. When PVM is run without NQE on UNICOS and UNICOS/mk systems, the log file is located in /tmp/pvml.uid, where uid is the user ID. The IRIX implementation allows overlapping PVM virtual machines. Therefore, more than one PVM daemon started by the same user can run on the same host. The log file is located in /tmp/pvml.uid.vmid, where uid is the user ID and vmid is the virtual machine ID. By default, is 0, but if the PVM_VMID (formerly PVMJID) environment variable is set, vmid will equal the numeric value of PVM_VMID.

When PVM is run using NQS on UNICOS and UNICOS/mk systems, the name of the log file is $TMPDIR/pvml.uid. $TMPDIR is a temporary directory created for the NQS job. You can examine this file at any time, but remember that each task buffers the output written to standard output independently (unless you flush the output after each write request), and so the sequence of output from two different tasks may vary.

Instead of having the data written to the PVM log file, you can request that output be sent as a PVM message to another task's output device. For more information, see the PvmOutputTid and PvmOutputCode options on the pvm_setopt(3) man page.

You can also redirect output by using options on the console spawn command (see Table 2-2) or by using the pvm_catchout(3) function. For more information about running your program in stand-alone mode, see “Running PVM in Stand-alone Mode on UNICOS Systems”, or Chapter 3, “UNICOS/mk Implementation”.

Using NQS to Run PVM Applications

On UNICOS, UNICOS/mk, and IRIX systems, PVM applications can be run as part of an NQS job script. Each NQS job has its own PVM daemon; therefore, the PVM daemon must be started within the NQS job script. This is different from interactive use, in which one daemon is run per user per system. Any application run as part of the same NQS job script uses the same PVM daemon. Slave daemons that run on UNICOS and UNICOS/mk systems will also run one daemon per NQS job. IRIX users can achieve similar functionality as UNICOS and UNICOS/mk users by using the PVM_VMID environment variable. Using PVM_VMID allows more than one daemon to run per user per system.

In UNICOS and UNICOS/mk implementations, a special environment variable is checked for a batch (NQE) environment. If a batch environment exists, these implementations place the PVM log and daemon (pvmd socket) files in a special temporary directory. In IRIX implementations, a single user running multiple NQE jobs on a single host should set the PVM_VMID environment variable for each batch job.

PVM processes spawned by the daemon inherit the limits of the NQS job. This allows a user to run multiple NQS jobs that use PVM, each with limits of the NQS job being run. Previous versions of PVM used the same daemon for multiple NQS jobs.

The following example is an NQS job script to run the application foo:

module load mpt
pvmd3 hostfile &   # Start the daemon
sleep 60        # Wait for startup
foo             # Run application
pvm << EOF      # Start console to halt pvm
halt
EOF

Using the PVM Console

Using the PVM console is an alternative to using the pvmd3(1) command to start the daemon and execute your application. The pvm(1) command starts the console, which can be started and stopped multiple times on any of the systems on which PVM is running.

Starting the Console

Start the PVM console by using the following command line:

pvm [hostfile]

When the console is started, it checks to see if a PVM daemon is running. If so, it simply attaches itself to the daemon and can be used to monitor ongoing PVM processes as shown:

% pvm
pvmd already running
pvm>

If the daemon is not started, the pvm(1) command tries to start one, but the command must first find the daemon. (Currently, the pvm(1) command does not examine the hostfile argument, if provided, but simply passes its name to the daemon. Therefore, the pvm command cannot use information from this file.)

The logic used by the pvm command to start the daemon is as follows:

  1. The command tries to execute $HOME/pvm3/lib/pvmd on all systems. $HOME/pvm3/lib/pvmd must be an executable file that is one of the following:

    • A shell script that starts up the PVM daemon, perhaps by using a host file. If you use this option, you may find it useful to have the script do other preparatory or related work.

    • A symbolic link to the PVM daemon. The following example shows how you can set up a link on Silicon Graphics systems:

      % mkdir ~/pvm3
      
      % mkdir ~/pvm3/lib
      
      % ln -s $PVM_ROOT/lib/$PVM_ARCH/pvmd3 ~/pvm3/lib/pvmd

  2. On Silicon Graphics systems, if pvmd3(1) is not found or cannot be executed, the pvm(1) command explicitly tries to start $PVM_ROOT/lib/$PVM_ARCH/pvmd3. This special processing is not performed on other systems.

    1. If a daemon is started, you see the following:

      % pvm
      
      pvm>

    2. If a daemon is not started, you see the following:

      % pvm
      libpvm [pid-1]: Console: Can't start pvmd
      %

Using Console Commands

When you enter the pvm(1) command, the console responds with a prompt and accepts the commands described in Table 2-2.

Table 2-2. Console Commands

Command

Description

 

add hostnames

Adds systems to the virtual machine.

alias[name command [args]]

Defines or lists console command aliases.

conf

Lists the PVM system configuration. Fields in the output from conf are as follows:

 

HOST

Host name

 

DTID

PVM daemon task identifier

 

ARCH

PVM system name (architecture)

 

SPEED

Relative speed of this system

delete hostnames

Deletes systems from the virtual machine. PVM processes that are still running on these systems are lost.

echo [ args ]

Echoes arguments.

halt

Kills all PVM processes and shuts down PVM; all daemons exit. This is the best way to exit the console if you are done using PVM. See quit.

help [ command ]

Provides minimal information about the console commands. If you enter help followed by a command name, a brief description of the syntax is displayed.

id

Prints the pvm_tid task identifier of the console. (The console is simply another PVM task.)

jobs [-l]

Displays a list of running jobs. The -l option provides more detailed output.

kill [-c ] taskids

Kills a PVM user process. The -c option indicates that children of the task IDs should also be killed.

mstat hostnames

Gives status for each system listed.

ps [-a] [-h host] [-n host] [-l][-x]

Gives a listing of current processes and their status. The following options are available:

 

-a

All systems (default is local)

 

-h host

Task ID of the system (with no blanks)

 

-n host

System name (with no blanks)

 

 

This example illustrates -n host usage:

 

 

ps -ngust

 

 

This command requests the status of a system named gust.

 

-l

Shows long output

 

-x

Shows console task

 

ps output includes the following fields:

 

HOST

System executing the process

 

A.OUT

Executable name (if known to PVM)

 

TID

Task identifier

 

PTID

Parent's task identifier (-l only)

 

PID

Task process identifier (-l only)

 

FLAG

Process status. Can be one or more of the following:

 

 

a

Task is waiting for authorization.

 

 

c

Task is connected to pvmd.

 

 

o

Task connection is being closed.

 

 

H

Host starter task is identified.

 

 

R

Resource manager task is identified.

 

 

T

Task starter task is identified.

pstat tid

Displays the status of the specified PVM process.

quit (or EOF)

Exits the console, but leaves the daemons and processes running. See halt.

reset

Resets the virtual machine. Causes a SIGKILL signal to be sent to every running process. All message queues are cleared. The pvmd daemons are left in an idle state.

setenv [name [ value ]]

Displays or sets environment variables.

sig num task

Sends a signal to specified tasks.

spawn [ options ] file

Starts a PVM application for the specified file. Options are as follows:

 

- count

Number of tasks (default is 1)

 

- host

Spawn on host

 

- arch

Spawn on hosts of arch

 

-?

Enables debugging

 

->

Redirects output of job to console

 

-> file

Redirects output of job to file

 

->> file

Appends output of job to file

 

If NQE load balancing is available, the spawn command places tasks based on the load balancer, but within the restrictions specified on the spawn command. In the following example, the spawn command spawns four instances of a.out on the system named gust.

 

pvm> spawn -4 -gust a.out

trace [ names ]

Sets or displays a trace event mask. The names argument refers to names defined in the PVM include file, $PVM_ROOT/include/pvmtev.h. Alternatives are as follows:

 

trace [+] names

 

trace [-] names

 

trace [+] *

 

trace [+] *

unalias name

Undefines the specified command alias.

version

Displays the libpvm version.


Troubleshooting PVM

This section describes common problems encountered when using PVM and provides suggested solutions. There are several kinds of problems that can keep pvmd3(1) from building a virtual machine. The most common are permission problems.

If you do not specify the pw option for a particular system, your .rhosts file on that system must contain the name of the host from which you start the master pvmd. Otherwise, you will get a message like one of the following (although you may not get the entire message):

pvmd3@hostname: Permission denied

pvmd3@hostname: Login incorrect

To get the entire error message, enter the following command at a shell prompt:

rsh hostname daemon

On UNICOS and UNICOS/mk systems, you need to use remsh(1) rather than rsh(1) because the name rsh is used for a restricted shell, not for the remote shell command. The remsh command is not available on IRIX systems. daemon is the location of the PVM daemon (for example, /tmp/pvm/pvmd3 or $PVM_ROOT/lib/$PVM_ARCH/pvmd3).

Look at the output of the command and consult whichever of the following sections most closely applies.

PVM Already Running

When you start the pvmd3(1) daemon, you may receive a message that PVM is already running because a file exists in /tmp. If no pvmd3(1) is running, it is likely that the last time you used PVM you did not terminate pvmd3(1) by using the console halt command, or the previous execution of the pvmd3 daemon terminated abnormally, leaving the files in /tmp. Remove the file named in the message and start pvmd3(1) again.

NQS jobs on UNICOS or UNICOS/mk systems place this file in the $TMPDIR directory, which is automatically deleted at the end of the job. Slave daemons of NQS jobs on these systems also use $TMPDIR, which is set by the login process. IRIX systems use /tmp. Messages about slave daemon startup failures are placed in the PVM log file.

pvmd3 Fails to Start on Remote System

If you use a shell (such as .kshrc) that does not automatically execute a startup script that sets $PVM_ROOT on added hosts, you can set the PVM_DPATH environment variable to the full or relative path of the pvmd startup script, or include the dx option in the host file to specify the path to the startup script. The pvmd startup script automatically sets $PVM_ROOT on the remote host.

The following command shows how to set the PVM_DPATH environment variable:

setenv PVM_DPATH $PVM_ROOT/lib/pvmd

The following command shows how to specify the pvmd startup script in the host file:

dx=/opt/ctl/mpt/mpt/pvm3/lib/pvmd


Note: The dx option in the host file overrides the PVM_DPATH environment variable, and $PVM_ROOT is not acknowledged for dx, so the dx path must be a full pathname.


Permission Denied

If you get a message denying you permission, it probably means that your .rhosts file on the remote system does not include your local system name. Add a line like the following to your .rhosts file on the remote system:

local-host-name your-local-user-name

Sometimes a system has more than one name, and the remote system may think your local system has a name that is different from the one that you have specified. To determine the name of your local system on the remote system, execute telnet(1) or rlogin(1) to get to the remote system and enter the following UNIX command:

% who am i

Look at the last column of the output of this command, which contains the first 16 characters of what the remote system (the one to which you connected) thinks is the name of your local system (the one on which you entered telnet(1) or rlogin(1)). Make sure you put that system name (the full name, not just the first 16 characters) in your .rhosts file on the remote system. Your /etc/hosts file should contain the full name. If you do not have this file, see your system administrator for the name. Some older systems require that you spell the name exactly the same, including the case; newer systems accept the name in either uppercase or lowercase.

Login Incorrect

If you get a message saying your login is incorrect, there is probably no account on the remote system that has the same login name as your login name on the local system. In this case, you need to add a lo= username option to your PVM host file.

Version Incorrect

If you get a message about a version mismatch, it indicates that the versions of PVM on the two systems were built from different PVM releases. You may be building with an old library, accessing an old PVM version built from the public domain version, or having some similar problem. Ensure that the versions of PVM on the two systems are compatible.

As a general rule, releases of the public domain implementation of PVM with the same second digit in the version number (for example, 3.2.0 and 3.2.6) will interoperate. Changes that result in incompatibility are held until a major version change (for example, from version 3.2 to version 3.3). For compatibility, you might need to upgrade one of your versions of PVM.

Failure of Spawn

A common application problem is the failure of a pvm_spawn () request. The PVM console command tickle 6 4 enables tracing of spawn requests. The complete executable path is printed in the PVM log file.

Other Problems

If you get any other messages, ensure that your .cshrc file on the remote system is not printing something out when you log in or is not trying to set your terminal characteristics (usually by using the stty(1) or tset(1) commands).

If you want to print from your .cshrc file when you log in, put the relevant commands in an if statement in your .cshrc file, as in the following example:

if ( { tty -s } && $?prompt )  then
# example of printing something when you log in
 echo terminal type is $TERM
# example of setting terminal attributes
   stty erase '^?' kill '^u' intr '^c' echo endif

This statement ensures that printing occurs only when you log in from a terminal (and when you are not running a csh(1) command script).

Optimizing Use of PVM

Several PVM functions are particularly useful when developing applications that involve UNICOS and UNICOS/mk systems. This section discusses some techniques that can help improve performance. As is true with programming in general, optimization with PVM involves trade-offs. Generally, the trade-off involves reducing generality in favor of better performance. Adding some of the optimizations discussed in the following sections will improve performance but will make the application harder to move to different PVM virtual machines or other systems.

Running PVM on UNICOS Multiprocessor Systems

When multiple PVM processes run on a UNICOS multiprocessor system, the processes use sockets, by default, to communicate. The UNICOS operating system recognizes that the transfer is local and uses a faster path, but the overhead is still quite significant. If the PVM processes are executing different executable files, this is probably your only choice.

In some applications, the PVM processes each execute the same executable file, with the work sent out by a master process. If these processes are not communicating with each other (perhaps they are communicating only with the master), this kind of general approach may work well. But if the processes need to communicate with one another, your overall performance will decrease when sockets are used for communication.

A shared memory implementation of the MPT version of PVM is offered to provide better performance for applications in which PVM processes need to communicate with each other. The shared memory implementation of PVM uses macrotasking so that communication between spawned processes can be done through memory instead of sockets. This implementation is available on UNICOS systems. Memory provides a mechanism for communicating between PVM processes on UNICOS systems that is faster than other mechanisms that involve the operating system. Because current UNICOS systems do not have hardware for System V shared memory support, this implementation of PVM uses the Cray multitasking software to imitate a shared memory system.

Two modes of execution are available with the shared memory implementation of PVM. In addition to the standard mode of operation, you can run the shared memory implementation of PVM in a stand-alone mode of operation that requires no PVM daemon or console. This mode provides the best performance for applications that consist of a single executable file and that execute within a single UNICOS machine. Stand-alone mode closely resembles the current PVM mode of operation on the UNICOS/mk system. Because PVM task management from outside the application itself is unnecessary, you can run an application by simply typing a.out. If an application follows the master/slave model (consisting of multiple executable files), it might be desirable to convert the application to run within a single executable file to get the best performance.

Modules were used to install the toolkit on your system. To access the shared memory implementation of PVM, the mpt module must be loaded.

To modify a PVM program to make use of shared memory, perform the following steps:

Procedure 2-2.

  1. Convert all global and static data to TASKCOMMON data.

    In the public domain version of PVM, all data is assumed to be private to each PVM task. Communication between tasks is done by sending messages. However, in a multitasking environment, all members of the multitasking group can access all global or static data because they share one user address space.

    To preserve the behavior of the public domain version of PVM as much as possible, all global or static data that can be modified during the course of execution of a program must be treated as data local to each task. This is done by placing the data in TASKCOMMON blocks. TASKCOMMON storage is a mechanism that is used in multitasked programs to provide a separate copy of data for each member of the multitasking group. TASKCOMMON data is still globally accessible across functions within a multitasked task, but it is private to that task.

    Fortran examples of global or static data that must be placed in TASKCOMMON storage are data that resides in COMMON blocks and data that appears in DATA or SAVE statements. In C, you must place all data that is declared static (either locally or globally) or data declared at a global level (outside of any function) in TASKCOMMON.

    Because changing your program so that all global and static data is private is both tedious and makes a program less portable, you can use compile-time command line options to do the conversions. Most global and static data can be converted automatically to TASKCOMMON data by using the following command-line options:

    • For C programs:

      cc -h taskprivate

    • For Fortran programs:

      f90 -a taskcommon
      
      


    Note: Software included in the 1.0 release of the Message Passing Toolkit is designed to be used with the Cray Programming Environment. When building an application that uses the shared memory version of PVM, you must be using the Programming Environment 3.0 release or later. Before you can access the Programming Environment, the PrgEnv module must be loaded. For more information on using modules, see Installing Programming Environment Products, or, if the Programming Environment has already been installed on your system, see the online ASCII file /opt/ctl/doc/README.

    When you are placing data in TASKCOMMON storage, there may be cases in which the compiler cannot do the conversion because of insufficient information. The compiler notes these cases by issuing a warning during compilation. For such cases, you must convert the data by hand. Most of the time, these cases are related to initialization that involves Fortran DATA or SAVE statements or C initialized static variables, and you might need to change only how or when the data is initialized for it to be placed in TASKCOMMON.

    The following is an example of a case that the compiler cannot handle:

      int a;
      int b = &a

    If variable a resides in TASKCOMMON, its address will not be known until run time; therefore, the compiling system cannot initialize it. In this case, the initialization must be handled within the user program.

  2. Use one of the following methods to request shared-memory PVM process initiation.

    • Stand-alone mode:

      Add a call to the start_pes () function at the beginning of the PVM program.

      This function is provided as a general process initiation function that can be used to start processes for shared memory (SHMEM) data-passing applications and PVM message passing applications that run in the stand-alone mode of operation. The start_pes function starts tasks the first time it is called and is not operational on subsequent calls. start_pes () has one argument, npes. This argument specifies the total number of tasks with which to run the program. If npes is 0, the function starts a number of tasks indicated by an environment variable called NPES. This environment variable allows more flexibility because the number of PEs to use on the application can be changed at run time.

    • Standard mode:

      Add a PvmMtSpawn flag to a call to the pvm_spawn () function.

      This flag specifies that spawned PVM processes are to be started in a new multitasked group. This is convenient in master-slave applications in which one master starts multiple slaves, and the slaves are set up for fast communication because they are threads in a multitasked group instead of separate user processes. The spawning process uses the fork(2) and exec(2) system calls to spawn the slave executable file in the master/slave model, and then uses the macrotasking TSKSTART(3F) routine to spawn further slave processes, creating a multitasking group for the slave executable file.

  3. Use the cc(1) or f90(1) commands to build your shared memory PVM program, as in the following examples:

    C programs:

    cc -htaskprivate -D_MULTIP_ -L$MPTDIR/lib/multi -I$PVM_ROOT/include file.c

    For C programs, the -D and -L options are needed to access the reentrant version of libc that is required to provide safe access to libc routines in a multitasking environment. When the mpt module is loaded, the module software sets $MPTDIR automatically and points to the default MPT software library. To make compiling in C easier, the environment variable $LIBCM is also set automatically when the mpt module is loaded. You can use $LIBCM with the cc(1) command to request the reentrant version of libc. $LIBCM is set to the following value:

    -D_MULTIP_ -L$MPTDIR/lib/multi

    The following example uses $LIBCM:

    cc -htaskprivate $LIBCM -I$PVM_ROOT/include file.c

    Fortran programs:

    f90 -ataskcommon -I $PVM_ROOT/include file.f

  4. Select private I/O if private Fortran file unit numbers are desired.


    Note: Automatic TASKCOMMON conversion and private I/O are available in the Programming Environment release 3.0 or later.

    In a multitasking environment, Fortran unit numbers are, by default, shared by all members of the multitasking group. This behavior forces all files to be shared among PVM tasks that were spawned using multitasking. Allowing PVM tasks to share files can be useful, but this behavior is different from that of the public domain version of PVM. The user can request that files be private to each PVM task by specifying the private I/O option on the assign(1) command. The examples in Table 2-3, request private I/O.

    Table 2-3. assign Examples

    Example

    Description

    assign -P private u:10

    Specifies that unit 10 should be private to any PVM task that opens it.

    assign -P private p:%

    Specifies that all named Fortran units should be private to any PVM task that opens them. This includes all units connected to regular files and excludes units such as 5 and 6, which are connected to stdin, stdout, or stderr by default.

    assign -P global u:0

    assign -P global u:5

    assign -P global u:6

    assign -P global u:100

    assign -P global u:101

    assign -P global u:102

    This set of assign commands can be used in conjunction with assign -P private g:all to retain units connected by default to stdin, stdout, and stderr as global units. A unit connected to these standard files cannot be a private unit.

    For more information on private I/O functionality on UNICOS systems, see the assign(1) man page.

  5. Use one of the following methods to run the application:

    • Stand-alone mode PVM applications

      To run an application that uses the shared memory version of PVM in the stand-alone mode of operation, simply type a.out. If you have included a call to start_pes () with 0 as the number of PEs to initiate, the NPES environment variable must be set before execution. Because PVM applications that run using the stand-alone mode of operation are of fixed size and composition, the support of some PVM functions is not appropriate.

      The following functions are not supported in stand-alone mode:

      pvm_addhosts ()
      pvm_catchout ()
      pvm_delhosts ()
      pvm_getfds ()
      pvm_hostsync ()
      pvm_kill ()
      pvm_mstat ()
      pvm_notify ()
      pvm_reg_hoster ()
      pvm_reg_tasker ()
      pvm_sendsig ()
      pvm_spawn ()
      pvm_tidtohost ()

      These functions are permitted in programs but return a PvmNotImpl status.

    • Standard mode (master/slave) PVM applications:

      A master/slave application that uses the shared memory implementation of PVM is run as it is with the public domain version of PVM.

      The master task and the PVM daemon are not multitasked and will communicate with the multitasked slave PVM tasks by means of sockets. The slave PVM tasks that were spawned by the master program are multitasked and can communicate with each other through memory. By default, all PVM tasks communicate with the daemon and other nonmultitasked PVM tasks by using sockets. Note, however, that UNICOS limits the number of open files per application and the number of open sockets in the system. Socket communication is very slow, especially compared to the speed of communication between multitasked PVM tasks. Because much of socket communication is single-threaded, the performance cost goes up as more PVM tasks try to communicate at the same time.

      For these reasons, it might be desirable to change a program so that only PE (processing element) 0 or a selected number of PEs communicate with other executable files like the master or the PVM daemon. To change the default communication behavior to decrease the number of socket connections made on the system, use the PVM_PE_LIST environment variable to specify which PEs should communicate through sockets. The PVM_PE_LIST environment variable specifies which processing elements can communicate with the PVM daemon. You can obtain the PE number for a task or process by calling the pvm_get_PE () or my_pe () functions. Set the environment variable as in the following examples:

      For csh(1):

      setenv PVM_PE_LIST 0, 4, 8, 12orsetenv PVM_PE_LIST all (default)

      For ksh(1):

      export PVM_PE_LIST=all(default)


      Note: The default behavior of the PVM_PE_LIST environment variable in the UNICOS implementation is different from that on UNICOS/mk systems. In the UNICOS/mk implementation of PVM, by default, only PE 0 can communicate with the PVM daemon in heterogeneous programs.


You should also consider using Autotasking instead of message passing whenever your application is run on a UNICOS system. The communications overhead for Autotasking is orders of magnitude less than that for sockets, even on the same system, so you might be better off having only one fully autotasked PVM process on the UNICOS system. In many cases, you might be able to achieve this simply by invoking the appropriate compiler options and sending a larger file of input data to the PVM process on the UNICOS system.

Running PVM in Stand-alone Mode on UNICOS Systems

The PVM stand-alone mode of operation allows you to run UNICOS/mk applications on UNICOS systems. Not all UNICOS/mk applications are appropriate to run on UNICOS systems (because of size limitations, for example), but for those that are appropriate, several extensions have been added to facilitate porting.

Table 2-4 lists and describes the UNICOS extensions that are supported in stand-alone mode. When the term PE is used in this table, it refers to PVM processes or tasks that were spawned by using multitasking. For more information on the functions described in Table 2-4, see the appropriate man pages.

Table 2-4. UNICOS Extensions for Stand-alone Mode

Extension

Description

pvm_get_PE ()

A function that returns the PE number associated with a pvm_tid task identifier.

barrier ()

An optimized barrier function that can be used to create a barrier between multitasked PEs.

_my_pe ()

A function that returns the PE number of the PVM task and calls the task (similar to the intrinsic function available on UNICOS/mk systems). This function is documented in the my_pe(3) man page.

Global group

A predefined group that consists of all members of the multitasking group. This can be used with communication and synchronization between multitasked PEs. The variable PVMALL is declared in the fpvm3.h function, as it is for UNICOS/mk PVM applications. The concept of a predefined global group also exists on UNICOS/mk systems.

_num_pes ()

A function that returns the total number of PEs in the program (similar to the function available on UNICOS/mk systems). This function is documented in the num_pes(3) man page.

PE number

A PE number. Most existing UNICOS/mk PVM applications are written to use PE numbers to identify tasks for communication. To aid in porting UNICOS/mk applications to a UNICOS system, PE numbers can be used in place of pvm_tid task identifiers in many of the PVM functions. Functions that support PE numbers document this in their man pages.


Running PVM on UNICOS/mk Systems

The UNICOS/mk implementation of PVM can be used in stand-alone or distributed mode. In stand-alone mode, PVM is used only to communicate among processing elements (PEs) within the same partition. In this mode, the PVM daemon is not required; you can simply execute your program. For more information on using PVM in stand-alone mode, see Chapter 3, “UNICOS/mk Implementation”. For more information on using PVM in distributed mode, see “Distributed Mode” in Chapter 3.

Using NQE

PVM applications can be run simultaneously. In previous releases, the same PVM daemon was used for all applications. If PVM applications are run as an NQS job, each application uses a unique PVM daemon. This can eliminate resource conflicts caused by both applications requesting PVM services. Because the daemon is part of the NQS job, resource limits associated with a job apply to processes spawned by the PVM daemon.

A site administrator can configure a batch job queue for PVM jobs. This enables the checking of resources on multiple nodes before a job is initiated.

Using Load Balancing

PVM supports load balancing for pvm_spawn () calls on UNICOS systems. Support for this feature is deferred on UNICOS/mk and IRIX systems. PVM has been modified to request ratings of the eligible hosts. This feature is available only with NQE, but PVM does not have to be run as an NQS job to use this feature.

A pvm_spawn () call proceeds through the logic of checking user-specified parameters, such as architecture. After a list of hosts has been identified, the load balancing server is asked to rate these hosts by evaluating a policy. Tasks are then placed, using a procedure based on a percentage of the total host ratings instead of a round-robin procedure. If the current host receives a large rating, all tasks can be started on that host. This allows hosts to be specified in the host file but not used if their current system load is large or a better host is available.

Specifying the -h option on the pvmd3(1) command when starting the PVM daemon causes the load balancing server to be used to create the virtual machine. If a host file is specified, the options are read. The NQE load balancing server is queried for a list of available hosts. The hosts specified in the host file but not marked as available are not used. Hosts not specified in the host file are added with default options. If no host file is specified, all of the available hosts are used with default options.

Automatic creation of the virtual machine allows the user to submit a PVM job without configuring the machine.

Using PVM Direct Routing

If two PVM processes are going to be doing any significant amount of communication, you should probably use PVM direct routing. With a normal transfer, a message goes from one PVM user process, to the PVM daemon on the local system, to the PVM daemon on the remote system, and finally to the PVM user process on the remote system. With direct routing, a message goes directly from one PVM task to the other. A significant performance gain is possible, and the gain increases for larger messages. For more information on setting the associated PVM option, see the pvm_setopt(3) man page.

Using Large Messages

Socket communication in PVM uses a default maximum packet size of 32 Kbytes. When sending large messages, you can increase bandwidth significantly by using the pvm_setopt () call to set PvmFragSize. Although underlying services might have lower limits, PVM's upper limit for PvmFragSize is 1 Mbyte. On UNICOS systems, you can change the TCP window shift size by using the pvm_setopt () call to set PvmWinShift. Valid values for PvmWinShift are between 1 and 16. Values above 4 show marginal performance improvement. This can increase the amount of data in transmission.

Avoiding XDR Conversion

By default, PVM automatically performs eXternal Data Representation (XDR) conversion when transferring data. This very powerful feature adds to the utility of PVM. Unfortunately, this feature has an adverse effect on performance, because the conversion method is very slow and inefficient.

In many applications, you can work around this limitation by using one of the following techniques:

Specifying the PvmDataRaw Value

The pvm_initsend(3) function takes an argument that specifies how data should be encoded. Specifying the PvmDataRaw value indicates that no data conversion should take place. When the pvm_send(3) call is made, PVM verifies that the two systems share a common data format and aborts the transfer of the message if they do not.

When appropriate, this technique is the best one to use. However, it is useful only when the two processes are running on systems with the same data format.

Byte Transfer

When data is transferred as bytes, no data conversion occurs. The pvm_pkbyte(3) and pvm_upkbyte(3) functions bypass data conversion because byte data is defined to be untyped. However, you must pass byte counts rather than element counts. As a result, this technique is more prone to programming error than the other two described in this section, especially for Fortran codes.

This technique is useful when the two processes are running on systems with the same data formats or the data format is one that does not require sophisticated conversions (such as packed integer data).

User-controlled Conversion

The most complex technique is user-controlled conversion; that is, performing data conversion in the application. UNICOS libraries offer a number of very high-performance data conversion functions that convert between Silicon Graphics formats and IEEE, IBM, DEC, and other formats.

For example, one process (perhaps a workstation) could use pvm_pkbyte(3) to pack the data; the receiving process (the Silicon Graphics system) could use pvm_upkbyte(3) to unpack the data and then call the appropriate function to convert it.

User-controlled conversion requires programmer care to ensure that the two processes know the format of the data blocks, and it also requires byte counts rather than element counts.

This technique is useful when the transfer is occurring between a Silicon Graphics system and another system for which data conversion functions are available. (For descriptions of conversion functions, see the Application Programmer's Library Reference Manual.)

Shared Memory PVM Limitations


Note: Information in this section is for UNICOS systems only.

Emulating a shared memory environment with the use of Cray multitasking software might provide unexpected program behavior. The goal is to preserve the original behavior as much possible. However, it is not efficient or productive to preserve completely the original PVM behavior in a multitasked environment. The intent is to document possible changes in behavior. For example, changes in behavior might occur with the use of signals; therefore, it is not recommended that signals be used with the shared memory version of PVM.

PvmDataDefault and PvmDataRaw packing are equivalent in the shared memory implementation of PVM. In stand-alone mode, data conversion is not necessary because the executable file never communicates outside of the UNICOS machine. Because the shared memory implementation of PVM running in standard mode does not handle data conversion, multitasked executable files currently can communicate only between UNICOS machines of the same architecture type. Communication to other architectures can still be achieved, however, through the master or nonmultitasked executable files that comprise the program.

The shared memory implementation of PVM supports the running of only 32 PVM tasks within a multitasking group. Running with more than the number of physical CPUs available on the UNICOS system will begin to degrade performance because PVM tasks must share CPU resources.

Data Types on UNICOS Systems

This discussion of how PVM data types are implemented assumes that you are familiar with the functions used to pack and unpack data. For more information about these functions, see “Data Transmittal” in Chapter 4, and “Data Receipt” in Chapter 4.

Data type support is different for each system. Systems that support both 32-bit and 64-bit data types map easily into the PVM data types.

Table 2-5, presents basic information about data types on UNICOS systems.

Table 2-5. Data Types On UNICOS Systems

Data characteristics

C functions

Fortran names

8 bits, not typed

pvm_pkbyte

BYTE1

64 bits, signed integer

pvm_pklong, pvm_pkint, pvm_pkshort

INTEGER4

64 bits, unsigned integer

pvm_pkulong, pvm_pkuint, pvm_pkushort

Not applicable

64 bits, floating-point

pvm_pkdouble, pvm_pkfloat

REAL8

Two 64 bits, floating-point

pvm_pkdcplx, pvm_pkcplx

COMPLEX16

Null-terminated character string

pvm_pkstr

Not applicable

Fortran character constant or variable

Not applicable

STRING


Fortran Data Types

Table 2-5 does not contain some Fortran type names, such as INTEGER2, REAL4, and COMPLEX8. These map to INTEGER4, REAL8, and COMPLEX16, respectively. To avoid confusion and to ease porting to other systems, you should use these only with the greatest of care.

64-bit Integer Usage

The Cray MPT implementation of PVM for UNICOS systems does not support the INTEGER8 specification. On UNICOS systems, you must specify INTEGER4 for UNICOS integers.

When PvmDataDefault packing is used, XDR converts data into a common format. XDR retains only 32 bits of precision for integer data; therefore, packing 64-bit integers results in a loss of the upper 32 bits of precision.

If you want all 64 bits of accuracy, use PvmDataRaw packing or specify untyped byte packing for PvmDataDefault.

Data Types on UNICOS/mk Systems

This section describes how PVM data types are implemented on UNICOS/mk systems. This discussion assumes that you are familiar with the functions used to pack and unpack data; for more information, see “Data Transmittal” in Chapter 4, and “Data Receipt” in Chapter 4.

Table 2-6 presents basic information about data types available on UNICOS/mk systems.

Table 2-6. Data Types on UNICOS/mk Systems

Data characteristics

C functions

Fortran names

8 bits, not typed

pvm_*pkbyte

BYTE1

64 bits, signed integer

pvm_*pklong, pvm_*pkint

INTEGER8

64 bits, unsigned integer

pvm_*pkulong, pvm_*pkuint

Not applicable

32 bits, signed integer

pvm_*pkshort

INTEGER4

32 bits, unsigned integer

pvm_*pkushort

Not applicable

64 bits, floating-point

pvm_*pkdouble

REAL8

32 bits, floating-point

pvm_*pkfloat

REAL4

(Two) 64 bits, floating-point

pvm_*pkdcplx

COMPLEX16

(Two) 32 bits, floating-point

pvm_*pkcplx

COMPLEX8

Null-terminated character string

pvm_*pkstr

Not applicable

Fortran character constant or variable

Not applicable

STRING


16-bit Fortran Data Types

The Fortran name INTEGER2 is implemented and maps into the same data characteristics as INTEGER4. Use of 16-bit data types is not recommended because the UNICOS/mk system does not support these data types.

32-bit Fortran Data Types

On the UNICOS/mk system, PVM supports 32-bit Fortran data types. This support is implemented in PVM regardless of whether your Fortran compiler supports 32-bit data types. If you are not using such a compiler and specify one of these data types (INTEGER4, REAL4, or COMPLEX8), you will get incorrect results.

64-bit Integer Data

In the UNICOS and public domain versions of PVM, data conversion of integers is limited to 32 bits of accuracy. The UNICOS/mk version handles 64-bit integers in a manner that is compatible and interoperable with the network version. If you pack 64-bit integers into a PvmDataDefault block, only the low-order 32 bits of each value are packed. PVM checks the high-order 32 bits of each value; if they contain significant data, the pack call sends a PvmLostPrecision error. (This checking can be turned off; see PVM_CHECKING in Table 3-1.)

If you want 64 bits of accuracy, you can use PvmDataRaw packing or specify untyped byte packing for PvmDataDefault.

Data Types on IRIX Systems

This section describes how PVM data types are implemented on IRIX systems. This discussion assumes that you are familiar with the functions used to pack and unpack data; for more information, see “Data Transmittal” in Chapter 4, and “Data Receipt” in Chapter 4.

Table 2-7 and Table 2-8 present basic information about data types on IRIX systems.

Table 2-7. N32 ABI Library Data Types on IRIX Systems

Data characteristics

C functions

Fortran names

8 bits, not typed

pvm_pkbyte

BYTE1

16 bits, signed integer

pvm_pkshort

INTEGER2

32 bits, signed integer

pvm_pkint, pvm_pklong

INTEGER4

16 bits, unsigned integer

pvm_pkushort

Not applicable

32 bits, unsigned integer

pvm_pkuint, pvm_pkulong

Not applicable

32 bits, floating-point

pvm_pkfloat,

REAL4

64 bits, floating-point

pvm_pkdouble

REAL8

Two 32 bits, floating-point

pvm_pkcplx

COMPLEX8

Two 64 bits, floating-point

pvm_pkdcplx

COMPLEX16

Null-terminated character string

pvm_pkstr

Not applicable

Fortran character constant or variable

Not applicable

STRING


Table 2-8. 64 ABI Library Data Types on IRIX Systems

Data characteristics

C functions

Fortran names

8 bits, not typed

pvm_pkbyte

BYTE1

16 bits, signed integer

pvm_pkshort

INTEGER2

32 bits, signed integer

pvm_pkint

INTEGER4

64 bits, signed integer

pvm_pklong

Not applicable

16 bits, unsigned integer

pvm_pkushort

Not applicable

32 bits, unsigned integer

pvm_pkuint

Not applicable

64 bits, unsigned integer

pvm_pkulong

Not applicable

32 bits, floating-point

pvm_pkfloat,

REAL4

64 bits, floating-point

pvm_pkdouble

REAL8

Two 32 bits, floating-point

pvm_pkcplx

COMPLEX8

Two 64 bits, floating-point

pvm_pkdcplx

COMPLEX16

Null-terminated character string

pvm_pkstr

Not applicable

Fortran character constant or variable

Not applicable

STRING


Environment Variables

To customize your PVM environment, you can use the environment variables described in this section. The variables are grouped into variables supported on IRIX systems only and variables supported on UNICOS, UNICOS/mk, and IRIX systems. Chapter 3, “UNICOS/mk Implementation”, describes the environment variables that are supported by UNICOS/mk systems only.

Setting Environment Variables on IRIX Systems

This section provides a table of environment variables you can set for IRIX systems only.

Table 2-9. Environment Variables on IRIX Systems

Variable

Description

Default

PVM_SHMEM_DIR

Directory location of the POSIX shared memory files.

/usr/tmp (Only valid for SGIMP64 and SGIMP64mips3 architecture types)

PVMBUFSIZE

Specifies the size of the shared memory buffer for each task and daemon.

1 Mbyte

PVM_VMID

Sets the virtual machine identification (VMID) number for the host. This environment variable allows a host to be included in more than one virtual machine by using one pvmd3 command per virtual machine per host. The virtual machine number is appended to the file name of the PVM log and daemon socket files, so that they appear as pvml.uid.vmid and pvmd.uid.vmid.

The previous name of this variable is PVMJID. This name is supported in the MPT 1.3 release, but will not be supported in subsequent releases.

0

 


Note: This environment variable prevents IRIX PVM from interoperating with any implementation other than Silicon Graphics IRIX PVM implementations.


 

Setting Environment Variables on UNICOS, UNICOS/mk, and IRIX Systems

This section provides a table of environment variables you can set for UNICOS, UNICOS/mk, and IRIX systems.

Table 2-10. Environment Variables on UNICOS, UNICOS/mk, and IRIX Systems

Variable

Description

Default

PVM_ROOT

Specifies the path where PVM libraries and system programs are installed. For PVM to function, this variable must be set on each PVM system.

Set automatically when you load the mpt module to access the Message Passing Toolkit software

PVM_EXPORT

Names the environment variables that a parent task exports to its children by using the pvm_spawn(3) function. Multiple names must be separated by a colon.

None

PVM_DEBUGGER

Specifies the debugger script to use when pvm_spawn(3) is called with PvmTaskDebug set.

$PVM_ROOT/lib/debugger

PVM_DPATH

Specifies the path of the pvmd3(1) command or the startup script.

If you use a shell (such as .kshrc) that does not automatically execute a startup script that sets PVM_ROOT on added hosts, you can set PVM_DPATH to the full or relative path of the pvmd startup script, such as $PVM_ROOT/lib/pvmd. This startup script automatically sets PVM_ROOT.

$PVM_ROOT/lib/pvmd. You can override this setting by using the dx= loc option in the host file.

PVM_POLICY

Specifies the NQE policy used for load balancing. For more information on specifying policies, see NQE Administration.


Note: Support for this environment variable is deferred on UNICOS/mk and IRIX systems.


PVM

NLB_SERVER

Specifies the location of the NQE load balancer. This host is known as the master server. Your system administrator might have this set automatically in the nqeinfo file. If NQE load balancing is enabled on your system, it is used automatically by PVM. To disable NQE load balancing for PVM applications, set the NLB_SERVER environment variable to 0. For more information, see the NQE User's Guide.


Note: Support for this environment variable is deferred on UNICOS/mk and IRIX systems.


Value in the nqeinfo file

PVM_RSH

Specifies that an alternative remote shell command, such as krsh (a Kerberos version of rsh), can be selected. PVM_RSH can specify the full path or relative path to the alternative remote command.

IRIX: If using Array Services, /usr/sbin/arshell. If not using Array Services, /usr/bsd/rsh.

UNICOS or UNICOS/mk: /usr/ucb/remsh.

PVM_SLAVE_STARTUP_TIMEOUT

Specifies the length of time that the master daemon will wait for a slave daemon to make contact after the slave daemon is started.

60 seconds