Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

umx_set_cores

umx_set_cores


Description

set the number of cores (threads) used by OpenMx

Usage

umx_set_cores(cores = NA, model = NULL, silent = FALSE)

Arguments

cores

number of cores to use. NA (the default) returns current value. "-1" will set to omxDetectCores().

model

an (optional) model to set. If left NULL, the global option is updated.

silent

If TRUE, no message will be printed.

Value

  • number of cores

References

See Also

Examples

library(umx)
manifests = c("mpg", "disp", "gear")
m1 = mxModel("ind", type = "RAM",
	manifestVars = manifests,
	mxPath(from = manifests, arrows = 2),
	mxPath(from = "one", to = manifests),
	mxData(mtcars[, manifests], type = "raw")
)
umx_set_cores() # print current value
oldCores = umx_set_cores(silent = TRUE)  # store existing value
umx_set_cores(omxDetectCores()) # set to max
umx_set_cores(-1); umx_set_cores() # set to max
m1 = umx_set_cores(1, m1)  # set m1 usage to 1 core
umx_set_cores(model = m1)  # show new value for m1
umx_set_cores(oldCores)    # reinstate old global value

umx

Structural Equation Modeling and Twin Modeling in R

v4.10.10
GPL-3
Authors
Timothy C. Bates [aut, cre] (<https://orcid.org/0000-0002-1153-9007>), Gillespie Nathan [wit], Michael Zakharin [wit], Brenton Wiernik [ctb], Joshua N. Pritikin [ctb], Michael C. Neale [ctb], Hermine Maes [ctb]
Initial release
2021-11-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.