mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   Microsoft adds Linux Bash Shell and Ubuntu Binaries to Win10 (https://www.mersenneforum.org/showthread.php?t=22468)

ewmayer 2017-07-21 21:45

Microsoft adds Linux Bash Shell and Ubuntu Binaries to Win10
 
[url=thehackernews.com/2016/03/ubuntu-on-windows-10.html]Microsoft adds Linux Bash Shell and Ubuntu Binaries to Windows 10[/url] | The Hacker News

So let's say I have some multithreaded code which is currently GCC/Posix-builds-only. Will this allow me to build with the usual Posix pthread/thread-affinity support under Win10? Because while MSYS et al. are fine as far single-threaded builds go, || builds are a huge hurdle there.

wombatman 2017-07-21 23:22

Want me to try compiling something? I use the Bash shell in Windows pretty regularly for sieving and prp testing and am able to compile and use, for instance, multithreaded instances of sr1sieve and sr2sieve.

ewmayer 2017-07-22 00:15

[QUOTE=wombatman;463935]Want me to try compiling something? I use the Bash shell in Windows pretty regularly for sieving and prp testing and am able to compile and use, for instance, multithreaded instances of sr1sieve and sr2sieve.[/QUOTE]

Sure, how about [url=http://www.mersenneforum.org/mayer/README.html]Mlucas v17[/url]? If this functions as hoped, you should be able to simply follow the Linux build instructions. Suggest trying on a single sample source file, though, e.g. (this assumes you're in an obj dir which you created within .../src):

gcc -c -O3 -DUSE_SSE2 -DUSE_THREADS ../util.c

wombatman 2017-07-22 00:29

Looks like it works right out of the box:

[CODE]Using 1 threads in carry step
100 iterations of M3888517 with FFT length 196608 = 192 K
Res64: 579D593FCE0707B2. AvgMaxErr = 0.240951102. MaxErr = 0.300781250. Program: E17.0
Res mod 2^36 = 67881076658
Res mod 2^35 - 1 = 21674900403
Res mod 2^36 - 1 = 42893438228
Clocks = 00:00:00.510[/CODE]

with -nthread 2:

[CODE]Using 2 threads in carry step
100 iterations of M3888517 with FFT length 196608 = 192 K
Res64: 579D593FCE0707B2. AvgMaxErr = 0.240951102. MaxErr = 0.300781250. Program: E17.0
Res mod 2^36 = 67881076658
Res mod 2^35 - 1 = 21674900403
Res mod 2^36 - 1 = 42893438228
Clocks = 00:00:00.339[/CODE]

Oh, and grep'ing for "error" in build.log returned nothing.

ewmayer 2017-07-22 00:43

[QUOTE=wombatman;463940]Looks like it works right out of the box:[/QUOTE]

Sweet! Note you should replace USE_SSE2 with one of

USE_AVX
USE_AVX2
USE_AVX512

depending on what the most-recent one of those instruction sets your hardware supports. Binary won't beat Prime95 (yet), but on at least 2 recent platforms (AMD Ryzen and Skylake Xeon, at least Google Cloud's version thereof) it should be pretty close, though optimal jobs/threads-per-job combos to maximize total throughput on the given CPU will often be different between the 2 programs. (On David Stanfill's Ryzen I get best total throughput for my code by running one 1-threaded job per physical core, after building for AVX2, obviously).

wombatman 2017-07-22 01:52

Duly noted! :tu:


All times are UTC. The time now is 06:36.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.