title: Using all cores with Microsoft R Open and Google Compute Engine
body: <p>I'm using Microsoft R Open on a GCE instance that has two vCPUs. Here are its specs.</p>
  
  <pre><code>$ lscpu
  Architecture:          x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Byte Order:            Little Endian
  CPU(s):                2
  On-line CPU(s) list:   0,1
  Thread(s) per core:    2
  Core(s) per socket:    1
  Socket(s):             1
  NUMA node(s):          1
  Vendor ID:             GenuineIntel
  CPU family:            6
  Model:                 63
  Model name:            Intel(R) Xeon(R) CPU @ 2.30GHz
  Stepping:              0
  CPU MHz:               2300.000
  BogoMIPS:              4600.00
  Hypervisor vendor:     KVM
  Virtualization type:   full
  L1d cache:             32K
  L1i cache:             32K
  L2 cache:              256K
  L3 cache:              46080K
  NUMA node0 CPU(s):     0,1
  Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush
   mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc
   eagerfpu pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hyp
  ervisor lahf_lm abm fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms xsaveopt
  </code></pre>
  
  <p>Even though I have two cores, Microsoft R Open seems to recognize only one of them, so I'm not taking full advantage of my computing capacity. I can't set the numbers of threads manually either.</p>
  
  <pre><code>Microsoft R Open 3.3.2
  The enhanced R distribution from Microsoft
  Microsoft packages Copyright (C) 2016 Microsoft Corporation
  Using the Intel MKL for parallel mathematical computing(using 1 cores).
  Default CRAN mirror snapshot taken on 2016-11-01.
  See: https://mran.microsoft.com/.
  &gt; getMKLthreads()
  [1] 1
  &gt; setMKLthreads(2)
  Number of threads at maximum: no change has been made.
  </code></pre>
  
  <p>Here's a graph showing CPU usage. It never uses more than 50% of CPU power. </p>
  
  <p><a href="https://i.stack.imgur.com/0OX6R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0OX6R.png" alt="enter image description here"></a></p>
  
  <p>So, what should I do so I can use all my cores with MRO?</p>