Path: utzoo!attcan!telly!lethe!becker!hybrid!scifi!bywater!uunet!maverick.ksu.ksu.edu!wallace From: wallace@math.ksu.edu (Wallace Bow) Newsgroups: comp.benchmarks Subject: Re: Sun weirdness. Message-ID: <1990Dec18.012615.2188@maverick.ksu.ksu.edu> Date: 18 Dec 90 01:26:15 GMT References: <605@mephisto.edu> Sender: news@maverick.ksu.ksu.edu (The News Guru) Distribution: usa Organization: Sandia National Laboratories, Albuquerque, NM Lines: 72 In article mccalpin@perelandra.cms.udel.edu (John D. McCalpin) writes: >> On 17 Dec 90 17:19:00 GMT, juan@burdell.gatech.edu (Juan Orlandini) said: >> >> Can anyone tell me why the following program takes only .9 user >> seconds an .1 sys seconds on a sun 4/370 and 5.0 user seconds >> and 39.0 sys seconds on sparc 1's (1, 1+, IPC)? > >I would guess that it is spending all of its time in a floating-point >exception handler, since the total time is cut to 2.9 seconds (on a >Sparc I, no optimization) if you initialize the two arrays before >using them! You guess correctly. Look at this: --------------------------------------------------------------------------- Script started on Mon Dec 17 18:16:34 1990 debbie:/home/debbie/wjbow>cat tempfile.c #include #include int boom() { printf("Game over!\n"); exit(-1); } main() { int num_times,row1,col2,col1,num_cols1,num_cols2,num_rows; float mat1[4][4],mat2[4][4],res[4][4]; float temp; ieee_handler("set","all",boom); num_rows = 4; num_cols1 = 4; num_cols2 = 4; for(num_times=0;num_times<10000;num_times++) { for(row1=0;row1junk Game over! debbie:/home/debbie/wjbow>exit --------------------------------------------------------------------------- ieee_handler(3M) catches the exception. See the man page on how to use it and put it in all of your floating point programs. It can save you hours of time with dbx. -- Wallace J. Bow Jr., wjbow@gorman.cs.sandia.gov sig .sig .sig .sig .sig .sig .sig .sig .sig .sig .sig .sig .sig .sig .sig sig .sig .sig .sig .sig .sig .sig .sig .sig .sig .sig .sig .sig .sig .sig