# Distributed computing in the Windows Subsystem for Linux

**URL:** https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723
**Category:** General Usage
**Created:** [May 1, 2019, 2:51am UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723 "2019-05-01T02:51:08Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [May 1, 2019, 2:51am UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/1 "2019-05-01T02:51:08Z")

</div>

I have noticed that running Distributed-enabled computations in the WSL is very much sub-optimal.  
I have a fast Windows 10 machine with 16 cores (which runs the simulation in the WSL), and when running a single worker, it is about 1.75 times faster than a Linux machine I use for comparison. When running with 4 workers, the fast Windows machine is 1.5 times _slower_ than the Linux machine.

I have also tried running the Distributed computations under Windows directly (i. e. with a Windows Julia), and the fast Windows machine is now indeed ~1.7 times faster than the Linux machine both for single worker and for multiple workers.

It would appear to me that the WSL is somehow crippled for the use of multiple cores. Could anyone verify that or contribute some knowledge as to this aspect?

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [May 1, 2019, 6:08am UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/2 "2019-05-01T06:08:02Z")

</div>

That’s a darned good question. I have a windows 10 laptop and WSL, but I have not used it much. I have not given much though to how it works. It is not a Virtual Machine - instead there is some sort of kernel compatibility layer - ie the Linux syscalls are emulated (or something) and are run by Windows. So maybe the emulation is where a slowdown is happening.

This might be useful

> **[Pico Process Overview](https://learn.microsoft.com/en-us/archive/blogs/wsl/pico-process-overview)**

---

<div class="post-metadata">

### Author: ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)
#### Post date: [May 1, 2019, 10:48am UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/3 "2019-05-01T10:48:08Z")

</div>

> [@PetrKryslUCSD](#):
>
> It would appear to me that the WSL is somehow crippled for the use of multiple cores. Could anyone verify that or contribute some knowledge as to this aspect?

Maybe you could cross check using a cygwin linux on your windows 10 machine. If you still get lower performace in cygwin julia … no, I just realize under cygwin you would run a native windows julia and not a linux julia, so you would propably get the same performance as directly from windows 10. Despite that I let this idea here for others if it isn’t as dumb as I think it is now 😁

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [May 2, 2019, 2:11pm UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/4 "2019-05-02T14:11:01Z")

</div>

Seems like a fine idea to me. Unfortunately I do not have cygwin installed, and no time to do so.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [May 2, 2019, 4:57pm UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/5 "2019-05-02T16:57:11Z")

</div>

For a laugh, I started up WSL and ran apt install Julia  
It installs version 0.4.5 ☹  
The Ubuntu release is 16.04 LTS

On a physical Ubuntu server with 18.10/Cosmic Julia with apt is version 1.0.1

Microsoft/Ubuntu guys - seriously? I know why Long Term Support versions.  
But many people just use the distro supplied software packages.  
And before anyone says, Julia is very easy to install even without root privileges.

---

<div class="post-metadata">

### Author: ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)
#### Post date: [May 2, 2019, 8:16pm UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/6 "2019-05-02T20:16:55Z")

</div>

I think WSL is a single core (sub)system

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [May 2, 2019, 8:22pm UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/7 "2019-05-02T20:22:29Z")

</div>

What made you think this?

WSL:

```julia
julia> peakflops(10000)
3.128249420206342e11

```

Windows:

```julia
julia> peakflops(10000)
3.235946865234721e11

```

---

<div class="post-metadata">

### Author: ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)
#### Post date: [May 2, 2019, 10:09pm UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/8 "2019-05-02T22:09:29Z")

</div>

Don’t remember now but it was from experiments running a program (very likely GMT) that was doing single core only in WSL.

However `lscpu` clearly tells me that I have 8 CPU(s)

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [May 2, 2019, 10:37pm UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/9 "2019-05-02T22:37:34Z")

</div>

My setup reports also several CPUs:  
Architecture: x86\_64  
CPU op-mode(s): 32-bit, 64-bit  
Byte Order: Little Endian  
CPU(s): 32  
On-line CPU(s) list: 0-31  
Thread(s) per core: 2  
Core(s) per socket: 8  
Socket(s): 2  
Vendor ID: GenuineIntel  
CPU family: 6  
Model: 45  
Model name: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz  
Stepping: 7  
CPU MHz: 2601.000  
CPU max MHz: 2601.0000  
BogoMIPS: 5202.00  
Virtualization: VT-x  
Hypervisor vendor: Windows Subsystem for Linux  
Virtualization type: container  
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm pni pclmulqdq dtes64 monitor ds\_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4\_1 sse4\_2 x2apic popcnt tsc\_deadline\_timer aes xsave osxsave avx

---

<div class="post-metadata">

### Author: ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)
#### Post date: [May 3, 2019, 3:42am UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/10 "2019-05-03T03:42:46Z")

</div>

WSL is no emulation, it’s (with a short, incomplete picture) “just” a translation from Linux Syscalls & process management to NT kernel syscalls and process management.

There’s more info about how the translation works [here](https://blogs.msdn.microsoft.com/wsl/2016/06/08/wsl-system-calls/). It’s part 3 of a series of blog posts about how the internals work, specifically syscalls.

---

<div class="post-metadata">

### Author: ![ihnorton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihnorton/32/26_2.png) [@ihnorton](https://discourse.julialang.org/u/ihnorton)
#### Post date: [May 3, 2019, 3:51am UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/11 "2019-05-03T03:51:19Z")

</div>

What is the output of `julia> Sys.cpu_info()`  
and `cat /proc/cpuinfo`?

Apparently WSL [does not support multiple sockets](https://github.com/Microsoft/WSL/issues/3314). Nevertheless, in theory, you should have 8 cores available from one of the sockets with that system. Perhaps you are hitting this issue below and getting pinned to a single core in a similar manner:

[https://github.com/Microsoft/WSL/issues/3294](https://github.com/Microsoft/WSL/issues/3294)

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [May 3, 2019, 3:52am UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/12 "2019-05-03T03:52:30Z")

</div>

Nice link. It helped me understand why while in the Linux WSL terminal ^z crashes Julia with “futex error” upon resume.

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [May 3, 2019, 3:56am UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/13 "2019-05-03T03:56:46Z")

</div>

> [@ihnorton](#):
>
> Sys.cpu\_info()

I got

```julia
julia> Sys.cpu_info()
32-element Array{Base.Sys.CPUinfo,1}:
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 1068306 s 0 s 24892 s 820290 s 2240 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 493720 s 0 s 4321 s 1415446 s 4 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 1108003 s 0 s 8535 s 796950 s 6 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 453254 s 0 s 5090 s 1455140 s 6 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 1142401 s 0 s 7731 s 763356 s 304 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 419200 s 0 s 4437 s 1489851 s 7 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 1079481 s 0 s 7817 s 826190 s 3 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 471112 s 0 s 3532 s 1438843 s 4 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 619456 s 0 s 10312 s 1283720 s 4 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 946284 s 0 s 5709 s 961496 s 6 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 661068 s 0 s 6282 s 1246137 s 156 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 881051 s 0 s 4345 s 1028092 s 3 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 1012118 s 0 s 57859 s 843510 s 90 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 574282 s 0 s 1556 s 1337650 s 1 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 760537 s 0 s 15771 s 1137179 s 54 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 804298 s 0 s 17753 s 1091439 s 7 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 12601 s 0 s 1348 s 1899539 s 3 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 30065 s 0 s 2532 s 1880889 s 0 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 20178 s 0 s 1634 s 1891673 s 1 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 21364 s 0 s 2509 s 1889612 s 7 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 44379 s 0 s 2365 s 1866742 s 1 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 76 s 0 s 43 s 1913368 s 0 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 34889 s 0 s 723 s 1877875 s 3 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 331 s 0 s 546 s 1912609 s 10 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 18600 s 0 s 434 s 1894451 s 1 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 1939 s 0 s 871 s 1910676 s 70 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 2001 s 0 s 471 s 1911015 s 81 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 232 s 0 s 193 s 1913062 s 0 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 28503 s 0 s 3262 s 1881720 s 0 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 375 s 0 s 370 s 1912743 s 4 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 30273 s 0 s 2692 s 1880520 s 4 s
        Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz:
        speed user nice sys idle irq
     2601 MHz 298 s 0 s 21481 s 1891707 s 12 s

julia>

```

And

```julia
cat /proc/cpuinfo
...
processor : 31
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
stepping : 7
microcode : 0xffffffff
cpu MHz : 2601.000
cache size : 256 KB
physical id : 1
siblings : 16
core id : 7
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave osxsave avx
bogomips : 5202.00
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

```

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [May 3, 2019, 4:01am UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/14 "2019-05-03T04:01:54Z")

</div>

I don’t know what to think. I followed the MPI run link, and dug down some more. It is an issue around two years old, so it might have gotten addressed. At least one person reports having been able to use all sockets from WSL.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [May 7, 2019, 10:44am UTC](https://discourse.julialang.org/t/distributed-computing-in-the-windows-subsystem-for-linux/23723/15 "2019-05-07T10:44:32Z")

</div>

Talking about WSL, Microsoft have announced WSL 2 which has a real Linux kernel

> **[Announcing WSL 2](https://devblogs.microsoft.com/commandline/announcing-wsl-2/)**
>
> WSL 2 is a new architecture that allows for dramatic file system performance and full system call compatibility in WSL using a Linux kernel.

I have no idea how this works, and it seems to be in the technology preview at the moment.  
I don’t think I m brave enough to enable this on my laptop!
