1

I have a Windows OS, with a WSL installed. I am running some computation heavy processes in WSL, written in Fortran, submit using nohup, which usually takes 10 hours to complete a task.

I wanted to simultaneously submit, say 30 tasks. But I want to leave at least one core (or thread) free for my windows processes (like my browser and OriginPro).

Is there a way to submit jobs in WSL that limit to only n-1 number of cores/threads? Or even better, prioritize windows tasks so that my WSL processes gets the lowest priority (similar to nice).

Thanks


2023-03-15: Post forwared from AskUbuntu.

The problem is, I only have one computer. Sometimes I submit a whole bunch of jobs at once in WSL and let it run non-stop for a few weeks. And during this time, I want to use Windows to do something else during the day, but it is extremely slow, and I want to prioritize those Windows apps to run faster. But at the same time, I want the PC to run at full power on those WSL jobs when I go home at night.

  • you could of course limit the number of processors available to WSL – Jaromanda X Mar 15 '23 at 06:17
  • @JaromandaX, thanks. That's one way to do it. But processor limitation is only available to WSL2 and not WSL1. Also, when I'm not running Win apps, those limited processors will be idle. – Raymond Chen Mar 15 '23 at 06:41
  • true - does each task use more than one cpu core/cpu thread? – Jaromanda X Mar 15 '23 at 07:46
  • @JaromandaX each task is running on a single core/thread. – Raymond Chen Mar 15 '23 at 08:18
  • 1
    You could lower the priority of these WSL tasks so they stay in the background. How do these tasks look like in Task Manager? Do they all use the same `.exe`? – harrymc Mar 15 '23 at 10:00
  • @RaymondChen Since you mention it in the comment, are you asking about WSL1 specifically? And I think harrymc is on the right track - That was the answer I was going to propose when you originally posted on AU, but I'm glad we got it over here -- More Windows expertise is a good thing on this one. – NotTheDr01ds Mar 15 '23 at 13:18
  • Thanks. I found that WSL processes appears as individual tasks in Windows task manager, and I can modify its priority in there. Thanks to harry and droid's hints. – Raymond Chen Mar 18 '23 at 07:30

0 Answers0