* Fast Compilers for Linux @ 1998-05-08 4:00 James Sternberg 1998-05-08 4:00 ` James D. Freels 1998-05-09 4:00 ` Fast Compilers for Linux Toon Moene 0 siblings, 2 replies; 25+ messages in thread From: James Sternberg @ 1998-05-08 4:00 UTC (permalink / raw) Does anyone here know of a good set of compilers for alpha-linux? We have recently purchased a DEC XL 300 and installed Linux on it, but the code which gcc and g77 produce is very slow. As a matter of fact, using gcc and g77 on my PC at home (only a Pentium 233MMX) and compiling the code for my research produces an executable which is about 20% faster on the Intel box than the Alpha. This does not make much sense. Anyway, does anyone produce a *good* fortran and C/C++ compiler for alpha-linux? If not, then we are probably going to have to resort to Windows NT and Microsoft Visual C++ Risc / Digital Visual Fortran. -James Sternberg jsternbe@atomic1.phys.utk.edu ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-08 4:00 Fast Compilers for Linux James Sternberg @ 1998-05-08 4:00 ` James D. Freels 1998-05-08 4:00 ` Dr. Ram Samudrala 1998-05-09 4:00 ` Toon Moene 1998-05-09 4:00 ` Fast Compilers for Linux Toon Moene 1 sibling, 2 replies; 25+ messages in thread From: James D. Freels @ 1998-05-08 4:00 UTC (permalink / raw) "James Sternberg" <jsternbe@atomic1.phys.utk.edu> writes: Most folks who need fast code on Alpha with FORTRAN or C are using DEC products under DEC unix. This is far better than anything under Windows NT. Further, code complied with -non_shared option under DEC-unix will run exactly the same on Linux and just as fast. Alot of us would like to see DEC make their compilers available as a commercial product for Linux. > > Does anyone here know of a good set of compilers for alpha-linux? We have > recently purchased a DEC XL 300 and installed Linux on it, but the code > which gcc and g77 produce is very slow. As a matter of fact, using gcc and > g77 on my PC at home (only a Pentium 233MMX) and compiling the code for my > research produces an executable which is about 20% faster on the Intel box > than the Alpha. This does not make much sense. > > Anyway, does anyone produce a *good* fortran and C/C++ compiler for > alpha-linux? If not, then we are probably going to have to resort to > Windows NT and Microsoft Visual C++ Risc / Digital Visual Fortran. > > -James Sternberg > jsternbe@atomic1.phys.utk.edu > > ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-08 4:00 ` James D. Freels @ 1998-05-08 4:00 ` Dr. Ram Samudrala 1998-05-10 4:00 ` James Sternberg 1998-05-09 4:00 ` Toon Moene 1 sibling, 1 reply; 25+ messages in thread From: Dr. Ram Samudrala @ 1998-05-08 4:00 UTC (permalink / raw) James D. Freels <fea@ornl.gov> wrote: >Most folks who need fast code on Alpha with FORTRAN or C are using DEC >products under DEC unix. This is far better than anything under >Windows NT. I second this. If you want fast compilers, you might as well dump Linux and Windows/NT and just go for Digital Unix. >Further, code complied with -non_shared option under DEC-unix will >run exactly the same on Linux and just as fast. In my experience, I find that code actually runs faster on a Linux machine... about 5-10% depending on the application. Linux's handling of I/O appears to be superior to whatever Digital Unix is doing. The comparison was done on a machine with identical hardware, except that the Digital Unix machine had far more memory (though the application didn't use much memory). Same compiler. Statically compiled. --Ram email@urls || http://www.ram.org || http://www.twisted-helices.com/th There lived a certain man in Russia long ago, He was big and strong in his eyes a flaming glow. Most people looked at him with terror and with fear, but to Moscow chicks he was such a lovely dear. ---Boney M, Rasputin ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-08 4:00 ` Dr. Ram Samudrala @ 1998-05-10 4:00 ` James Sternberg 0 siblings, 0 replies; 25+ messages in thread From: James Sternberg @ 1998-05-10 4:00 UTC (permalink / raw) Dr. Ram Samudrala wrote: > > James D. Freels <fea@ornl.gov> wrote: > > >Most folks who need fast code on Alpha with FORTRAN or C are using DEC > >products under DEC unix. This is far better than anything under > >Windows NT. > > I second this. If you want fast compilers, you might as well dump > Linux and Windows/NT and just go for Digital Unix. Unfortunately, DEC does not make a version of Unix for this machine. They have decided it is an "NT only" machine, which seems pretty stupid to me. -James Sternberg ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-08 4:00 ` James D. Freels 1998-05-08 4:00 ` Dr. Ram Samudrala @ 1998-05-09 4:00 ` Toon Moene 1998-05-09 4:00 ` James D. Freels 1 sibling, 1 reply; 25+ messages in thread From: Toon Moene @ 1998-05-09 4:00 UTC (permalink / raw) fea@ornl.gov (James D. Freels) wrote: > Most folks who need fast code on Alpha with FORTRAN or C are using DEC > products under DEC unix. This is far better than anything under > Windows NT. Further, code complied with -non_shared option under > DEC-unix will run exactly the same on Linux and just as fast. Most, perhaps, but not all. See: http://swift.lanl.gov/avalon/FAQ.html, item 13. -- Toon Moene (mailto:toon@moene.indiv.nluug.nl) Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Phone: +31 346 214290; Fax: +31 346 214286 g77 Support: mailto:fortran@gnu.org; NWP: http://www.knmi.nl/hirlam ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-09 4:00 ` Toon Moene @ 1998-05-09 4:00 ` James D. Freels 1998-05-09 4:00 ` Toon Moene 0 siblings, 1 reply; 25+ messages in thread From: James D. Freels @ 1998-05-09 4:00 UTC (permalink / raw) Toon Moene <toon@moene.indiv.nluug.nl> writes: Toon: I am aware of the parallel processing projects going on with Linux. This is great, but I think that the question is with regard to a single (serial) processer. Sure, I would like my application to perform under parallel processing and I would like to have such a system available to use. However, for an average user who needs fast code now, as I understand it anyway, the DEC compilers are presently the best. Of course, they cost significant dollars. I understand the newer egcs compilers also are comparing well with the DEC compilers in some areas. Perhaps before too long, the DEC compiler option will not be necessary! > > fea@ornl.gov (James D. Freels) wrote: > > > Most folks who need fast code on Alpha with FORTRAN or C are using DEC > > products under DEC unix. This is far better than anything under > > Windows NT. Further, code complied with -non_shared option under > > DEC-unix will run exactly the same on Linux and just as fast. > > Most, perhaps, but not all. > > See: http://swift.lanl.gov/avalon/FAQ.html, item 13. > > -- > Toon Moene (mailto:toon@moene.indiv.nluug.nl) > Saturnushof 14, 3738 XG Maartensdijk, The Netherlands > Phone: +31 346 214290; Fax: +31 346 214286 > g77 Support: mailto:fortran@gnu.org; NWP: http://www.knmi.nl/hirlam ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-09 4:00 ` James D. Freels @ 1998-05-09 4:00 ` Toon Moene 1998-05-20 4:00 ` Matt Kennel 0 siblings, 1 reply; 25+ messages in thread From: Toon Moene @ 1998-05-09 4:00 UTC (permalink / raw) fea@ornl.gov (James D. Freels) wrote: > I am aware of the parallel processing projects going on with Linux. > This is great, but I think that the question is with regard to a > single (serial) processer. Sure, I would like my application to > perform under parallel processing and I would like to have such a > system available to use. However, for an average user who needs fast > code now, as I understand it anyway, the DEC compilers are presently > the best. Of course, they cost significant dollars. I understand the > newer egcs compilers also are comparing well with the DEC compilers in > some areas. Perhaps before too long, the DEC compiler option will not > be necessary! I understand your difficulties, but the reason I pointed to the Avalon web page was not their beowulf architecture, but that they found g77 and gcc from egcs-1.0.2 good enough for their purposes. I know very well that there are codes where Digital Fortran currently does better than g77/egcs, but we're working on eliminating even that gap. -- Toon Moene (mailto:toon@moene.indiv.nluug.nl) Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Phone: +31 346 214290; Fax: +31 346 214286 g77 Support: mailto:fortran@gnu.org; NWP: http://www.knmi.nl/hirlam ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-09 4:00 ` Toon Moene @ 1998-05-20 4:00 ` Matt Kennel 1998-05-21 4:00 ` Toon Moene 0 siblings, 1 reply; 25+ messages in thread From: Matt Kennel @ 1998-05-20 4:00 UTC (permalink / raw) On 9 May 1998 19:13:09 GMT, Toon Moene <toon@moene.indiv.nluug.nl> wrote: :I know very well that there are codes where Digital Fortran currently does :better than g77/egcs, but we're working on eliminating even that gap. Will it be eliminated for elementary functions, most importantly sin/cos/exp? This is where my performance has been very poor. All FP is not linear algebra. The "bytemarks" reported previously exercise these functions heavily--- sin/cos in the Fourier transform subtest, and exp in the 'neural network' subtest. SPECfp apparently does not test sin/cos/exp; a very stupid choice in my opinion, but others vigorously defend it. -- * Matthew B. Kennel/Institute for Nonlinear Science, UCSD - * "People who send spam to Emperor Cartagia... vanish! _They say_ that * there's a room where he has their heads, lined up in a row on a desk... * _They say_ that late at night, he goes there, and talks to them... _they *- say_ he asks them, 'Now tell me again, how _do_ you make money fast?'" ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-20 4:00 ` Matt Kennel @ 1998-05-21 4:00 ` Toon Moene 1998-05-21 4:00 ` Greg Lindahl 0 siblings, 1 reply; 25+ messages in thread From: Toon Moene @ 1998-05-21 4:00 UTC (permalink / raw) NOSPAMmbkennelNOSPAM@yahoo.com (Matt Kennel) wrote: > On 9 May 1998 19:13:09 GMT, I wrote: > :I know very well that there are codes where Digital Fortran currently does > :better than g77/egcs, but we're working on eliminating even that gap. > > Will it be eliminated for elementary functions, most importantly sin/cos/exp? > > This is where my performance has been very poor. All FP is not linear > algebra. [ Neither is ours, but on the other hand, we try to avoid transcendentals as the plague - they're expensive on almost any machine ] Because the Alpha's don't have native instructions for sin/cos/exp, all depends on the (glibc) library implementation - the compiler can't really do much here (unless we started to inline "better" code than there is to be found in glibc, but that seems to be putting the horse behind the cart). > SPECfp apparently does not test sin/cos/exp; a very stupid choice in > my opinion, but others vigorously defend it. Self-imposed limitation - they don't want to have benchmark code that spends a significant time in libraries (probably to prevent all sorts of uncontrollable special-case tuning) - see their web page, http://www.spec.org. -- Toon Moene (mailto:toon@moene.indiv.nluug.nl) Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Phone: +31 346 214290; Fax: +31 346 214286 g77 Support: mailto:fortran@gnu.org; NWP: http://www.knmi.nl/hirlam ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-21 4:00 ` Toon Moene @ 1998-05-21 4:00 ` Greg Lindahl 1998-05-21 4:00 ` John Lyon <SPP> 0 siblings, 1 reply; 25+ messages in thread From: Greg Lindahl @ 1998-05-21 4:00 UTC (permalink / raw) Toon Moene <toon@moene.indiv.nluug.nl> writes: > Because the Alpha's don't have native instructions for sin/cos/exp, all > depends on the (glibc) library implementation - the compiler can't really do > much here (unless we started to inline "better" code than there is to be > found in glibc, but that seems to be putting the horse behind the cart). And it should be pointed out that there is still no volunteer to work on these functions. If someone had a clue about fast numerical functions and a few free weeks, they could earn a lot of free beers from their numerical friends... -- greg ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-21 4:00 ` Greg Lindahl @ 1998-05-21 4:00 ` John Lyon <SPP> 1998-05-21 4:00 ` Greg Lindahl 1998-05-22 4:00 ` Joachim Wesner 0 siblings, 2 replies; 25+ messages in thread From: John Lyon <SPP> @ 1998-05-21 4:00 UTC (permalink / raw) Greg Lindahl wrote: > > Toon Moene <toon@moene.indiv.nluug.nl> writes: > > > Because the Alpha's don't have native instructions for sin/cos/exp, all > > depends on the (glibc) library implementation - the compiler can't really do > > much here (unless we started to inline "better" code than there is to be > > found in glibc, but that seems to be putting the horse behind the cart). > > And it should be pointed out that there is still no volunteer to work > on these functions. If someone had a clue about fast numerical > functions and a few free weeks, they could earn a lot of free beers > from their numerical friends... > > -- greg Just like to point out that a lot of the work was done to get the Alpha working fast on the Cray T3D-T3E machines. Source for a fast scalar and vector versions of the transcendentals and other things can be found via anonymous ftp at ftp.arsc.edu:/pub/software/sources/libbnch.tar.Z. The only catch is that the assembly used is CAL ( Cray Assembly Language ), but I'm guessing that the translation into standard Alpha assembly is probably pretty trivial. -- John ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-21 4:00 ` John Lyon <SPP> @ 1998-05-21 4:00 ` Greg Lindahl 1998-05-22 4:00 ` John Lyon <SPP> 1998-05-22 4:00 ` Joachim Wesner 1 sibling, 1 reply; 25+ messages in thread From: Greg Lindahl @ 1998-05-21 4:00 UTC (permalink / raw) "John Lyon <SPP>" <lyon@tinman.dartmouth.edu> writes: > Just like to point out that a lot of the work was done to get the Alpha > working fast on the Cray T3D-T3E machines. Source for a fast scalar and > vector versions of the transcendentals and other things can be found via > anonymous ftp at ftp.arsc.edu:/pub/software/sources/libbnch.tar.Z. The > only catch is that the assembly used is CAL ( Cray Assembly Language ), > but I'm guessing that the translation into standard Alpha assembly is > probably pretty trivial. Hm. It's copyright by Cray Research, but perhaps we could get them to donate it. I would guess that the routines would be pretty fast and accurate; there are standard testing libraries for these functions. -- g ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-21 4:00 ` Greg Lindahl @ 1998-05-22 4:00 ` John Lyon <SPP> 1998-05-22 4:00 ` Joachim Wesner 0 siblings, 1 reply; 25+ messages in thread From: John Lyon <SPP> @ 1998-05-22 4:00 UTC (permalink / raw) Greg Lindahl wrote: > > Hm. It's copyright by Cray Research, but perhaps we could get them to > donate it. I would guess that the routines would be pretty fast and > accurate; there are standard testing libraries for these functions. > > -- g The COPYRIGHT doesn't seem to restrict usage -- in fact, it seems to refer to the OS, not the benchlib routines, so I don't know if permission is required. If you pick up ftp://ftp.arsc.edu/pub/mpp/docs/bmguide.ps.Z, there's a table which gives values of the speeds of the various routines: roughly 100 clocks for scalar transcendtals and 25-45 for vector versions. The document is an optimization guide for single processor code on the T3E, but it does have some useful things to say about how high level code can be structured for better performance. John ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-22 4:00 ` John Lyon <SPP> @ 1998-05-22 4:00 ` Joachim Wesner 1998-05-22 4:00 ` Greg Lindahl 0 siblings, 1 reply; 25+ messages in thread From: Joachim Wesner @ 1998-05-22 4:00 UTC (permalink / raw) To: John Lyon <SPP> Hi, John Lyon wrote: > > If you pick up ftp://ftp.arsc.edu/pub/mpp/docs/bmguide.ps.Z, there's a > table which gives values of the speeds of the various routines: roughly > 100 clocks for scalar transcendtals and 25-45 for vector versions. The > document is an optimization guide for single processor code on the T3E, > but it does have some useful things to say about how high level code can > be structured for better performance. > > John Do you know for what argument range those result apply ?? I ask because my initial testing of the actual libm and and some other routines I will try to use shows the surprising result that, at least for sin, cos and tan and also the hyperbolic equivalents, most of the time is spent in argument reduction instead of approximating. The upshot is that, if Cray tested only for small arguments, their sin routine for example, is NOT any faster than the actual libm !! My measured execution time on a LX 533 (1 tick ~ 2 ns) (all routines were tested with random arguments from 0 to x) 0..0.3 0..10 0..300 actual libm sin 0.18 us 0.45 us 0.51 us cos 0.20 us 0.46 us 0.52 us tan 0.30 us 0.63 us 0.69 us goto's routine (sin/cos kernel in assembler) sin 0.12 us 0.36 us 0.49 us cos 0.15 us 0.39 us 0.52 us my alternative routine (C, will be changed to assembler later) sin 0.22 us 0.27 us 0.27 us cos 0.26 us 0.26 us 0.26 us Cray routines range = ? sin 0.24 us cos 0.26 us As one can see, for larger arguments, most of the time is spent in argument reductions. Similar increases can be seen for libm and tan and the xxxh functions. If the cray numbers only apply for arguments up to ~ 1, it's not much faster. I sincerely hope not, I think I will know soon. Another way to follow would be to combine my way of argument reduction with goto's routine (goto@statabo.rim.or.jp), he still seems to use the original libm subroutine written in C, which is way too complicated and long, much longer than the sin or cos kernel. HOWEVER **Unfortunatelly**, a "real" coprocessor like in a Pentium can still keep the competition with those numbers and it's even more accurate ! For a sad comparison, Pentium MMX 233: :-(( sin 0.21 us 0.32 us 0.32 us cos 0.21 us 0.32 us 0.33 us Joachim ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-22 4:00 ` Joachim Wesner @ 1998-05-22 4:00 ` Greg Lindahl 1998-05-22 4:00 ` Joachim Wesner 0 siblings, 1 reply; 25+ messages in thread From: Greg Lindahl @ 1998-05-22 4:00 UTC (permalink / raw) Joachim Wesner <joachim.wesner@frankfurt.netsurf.de> writes: > My measured execution time on a LX 533 (1 tick ~ 2 ns) (all routines > were tested with random arguments from 0 to x) > > 0..0.3 0..10 0..300 > > actual libm > sin 0.18 us 0.45 us 0.51 us Do you have any idea how fast the Digital Unix routines are? I think you are doing quite well with your routine, I'm just curious if you have gotten "the right answer" yet. I'll personally buy you a beer if you get this into libm ;-) (and Goto already gets beer, of course...) > HOWEVER > > **Unfortunatelly**, a "real" coprocessor like in a Pentium can still > keep the competition with those numbers and it's even more accurate ! I thought that the Pentium hardware used a bad reduction algorithm which really sucks for large arguments? -- g ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-22 4:00 ` Greg Lindahl @ 1998-05-22 4:00 ` Joachim Wesner 1998-05-22 4:00 ` Andi Kleen ` (2 more replies) 0 siblings, 3 replies; 25+ messages in thread From: Joachim Wesner @ 1998-05-22 4:00 UTC (permalink / raw) Greg Lindahl wrote: > > Joachim Wesner <joachim.wesner@frankfurt.netsurf.de> writes: > > > My measured execution time on a LX 533 (1 tick ~ 2 ns) (all routines > > were tested with random arguments from 0 to x) > > > > 0..0.3 0..10 0..300 > > > > actual libm > > sin 0.18 us 0.45 us 0.51 us > > Do you have any idea how fast the Digital Unix routines are? I think > you are doing quite well with your routine, I'm just curious if you > have gotten "the right answer" yet. I'll personally buy you a beer if > you get this into libm ;-) (and Goto already gets beer, of course...) > > > HOWEVER > > > > **Unfortunatelly**, a "real" coprocessor like in a Pentium can still > > keep the competition with those numbers and it's even more accurate ! > > I thought that the Pentium hardware used a bad reduction algorithm > which really sucks for large arguments? Is it ?? I thought/hoped that Intel extended 10 byte precision is pretty OK, I usually use it as a reference to test the other routines for accuracy for *small* arguments and it seems pretty consistent. HOWEVER, I did not yet try what happens for VERY large arguments. I real wonder why the libdm reduction routine in the old libm is so complex, it's way larger than the approximation code. I think I also will have to upgrade my argument reduction a bit, in the moment it uses an extended PI value with ~ 84 significant bits, I would like to go to up to ~ 144 bits (2.5 doubles) to be on the save side. This should only add around 10 cycles. However, I only have PI printed up to 40 octal digits, somebody knows where I could get PI up to ~ 55 octal or 40 hex digits ?? (NO decimal values please, I would first need to write an extended precision version of printf). I've now started to modify the cray sin routine to run under AXP linux, I think I will have the result tomorrow and will see how its perfomance fits here. Joachim ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-22 4:00 ` Joachim Wesner @ 1998-05-22 4:00 ` Andi Kleen 1998-05-23 4:00 ` Michal Jaegermann 1998-05-23 4:00 ` James H. Cloos Jr. 2 siblings, 0 replies; 25+ messages in thread From: Andi Kleen @ 1998-05-22 4:00 UTC (permalink / raw) Joachim Wesner <joachim.wesner@frankfurt.netsurf.de> writes: > > I real wonder why the libdm reduction routine in the old libm is so > complex, it's way larger than the approximation code. I think I also > will have to upgrade my argument reduction a bit, in the moment it uses > an extended PI value with ~ 84 significant bits, I would like to go to > up to ~ 144 bits (2.5 doubles) to be on the save side. This should only > add around 10 cycles. However, I only have PI printed up to 40 octal > digits, somebody knows where I could get PI up to ~ 55 octal or 40 hex > digits ?? (NO decimal values please, I would first need to write an > extended precision version of printf). Look for a blowfish cipher code [e.g. at ftp://ftp.funet.fi/pub/crypt/cryptography/symmetric/blowfish/ ] Blowfish uses a few hundred digits of hexadecimal Pi to initialise its S-Boxes. -Andi ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-22 4:00 ` Joachim Wesner 1998-05-22 4:00 ` Andi Kleen @ 1998-05-23 4:00 ` Michal Jaegermann 1998-05-23 4:00 ` James H. Cloos Jr. 2 siblings, 0 replies; 25+ messages in thread From: Michal Jaegermann @ 1998-05-23 4:00 UTC (permalink / raw) Joachim Wesner (joachim.wesner@frankfurt.netsurf.de) wrote: : However, I only have PI printed up to 40 octal : digits, somebody knows where I could get PI up to ~ 55 octal or 40 hex : digits ?? This is from Maple: 3.11037552421026430215142306305056006701632112201116\ 0210514763072002027372461661163310450512020746161500\ 2335737124315474647220615460126051557445742415647741\ 152665552434110571102665354611363754336423041 after 'Digits :=200:' and 'convert(evalf(Pi,200),octal);' Should be good for a while. I am pretty sure that other symbolic algebra systems, like Mathematica or Pari, could do similar things. : (NO decimal values please, I would first need to write an : extended precision version of printf). These shoud be available in libraries like gmp (GNU Multi Precision) for example. --mj ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-22 4:00 ` Joachim Wesner 1998-05-22 4:00 ` Andi Kleen 1998-05-23 4:00 ` Michal Jaegermann @ 1998-05-23 4:00 ` James H. Cloos Jr. 1998-05-25 4:00 ` Huw Davies 2 siblings, 1 reply; 25+ messages in thread From: James H. Cloos Jr. @ 1998-05-23 4:00 UTC (permalink / raw) To: Joachim Wesner >>>>> "Joachim" == Joachim Wesner <joachim.wesner@frankfurt.netsurf.de> writes: Joachim> However, I only have PI printed up to 40 octal Joachim> digits, somebody knows where I could get PI up to ~ 55 octal Joachim> or 40 hex digits ?? (NO decimal values please, I would first Joachim> need to write an extended precision version of printf). Try: echo 'obase=16; scale=56; 4*a(1);' |bc -ql That gives you 47 hex digits rt of the (hexi?)decimal point. Of those, at least the 40 you want will be exact. -JimC -- James H. Cloos, Jr. <cloos@jhcloos.com> ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-23 4:00 ` James H. Cloos Jr. @ 1998-05-25 4:00 ` Huw Davies 0 siblings, 0 replies; 25+ messages in thread From: Huw Davies @ 1998-05-25 4:00 UTC (permalink / raw) James H. Cloos Jr. (cloos@jhcloos.com) wrote: : Try: echo 'obase=16; scale=56; 4*a(1);' |bc -ql Cool trick! It even seems to get the right answer in base 10, but at least under Digital Unix, gets very much the _wrong_ answer in base 2, that is, unless pi=3.125 :-) I've just tested it on a Linux/Alpha box which seems a lot closer to the truth (I recall the tedious proof that pi is trancendental....). Time to log a call with Digital - must be that 64 bit stuff not working, or perhaps it's a compiler problem? -- Huw Davies | e-mail: Huw.Davies@latrobe.edu.au Information Technology Services | Phone: +61 3 9479 1550 Fax: +61 3 9479 1999 La Trobe University | "My Alfas keep me poor in a monetary Melbourne Australia 3083 | sense, but rich in so many other ways" ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-21 4:00 ` John Lyon <SPP> 1998-05-21 4:00 ` Greg Lindahl @ 1998-05-22 4:00 ` Joachim Wesner 1998-05-22 4:00 ` Fast Cray libm on axp/Linux, was " Joachim Wesner 1 sibling, 1 reply; 25+ messages in thread From: Joachim Wesner @ 1998-05-22 4:00 UTC (permalink / raw) John Lyon wrote: > > Greg Lindahl wrote: > > > > Toon Moene <toon@moene.indiv.nluug.nl> writes: > > > > And it should be pointed out that there is still no volunteer to work > > on these functions. If someone had a clue about fast numerical > > functions and a few free weeks, they could earn a lot of free beers > > from their numerical friends... > > > > -- greg > > Just like to point out that a lot of the work was done to get the Alpha > working fast on the Cray T3D-T3E machines. Source for a fast scalar and > vector versions of the transcendentals and other things can be found via > anonymous ftp at ftp.arsc.edu:/pub/software/sources/libbnch.tar.Z. The > only catch is that the assembly used is CAL ( Cray Assembly Language ), > but I'm guessing that the translation into standard Alpha assembly is > probably pretty trivial. > Actually I have been working a bit to speed up the libm routines on AXP, also looking at goto@statabo.rim.or.jp's code. I'm also testing an own implementation that is based on a different approximation that sacrifices 1 or 2 bits accuracy, but should be much faster though. I did not know of the Cray code, it looks pretty interesting. I will first concentrate on sin/cos and try to translate their code and compare it with my approach and the default library. Results to come the next days, unfortunatelly I don't have too much free time to spend on that. Joachim ^ permalink raw reply [flat|nested] 25+ messages in thread
* Fast Cray libm on axp/Linux, was Re: Fast Compilers for Linux 1998-05-22 4:00 ` Joachim Wesner @ 1998-05-22 4:00 ` Joachim Wesner 1998-05-22 4:00 ` Greg Lindahl 1998-05-23 4:00 ` Fast Cray libm on axp/Linux, more results Joachim Wesner 0 siblings, 2 replies; 25+ messages in thread From: Joachim Wesner @ 1998-05-22 4:00 UTC (permalink / raw) Yup, I suceeded in rewriting the first of the cray CAL routines (sin()) to AXP/linux/GCC. Incredibly it worked from the start. I will later continue with the other routines. So, what's the deal ??? YES, it's pretty fast !! And it does not suffer from slowdown for larger arguments !! I wrote before: My measured execution time on a LX 533 (1 tick ~ 2 ns) (all routines were tested with random arguments from 0 to x) 0..0.3 0..10 0..300 actual libm sin 0.18 us 0.45 us 0.51 us cos 0.20 us 0.46 us 0.52 us tan 0.30 us 0.63 us 0.69 us goto's routine (sin/cos kernel in assembler) sin 0.12 us 0.36 us 0.49 us cos 0.15 us 0.39 us 0.52 us my alternative routine (C, will be changed to assembler later) sin 0.22 us 0.27 us 0.27 us cos 0.26 us 0.26 us 0.26 us >>>>>>> Here we go ...... <<<<<<<<< New converted CRAY routine sin 0.20 us 0.20 us 0.20 us Let's have a beer !!! To be honest, the routine is a bit less accurate than the old libm. It's not really true, what Cray implies in the paper, that it's always accurate up to the last bits in contrast to their fast vector routines. My "measurements" show that the old libdm based libm nearly always achieves less than 0.5 ULB (units of last bit) error, this means the result is always exact in the sense it's the same as the rounded version of the infinite precision result. cray sin instead typically has ~ 1 ULB error, some times up to 1.5 ULB, meaning that the last bit is often incorrectly rounded and very few times the next bit is also wrong. BUT, I think we can live with that, my own fast routine above even was a bit worse in that respect. So, what to do next ?? I will try to convert all the other routines in the next days and test them (vector routines later !?) and try to put them in libm compatable form. Meanwhile, could somebody else, more knownledgable of that kind of legal stuff, probably even in close contact of cray, find out what the exact status of that stuff is and how we can put it in a freely distributable form ?? Thanx, have a good night and Prost Joachim ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Cray libm on axp/Linux, was Re: Fast Compilers for Linux 1998-05-22 4:00 ` Fast Cray libm on axp/Linux, was " Joachim Wesner @ 1998-05-22 4:00 ` Greg Lindahl 1998-05-23 4:00 ` Fast Cray libm on axp/Linux, more results Joachim Wesner 1 sibling, 0 replies; 25+ messages in thread From: Greg Lindahl @ 1998-05-22 4:00 UTC (permalink / raw) Joachim Wesner <joachim.wesner@frankfurt.netsurf.de> writes: > New converted CRAY routine > sin 0.20 us 0.20 us 0.20 us Yes, but. You know that Goto's assembler routine is faster than this for small arguments, and you know that your routines are pretty fast at argument reduction. This combination should be as good as the Cray library, and we don't have to figure out which person at SGI/Cray to ask "pretty please?", so your efforts won't be wasted if they say "no". It is good to know that you and Goto together have done a great job, compared to a professional library. Great work! -- greg ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Cray libm on axp/Linux, more results 1998-05-22 4:00 ` Fast Cray libm on axp/Linux, was " Joachim Wesner 1998-05-22 4:00 ` Greg Lindahl @ 1998-05-23 4:00 ` Joachim Wesner 1 sibling, 0 replies; 25+ messages in thread From: Joachim Wesner @ 1998-05-23 4:00 UTC (permalink / raw) More results from converting cray/libm to axp/linux: Only a short summy here, see my previous post I wrote before: My measured execution time on a LX 533 (1 tick ~ 2 ns) (all routines were tested with random arguments from 0 to x) 0..0.3 0..10 0..300 actual libm: sin 0.18 us 0.45 us 0.51 us cos 0.20 us 0.46 us 0.52 us tan 0.30 us 0.63 us 0.69 us New converted CRAY routines: sin 0.20 us 0.20 us 0.20 us cos 0.22 us 0.22 us 0.22 us sin+cos (simultaneous) 0.24 us 0.24 us 0.24 us tan (derived) 0.27 us 0.27 us 0.27 us Looks good !!? This stuff really has virtally constant running time for all arguments. Unfortunatelly I do not yet understand, how the algorithms really work..... Accuracy on sin+cos is ~ as mentioned before ~ 1 ULB. Good night from Frankfurt Joachim ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Fast Compilers for Linux 1998-05-08 4:00 Fast Compilers for Linux James Sternberg 1998-05-08 4:00 ` James D. Freels @ 1998-05-09 4:00 ` Toon Moene 1 sibling, 0 replies; 25+ messages in thread From: Toon Moene @ 1998-05-09 4:00 UTC (permalink / raw) "James Sternberg" <jsternbe@atomic1.phys.utk.edu> wrote: > Does anyone here know of a good set of compilers for alpha-linux? We have > recently purchased a DEC XL 300 and installed Linux on it, but the code > which gcc and g77 produce is very slow. As a matter of fact, using gcc and > g77 on my PC at home (only a Pentium 233MMX) and compiling the code for my > research produces an executable which is about 20% faster on the Intel box > than the Alpha. This does not make much sense. Which gcc/g77 combo do you use ? You won't get any performance out of g77-0.5.2[012] + gcc-2.7.2.3 on Alpha's because of a design problem in the handling of the combination of 64-bit pointers and 32-bit array indices (not that it would generate wrong code, it's just painfully slow). Try egcs-1.0.2 for a better solution (or, if you can wait a week, egcs-1.0.3) - http://egcs.cygnus.com -- Toon Moene (mailto:toon@moene.indiv.nluug.nl) Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Phone: +31 346 214290; Fax: +31 346 214286 g77 Support: mailto:fortran@gnu.org; NWP: http://www.knmi.nl/hirlam ^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~1998-05-25 4:00 UTC | newest] Thread overview: 25+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 1998-05-08 4:00 Fast Compilers for Linux James Sternberg 1998-05-08 4:00 ` James D. Freels 1998-05-08 4:00 ` Dr. Ram Samudrala 1998-05-10 4:00 ` James Sternberg 1998-05-09 4:00 ` Toon Moene 1998-05-09 4:00 ` James D. Freels 1998-05-09 4:00 ` Toon Moene 1998-05-20 4:00 ` Matt Kennel 1998-05-21 4:00 ` Toon Moene 1998-05-21 4:00 ` Greg Lindahl 1998-05-21 4:00 ` John Lyon <SPP> 1998-05-21 4:00 ` Greg Lindahl 1998-05-22 4:00 ` John Lyon <SPP> 1998-05-22 4:00 ` Joachim Wesner 1998-05-22 4:00 ` Greg Lindahl 1998-05-22 4:00 ` Joachim Wesner 1998-05-22 4:00 ` Andi Kleen 1998-05-23 4:00 ` Michal Jaegermann 1998-05-23 4:00 ` James H. Cloos Jr. 1998-05-25 4:00 ` Huw Davies 1998-05-22 4:00 ` Joachim Wesner 1998-05-22 4:00 ` Fast Cray libm on axp/Linux, was " Joachim Wesner 1998-05-22 4:00 ` Greg Lindahl 1998-05-23 4:00 ` Fast Cray libm on axp/Linux, more results Joachim Wesner 1998-05-09 4:00 ` Fast Compilers for Linux Toon Moene
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox