The main part of TSF is a graphical interface dedicated to the manipulation of a set of toolkits. Each toolkit is stored in text file that can be dynamically loaded. Several toolkits can be used simultaneously. Each toolkit entry consists in:
The script is the probably the most important part so we often use the term
script instead of toolkit entry. The documentation is also
interesting since it allows the user to be aware of the usage and restriction
of the proposed transformation. This is especially important as most
techniques are under the control of the user. See example 1. The
toolkit is an essential part of the system as it enables users to share
program transformation scripts.
Example 1: a TSF Toolkit Entry
StartCase 14 : Name : "insert mpi send for real"; Application : "send data"; Author : "xxxx"; PatternIn : ""; Transformation : " SCRIPT SendMPIReal () ... ENDSCRIPT"; Documentation : " insert a call to MPI send ..."; EndCase\\
Once loaded the transformations stored in the toolkit become available from a
menu (see figure 6). The example 2 shows a
script to insert a call to a MPI routine.
Example 2:Insertion of a MPI call
SCRIPT Send_MPI () IF (NOTUSED ("mpi_ierror")) THEN DECLARE("include 'mpif.h'") DECLARE("integer mpi_ierror") ENDIF newStat := PARSESTAT("call MPI_SEND(name,size,MPI_REAL,dest, type,MPI_COMM_WORLD,mpi_ierror)") verif := PARSESTAT("if (mpi_ierror .ne. MPI_SUCCESS) print *, 'ERROR WITH SEND MESSAGE'") PASTE("AFTER",verif, $csel) PASTE("AFTER",newStat, $csel) ENDSCRIPT
TSF uses the extension '.db' for toolkit files and '.dbm' multiple toolkit
files. A '.dbm' file must contain a list of toolkits files (see example 3).
Example 3: The content of a simple '.dbm' file
/home/foo/TSF/trans/Demo.db /home/foo/TSF/trans/Utils.dbm /home/foo/TSF/trans/Unrolling.db /home/foo/Work/Fortran/Cray/MPI.db
For convenience, the file '.TSF.dbm' is automatically loaded in the user home directory when TSF is started.