title: Parallel computing in R: how to choose cores
body: <p>In R, I using packages "doParallel" and "foreach" to parallel computing. Recently, I am running the program in HPC. It has four nodes, and each node has 16 processors. My R program only needs 4 processors. But the HPC always assigns the program to one node occupying all 16 processors. So I cannot run any other program in that node then. <strong>How to choose the self-defined number of processors in one node? And how to choose the processors which are not running program in one node?</strong>
  I use</p>
  
  <pre><code>library(foreach)
  library(doParallel)
  library(MASS)
  registerDoParallel(makeCluster(4))
  </code></pre>
  
  <p>I only need to use 4 processors. But the hpc always assigns one program to all processors in one nodes(actually the program is running in 4 processors).
  <strong>For example</strong>, a node has 16 processors. I have four programs that each of them needs four cores. What should I do to put four programs in one node?</p>