I have set up R/RStudio in WSL following the instructions I wrote up a while back outlined here: https://killianmelsen.github.io/guide/2023/06/20/Accelerating-R-using-oneMKL-and-Windows-Subsystem-for-Linux.html
However, setting the number of threads in the /etc/environment file no longer does anything. It used to work perfectly.
Here's the environment file for 1 thread, and here's the same file for the multi-threaded setting. I shut down and restarted WSL after making any changes.
Here are the results:
default BLAS/LAPACK, i.e. not MKL
same 5000x5000 matrix using MKL/16 threads
Any ideas this seems to no longer work?
Changing these settings in /etc/environment always had an effect on the CPU utilization and runtimes. For some reason that is not the case anymore. This is an imported Ubuntu distribution that is based on the original WSL Ubuntu installation (I wanted to set up multiple distributions), could that have anything to do with it?
Solution: seems like editing /etc/environment
does not work with WSL (I am 100% sure it did when I was using a VM). As an alternative export MKL_NUM_THREADS=x
can be added to ~/.profile
as per the instructions here.