How can you tell if OpenMx is using multiple cores?
Posted on

Forums
I'm running OpenMx on 4 different computers running Ubuntu 15.04 and the latest version of OpenMx and current versions of R. On one, when look at the output for htop, it seems clear that all 4 cores are being used by OpenMx. Yet on two of the others, htop seems to indicate that not all 4 cores are being used simultaneously and the same model takes 2 to 3 times longer to run. I've tried using the suggestion to tell OpenMx to use more threads - but this seems to have no effect and I never had to do this on the computer that seems to be using all 4 cores and runs the model much more quickly. I don't think its processing power is greater than the other computers. When I used to install OpenMx, it seemed that it asked you if you wanted parallel processing enabled. But lately it no longer asks.
source for multicore on mac (thought *nix always was multi?)
source('http://openmx.psyc.virginia.edu/getOpenMx.R')
FYI, umx supports a method to check core usage effects fairly easily:
library(umx)
umx_check_parallel()
# You are using 0 of 4 available cores (0 means max - 1)
# I will now set cores to 4 (they will be reset after) and run a script that hits multiple cores if possible.
# Check CPU while it's running and see if R is pegging the processor.
# Running threeLatentWithModerator with 32 parameters
threeLatentWithModerator: 01 minute, 58.30 seconds
This will let you also experiment with different core numbers (parameter to function, defaults to -1)
Watch an activity monitor and see if the usage goes to 200 or 400% etc.
umx_check_parallel()
will also return the timing, so you can doumx_check_parallel(8)
umx_check_parallel(4)
Log in or register to post comments
In reply to source for multicore on mac (thought *nix always was multi?) by tbates
R running under Linux always
Log in or register to post comments
It certainly sounds to me
-fopenmp
, at the very least) to compile with multithreading. My guess is that your best bet is to try adding those flags in the appropriate part of R's Makeconf, assuming you're authorized to edit it on that system. Failing that, you could maybe try adding the flags to OpenMx's src/Makevars.in .Someone who installs OpenMx under Linux more frequently than I do might have better advice.
Log in or register to post comments