fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

MONITOR ENTRY

Syntax:

[DO NOT] MONITOR ENTRY [AND EXIT] [DO NOT] MONITOR ENTRIES [AND EXITS] [DO NOT] TRACE ENTRY [AND EXIT] [DO NOT] TRACE ENTRIES [AND EXITS] [DO NOT] REMOVE MONITOR ENTRY [AND EXIT]

Function:

fpt inserts the statement:

CALL fpt_monitor_entry(<integer>)

as the first executable statement of every subroutine and function in the code, where the integer value is a unique identifier for the sub-program. It inserts the statement:

CALL fpt_monitor_exit(<integer>)

before every exit statement from the sub-program. An exit statement may be the terminating END statement if this is reachable, a RETURN or a STOP statement. For example:

SUBROUTINE fumer_check(*) IMPLICIT NONE ! ! --Various checks on the form data before we attempt to merge it; including setting IFU to f/u visit number 1.. ! INCLUDE 'fumercom_inc.i90' CHARACTER fuevcc*2,saec*1,sampnotrec*1 INTEGER ircode,iev,jprev,jcur,idih,jfuev,id,im,iy,jfuevmin, & jfuevmax LOGICAL gotit CALL fpt_monitor_entry(4) ! forced = .FALSE. ! ! --Input records should be so long... IF (nsl(d.recc2.buf) .LT. 83) THEN CALL errsay(d.recc1.id// & ' ** REJECTED: Second input record too short (date missing?)' & ,*9999) reject = .TRUE. ENDIF ! ! --Set the visit number; moan if no date present CALL fumer_visno IF (r.dafus(ifu) .EQ. ' ') THEN CALL errsay(d.recc1.id//' ** REJECTED: No visit date in RAND' & ,*9999) reject = .TRUE. IF (force) CALL errsay(d.recc1.id// & ' ** FORCE command overridden',*9999) CALL fpt_monitor_exit(4) RETURN ENDIF ! ! --Check form present IF (r.rfus(ifu) .NE. 'Y') THEN CALL errsay(d.recc1.id// & ' ** REJECTED: RFUn in RAND record 07 is not Y',*9999) reject = .TRUE. IF (force) CALL errsay(d.recc1.id// & ' ** FORCE command overridden',*9999) CALL fpt_monitor_exit(4) RETURN ENDIF ! : :

Support Files

fpt writes the file <PROJECT_NAME>_subprograms.txt to the directory in which fpt is run (NOT the primary output directory). This file contains the list of sub-programs and their corresponding indices, for example:

!H!**************************************************************************** !H! File: fumer_subprograms.txt !H! Output by fpt 4.1-r Intel-Linux On 3-AUG-22 At 15:15:22 !H!**************************************************************************** Main input: /media/truecrypt1/fortran_codes/fumeur/fpt/fumer.fsp Processed: 15:15:22, 3-AUG-22 ------------------------------------------------------------------------------- 25 sub-programs 1 errsay 2 file_error 3 fumer * 4 fumer_check 5 fumer_deinit 6 fumer_doit 7 fumer_dumprecs 8 fumer_getrecs : :

fpt also writes the file fpt_n_subprograms.h to the main code output directory. This file contains the count of the number of sub-programs and is used by the c support code described below. For example:

// **************************************************************************** // File: ../fpt_output/fpt_n_subprograms.h // Output by fpt 4.1-rB Intel-Linux On 3-AUG-22 At 15:15:22 #define N_SUBPROGRAMS 25 // End of ../fpt_output/fpt_n_subprograms.h

The Monitor Routines

Users may write their own routines to log entry and exit, for example, to a text file. If you do this, remember to flush the output after each write statement, otherwise the file will be truncated if the program crashes.

However, this facility was first created to identify the points of failure in a very large real-time multi-threaded system. A small set of c and Fortran routines was created to record the entries and exits in memory, and to capture the memory after the program had exited or crashed. These wil be found in the fpt distribution in the directory: fpt/fpt_monitor_entry_support.

REMOVE MONITOR ENTRY

The command REMOVE MONITOR ENTRY removes the monitor statements from the code.

Where to Use these Commands

Operating system command line Yes
Configuration file, config.fsp Yes
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt Yes
Interactive command files Yes
Embedded in the Fortran code No

Default

Monitoring statements are neither inserted nor removed by default.

Copyright ©1995 to 2022 Software Validation Ltd. All rights reserved.