November 2, 2012
OpenMx + mclapply

If you are trying to run multiple OpenMx models at once, such as on a cluster or through a function like mclapply(), you need to tell OpenMx to just use a single thread. Otherwise the OpenMx threads from the processing running in parallel will step all over each other and hang.

The trick is to set the option

mxOption(NULL, 'Number of Threads', 1)

Then your code will look something like