From 05df90d8328b804ad1efe92c81e9ace491b386ec Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 28 Sep 2022 16:47:48 +0200 Subject: Update vignette and static docs --- docs/dev/reference/multistart.html | 40 +++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'docs/dev/reference/multistart.html') diff --git a/docs/dev/reference/multistart.html b/docs/dev/reference/multistart.html index c85e6d1e..714cb2fc 100644 --- a/docs/dev/reference/multistart.html +++ b/docs/dev/reference/multistart.html @@ -100,16 +100,19 @@ mixed-effects models by Duchesne et al (2021).

-
multistart(object, n = 50, cores = 1, ...)
+    
multistart(
+  object,
+  n = 50,
+  cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(),
+  cluster = NULL,
+  ...
+)
 
 # S3 method for saem.mmkin
-multistart(object, n = 50, cores = 1, ...)
+multistart(object, n = 50, cores = 1, cluster = NULL, ...)
 
 # S3 method for multistart
-print(x, ...)
-
-# S3 method for multistart
-parms(object, ...)
+print(x, ...)
@@ -124,7 +127,12 @@ used?

cores
-

How many fits should be run in parallel?

+

How many fits should be run in parallel (only on posix platforms)?

+ + +
cluster
+

A cluster as returned by parallel::makeCluster to be used +for parallel execution.

...
@@ -144,9 +152,7 @@ used?

Details

-

Currently, parallel execution of the fits is only supported using -parallel::mclapply, i.e. not available on Windows.

-

In case the online version of this help page contains error messages +

In case the online version of this help page contains error messages in the example code and no plots, this is due to the multistart method not working when called by pkgdown. Please refer to the online vignette @@ -186,10 +192,18 @@ doi: 10.1186/s12859-021-04373-4.

#> Error in UseMethod("parms", object): no applicable method for 'parms' applied to an object of class "try-error" f_saem_reduced <- update(f_saem_full, covariance.model = diag(c(1, 1, 0, 1))) -f_saem_reduced_multi <- multistart(f_saem_reduced, n = 16, cores = 16) -#> Warning: all scheduled cores encountered errors in user code +# On Windows, we need to create a cluster first. When working with +# such a cluster, we need to export the mmkin object to the cluster +# nodes, as it is referred to when updating the saem object on the nodes. +library(parallel) +cl <- makePSOCKcluster(12) +clusterExport(cl, "f_mmkin") +#> Error in get(name, envir = envir): object 'f_mmkin' not found +f_saem_reduced_multi <- multistart(f_saem_reduced, n = 16, cluster = cl) +#> Error in checkForRemoteErrors(val): 12 nodes produced errors; first error: object 'f_mmkin' not found parhist(f_saem_reduced_multi, lpos = "bottomright") -#> Error in UseMethod("parms", object): no applicable method for 'parms' applied to an object of class "try-error" +#> Error in parhist(f_saem_reduced_multi, lpos = "bottomright"): object 'f_saem_reduced_multi' not found +#> Warning: calling par(new=TRUE) with no plot # }
-- cgit v1.2.1