Created
May 19, 2014 12:59
-
-
Save tbates/0a6e5285f42b86099858 to your computer and use it in GitHub Desktop.
Mucking around with parallel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# R version 3.0.3 (2014-03-06) -- "Warm Puppy" | |
source("http://openmx.psyc.virginia.edu/getOpenMxBeta.R") | |
library("OpenMx") | |
packageVersion("OpenMx") # [1] ‘999.0.0.3473’ | |
data(demoOneFactor) | |
manifests <- names(demoOneFactor) | |
latents <- c("G") | |
model <- mxModel(model="One Factor", type="RAM", | |
manifestVars = manifests, | |
latentVars = latents, | |
mxPath(from=latents, to=manifests, labels=paste("b", 1:5, sep="")), | |
mxPath(from=manifests, arrows=2, labels=paste("u", 1:5, sep="")), | |
mxPath(from=latents , arrows=2, free=FALSE, values=1.0), | |
mxData(cov(demoOneFactor), type="cov", numObs=500) | |
) | |
model <- mxRun(model) | |
summary(model) | |
omxDetectCores() # cores available | |
getOption('mxOptions')$"Number of Threads" # cores used by OpenMx | |
# Activate parallel as follows: | |
mxOption(model= model, key="Number of Threads", value= (omxDetectCores() - 1)) | |
# R version 3.1.0 (2014-04-10) -- "Spring Dance" | |
# Platform: x86_64-apple-darwin10.8.0 (64-bit) | |
source("http://openmx.psyc.virginia.edu/getOpenMxBeta.R") | |
library("OpenMx") | |
packageVersion("OpenMx") # [1] ‘999.0.0.3473’ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment