

            t$clup (6) --- profiling routine called on program exit  07/04/83


          | _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 subroutine t$clup

                 Library:  vswtlb (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 A  call  to 't$clup' is inserted before each "call swt" in a
                 Subsystem program that is to be profiled.   When  used  with
                 the  "-p"  option,  Ratfor  inserts  this call automatically
                 before a "stop" statement, and  converts  the  "stop"  to  a
                 "call swt".

                 The purpose of 't$clup' is to write to the file "_profile" a
                 summary of the amount of real, cpu, and paging time spent in
                 each  subroutine  of  the profiled program.  This summary is
                 then read by the program  'profile'  and  formatted  into  a
                 report.

                 Since  no  profiling  information  is  written by any of the
                 other profiling routines,  't$clup'  must  be  called  if  a
                 profile is to be made.

                 'T$clup'  should  be  called  explicitly only by those users
                 wishing to profile Fortran programs by  hand;  Ratfor  users
                 should always profile with the "-p" option of the preproces-
                 sor.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 'T$clup'  repeatedly  calls  't$exit'  until  all subprogram
                 calls have been cleaned up from  the  internal  call  stack.
                 The  file  "_profile"  is  opened via a call to 'create' and
                 filled by repeated calls  to  'writef'.   A  final  call  to
                 'close'  closes  the  file, leaving it ready for analysis by
                 'profile'.


            _C_a_l_l_s

          |      cant, close, create, t$exit, writef, Primos at$hom


            _B_u_g_s

                 This code should be invoked by 'swt', if necessary and  pos-
                 sible.


            _S_e_e _A_l_s_o

                 t$entr (6), t$exit (6), t$time (6), t$trac (6), rp (1)



            t$clup (6)                    - 1 -                    t$clup (6)


