none
System.time shows almost same time with R and MRO RRS feed

  • Question

  • When I run my code using MRO, I get a bit greater system time then normal R.

    And, I have checked for how 2 cores are being used.

    And, Secondly I have four Cores in my computer, I have checked with Parallel::detectCores(), but when i try increase the cores using setMKLthreads(<value>) command i got a error saying that you are already using the maximum cores 

    Wednesday, October 26, 2016 7:07 AM

All replies

  • Because MRO uses Intel's MKL and it's optimized math libaries most computations will be faster in MRO than base CRAN-R, but not all computations are faster than they are in base CRAN-R.

    It is possible to swap out the BLAS libraries with the default CRAN ones, which are also included with MRO.

    You can do this as follows:

    1).  Backup the BLAS DLL's and rename the following files:

         Rename 'C:/Program Files/Microsoft/MRO-3.3.1/bin/x64/Rblas.dll' to Rblas.dll.old'.

         Rename 'C:/Program Files/Microsoft/MRO-3.3.1/bin/x64/Rlapack.dll' to Rlapack.dll.old'.


    2).  Rename the CRAN DLL's:

           Rename 'C:/Program Files/Microsoft/MRO-3.3.1/bin/x64/Rblas.dll_CRAN' to 'Rblas.dll'.

           Rename 'C:/Program Files/Microsoft/MRO-3.3.1/bin/x64/Rlapack.dll_CRAN' to 'Rlapack.dll'.

    3). Restart Microsoft R Open. MRO will now use the default CRAN libraries for numerical computations.

    To answer your second question, the issue here is that you have 4 logical processors on your macine, but 2 of them are virtual processors. Only non-virtual processors are important in parallel processing in R.

    On my work laptop for example, paralell:::detectCores() reports 8, but I have only 4 actual processores on the system. Hyperthreading is of little benefit in R and is not used in parallel computing.

    Stephen Weller

    Microsoft R Open Product Team

      

     
    Wednesday, October 26, 2016 3:07 PM
  • Also, when it comes to parallel processing it's the elapsed time that's of interest, not the system time. Parallel processing has additional overhead, so you expect the system will have to do a little more work. But in most (but not all cases, as Stephen points out), you shouldn't have to wait as long for it to complete.
    Wednesday, October 26, 2016 8:43 PM
  • Regarding renaming  Rename the CRAN DLL's:

    There are no such file in that in "C:/Program Files/Microsoft/MRO-3.3.1/bin/x64/" location

    Thursday, October 27, 2016 4:17 AM
  • The elapsed time is even more than normal elapsed time

    Thursday, October 27, 2016 4:32 AM