Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Acovea-4.0.0 : Try out my ebuilds (and scripts)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, ... 14, 15, 16  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
aethyr
Veteran
Veteran


Joined: 06 Apr 2003
Posts: 1085
Location: NYC

PostPosted: Wed Apr 07, 2004 6:54 am    Post subject: Re: Error Reply with quote

Angel666 wrote:
Does anyone have any idea of how i could resolve my problem?

Maybe try running `ldconfig` as root, then running it again?
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Wed Apr 07, 2004 8:34 am    Post subject: Reply with quote

<removed - obsolete >
_________________
linux: #232767


Last edited by ikaro on Sat Apr 10, 2004 10:58 pm; edited 3 times in total
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Wed Apr 07, 2004 10:53 am    Post subject: Reply with quote

ikaro wrote:

Best CFLAGS:
Code:

CLAGS="-march=athlon-xp -O3  -fprefetch-loop-arrays -mieee-fp -ftracer -minline-all-stringops  -finline-limit  -maccumulate-outgoing-args -fmove-all-movables -mno-push-args -fnew-ra -fno-inline -fomit-frame-pointer"


sugestions ?
Let the tests begin.

I woudl recommend against -mieee-fp, and I would make -finline-limit read "-finline-limit=600" otherwise gcc might barf.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Wed Apr 07, 2004 12:31 pm    Post subject: Reply with quote

alright, i searched for what those options are about, but didnt found anything in the gcc website ..
Thx for the tip.
_________________
linux: #232767
Back to top
View user's profile Send private message
aethyr
Veteran
Veteran


Joined: 06 Apr 2003
Posts: 1085
Location: NYC

PostPosted: Wed Apr 07, 2004 2:04 pm    Post subject: Reply with quote

mfpmath=anything has been coming up pessimistic on my tests as well... it's sort of surprising to see all three be pessimistic choices.

Has anyone done any testing of packages based on these flags? I'll have to try some later when I get a chance.

Just for kicks, here's two of my results so far (p3/gcc3.3):
Code:

HUFFBENCH
optimistic options:
           -fno-if-conversion2 (1.279)
           -fno-delayed-branch (1.279)
                        -fgcse (1.172)
     -fexpensive-optimizations (1.065)
              -frerun-loop-opt (1.065)
                   -fforce-mem (1.707)
  -fdelete-null-pointer-checks (1.547)
                 -falign-loops (1.119)
                 -ffloat-store (1.279)
                      -fnew-ra (2.135)
    -maccumulate-outgoing-args (1.386)
          -fomit-frame-pointer (1.761)

pessimistic options:
 -fno-guess-branch-probability (-2.037)
            -fno-if-conversion (-2.358)
              -fschedule-insns (-1.93)
             -fschedule-insns2 (-1.181)
                -mno-push-args (-1.021)
                  -mfpmath=387 (-1.448)
                  -mfpmath=sse (-1.448)
              -mfpmath=sse,387 (-2.037)
     -momit-leaf-frame-pointer (-1.769)


EVOBENCH
optimistic options:
          -fno-merge-constants (1.319)
 -fno-guess-branch-probability (1.256)
                        -fgcse (3.255)
             -fschedule-insns2 (1.006)
            -fsched-interblock (1.131)
            -frename-registers (1.506)
                 -ffloat-store (1.006)
                -malign-double (1.631)
            -ffinite-math-only (1.444)

pessimistic options:
              -fschedule-insns (-2.741)
           -freorder-functions (-1.242)
                 -falign-loops (-1.055)
                -funroll-loops (-1.867)
                  -mfpmath=387 (-2.679)
                  -mfpmath=sse (-1.429)
              -mfpmath=sse,387 (-1.18)
          -fomit-frame-pointer (-1.554)
     -momit-leaf-frame-pointer (-1.305)


[edit] Changed to reflect CPU and GCC version.


Last edited by aethyr on Wed Apr 07, 2004 3:26 pm; edited 2 times in total
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Wed Apr 07, 2004 2:51 pm    Post subject: Reply with quote

neat
_________________
linux: #232767


Last edited by ikaro on Sat Apr 10, 2004 10:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Wed Apr 07, 2004 3:21 pm    Post subject: Reply with quote

< removed - obsolete >
_________________
linux: #232767


Last edited by ikaro on Sat Apr 10, 2004 10:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
Angel666
n00b
n00b


Joined: 14 Nov 2003
Posts: 45
Location: Palo Alto, CA

PostPosted: Wed Apr 07, 2004 5:52 pm    Post subject: Not yet Reply with quote

aethyr wrote:
Anglel666 wrote:
Does anyone have any idea of how i could resolve my problem?


Maybe try running `ldconfig` as root, then running it again?


I did, and unfortunately it still does not work :(
_________________
"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Fuhrer" - Adolf Hitler
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Wed Apr 07, 2004 8:30 pm    Post subject: Reply with quote

ikaro wrote:
alright, i searched for what those options are about, but didnt found anything in the gcc website ..
Thx for the tip.

Google "GCC manual"
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Angel666
n00b
n00b


Joined: 14 Nov 2003
Posts: 45
Location: Palo Alto, CA

PostPosted: Sat Apr 10, 2004 6:12 am    Post subject: Reply with quote

well, i solved my problem. all i had to do was recompile acovea.

and now for my results (pentium 4 2.8 ghz, hyperthreading, gcc 3.4):

Code:
483     -freorder-blocks (-O2)
446     -funsafe-math-optimizations (fast math)
444     -fgcse (-O2)
444     -finline-functions (-O3)
417     -fstrict-aliasing (-O2)
409     -falign-loops (-O2 GCC 3.3)
407     -funit-at-a-time
404     -fexpensive-optimizations (-O2)
401     -fdelete-null-pointer-checks (-O2)
396     -fpeel-loops
395     -fsched-interblock (-O2 GCC 3.3)
394     -fforce-mem (-O2)
392     -fpeephole2 (-O2)
391     -fno-if-conversion2 (! -O1)
386     -malign-double
379     -fstrength-reduce (-O2)
374     -fno-trapping-math (fast math)
369     -fno-crossjumping (! -O1)
368     -fschedule-insns2 (-O2)
365     -falign-labels (-O2 GCC 3.3)
365     -mno-push-args
365     -ffinite-math-only (fast math)
364     -falign-functions
363     -finline-limit
358     -mieee-fp
357     -fregmove (-O2)
353     -fno-signaling-nans (fast math)
352     -fcse-skip-blocks (-O2)
351     -frerun-cse-after-loop (-O2)
351     -maccumulate-outgoing-args
349     -frerun-loop-opt (-O2)
348     -fcaller-saves (-O2)
348     -fweb
347     -fcse-follow-jumps (-O2)
343     -falign-jumps (-O2 GCC 3.3)
338     -fsched-spec (-O2 GCC 3.3)
338     -ftracer
335     -funswitch-loops
335     -minline-all-stringops
333     -fmove-all-movables
332     -fno-omit-frame-pointer (! -O1)
330     -fno-thread-jumps (! -O1)
328     -fno-defer-pop (! -O1)
324     -fno-cprop-registers (! -O1)
321     -fno-if-conversion (! -O1)
316     -frename-registers (-O3)
305     -fno-delayed-branch (! -O1)
301     -freorder-functions (-O2 GCC 3.3)
301     -fno-math-errno (fast math)
295     -freduce-all-givs
286     -fnew-ra
285     -fschedule-insns (-O2)
282     -mno-align-stringops
278     -fno-merge-constants (! -O1)
278     -fprefetch-loop-arrays
265     -fbranch-target-load-optimize
260     -foptimize-sibling-calls (-O2)
254     -fno-loop-optimize (! -O1)
246     -ffloat-store
193     -funroll-loops
185     -fomit-frame-pointer
183     -fno-inline
172     -fno-guess-branch-probability (! -O1)
170     -funroll-all-loops
150     -momit-leaf-frame-pointer
134     -fbranch-target-load-optimize2
132     -mfpmath=387
96      -mfpmath=sse,387
85      -mfpmath=sse

_________________
"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Fuhrer" - Adolf Hitler
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sat Apr 10, 2004 6:17 am    Post subject: Reply with quote

Angel666 wrote:
well, i solved my problem. all i had to do was recompile acovea.

and now for my results (pentium 4 2.8 ghz, hyperthreading, gcc 3.4):
Code:
[...]
185     -fomit-frame-pointer
183     -fno-inline
172     -fno-guess-branch-probability (! -O1)
170     -funroll-all-loops
150     -momit-leaf-frame-pointer
134     -fbranch-target-load-optimize2
132     -mfpmath=387
96      -mfpmath=sse,387
85      -mfpmath=sse

Interesting, that some of these flags (-fomit-frame-pointer and -fno-guess-branch-probability) are at the top for me! I'll have to run the benches again with GCC 3.4 when it goes stable ...

I should add that the uniform pessimism on generated SSE instructions is quite eye-opening ... quoting the GCC manual:

Quote:

Use scalar floating point instructions present in the SSE instruction set.
[...]
The resulting code should be considerably faster in the majority of cases and avoid the numerical instability problems of 387 code, [...]

Perhaps someone more knowledgeable could offer an explanation of this irony.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Angel666
n00b
n00b


Joined: 14 Nov 2003
Posts: 45
Location: Palo Alto, CA

PostPosted: Sat Apr 10, 2004 6:59 am    Post subject: Reply with quote

Another irony that i found was this:

from huff.run:

Code:
optimistic options:
                     [...]                     
                 -fnew-ra (2.737)


and from alma.run:

Code:
pessimistic options:
                      [...]
               -fnew-ra (-2.281)


from the perl script:

Code:
286                            -fnew-ra


-fnew-ra seems to be very controversial- for almabench it totally killed it, which for huffbench it was the nest optimiazer. I have to say, im puzzled.

Looking at the results for individual options such as -fnew-ra, i cant say that i can be sure that the conglomerated results achieved by that perl script are totally to be trusted. At the same time, there is no real way to gather such different results into one. So what i suggest is something like this - the script checks the results of the benchmarking programs, and if an option is found in both the positive and negative results, a warning is given to the user that that flag is unpredictable. I would also put them in a category of their own, because they might be amazingly good for some programs, meriting a top spot, but also a real drag for others, meriting the lower levels - so maybe section of "controversial" or "shaky" flags might be good.

I don't know much perl myself, certainly not enough to modify this script, but maybe someone else does - and thinks this is a good idea.

and, here are my new CFLAGS:

Code:
CFLAGS="-Wall -pipe -march=pentium4 -O3 -pipe -funit-at-a-time -fpeel-loops -fsched-interblock -fno-crossjumping -mno-push-args -falign-functions -finline-limit -fmieee-fp -maccumulate-outgoing-args -fweb -ftracer -funswitch-loops -minline-all-stringops -fmove-all-movables "


If any of these options that i have chosen are dangerous, please tell me, as i an not very knowledgable in regards to GCC flags and CFLAGS.

Also, if anyone is familiar with these controversial GCC 3.4 flags (there is no online documentation that i can find on flags like -fnew-ra) it would be really helpful!
_________________
"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Fuhrer" - Adolf Hitler
Back to top
View user's profile Send private message
aethyr
Veteran
Veteran


Joined: 06 Apr 2003
Posts: 1085
Location: NYC

PostPosted: Sat Apr 10, 2004 8:42 am    Post subject: Reply with quote

Angel666 wrote:
Also, if anyone is familiar with these controversial GCC 3.4 flags (there is no online documentation that i can find on flags like -fnew-ra) it would be really helpful!

http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Optimize-Options.html
http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sat Apr 10, 2004 9:38 am    Post subject: Reply with quote

Angel666 wrote:
[...] So what i suggest is something like this - the script checks the results of the benchmarking programs, and if an option is found in both the positive and negative results, a warning is given to the user that that flag is unpredictable. I would also put them in a category of their own, because they might be amazingly good for some programs, meriting a top spot, but also a real drag for others, meriting the lower levels - so maybe section of "controversial" or "shaky" flags might be good.

Dear sir, your wish is my command:

Code:
<obsolete>

Man, I wish I coded this in Python ...

Anyway, my newly presented results:

Code:
<obsolete>


So, my new CFLAGS:

Code:
<obsolete>


Again, we'll see how it goes with normal usage; my last CFLAGS were rock stable.
_________________
Personal overlay | Simple backup scheme


Last edited by Hypnos on Sat Apr 10, 2004 11:54 pm; edited 3 times in total
Back to top
View user's profile Send private message
aethyr
Veteran
Veteran


Joined: 06 Apr 2003
Posts: 1085
Location: NYC

PostPosted: Sat Apr 10, 2004 10:08 am    Post subject: Reply with quote

Hypnos (or anyone else) are you doing any testing of these flags after compiling a program with them?

I'm still waiting for all my benchmarks to finish before I start testing programs.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sat Apr 10, 2004 10:13 am    Post subject: Reply with quote

aethyr wrote:
Hypnos (or anyone else) are you doing any testing of these flags after compiling a program with them?

I'm still waiting for all my benchmarks to finish before I start testing programs.

No; the idea of benchmarking is that your test algorithms are representative of the Real World. So that's a question for the creator of Acovea. I guess one could apply "weights" to the different benchmark scores to represent the situation in your target environment.

Stuff compiles cleanly and runs solid for me, thus far ...
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
sindre
Guru
Guru


Joined: 01 Nov 2002
Posts: 315
Location: Norway

PostPosted: Sat Apr 10, 2004 5:38 pm    Post subject: Reply with quote

Hypnos wrote:
So, my new CFLAGS:

Code:
CFLAGS="-Wall -pipe -O3 -mcpu=pentium4 -march=pentium4 -maccumulate-outgoing-args -fmove-all-movables -minline-all-stringops -fno-merge-constants -fno-if-conversion2 -finline-limit=600 -fno-delayed-branch -fno-crossjumping -fno-thread-jumps -fno-omit-frame-pointer -mno-align-stringops -fno-defer-pop -fno-cprop-registers -ftracer -mno-push-args -freduce-all-givs -mfpmath=387 -fno-guess-branch-probability -fno-cse-follow-jumps -fno-gcse -fno-schedule-insns2 -fno-schedule-insns"


Again, we'll see how it goes with normal usage; my last CFLAGS were rock stable.

-fno-omit-frame-pointer?? that can't be right.
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Sat Apr 10, 2004 5:41 pm    Post subject: Reply with quote

Updating with the new script ( thx )

Code:

obsolete


This looks like alot of cflags to use,
_________________
linux: #232767


Last edited by ikaro on Fri May 14, 2004 9:03 pm; edited 2 times in total
Back to top
View user's profile Send private message
aethyr
Veteran
Veteran


Joined: 06 Apr 2003
Posts: 1085
Location: NYC

PostPosted: Sat Apr 10, 2004 7:25 pm    Post subject: Reply with quote

ikaro wrote:

Code:
   17.8 |    11.9   |      86.7      | -mfpmath=387


CFLAGS:
Code:

CFLAGS="-march=athlon-xp -03 -maccumulate-outgoing-args -mfpmath=387 -malign-double  -mno-push-args -fmove-all-movables -mno-align-stringops -finline-limit=600 -minline-all-stringops -ftracer
-fno-defer-pop -fno-if-conversion2 -fno-cprop-registers -fno-thread-jumps -fno-delayed-branch -fno-omit-frame-pointer
-fno-merge-constants -fno-crossjumping

If I understand Hypnos' code, if something has a low mean with high confidence, that means it's a bad flag (Hypnos, am I correct?). Confidence is just a measure of how spread out the seven means are. So the best flag has high mean and high confidence. An "unsure" flag like -fnew-ra has a decently high mean, but poor confidence.


Last edited by aethyr on Sat Apr 10, 2004 7:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Sat Apr 10, 2004 7:37 pm    Post subject: Reply with quote

i was looking at the values of 'confidence' .. higher better ? :?
_________________
linux: #232767
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sat Apr 10, 2004 8:51 pm    Post subject: Reply with quote

sindre wrote:
-fno-omit-frame-pointer?? that can't be right.

*Shrug* You'll see from the results that it doesn't help much, but it does so far more reliably than "-fomit-frame-pointer".

ikaro wrote:
This looks like alot of cflags to use,
Comments ?

I agree that it's rather unseemly, but most of the CFLAGS are to turn off things implied by -O1 and -O2. I'd be more worried by activating flags, like the -fmove-all-movables ....

aethyr wrote:
If I understand Hypnos' code, if something has a low mean with high confidence, that means it's a bad flag (Hypnos, am I correct?). Confidence is just a measure of how spread out the seven means are. So the best flag has high mean and high confidence. An "unsure" flag like -fnew-ra has a decently high mean, but poor confidence.


ikaro wrote:
i was looking at the values of 'confidence' .. higher better ?


Low mean and high standard deviation is bad, because it doesn't differentiate from zero; high mean and low standard deviation is good because it does.

Confidence is a quantitative measure of this relationship. You can learn more about it here:

http://mathworld.wolfram.com/ConfidenceInterval.html

(If you notice in my Perl script I had to implement erf(); I used a continuing fraction discovered disjointly by Laplace, Legendre and Ramanujan, which is way cool ...)
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sat Apr 10, 2004 10:25 pm    Post subject: Reply with quote

"Version 3" of the perl script, with acceptable commenting and sigma-separators on output (so you can choose switches based on your own desired confidence more easily):

Code:
<obsolete>

_________________
Personal overlay | Simple backup scheme


Last edited by Hypnos on Sat Apr 10, 2004 11:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Sat Apr 10, 2004 11:05 pm    Post subject: Reply with quote

. double posted :roll:
_________________
linux: #232767


Last edited by ikaro on Sat Apr 10, 2004 11:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2527
Location: Denmark

PostPosted: Sat Apr 10, 2004 11:06 pm    Post subject: Reply with quote

Code:

obsolete

_________________
linux: #232767


Last edited by ikaro on Fri May 14, 2004 9:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sat Apr 10, 2004 11:57 pm    Post subject: Reply with quote

Tweaked run script:

Code:
#!/bin/sh
 
BENCHES="alma evo fft huff lin mat1 tree"
 
for bench in $BENCHES; do
        echo ""
        echo "*** $bench ***"
        time runacovea -config gcc33_pentium4.acovea -bench ${bench}bench.c\
                1> ${bench}.run 2> ${bench}.err
done


New reporting script (vastly simplified output):

Code:
#!/usr/bin/env perl

#----------------------------------------------------------------------------
#
# Settings
#

# Names of benchmarks run by Acovea
@benches = ("alma", "evo", "fft", "huff", "lin", "mat1", "tree");

# Number of populations evolved per benchmark by Acovea
$pops = 5;
# Population size
$popsize = 40;

# Number of generations of evolution by Acovea
$gens = 20;

# Suppress output of statistical mumbo-jumbo?
$suppress = "1";

#----------------------------------------------------------------------------
#
# Digest data from *.run files
#

@switches = ();
$listflag = "";
foreach $bench (@benches) {
   open(BENCHRUN, "$bench.run");
   $genflag = "";
   $countflag = "";
   $blankflag = "";
   $linecount = 0;
   while (<BENCHRUN>) {
      # Look for final iteration
      if(/^iteration $gens/) {$genflag = "1"; next;}
      # Look for start of option counts table
      if($genflag && /^Option counts:/) {$countflag = "1"; next;}
      # Look for end of option counts table (blank line)
      if($genflag && $countflag && /^$/) {$blankflag = "1"; next;}
      # Parse counts lines
      if($genflag && $countflag && (! $blankflag)) {
         # first bench
         s/\n$//;
         if($listflag) {
            s/(^\s*?-\S+?\s+?)(\S)/$2/;
            s/\s+/ /g;
            s/\s$//;
            my @line2 = split(/\s/);
            $ref2 = $switches[$linecount];
            push @$ref2, @line2;
         }
         # subsequent benches
         else {
            s/^\s*?-/-/;
            s/\s+/ /g;
            s/\s$//;
            my @line = split(/\s/);
            $ref= \@line;
            @switches = (@switches, $ref);
         }
         $linecount += 1;
      }
   }
   $listflag = "1";
}

#----------------------------------------------------------------------------
#
# Calculate mean (total/bench), standard deviation, confidence interval,
# and score for each switch across all the benchmarks
#

#
# Implementation of erf()
# (continuing fraction by Laplace, Legendre, Ramanujan)
#
$pi = 3.14159;
sub erffrac {
   my($x, $count, $max) = @_;
   if ($count > $max) {1;}
   else{
      if ($count % 2 == 0) {$a = 2;}
      else {$a = 1;}
      $a*$x+$count/&erffrac($x, $count + 1, $max);
   };
}
sub erf {
   my($x) = @_ ;
   1-exp(-$x**2)/sqrt($pi)/&erffrac($x, 1, 10.*(1 + 1/$x));
}
#
# End implementation of erf()
#

@tswitches = ();
foreach $line (@switches) {
   # Mean
   $col = 1 + $pops;
   $total = 0;
   @line2 = @$line;
   while ($col < $#line2 + 1) {
      $total += $line2[$col];
      $col += 1 + $pops ;
   }
   $mean = $total/$#benches;
   # Standard deviation
   $col = 1 + $pops;
   $total = 0;
   while ($col < $#line2 + 1) {
      $total += ($line2[$col] - $mean)**2;
      $col += 1 + $pops ;
   }
   $stddev = sqrt($total)/$pops/$popsize;
   $mean = $mean/$pops/$popsize;  # renormalize
   # Confidence interval
   $x=$mean/$stddev/sqrt(2); # cum. prob. = erf(n/sqrt(2))
   # Gaussian approximation to Poisson distribution only works
   # for counts >= 5 (or so)
   if ($mean < 5/$popsize) {$confidence = 0.;}
   else {$confidence = &erf($x);}
   # score
   $score = $mean * $confidence * 100;
   # Store data
   my @foo = ($line2[0], $mean, $stddev, $confidence, $score);
   push @tswitches, \@foo;
}

#----------------------------------------------------------------------------
#
# Sort by score
#

sub byScore {
   $b2 = $b; $a2 = $a;
   @b3 = @$b2; @a3 = @$a2;
   $b4 = @b3[4]; $a4 = @a3[4];
   $b4 <=> $a4;
}

@sswitches = sort byScore @tswitches;

#----------------------------------------------------------------------------
#
# Set up annotation hash (GCC 3.3.x)
#

%annhash = ("-fno-merge-constants", "! -O1", "-fno-defer-pop", "! -O1", "-fno-thread-jumps", "! -O1", "-fno-omit-frame-pointer", "! -O1", "-fno-guess-branch-probability", "! -O1", "-fno-cprop-registers", "! -O1", "-fno-if-conversion", "! -O1", "-fno-if-conversion2", "! -O1", "-fno-delayed-branch", "! -O1", "-fno-loop-optimize", "! -O1", "-fno-crossjumping", "! -O1", "-foptimize-sibling-calls", "-O2", "-fcse-follow-jumps", "-O2", "-fcse-skip-blocks", "-O2", "-fgcse", "-O2", "-fexpensive-optimizations", "-O2", "-fstrength-reduce", "-O2", "-frerun-cse-after-loop", "-O2", "-frerun-loop-opt", "-O2", "-fcaller-saves", "-O2", "-fforce-mem", "-O2", "-fpeephole2", "-O2", "-fschedule-insns", "-O2", "-fschedule-insns2", "-O2", "-fregmove", "-O2", "-fstrict-aliasing", "-O2", "-fdelete-null-pointer-checks", "-O2", "-freorder-blocks", "-O2", "-fsched-interblock", "-O2 GCC 3.3", "-fsched-spec", "-O2 GCC 3.3", "-freorder-functions", "-O2 GCC 3.3", "-falign-loops", "-O2 GCC 3.3", "-falign-jumps", "-O2 GCC 3.3", "-falign-labels", "-O2 GCC 3.3", "-finline-functions", "-O3", "-frename-registers", "-O3", "-ffloat-store", "", "-fprefetch-loop-arrays", "", "-fmove-all-movables", "", "-freduce-all-givs", "", "-fno-inline", "", "-ftracer", "", "-fnew-ra", "",  "-funroll-loops", "", "-funroll-all-loops", "",  "-mieee-fp", "", "-malign-double", "", "-mno-push-args", "", "-maccumulate-outgoing-args", "", "-mno-align-stringops", "", "-minline-all-stringops", "", "-mfpmath=387", "", "-mfpmath=sse", "",  "-mfpmath=sse,387", "", "-fomit-frame-pointer", "", "-momit-leaf-frame-pointer", "", "-fno-math-errno", "fast math", "-funsafe-math-optimizations", "fast math", "-fno-trapping-math", "fast math",  "-ffinite-math-only", "fast math", "-fno-signaling-nans", "fast math", "-finline-limit", "" );

#----------------------------------------------------------------------------
#
# Display results
#

sub printbar {
   print "------------------------------------------------------------------------------\n";
}

if (not $suppress) {print "  Mean  | Std. Dev. | Conf. |";}
print " Score |  So?  | Switch (annotation)\n";
&printbar;
foreach $line (@sswitches) {
   if (not $suppress) {
      print sprintf("  %5.3f",@$line[1]);
      print " | ";
      print sprintf("  %5.3f  ",@$line[2]);
      print " | ";
      print sprintf("%5.3f", @$line[3]);
      print " |";
   }
   print " ";
   print sprintf(" %4.1f", @$line[4]);
   print " | ";
   # Recommend based on confidence
   if (@$line[3] < 0.683) {print "  No ";}
      elsif (@$line[3] < 0.866) {print "Maybe";}
         else {print " Yes ";}
   print " | ";
   print @$line[0];
   if ($annhash{@$line[0]}) {print " (".$annhash{@$line[0]}.")";}
   print "\n";
}


Output:

Code:
 Score |  So?  | Switch (annotation)
------------------------------------------------------------------------------
  37.7 |  Yes  | -funsafe-math-optimizations (fast math)
  33.8 |  Yes  | -maccumulate-outgoing-args
  33.0 |  Yes  | -finline-limit
  31.8 |  Yes  | -fdelete-null-pointer-checks (-O2)
  31.6 |  Yes  | -fmove-all-movables
  31.5 |  Yes  | -fcaller-saves (-O2)
  31.3 |  Yes  | -fno-if-conversion2 (! -O1)
  30.9 | Maybe | -fcse-skip-blocks (-O2)
  30.7 |  Yes  | -fno-crossjumping (! -O1)
  30.7 |  Yes  | -minline-all-stringops
  30.5 |  Yes  | -falign-loops (-O2 GCC 3.3)
  30.1 |  Yes  | -fpeephole2 (-O2)
  28.9 |  Yes  | -malign-double
  28.8 |  Yes  | -falign-jumps (-O2 GCC 3.3)
  28.4 |  Yes  | -finline-functions (-O3)
  27.7 |  Yes  | -foptimize-sibling-calls (-O2)
  27.3 | Maybe | -fforce-mem (-O2)
  27.0 |  Yes  | -fsched-interblock (-O2 GCC 3.3)
  26.7 |  Yes  | -falign-labels (-O2 GCC 3.3)
  26.6 | Maybe | -fno-signaling-nans (fast math)
  25.7 | Maybe | -ffinite-math-only (fast math)
  25.7 | Maybe | -fno-defer-pop (! -O1)
  25.4 | Maybe | -freorder-functions (-O2 GCC 3.3)
  25.2 |  Yes  | -frerun-cse-after-loop (-O2)
  25.2 | Maybe | -mieee-fp
  24.9 | Maybe | -mno-align-stringops
  24.7 | Maybe | -fstrict-aliasing (-O2)
  24.3 |  Yes  | -fno-delayed-branch (! -O1)
  24.2 | Maybe | -fno-math-errno (fast math)
  23.7 |  Yes  | -fno-omit-frame-pointer (! -O1)
  23.4 | Maybe | -ftracer
  23.1 | Maybe | -freduce-all-givs
  23.0 | Maybe | -fno-trapping-math (fast math)
  22.9 | Maybe | -fno-cprop-registers (! -O1)
  22.8 | Maybe | -mno-push-args
  22.5 | Maybe | -fexpensive-optimizations (-O2)
  22.4 | Maybe | -fregmove (-O2)
  22.4 |  Yes  | -fno-merge-constants (! -O1)
  22.2 |  Yes  | -freorder-blocks (-O2)
  22.2 |  Yes  | -fno-thread-jumps (! -O1)
  22.0 | Maybe | -frename-registers (-O3)
  21.4 | Maybe | -frerun-loop-opt (-O2)
  21.2 |   No  | -fomit-frame-pointer
  20.4 | Maybe | -fstrength-reduce (-O2)
  18.4 |   No  | -fno-if-conversion (! -O1)
  18.3 |   No  | -fcse-follow-jumps (-O2)
  18.1 | Maybe | -fsched-spec (-O2 GCC 3.3)
  16.9 |   No  | -fgcse (-O2)
  16.7 | Maybe | -fno-guess-branch-probability (! -O1)
  16.3 |   No  | -fprefetch-loop-arrays
  15.8 |   No  | -fno-inline
  11.4 |   No  | -fschedule-insns2 (-O2)
   9.8 | Maybe | -mfpmath=387
   8.9 |   No  | -funroll-all-loops
   8.9 |   No  | -funroll-loops
   7.0 |   No  | -fnew-ra
   6.2 |   No  | -fschedule-insns (-O2)
   5.9 |   No  | -ffloat-store
   4.5 |   No  | -fno-loop-optimize (! -O1)
   0.0 |   No  | -mfpmath=sse
   0.0 |   No  | -mfpmath=sse,387
   0.0 |   No  | -momit-leaf-frame-pointer


My flags:

Code:
CFLAGS="-Wall -pipe -O2 -mcpu=pentium4 -march=pentium4 -maccumulate-outgoing-args -finline-limit=600 -fmove-all-movables -fno-if-conversion2 -fno-crossjumping -minline-all-stringops -finline-functions -fno-delayed-branch -fno-omit-frame-pointer -fno-merge-constants -fno-thread-jumps -fno-cse-follow-jumps -fno-gcse -fno-schedule-insns2 -fno-schedule-insns"

Just cut out the "Maybe"'s, and you'll have fewer switches to contend with.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3, ... 14, 15, 16  Next
Page 2 of 16

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum