Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!rutgers!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!VACATION.VENARI.CS.CMU.EDU!mwm From: mwm@VACATION.VENARI.CS.CMU.EDU (Mark Maimone) Newsgroups: comp.lang.fortran Subject: Re: f2c for numerical Fortran conversion Message-ID: <1990Dec6.184558.10625@cs.cmu.edu> Date: 6 Dec 90 18:45:58 GMT References: <1990Dec5.001924.11786@ariel.unm.edu> Sender: netnews@cs.cmu.edu (USENET News Group Software) Reply-To: mwm@VACATION.VENARI.CS.CMU.EDU (Mark Maimone) Organization: Carnegie Mellon University Lines: 81 Some info from David Gay of AT&T: ------------------------------------------------------------------------ From: dmg@research.att.com [David Gay] Date: Wed, 5 Dec 90 09:07:18 EST Concerning the efficiency of the C produced by f2c, whether a Fortran program runs faster or slower when converted by f2c depends both on the Fortran and C compilers involved and on the program itself; the comparison can go either way. (The point of f2c is to allow using Fortran source on systems that have a C but not a Fortran compiler and to allow portable mixing of C and Fortran.) > has anyone > ever considered running an entire library (say SLATEC) through f2c and > then seeing if it still works. Yes (e.g., PORT3). RTFM. [also MINOS and the smaller NAG library -mwm] > How > well does something like f2c preserve the numerical properties of the > Fortran coding? F2c obeys the Fortran 77 standard, at least when the resulting C is compiled by an ANSI C compiler (which must honor parentheses) or when -kr is specified (see the f2c man page). -- Dave ------------------------------------------------------------------------ You can find more descriptive information about f2c by reading Bell Labs Computing Science Tech Report 149, available in postscript format by anon-ftp from research.att.com, in /dist/f2c/f2c.ps.Z. Or you can request it by email by sending this message to netlib@research.att.com: send f2c.ps from f2c In writing f2c, we started with the source for the original f77. Not a good optimizing compiler, but one that has been in service for over a decade. We corrected several known (and some previously unrecognized) bugs with f77 along the way. Why not try running your favorite library source and test suite through f2c? Here's a repost of one set of benchmarks taken two months ago by some other folks: ------------------------------------------------------------------------------- From: jim@interet.UUCP (User) Subject: f2c is almost great Date: 1 Oct 90 17:13:16 GMT Here are some f2c versus Fortran benchmarks. They were provided by Nhuan Doduc, Framentec-Cognitech, Paris, France. The program is a thermohydraulic model, uses double precision arithmetic, is compute bound, uses negligible IO, and is only 2% vectorizable. R Values using f2c and Fortran (larger R is faster) =================================================== Computer R f2c R Fortran Relative -------- ----- --------- -------- Solbourne Series 5 235 265 89 % Sun 4/110 61 74 82 Sun 4/260 81 95 85 Sun 4/20 SLC 93 103 90 Sun 4/60 SparcStation I 107 119 90 Sun 4/370 164 234 70 Note that the f2c translation is about 84% as fast as Fortran. Nhuan Doduc wrote me to say: "I would suggest only 2 conclusions: (1) f2c is SOLID since the doduc source is VERY UGLY (it has broken many compilers) and (2) the doduc is a good candidate for evaluating the progress of the work done on f2c, that is if f2c workers want to improve their product." Jim Ahlstrom uunet!interet!jim Nhuan Doduc ndoduc@framentec.fr or ndoduc@cognitech.fr ------------------------------------------------------------------------------- ---------------------------------------------------------------------- Mark Maimone phone: (412) 268 - 7698 Carnegie Mellon Computer Science email: mwm@cs.cmu.edu grad student, vocal jazz and PDQ Bach enthusiast