From bcd98a1fa3cd2fb4b7105b7ec6c129ca18f872e8 Mon Sep 17 00:00:00 2001
From: Johannes Ranke
-# On Windows, we can use multiple cores by making a cluster using the parallel
-# package, which gets loaded with mkin, and passing it to mmkin, e.g.
-cl <- makePSOCKcluster(12)
-#> Error in makePSOCKcluster(12): could not find function "makePSOCKcluster"
+# On Windows, we can use multiple cores by making a cluster first
+cl <- parallel::makePSOCKcluster(12)
f <- mmkin(c("SFO", "FOMC", "DFOP"),
list(A = FOCUS_2006_A, B = FOCUS_2006_B, C = FOCUS_2006_C, D = FOCUS_2006_D),
cluster = cl, quiet = TRUE)
-#> Error in system.time({ if (is.null(cluster)) { results <- parallel::mclapply(as.list(1:n.fits), fit_function, mc.cores = cores, mc.preschedule = FALSE) } else { results <- parallel::parLapply(cluster, as.list(1:n.fits), fit_function) }}): object 'cl' not found
-#> Timing stopped at: 0 0 0.001
print(f)
-#> Error in print(f): object 'f' not found
+#> <mmkin> object
+#> Status of individual fits:
+#>
+#> dataset
+#> model A B C D
+#> SFO OK OK OK OK
+#> FOMC OK OK OK OK
+#> DFOP OK OK OK OK
+#>
+#> OK: No warnings
# We get false convergence for the FOMC fit to FOCUS_2006_A because this
# dataset is really SFO, and the FOMC fit is overparameterised
-stopCluster(cl)
-#> Error in stopCluster(cl): could not find function "stopCluster"
+parallel::stopCluster(cl)
# }
@@ -254,7 +275,7 @@ plotting.
--
cgit v1.2.3