mspathDistributedCalculator-class {mspath}R Documentation

Distributed Calculator for Multi-State Path Models

Description

This calculator distributes the calculation of the likelihood to slave processes, which compute a multi-state path model with possible non-Markov properties. Though you can use this class directly, it is usually more convenient to invoke mspath. This is a subclass of (aka "extends") mspathCalculator; the slaves also use that class to perform their computations.

Objects from the Class

Create objects of this class by calling mspathDistributedCalculator, and clean them up by calling done. One can also create a factory object via mspathDistributedCalculatorFactory and create instances via that object.

Slots

comm:
MPI communicator ("integer")
work:
Work estimate, to aid scheduling ("matrix")
worki:
Sorted indices into the rows of work such that worki[1] is the row with the most work, worki[2] has the 2nd biggest workload, and so on ("integer")
analyzer:
Holds a runAnalyzer, but initially empty. ("ANY")
mode:
requestCode or timeRequestCode, depending on whether we are profiling ("integer")
cuts:
show how to cut the work into jobs. These are indices into worki ("numeric").
maxlen:
The longest list of ID's that will be sent ("integer")
cutids:
ID's of first case in each group ("integer")
evals:
Number of evaluations of this calculator. Useful for determining if we need initial timings or setup. Object of class "integer"

From mspathCalculator:

args:
A list of arguments to the C function call. As such, they must be in the correct order, with all necessary as.xxx's performed.
manager:
Reference to the C++ object that performs the calculations. Object of class "externalptr". Much of the state of the mspathCalculator is really in this C++ object. The persistence of information between calls permits faster calculations, but raises the possibility for errors. Do not do anything with the manager.
do.what:
"integer" with the code for the desired operation. This will be interpreted by the C++ routines, and is subject to being changed as a side-effect of user-level operations.
subset:
"integer" of the ID's of cases for which the likelihood should be evaluated. The restriction to integers makes the interface with C easier. If this vector is empty, it means analyze all cases.
results:
Object of class "numeric" holding the results of the calculation. In the future, it may hold other types. If there has not been a calculation with the current calculator values, this slot will have length 0. See results for details.

Extends

Class "mspathCalculator", directly.

Methods

calculate
signature(calc = "mspathDistributedCalculator", params = "numeric", activeCases = "missing", do.what = "missing"): Perform the requested calculation by distributing it across slave processes. Returns calc with the desired results. Notice that distribution evaluates a given set of parameters (if params are not given the existing ones will be used) for all cases. Different subsets of the cases go to different processors.
done
signature(calc = "mspathDistributedCalculator"): Call this to cleanup. Note it will leave the overall MPI session running. Returns an updated calc, but you shouldn't refer to the old or new values after calling this method.
params<-
signature(calc = "mspathDistributedCalculator", value = "numeric"): Sets the free parameters (including for the slaves), but performs no calculation.

Note

Using this class requires proper initialization of the MPI environment.

Author(s)

Ross Boylan

See Also

mspathCalculator, mspath


[Package mspath version 0.9-9 Index]