Biology Reference
In-Depth Information
It is important to note that calls must not have more elements than the number of
slave processes referenced by the cl object. Otherwise, some commands will not
be executed because there are more commands than slaves.
Now we can copy calls to the slave processes and make them execute the
command stored in the element of the list that matches the identifier we stored in
the id variable.
> clusterExport(cl, list("calls"))
> clusterEvalQ(cl, calls[[id]](marks))
[[1]]
MECH VECT ALG ANL STAT
38.95455 50.59091 50.60227 46.68182 42.30682
[[2]]
MECH VECT ALG ANL STAT
17.48622 13.14695 10.62478 14.84521 17.25559
The unique identifier id can be used in a similar way to define a list of argument
sets to match the functions in calls , thus increasing the flexibility of the approach
shown in this last example.
The synchronization of the slave processes must be managed in the master pro-
cess, because slave processes cannot communicate directly with each other. There-
fore, two slaves can exchange data only when the current call to clusterEvalQ
(or parApply , parSapply , etc.) executing on the master returns, and that ex-
change must be taken care of by the user from the master process. This may be
problematic when dealing with fine-grained parallel problems, but in most cases the
performance penalty introduced by this kind of synchronization is far outweighed
by the gains in performance due to the efficient use of multiple processors.
Finally, once the parallel computations are completed, we can call
stopCluster to shut down the slave processes and update their status in the cl
object.
> stopCluster(cl)
5.3 Applications to Structure and Parameter Learning
It is well known from literature that the problem of learning the structure of
Bayesian networks is very hard to tackle. Its computational complexity, measured
with the required number of conditional independence tests or network scores, is
super-exponential in the number of nodes in the worst case and polynomial in most
real-world situations. For instance, the Grow-Shrink algorithm performs a number
of conditional independence test that is O
p 2
for a network with p nodes, under
the assumption that the dimension of the Markov blanket of each node is bound by
a constant. For extremely dense graphs, the number of conditional tests increases to
O
(
)
p 3 2 p
(
)
.
Search WWH ::




Custom Search