mspathDistributedCalculator-class {mspath} | R Documentation |
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.
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.
comm
:"integer"
) work
:"matrix"
)worki
:work
such that worki[1]
is the row with the most work,
worki[2]
has the 2nd biggest workload, and so on ("integer"
)analyzer
:runAnalyzer
, but
initially empty. ("ANY"
) mode
:requestCode
or timeRequestCode
,
depending on whether we are profiling ("integer"
) cuts
:worki
("numeric"
). maxlen
:"integer"
) cutids
:"integer"
) evals
:"integer"
From mspathCalculator
:
args
: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
: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
:"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.
Class "mspathCalculator"
, directly.
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.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.signature(calc =
"mspathDistributedCalculator", value = "numeric")
:
Sets the free parameters (including for the slaves), but performs
no calculation. Using this class requires proper initialization of the MPI environment.
Ross Boylan