<html><div style='background-color:'><DIV>
<P>Dear Sir or Mada,</P>
<P>&nbsp;</P>
<P>Thank you very much for your kind suggestion. <IMG height=12 src="http://graphics.hotmail.com/emthup.gif" width=12><BR></P></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>&gt;Well, for my little experience, optimizing FORTRAN is a different
<DIV></DIV>&gt;matter than optimizing C code (incidentally generated by a &gt;FORTRAN-to-C translator): the former should be easier to &gt;optimize (or, at least, producing optimized code from &gt;FORTRAN&nbsp;should be a better understood problem than producing &gt;optimized &gt;code from C).
<DIV></DIV>&gt;
<DIV></DIV>&gt;But be sure to have a look at the optimizing options available for gcc
<DIV></DIV>&gt;(i.e. even with -O3 it doesn't always unroll loops unless you tell it
<DIV></DIV>&gt;explicitly).
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<P>&nbsp;</P>
<P>Actually, I already used the -O3 during compiling.</P>
<P>&nbsp;</P>
<P>The g77 was used in compiling the fortran source code,</P>
<P>and f2c and gcc were also used, and the computational</P>
<P>speed is comparable (but much slow than other compilers,</P>
<P>say, absoft fortran)</P>
<P>&nbsp;</P>
<P>&gt;I'd say that you have basically four choices: </P>
<DIV></DIV>&gt;
<DIV></DIV>&gt;1) Stick to FORTRAN, and buy a proprietary compiler targeted to the
<DIV></DIV>&gt; platform of you choice.
<DIV></DIV>&gt;
<DIV></DIV>&gt; This already gave you very good results, from what you said.
<DIV></DIV>
<P>&nbsp;</P>
<P>Those commercial compilers are too expensive.</P>
<P>&nbsp;</P>
<DIV></DIV>&gt;2) Port the FORTRAN code to C by hand, without using an automatic
<DIV></DIV>&gt; translator (which probably doesn't generate very good C), and buy a
<DIV></DIV>&gt; proprietary C compiler targeted to the platform of your choice.
<DIV></DIV>&gt;
<DIV></DIV>&gt; This should give equally good results as (1), but with more effort,
<DIV></DIV>&gt; and you end buying a proprietary compiler anyways.
<DIV></DIV>
<DIV></DIV>
<P>&nbsp;</P>
<P>Not only the "g77 (or f77)" (and "f2c + gcc") are slow but also</P>
<P>the gcc is slow.</P>
<P>&nbsp;</P>
<P>&gt;3) Port the FORTRAN code to C and use gcc, optimizing the code by &gt;hand&nbsp; where needed using inline assembly. </P>
<P>&gt; This is the solution used for the Linux kernel: it works, but </P>
<DIV></DIV>&gt; requires a lot of effort and knowledge.
<DIV></DIV>
<P>&nbsp;</P>
<P>Good idea.</P>
<P>&nbsp;</P>
<DIV></DIV>&gt;3bis) Port the FORTRAN code to C, and use GNU GMP
<DIV></DIV>&gt; (http://swox.com/gmp/#DOC) to do math. GMP functions are already
<DIV></DIV>&gt; optimized by hand for several platforms, using inline
<DIV></DIV>&gt; assembly. YMMV.
<DIV></DIV>
<DIV></DIV>
<P>&nbsp;</P>
<P>Yes. But it seems not easy to use the GMP, right?</P>
<P>&nbsp;</P>
<P>&gt;4) Stay with f2c + gcc. It works, slowly, but it works. </P>
<DIV><IMG height=12 src="http://graphics.hotmail.com/emcrook.gif" width=12></DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank you very much again.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Ray</DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://g.msn.com/1HM301601/10'>http://explorer.msn.com</a>.<br></html>

_______________________________________________
This is the Linux C++ Programming List
: http://lists.linux.org.au/listinfo/tuxcpprogramming List


------=_NextPart_000_2adc_2002_7354--