[Contents] [Chapter 4] [Index]



Managing a Compaq PVM Application

This chapter describes how to increase the resource allocation to Memory Channel and shared memory; how to clean up and debug a Compaq PVM application if there was an error when running it, or if the application exited abnormally. This chapter also describes how to tune the application's performance. The chapter consists of the following sections:

5.1 Increasing Resources in Memory Channel and Shared Memory

Since Compaq PVM uses Memory Channel and shared memory for communications (see Setting Shared Memory and Memory Channel Parameters), their default values will have to be increased if a program fails and a message signals a problem with resources.

  1. To increase Memory Channel resources, enter the following command:

    imc_init [-a maxalloc] [-r maxrecv]

  2. To increase shared memory resources:

    1. Increase PVM_BUF_SIZE.

    2. If there are still insufficient resources:

      Edit /etc/sysconfig and insert the following:

      shm-max=max-alloc

5.2 Cleaning Up a Compaq PVM Application

If Compaq PVM reports an error message indicating that PVM_BUF_SIZE should be increased, and the task exits, this indicates the standard buffer size or the user-specified buffer size is not big enough to transfer the largest messages between the tasks.

Compaq PVM attempts to remove all semaphores, and so on, before the application exits. However, some shared memory regions and/or semaphores may be left on the system which you should clean up before restarting the daemon or re-running the application.

You may need to perform one of these steps if a program exits abnormally:

  1. Use the ipcs command to see what regions and semaphores exist and use the ipcrm command to remove them.

    or

  2. Run a script provided with Compaq PVM that can do much of the work for you.

    A link to it is at /usr/bin/dpvmclean.

    The script purges old shared memory regions, semaphores, temporary files and PVM processes that are running.

    The script may not kill all PVM processes on the system, for example, if a process does not have pvm anywhere in the output generated by the ps command for that process, the script will not find it. Use the command ipcs to see what regions and semaphores exist.

    The script checks to see if it is being executed by root and, if so, exits immediately. This is to avoid accidental removal of shared memory regions or semaphores used by other system processes.

    Note: There is no cleanup procedure for the Memory Channel regions allocated by Compaq PVM. This is because the Memory Channel Services software ensures that any region allocated by a process is deallocated when that process dies (if it is the last process holding the region).

5.3 Debugging a Compaq PVM Application

The following error codes are returned by Compaq PVM if an error was detected during the execution of a routine:

Error Code

 

Meaning

PvmOk

0

Okay

PvmBadParam

-2

Bad parameter

PvmMismatch

-3

Barrier count mismatch

PvmNoData

-5

Read past end of buffer

PvmNoHost

-6

No such host

PvmNoFile

-7

No such executable

PvmNoMem

-10

Cannot get memory

PvmBadMsg

-12

Cannot decode receive message

PvmSysErr

-14

pvmd not responding

PvmNoSuchBuf

-16

Bad message id

PvmNullGroup

-17

Null group name is illegal

PvmDupGroup

-18

Already in group

PvmNoGroup

-19

No group with that name

PvmNotInGroup

-20

Not in group

PvmNoInst

-21

No such instance in group

PvmHostFail

-22

Host failed

PvmNoParent

-23

No parent task

PvmNotImpl

-24

Function not implemented

PvmDSysErr

-25

pvmd system error

PvmBadVersion

-26

pvmd-pvmd protocol mismatch

PvmOutOfRe

-27

Out of resources

PvmDupHost

-28

Host already configured

PvmCantStart

-29

Failed to execute new slave pvmd

PvmAlready

-30

Slave pvmd already running

PvmNoTask

-31

Task does not exist

PvmNoEntry

-32

No such (group, instance)

PvmDupEntry

-33

(Group, instance) already exists

Notes:

  1. Compaq PVM prints error conditions detected in routines by default. You can use pvm_setopt() to turn off this automatic reporting. You can view diagnostic prints from spawned tasks using the Compaq PVM console redirection or by calling pvm_catchout() in the spawning task.

  2. You can start Compaq PVM tasks manually under any standard serial debugger.

  3. You can start spawned Compaq PVM tasks under a debugger. By setting the flag option to include PvmTaskDebug in the pvm_spawn() call, Compaq PVM executes the shell script (usr/bin/dpvmdbg) by default. The task being debugged can be executed on any of the hosts in the virtual machine, as specified by the flag and where arguments on pvm_spawn().

    You can create your own customized debugger script to include a preferred debugger, even a parallel debugger, if one is available.

5.4 Hints on Tuning a Compaq PVM Application

  1. If you use pvm_psend, the data can be copied directly in the communication channels. In most cases, this eliminates the need for local copies to the PVM buffer space, and the resultant overhead associated with a second copy.

  2. Increase the value(s) of PVM_MC_CHAN_SIZE and/or PVM_SM_CHAN_SIZE when sending large messages. This allocates more communication channel space in Memory Channel and shared memory, resulting in faster code and a more efficient use of Memory Channel resources.

  3. The variables set for UMP_THREAD_MODE, UMP_YIELD, UMP_MULTIRAIL and UMP_ERROR_MODE can affect performance depending on your application and configuration.


[Contents] [Chapter 4] [Index]


pvm@ilo.dec.com

Copyright © 1999, Digital Equipment Corporation. All rights reserved. Unpublished rights reserved under the copyright laws of the United States.