Questions and Answers :
Unix/Linux :
Website to optimize compilation of client?
Message board moderation
Author | Message |
---|---|
vrillusions Send message Joined: 12 Aug 00 Posts: 2 Credit: 245,025 RAC: 0 |
I thought I saw a site in here before when searching but can't find it now. It supposedly was a page with tips on how to optimize the linux client. Anyone have the link bookmarked or something? thanks |
Darren Send message Joined: 2 Jul 99 Posts: 259 Credit: 280,503 RAC: 0 |
Don't know of a site in here for it, but here is a thread with a lot of info on different things people were trying and some of the results: http://setiweb.ssl.berkeley.edu/forum_thread.php?id=1212 |
Dr. Jones Send message Joined: 24 Oct 00 Posts: 8 Credit: 6,043,144 RAC: 28 |
I have saved a post from the beta-test: Here's a couple of ideas on how to optimize your sah client for optimum performance. According to my experience it gives at least 10% higher performance (less CPU-time per WU) on my Athlon XP and MIPS based systems. Please let me know of any results you get. This is done with GCC-3.3 and GCC-3.2. I don't think this will work unmodified for older GCC compilers like 2.x. 1. Download the latest source for boinc client and seti_boinc. 2. Unpack the sources in the same top level directory (boinc_src for this example). 3. In boinc_src/boinc, do "./configure && make" and then copy the resulting client (will be in client directory) to whereever you run boinc from. 4. This is where you want to find the optimal CFLAGS for your host. For my Athlon XP box, I use: "-O3 -march=athlon-xp -fomit-frame-pointer". Different CPU's will have different optimal settings, take a look in GCC's info pages. Do the configure in seti_boinc: CFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer" ./configure (above is one command) 5. Edit client/Makefile What you want to do next is enable GCC's "-fprofile-arcs" option, which counts how many times each branch is taken in the compiled code. In client/Makefile, add this option to the end of the CFLAGS line. 6. Now build the client: make 7. Run the client You can now either copy the client to wherever boinc is installed (you have to create the app_info.xml in the projects directory as directed on this page: http://boinc.berkeley.edu/anonymous_platform.php). Or you can just run it from the client dir in standalone mode: copy test_workunits/reference_work_unit.sah to work_unit.sah in client, and run "./setiathome-2.xx.i686-pc-linux-gnu -standalone" Either way, let it crunch most or all of a workunit to get the statistics for the branches. 8. When it's done, and you break it, it will save ".da" files for each of the object files in the client build directory. Now you can recompile using these options to tell the compiler which branches are most likely to execute: Edit the Makefile and change "-fprofile-arcs" to "-fbranch-probabilities". This will instruct the compiler to use the .da files. Delete all object files in the client folder: "rm -f *.o" Now from the top-level seti_boinc directory run make , this will create a new client. This is the fully optimized one, and you can copy it to your boinc installation folder and start crunching away.. Let me know how you get on. // Thomas |
Darren Send message Joined: 2 Jul 99 Posts: 259 Credit: 280,503 RAC: 0 |
> 8. When it's done, and you break it, it will save ".da" files for each of the > object files in the client build directory. Now you can recompile using these > options to tell the compiler which branches are most likely to execute: I've gone through this on my system, but after it completes the test work unit and I break it, it does not create any .da files. > Now from the top-level seti_boinc directory run make , this will create a new > client. This is the fully optimized one, and you can copy it to your boinc > installation folder and start crunching away.. And of course without the .da files, a recompile will report "file xxx.da not found, execution counts assumed to be zero". Any advise? |
Dr. Jones Send message Joined: 24 Oct 00 Posts: 8 Credit: 6,043,144 RAC: 28 |
Have you edited the correct Makefile ? I have once done the same mistake and edited the Makefile in the main directory, not in the client directory. |
Darren Send message Joined: 2 Jul 99 Posts: 259 Credit: 280,503 RAC: 0 |
> Have you edited the correct Makefile ? I have once done the same mistake and > edited the Makefile in the main directory, not in the client directory. Yep, I just checked it again to make sure. Since I use vi as my text editor, it automatically makes a backup of the files that are modified. Here is the beginning of the file ~/seti_boinc/client/Makefile that I compiled with: # $Id: Makefile.in,v 1.9 2004/06/15 23:08:19 davea Exp $ # # EXEEXT = OBJEXT = o LIBEXT = a DLLEXT = so DOTEXEEXT = SUFFIXES = .cpp .c .o .so .a VERSION_MAJOR = 3 VERSION_MINOR = 10 BOINCDIR = /home/darren/boinccompile/boinc CC = gcc CFLAGS = -O3 -msse2 -funroll-loops -fomit-frame-pointer -mmmx -msse -s -fexpensive-optimizations -m3dnow -march=pentium4 -mcpu=pentium4 -DHAVE_CONFIG_H -DTEXT_UI -DNDEBUG -DCLIENT -fprofile-arcs CXX = g++ CXXFLAGS = $(CFLAGS) - - - - - - - - - and here is the CFLAGS line from the backup made when I added the entry: CFLAGS = -O3 -msse2 -funroll-loops -fomit-frame-pointer -mmmx -msse -s -fexpensive-optimizations -m3dnow -march=pentium4 -mcpu=pentium4 -DHAVE_CONFIG_H -DTEXT_UI -DNDEBUG -DCLIENT - - - - - - - - - - As it compiled, I did visually notice that it included the -fprofile-arcs entry in each step also. It seemed to process the test work unit normally, but just didn't create the expected files when I exited it. I'm going to recompile it again the same as I did before just to give it one more try, unless you can reccommend something else for me to try. Thanks. |
vrillusions Send message Joined: 12 Aug 00 Posts: 2 Credit: 245,025 RAC: 0 |
I got the first part done, but when I went to configure seti_boinc I get a ton of "present but cannot be compiled" errors. Here's a part of it: checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking algorithm usability... no checking algorithm presence... yes configure: WARNING: algorithm: present but cannot be compiled configure: WARNING: algorithm: check for missing prerequisite headers? configure: WARNING: algorithm: proceeding with the preprocessor's result configure: WARNING: ## ------------------------------------ ## configure: WARNING: ## Report this to bug-autoconf@gnu.org. ## configure: WARNING: ## ------------------------------------ ## checking for algorithm... yes checking bitset usability... no checking bitset presence... yes configure: WARNING: bitset: present but cannot be compiled configure: WARNING: bitset: check for missing prerequisite headers? configure: WARNING: bitset: proceeding with the preprocessor's result configure: WARNING: ## ------------------------------------ ## configure: WARNING: ## Report this to bug-autoconf@gnu.org. ## configure: WARNING: ## ------------------------------------ ## checking for bitset... yes checking cassert usability... no checking cassert presence... yes configure: WARNING: cassert: present but cannot be compiled configure: WARNING: cassert: check for missing prerequisite headers? configure: WARNING: cassert: proceeding with the preprocessor's result configure: WARNING: ## ------------------------------------ ## configure: WARNING: ## Report this to bug-autoconf@gnu.org. ## configure: WARNING: ## ------------------------------------ ## any ideas? I tried to make anyway and it gave a bunch of errors. |
Dr. Jones Send message Joined: 24 Oct 00 Posts: 8 Credit: 6,043,144 RAC: 28 |
> > I'm going to recompile it again the same as I did before just to give it one > more try, unless you can reccommend something else for me to try. > How do you break the client? I have tested some possibilities and the only ones which created the .da files are : let the client crunch the whole workunit or kill the client with: kill -6 pid |
Darren Send message Joined: 2 Jul 99 Posts: 259 Credit: 280,503 RAC: 0 |
> How do you break the client? I have tested some possibilities and the only > ones which created the .da files are : let the client crunch the whole > workunit or kill the client with: kill -6 pid The first time I let it run the whole wu, the subsequent times I stopped it with ctrl-c at somewhere around 80%. I'll try again letting it run the whole wu. Maybe I jumped the gun a bit by stopping it with crtl-c, but in various ways of trying things out I noticed that if I used the other gcov option (-ftest-coverage), it creates its .dd files on a ctrl-c, so I assumed -fprofile-arcs would work the same way with its .da files. Thanks. |
©2024 University of California
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.