home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / fortran / 3470 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  2.4 KB

  1. Path: sparky!uunet!usc!rpi!crdgw1!ge-dab!puma.ATL.GE.COM!fergie.dnet.ge.com!wmitchel
  2. From: wmitchel@fergie.dnet.ge.com (Bill Mitchell)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: Size of executables
  5. Message-ID: <1992Sep8.141200.12145@puma.ATL.GE.COM>
  6. Date: 8 Sep 92 14:12:00 GMT
  7. References: <9209031948.AA10327@ros6.gsfc.nasa.gov>
  8. Sender: news@puma.ATL.GE.COM (USENET News System)
  9. Organization: GE Advanced Technology Labs
  10. Lines: 77
  11.  
  12. It would seem there is more than just a question of shared/static
  13. libraries involved here.  Consider the following two programs:
  14.  
  15. edgar% cat test1.f
  16.       END
  17. edgar% cat test2.f
  18.       parameter(ndim=128)
  19.       real a(ndim,ndim),b(ndim,ndim),c(ndim,ndim)
  20.       real second
  21. ......trivial main program to initialize a,b,c,n, call matmul
  22.       between calls to second, and print results, omitted ......
  23.       stop
  24.       end
  25.       subroutine matmul(a,b,c,n,lda)
  26.       real a(lda,*),b(lda,*),c(lda,*)
  27.       real sdot
  28.       do i=1,n
  29.          do j=1,n
  30.             c(i,j)=sdot(n,a(i,1),lda,b(1,j),1)
  31.          end do
  32.       end do
  33.       return
  34.       end
  35.       REAL FUNCTION SDOT(N,SX,INCX,SY,INCY)
  36. C
  37. ......... Level 1 BLAS routine SDOT from netlib omitted ........
  38.       END
  39.       function second()
  40. c
  41. c returns user time since beginning of program
  42. c
  43.       real dummy,times(2)
  44. c
  45.       dummy = etime(times)
  46.       second = times(1)
  47. c
  48.       return
  49.       end
  50.  
  51. Compiled on a Sun SPARCstation IPC running SunOS 4.1.1.  I get
  52.  
  53. edgar% f77 -o test1 test1.f
  54. test1.f:
  55.  MAIN:
  56. edgar% f77 -o test2 test2.f
  57. test2.f:
  58.  MAIN:
  59.     matmul:
  60.     sdot:
  61.     second:
  62. edgar% ls -l
  63. total 315
  64. -rwxr-xr-x  1 wmitchel   147456 Sep  2 11:20 test1*
  65. -rw-r--r--  1 wmitchel       10 Sep  2 10:42 test1.f
  66. -rw-r--r--  1 wmitchel       88 Sep  2 11:21 test1.o
  67. -rwxr-xr-x  1 wmitchel   147456 Sep  2 11:21 test2*
  68. -rw-r--r--  1 wmitchel     2345 Sep  2 10:49 test2.f
  69. -rw-r--r--  1 wmitchel     5236 Sep  2 11:21 test2.o
  70.  
  71. Why are the two executable *exactly* the same size?
  72.  
  73. BTW, on a VAX running ULTRIX I get
  74.  
  75. -rwxr-xr-x  1 wmitchel    24576 Sep  2 13:22 test1*
  76. -rw-r--r--  1 wmitchel       10 Sep  2 10:42 test1.f
  77. -rw-r--r--  1 wmitchel      124 Sep  2 13:22 test1.o
  78. -rwxr-xr-x  1 wmitchel    35840 Sep  2 13:22 test2*
  79. -rw-r--r--  1 wmitchel     2350 Sep  2 13:21 test2.f
  80. -rw-r--r--  1 wmitchel     3544 Sep  2 13:22 test2.o
  81.  
  82. -- 
  83.  -- Bill
  84.  
  85. William F. Mitchell           |  wmitchell@atl.ge.com
  86. GE Advanced Technology Labs   |  na.mitchell@na-net.ornl.gov
  87.  
  88. Just the facts -- no opinion disclaimer necessary.
  89.