rpi_logo
Source Code and Optimized FreeBSD Binaries
Source Code and Optimized FreeBSD Binaries
log in

Advanced search

Message boards : Application Code Discussion : Source Code and Optimized FreeBSD Binaries

1 · 2 · Next
Author Message
Brian Neal
Send message
Joined: 9 Oct 14
Posts: 14
Credit: 1,893,890
RAC: 0

Message 62726 - Posted: 22 Nov 2014, 9:38:09 UTC

Hi,

I've been running the project on both Windows and FreeBSD and have noticed the FreeBSD binaries run substantially slower (~14x) than their Windows counterparts on the same hardware. The v1.00 FreeBSD binary appears to be using an SSE3 codepath whereas Windows is using SSE4.1:

Windows:

http://milkyway.cs.rpi.edu/milkyway/result.php?resultid=880295284

FreeBSD:

http://milkyway.cs.rpi.edu/milkyway/result.php?resultid=882142548

I'd be happy to contribute optimized binaries for FreeBSD. Does anyone know if this is the latest source revision?

http://milkyway.cs.rpi.edu/milkyway/download/src/

Thanks!

-Brian

boinc127
Send message
Joined: 16 Mar 11
Posts: 11
Credit: 630,124
RAC: 0

Message 62727 - Posted: 23 Nov 2014, 1:24:28 UTC

If you could do that that would be totally awesome! I was just about ready to attempt to compile from some source code, I believe from

https://github.com/Milkyway-at-home/milkywayathome_client

but honestly, I don't have much experience compiling from source code for FreeBSD. Using cmake makes it tremendously easier to figure out how to fix issues I have come across, but my lack of experience has made my endeavor substantially slower. I was actually about to give up and switch over to the linux binary, which I believe would also be much faster. I know when running the linux binary separation (modified fit) program through FreeBSD it does pick up the SSE4.1 intrinsics.

Thanks
Jeremy

Brian Neal
Send message
Joined: 9 Oct 14
Posts: 14
Credit: 1,893,890
RAC: 0

Message 62728 - Posted: 23 Nov 2014, 6:41:49 UTC
Last modified: 23 Nov 2014, 6:46:25 UTC

Thanks! I had gotten that old code working, but this is much better!

I now have optimized separation and nbody binaries:

Download:

https://aceshardware.files.wordpress.com/2014/11/milkyway_1-44_1-36_x86_64-pc-freebsd.zip

CFLAGS (clang 3.4.1):

-O3 -fvectorize -static


milkyway_nbody:

~/dev/milkywayathome_client % make check Test project /home/brian/dev/milkywayathome_client/nbody/tests Start 1: checkpoint_test 1/4 Test #1: checkpoint_test .................. Passed 1.60 sec Start 2: custom_arg_test 2/4 Test #2: custom_arg_test .................. Passed 8.00 sec Start 3: emd_test 3/4 Test #3: emd_test ......................... Passed 0.80 sec Start 4: invalid_input_test 4/4 Test #4: invalid_input_test ............... Passed 19.99 sec 100% tests passed, 0 tests failed out of 4 Total Test time (real) = 30.40 sec


milkyway_separation:

~/dev/milkywayathome_client/separation % make test Running tests... Test project /usr/home/brian/dev/milkywayathome_client/separation Start 1: tests 1/1 Test #1: tests ............................ Passed 145.80 sec 100% tests passed, 0 tests failed out of 1 Total Test time (real) = 145.80 sec


The performance is much improved:

Before:

http://milkyway.cs.rpi.edu/milkyway/result.php?resultid=882142548

882142548 653711462 20 Nov 2014, 12:10:13 UTC 21 Nov 2014, 14:28:12 UTC Completed and validated 51,249.09 51,043.42 106.88 MilkyWay@Home v1.00


After:

http://milkyway.cs.rpi.edu/milkyway/result.php?resultid=884981220

884981220 655662031 23 Nov 2014, 4:48:51 UTC 23 Nov 2014, 5:48:13 UTC Completed and validated 3,324.51 3,236.41 106.88 MilkyWay@Home
Anonymous platform (CPU)


Note that the SSE4.1 codepath is now utilized. I'm also now running NBody work units, which were previously unavailable on FreeBSD.

boinc127
Send message
Joined: 16 Mar 11
Posts: 11
Credit: 630,124
RAC: 0

Message 62729 - Posted: 23 Nov 2014, 8:35:04 UTC - in response to Message 62728.

That's really great. I'm looking forward to using the new apps as soon as I restart my computer into FreeBSD. I was getting frustrated trying to understand all of the cmake errors and I got stuck when it reported the BOINC library files were too old. I'm glad to see you got them working.

I was using the Linux 32 bit versions of nbody (1.44) and separation modified fit (1.36) and they ran fine. I know that separation found the sse4.1 code path with no issues. And I just put a copy of the libgomp library file in my milkyway project directory to get nbody working ok. But native FreeBSD is much better. I'm always happy to represent FreeBSD while crunching BOINC projects, and this will go even farther.

Thanks a lot!
Jeremy

Brian Neal
Send message
Joined: 9 Oct 14
Posts: 14
Credit: 1,893,890
RAC: 0

Message 62730 - Posted: 23 Nov 2014, 15:07:55 UTC

Fantastic, let me know how it goes!

boinc127
Send message
Joined: 16 Mar 11
Posts: 11
Credit: 630,124
RAC: 0

Message 62744 - Posted: 27 Nov 2014, 6:43:12 UTC - in response to Message 62730.

Hey quick question for you, what did you compile the NBody app with, clang or gcc? I haven't had a chance to test the new programs yet, I've been stuck doing work with Windows (bleck), but I wasn't sure if the NBody app is able to multithread with more than one core or thread. Just curious.

Brian Neal
Send message
Joined: 9 Oct 14
Posts: 14
Credit: 1,893,890
RAC: 0

Message 62746 - Posted: 27 Nov 2014, 19:59:50 UTC - in response to Message 62744.

It's built with clang, using the flags in the above post. I didn't build it with OpenMP, so both apps are single-threaded. I haven't found this to be a problem for N-Body because BOINC just runs one process per core anyway.

I'm testing some minor optimizations to the separation code that's currently saving ~15 seconds per unit/core, or about an hour of CPU time a day for my system. Once I finalize it, I'll post another build and I'll try to include OpenMP-enabled binaries as well.

boinc127
Send message
Joined: 16 Mar 11
Posts: 11
Credit: 630,124
RAC: 0

Message 62783 - Posted: 5 Dec 2014, 2:53:09 UTC

Wow those binaries are much faster, possibly faster than running the linux ones. I'm still trying to tackle compiling the binaries myself, as a good learning tool, but have hit a brick wall with undefined references galore while trying to compile separation. What a headache.

Brian Neal
Send message
Joined: 9 Oct 14
Posts: 14
Credit: 1,893,890
RAC: 0

Message 62796 - Posted: 7 Dec 2014, 11:00:00 UTC - in response to Message 62783.

Wow those binaries are much faster, possibly faster than running the linux ones. I'm still trying to tackle compiling the binaries myself, as a good learning tool, but have hit a brick wall with undefined references galore while trying to compile separation. What a headache.


The code does not compile 100% cleanly on FreeBSD, so I had to make some minor patches. I'll try and reach out to the project admins to see if they'd like to integrate my changes into their mainline to permit easy FreeBSD builds going forward. I also have some slightly faster binaries I'll post soon!

Torfinn Ingolfsen
Send message
Joined: 17 Aug 08
Posts: 8
Credit: 3,561,238
RAC: 0

Message 62917 - Posted: 31 Dec 2014, 12:17:10 UTC

FWIW, I am using the binaries from message 62728 on my BOINC machine, even if it is a bit outdated:

root@kg-vm# uname -a FreeBSD kg-vm.kg4.no 8.3-PRERELEASE FreeBSD 8.3-PRERELEASE #5: Sun Jun 9 17:44:22 CEST 2013 root@kg-vm.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64

and the programs appear to run just fine - thanks!
However, in the workunit logs for nbody, I see this error message:
<search_application> milkyway_nbody 1.44 FreeBSD x86_64 double , Crlibm </search_application> Application version too old. Workunit requires version 1.46, but this is 1.44 Failed to read input parameters file 12:13:21 (95209): called boinc_finish

Just in case anybody knows where to find newer source code.

Torfinn Ingolfsen
Send message
Joined: 17 Aug 08
Posts: 8
Credit: 3,561,238
RAC: 0

Message 62926 - Posted: 1 Jan 2015, 18:48:58 UTC

This message found source code on Github, but no one has confirmed that it is the official source - yet.
____________

Brian Neal
Send message
Joined: 9 Oct 14
Posts: 14
Credit: 1,893,890
RAC: 0

Message 62979 - Posted: 10 Jan 2015, 10:29:50 UTC

Looks like there was an update to NBody. I'll see about building an updated binary for it.

Torfinn Ingolfsen
Send message
Joined: 17 Aug 08
Posts: 8
Credit: 3,561,238
RAC: 0

Message 63017 - Posted: 14 Jan 2015, 23:12:23 UTC - in response to Message 62979.

Thank you for doing this.

Torfinn Ingolfsen
Send message
Joined: 17 Aug 08
Posts: 8
Credit: 3,561,238
RAC: 0

Message 63143 - Posted: 14 Feb 2015, 23:33:11 UTC

The source code on Github: https://github.com/Milkyway-at-home/milkywayathome_client
is updated, nBody 1.48 is there.

Brian Neal
Send message
Joined: 9 Oct 14
Posts: 14
Credit: 1,893,890
RAC: 0

Message 63256 - Posted: 24 Mar 2015, 17:24:39 UTC - in response to Message 63143.

The source code on Github: https://github.com/Milkyway-at-home/milkywayathome_client
is updated, nBody 1.48 is there.


Thanks, I'll pull down the updated code and post a new build tonight.

Brian Neal
Send message
Joined: 9 Oct 14
Posts: 14
Credit: 1,893,890
RAC: 0

Message 63260 - Posted: 25 Mar 2015, 5:12:38 UTC
Last modified: 25 Mar 2015, 5:12:54 UTC

NBODY 1.48 is now available:

https://aceshardware.files.wordpress.com/2015/03/milkyway_1-48_1-36_x86_64-pc-freebsd.zip

milkyway_nbody 1.44:

% make check Test project milkywayathome_client/nbody/tests Start 1: checkpoint_test 1/4 Test #1: checkpoint_test .................. Passed 1.01 sec Start 2: custom_arg_test 2/4 Test #2: custom_arg_test .................. Passed 8.00 sec Start 3: emd_test 3/4 Test #3: emd_test ......................... Passed 0.97 sec Start 4: invalid_input_test 4/4 Test #4: invalid_input_test ............... Passed 19.99 sec 100% tests passed, 0 tests failed out of 4


milkyway_separation 1.36:

% make test Running tests... Test project milkywayathome_client/separation Start 1: tests 1/1 Test #1: tests ............................ Passed 145.82 sec 100% tests passed, 0 tests failed out of 1 Total Test time (real) = 145.82 sec

boinc127
Send message
Joined: 16 Mar 11
Posts: 11
Credit: 630,124
RAC: 0

Message 63272 - Posted: 26 Mar 2015, 18:25:16 UTC - in response to Message 63260.

Thanks so much for the binaries. It works like a charm.

Torfinn Ingolfsen
Send message
Joined: 17 Aug 08
Posts: 8
Credit: 3,561,238
RAC: 0

Message 63277 - Posted: 27 Mar 2015, 18:28:13 UTC - in response to Message 63260.
Last modified: 27 Mar 2015, 18:28:34 UTC

Thanks for compiling the binaries! Been running them almost a day now, everything looks ok. Have a nice weekend, everyboday.

boinc127
Send message
Joined: 16 Mar 11
Posts: 11
Credit: 630,124
RAC: 0

Message 63313 - Posted: 2 Apr 2015, 2:51:31 UTC
Last modified: 2 Apr 2015, 2:59:19 UTC

Has anyone else had any issues running the FreeBSD Nbody 1.48 binary? I've gotten 8 validate errors with them so far... they aren't invalids, but they aren't validating. I've switched back over to the linux 32 bit (mt) binary and the issue goes away.

Perhaps there's some weird regression with LLVM or clang thats botching the workunits up?

EDIT: I've noticed some of these same issues with Darwin hosts when the workunit is sent to another host to check my inconclusives.

Brian Neal
Send message
Joined: 9 Oct 14
Posts: 14
Credit: 1,893,890
RAC: 0

Message 63314 - Posted: 2 Apr 2015, 3:46:00 UTC - in response to Message 63313.
Last modified: 2 Apr 2015, 3:46:16 UTC

Has anyone else had any issues running the FreeBSD Nbody 1.48 binary? I've gotten 8 validate errors with them so far... they aren't invalids, but they aren't validating. I've switched back over to the linux 32 bit (mt) binary and the issue goes away.

Perhaps there's some weird regression with LLVM or clang thats botching the workunits up?

EDIT: I've noticed some of these same issues with Darwin hosts when the workunit is sent to another host to check my inconclusives.


Could be bad work units...I've noticed a few that are inconclusive:

http://milkyway.cs.rpi.edu/milkyway/workunit.php?wuid=775468075

http://milkyway.cs.rpi.edu/milkyway/workunit.php?wuid=775464620

I've also had several that were successfully validated.

1 · 2 · Next
Post to thread

Message boards : Application Code Discussion : Source Code and Optimized FreeBSD Binaries


Main page · Your account · Message boards


Copyright © 2018 AstroInformatics Group