ADDHOST(3PVM)

NAME
pvm_addhosts - Adds one or more hosts to the virtual machine.

SYNOPSIS
C    int info = pvm_addhosts( char **hosts, int nhost, int *infos )
Fortran    call pvmfaddhost( host, info )

PARAMETERS

hosts
    An array of pointers to character strings containing the names of the machines to be added. Pvmd must already be installed and the user must have an account on the specified machines.

nhost
    Integer specifying the number of hosts to be added.

infos
    Integer array of length nhost which contains the status code returned by the routine for the individual hosts. Values less than zero indicate an error.

host
    Character string containing the name of the machine to be added.

info
    Integer status code returned by the routine. Values less than nhost indicate partial failure, values less than 1 indicate total failure.

DISCUSSION
The routine pvm_addhosts adds the list of computers pointed to in hosts to the existing configuration of computers making up the virtual machine. If pvm_addhosts is successful, info will be equal to nhost. Partial success is indicated by 1<= info < nhost, and total failure by info < 1. The array infos can be checked to determine which host caused the error.

The Fortran routine pvmfaddhost adds a single host to the configuration with each call. info will be 1 if successful or < 0 if error.

If a host fails, the PVM system will continue to function. The user can use this routine to increase the fault tolerance of his PVM application. The status of hosts can be requested by the application using pvm_mstat and pvm_config. If a host has failed it will be automatically deleted from the configuration. Using pvm_addhosts a replacement host can be added by the application. It is still the responsibility of the application developer to make his application tolerant of host failure. Another use of this feature would be to add more hosts as they become available, for example on a weekend, or if the application dynamically determines it could use more computational power.

pvm_addhosts requires the synchronization of the entire virtual machine.

EXAMPLES
C:
	static char *hosts[] = {
	    "sparky",
	    "thud.cs.utk.edu",
	};
	info = pvm_addhosts( hosts, 2, infos );

Fortran:
	CALL PVMFADDHOST( 'azure', INFO )

ERRORS
The following error conditions can be returned
	PvmBadParam	giving an invalid argument value.
	PvmAlready	already being added.
	PvmSysErr	local pvmd is not responding.
	PvmOutOfRes	PVM has run out of system resources.

SEE ALSO
delhost(3PVM), start_pvmd(3PVM), config(3PVM), mstat(3PVM)