nonmem version iii implementation on a vax 9000: a dcl procedure for single-step execution and the...

13
Computer Method~ and Programs in Biomedicine. 40 (1993) 103-115 NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler Jonathan P. Vielhaber a, Jeanne V. Kuhlman b, Jeffrey S. Barrett *'c "Rochester Institute of Technology, Rochester, N Y. USA I'Corporate Computer Resources Department, Merck & Co.. Rahway. N J. USA CDrug Metabolism Department, Merck Research Laboratories, WP26-372 West Point, PA 19486. USA Abstract There is great interest within the FDA, academia, and the pharmaceutical industry to provide more detailed information about the time course of drug concentration and effect in subjects receivinga drug as part of their overall therapy. Advocates of this effort expect the eventual goal of these endeavors to provide labeling which reflects the experienceof drug administration to the entire popu- lation of potential recipients. The set of techniques which have been thus far applied to this task has been defined as population ap- proach methodologies. While a consensus view on the usefulness of these techniques is not likely to be formed in the near future, most pharmaceuticalcompanies or individuals who provide kinetic/dynamic support for drug developmentprograms are investigating population approach methods. A major setback in this investigation has been the shortage of computational tools to analyze popula- tion data. One such algorithm, NONMEM, supplied by the NONMEM Project Group of the Universityof California, San Francisco has been widely used and remains the most accessiblecomputational tool to date. The program is distributed to users as FORTRAN 77 source code with instructions for platform customization. Given the memory and compiler requirements of this algorithm and the intensive matrix manipulation required for run convergence and parameter estimation, this program's performance is largely deter- mined by the platform and the FORTRAN compiler used to create the NONMEM executable. Benchmark testing on a VAX 9000 with Digital's FORTRAN (v. 1.2)compiler suggests that this is an acceptable platform. Due to excessive branching within the loops of the NONMEM source code, the vector processing capabilities of the KV900-AAvector processor actually decrease performance. A DCL procedure is given to provide single step execution of this algorithm. Key word~." NONMEM; Vector processor; VAX 1. Introduction Population approach methodologies are cur- rently an expanding area of interest to those who are involved in the drug development and drug evaluation processes. The initial incentive to develop population analysis techniques came from the desire to analyze observational data. Pro- ponents of population approach methods claim that these techniques may limit the need for non- patient (i.e., preclinical and Phase-I) data, may im- prove our understanding of efficacy, and perhaps reduce the time and cost of clinical evaluation. Presently, these benefits have not been realized due to the limited application of these methods in actual drug development programs and the uncer- tainty many investigators feel with these methods. The most compelling population approach analyses have been completed retrospectively after more traditional approaches have been examined. Other obstacles to population approach methods are the difficulty of collecting data in the later *Corresponding author. 016%2607/93/$06.00 © 1993 Elsevier Scientific Publishers Ireland Ltd. All rights reserved COMMET 01376

Upload: jonathan-p-vielhaber

Post on 28-Aug-2016

238 views

Category:

Documents


12 download

TRANSCRIPT

Page 1: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

Computer Method~ and Programs in Biomedicine. 40 (1993) 103-115

N O N M E M version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage

of a vectorizing F O R T R A N compiler

J o n a t h a n P. V i e l h a b e r a, J e a n n e V. K u h l m a n b, J e f f r e y S. B a r r e t t *'c

"Rochester Institute of Technology, Rochester, N Y. USA I'Corporate Computer Resources Department, Merck & Co.. Rahway. N J. USA

CDrug Metabolism Department, Merck Research Laboratories, WP26-372 West Point, PA 19486. USA

Abstract

There is great interest within the FDA, academia, and the pharmaceutical industry to provide more detailed information about the time course of drug concentration and effect in subjects receiving a drug as part of their overall therapy. Advocates of this effort expect the eventual goal of these endeavors to provide labeling which reflects the experience of drug administration to the entire popu- lation of potential recipients. The set of techniques which have been thus far applied to this task has been defined as population ap- proach methodologies. While a consensus view on the usefulness of these techniques is not likely to be formed in the near future, most pharmaceutical companies or individuals who provide kinetic/dynamic support for drug development programs are investigating population approach methods. A major setback in this investigation has been the shortage of computational tools to analyze popula- tion data. One such algorithm, NONMEM, supplied by the NONMEM Project Group of the University of California, San Francisco has been widely used and remains the most accessible computational tool to date. The program is distributed to users as FORTRAN 77 source code with instructions for platform customization. Given the memory and compiler requirements of this algorithm and the intensive matrix manipulation required for run convergence and parameter estimation, this program's performance is largely deter- mined by the platform and the FORTRAN compiler used to create the NONMEM executable. Benchmark testing on a VAX 9000 with Digital's FORTRAN (v. 1.2) compiler suggests that this is an acceptable platform. Due to excessive branching within the loops of the NONMEM source code, the vector processing capabilities of the KV900-AA vector processor actually decrease performance. A DCL procedure is given to provide single step execution of this algorithm.

Key word~." NONMEM; Vector processor; VAX

1. Introduction

Populat ion approach methodologies are cur- rently an expanding area of interest to those who

are involved in the drug development and drug evaluat ion processes. The initial incentive to develop populat ion analysis techniques came from the desire to analyze observat ional data. Pro- ponents of popula t ion approach methods claim that these techniques may limit the need for non- patient (i.e., preclinical and Phase-I) data, may im-

prove our unders tanding of efficacy, and perhaps reduce the time and cost of clinical evaluation. Presently, these benefits have not been realized due to the limited applicat ion of these methods in actual drug development programs and the uncer-

tainty many investigators feel with these methods. The most compelling popula t ion approach analyses have been completed retrospectively after more tradit ional approaches have been examined. Other obstacles to popula t ion approach methods are the difficulty of collecting data in the later

*Corresponding author.

016%2607/93/$06.00 © 1993 Elsevier Scientific Publishers Ireland Ltd. All rights reserved COMMET 01376

Page 2: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

llM

phases of drug development and the need to educate clinical investigators in this approach.

The design, performance, and evaluation of population pharmacokinetics and/or pharmaco- dynamic (PK/PD) studies have received major attention from academia, the pharmaceutical industry, and health authorities over the last several years. At recent workshops/conferences of the Drug Information Association (DIA; May 6-7, 1991) on 'Applications of Population Pharmacokinetics/Pharmacodynamics in Drug Development' and the European Cooperation in Science & Technology B l Program (COST; September 21-23, 1991) on 'New Strategies in Drug Development and Clinical Evaluation: The Population Approach' the potential for popula- tion approach techniques to influence drug de- velopment was discussed. It seems quite obvious that regulatory agencies will insist that population approach trials endure the same scrutiny and justi- fication as current Phase-III clinical trials. Of these requirements, a strict attention to design (a priori deciding which class(es) of models will be studied), knowledge of sample sizes within covariates (effect sample sizes), demonstration of model validation and reproducibility, documenta- tion of modeling effects, examination of robustness and other models which are consistent with the data, and simulation studies which ex- amine expectations under a variety of scenarios, will be integral parts of any population trial analy- sis submitted to regulatory agencies.

Before any of these investigations can proceed, validated computational tools must be in place. The most available algorithm to analyze popula- tion PK/PD data is the NONMEM (an acronym for nonlinear mixed-effect models) algorithm sup- plied by the NONMEM Project Group at the Uni- versity of California, San Francisco (UCSF). The procedure utilized by NONMEM was first introduced by Sheiner and Beal [1-3]. The NONMEM approach is often referred to as the 'first-order' approach since the method involves the linearization of a statistical model which will account for the non-homogeneous way in which various factors (covariates) affect the observed data. This linearization takes the form of a first- order Taylor expansion around population param-

eter values. Parameters are then estimated by those which minimize an objective function. The objec- tive function is a measure of the discrepancy be- tween observed and expected (true) values. In a least-squares approach,

Objective function, O, = E (observed - expected) 2

NONMEM utilizes a general parameter estima- tion method called extended least squares [4-7].

E { log det Ci(0,fl,E) +

[Yi - E ~ ( O , f l , F . ) I ' [ C ~ ( O , f l , E ) ] - ' [y~ - E~(0,fl,r.)] I

This method is an extension of the normal least squares which allows the calculation of random in- terindividual effects and reduces to ordinary non- linear least squares when all measurements are from a single individual and weighted least squares with the appropriate model [3]. The extended least squares objective function looks like the following: where Ei(O,fl,~ ) is the matrix of expected values of the response vector Yi and Ci(0,fl,E) is the variance-covariance matrix of the same vector. The prime (') denotes vector transpose and det denotes the matrix determinant. The response, Yi, is actually a multivariate collection of Ji measurements recorded on I individuals. These measurements may consist of drug concentration in plasma, urine, or other bodily fluid and/or various quantitative or qualitative determinations of pharmacologic effect. In the most common pop- ulation analysis experiment, data is collected from the later phases of drug development (Phase-III and beyond). These data are generated mainly from the population of interest and are, by nature, sparse (few observations per subject), although many subjects are often admitted into these later trials. A great deal of the effort in such an analysis involves the explanation of the unaccounted variability by the presence of various categorizing variables (covariates) such as sex, age, weight, renal function, etc.

Several excellent sources describe in more detail the statistical theory and application of the phar- macostatistical model which is necessary for the extended least squares estimation procedure within NONMEM [8-Ill. The above function

Page 3: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

gives an indication of the intense matrix manipula- tion that results during execution of the NONMEM program. The current investigation gives expected run times on the VAX; the Appen- dix contains an example data set, control file, and subsequent NONMEM-generated files from three test runs used in a run time analysis on control files of varying complexity. Various clinical and experi- mental studies have been published [12-181. They illustrate the broad range of potential applications of this algorithm and give some indication of the variety of platforms on which the NONMEM pro- gram has been installed. In any event, it is always recommended that NONMEM be run on the fastest hardware/software platform available, par- ticularly with the double-precision version. The VAX 9000 has certain advantages over other plat- forms. Software porting is straightforward due to the richness of the VAX FORTRAN language and the VAX 9000 can be equipped with an integral vector processor (KV900-AA).

2. Materials and Methods

2.1. N O N M E M code: form and structure The original NONMEM source code is distri-

buted as 12 files on tape - - 4 double precision specific, 4 single precision specific, 2 precision in- dependent versions and 2 data files. With the ex- ception of the 2 data files, each individual file contains several subroutines (over 150 in some cases). These files should be placed in individual subdirectories and then separated. These files are much easier to work with once separated. The file SEP.FOR in Part III: installation Guide of the NONMEM manuals is included to easily separate these files.

The subroutines in these files, including all the files needed for the NONMEM executable and the NM-TRAN executable (NONMEM's data pre- processor), are written in FORTRAN 77. These files may be compiled with any FORTRAN com- piler that supports the ANSI FORTRAN 77 stan- dard. The files included are specific for a UNIX system, but changes made following the installa- tion guide make it easy to port to another plat- form. The main changes needed to be made when

105

porting from one system to another are machine specific constants, which are easily located in one file for NONMEM and one file for NM-TRAN. Any other changes or modifications that might be needed to port to another platform that is not sup- ported might be harder to make due to the fact that the source code is mostly undocumented.

2.2. Installation and validation on the VAX 9000 To compile NONMEM for use with the VAX

9000, the source files were first separated with the SEP program and placed in subdirectories. The platform specific constants in BLKDAT.FOR and ABLOCK.FOR were changed as mentioned in the installation guide. The null file specification in BLKDAT.FOR was changed to 'NL:', the VAX null file designation. Extensions were added to all the file names in BLKDAT.FOR and ABLOCK.FOR to prevent confusion and future problems. (.TMP was added to temporary files, .DAT to the generated data files, and .FOR to the generated FORTRAN file FSUBS.)

Once the changes were made, the source code was compiled. When compiling, the high perfor- mance optimization (hpo) switch was used to help speed up execution. (The vector switch was also used to obtain benchmarks for use with the vector coprocessor.) An example compile would be:

$fortran/hpo file.for

Once all of the individual modules were compiled, libraries were created for NONMEM, while NM- TRAN was linked into the final executable. The command for linking NM-TRAN would be:

$1ink/exec = nmtran nmtran.obj, ablock.obj, [many other .obj files], timeii.obj

All of the object files in the NM-TRAN subdirec- tory were used to produce an executable for NM- TRAN. Creating a library for NONMEM is just as easy. Simply use the command:

$1ibrary/create/object nonmemlib chol.obj, [many other .obj files], zxmjn.obj

cfiles.obj,

Page 4: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

106

Use all of the object files in the nonmem subdirec- tory, except BLKDAT.OBJ and NONMEM.OBJ.

Once the files have been compiled and libraries set up, validation of the program was done using the supplied data sets. Following the installation guide, each example was run and the results com- pared. This small amount of testing helped to verify that N O N M E M was generating results com- parable to those obtained by the N O N M E M Pro- ject group. Small differences should be expected due to individual machine precision.

2.3. Program execution Initial execution of N O N M E M was done step

by step from the command prompt. N O N M E M requires the creation of a data file and control file to define the type of model and the data used. The first step after creating a data file and control file was to pass the control file through NM-TRAN. By running N M - T R A N and connecting the con- trol file to standard input, the control file could be parsed. The command for this would be:

$run nmtran.exe/input = controi.txt

Once the file has been run, there should be several additional files in your directory represen- ting the new control file, the new data file, etc. If errors occur within the control file or data file, they must be fixed before continuing.

After running NM-TRAN, the N O N M E M executable must be generated. To do this, any subroutines generated by N M - T R A N must be compiled. After compiling these subroutines, NONMEM must be linked into an executable. All generated routines, the routines mentioned in the FREPORT file, the N O N M E M library, NONMEM.OBJ and BLKDAT.OBJ must be linked using the command:

$1ink/exec = nonmem.exe nonmem, blkdat, [any routines mentioned in FREPORT], fsubs, nonmemlib/lib

After linking these files, N O N M E M can be run with the command:

$run nonmem/input -- fcon.dat /output = report.txt

This command, after a hopefully short run, will output your report to the file REPORT.TXT. This file can now be reviewed or printed. If there were any errors during these steps, they must be fixed and the steps redone.

3. Platform improvements

3.1. Vector processing The VAX 9000-420 is a 40 VUP (VAX units of

processing) computer system. An integral KV900- AA vector processor manufactured by Digital Equipment Corporation was also used to examine performance enhancement as measured by elapsed time and CPU time comparison with and without the vector processor. Use of the vector processor is accomplished by compiling source code with the vectorizing high performance F O R T R A N (v. 1.2) compiler. The VAX 9000 was running the VMS 5.4 operating system. The KV900-AA vector pro- cessor is a register-to-register integrated vector processor in which the data are first loaded from memory into a set of high-speed vector registers. Until all operations pertaining to that data are completed, the data reside in the registers. Once all operations have completed, the results are return- ed to memory [191.

Use of a vector processor can shorten the execu- tion time of a computationally intensive program if that program requires manipulation of large matrices of data. The vector processor treats each vector operation as a single mathematical opera- tion rather than a series of row and column manipulations. For example, a vector processor treats the multiplication of a 1 × 3 vector with a 3 x 1 vector as a single instruction. A non- vectorizing processor requires 5 separate instruc- tions to perform the same computation. Some pro- gramming practices may make it impossible to vectorize some computations; if branches or ex- traneous computations occur within a loop, the operations within the loop cannot be vectorized.

3.2. Optimizing the NONMEM code No extensive efforts have been made to optimize

the N O N M E M code for the vector processor. In order to optimize it, it would be necessary to analyze the loop structures and the data structures

Page 5: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

NMTRAELEXE

FCl)R~T I ~b ~ FDATADAT FLIB.DAT FREPC]I:IT. DAT F~I"REAM DAT F~JBS.FOR

107

DEC FOFITRAN Compiler vl.2 i DEC I_ird~or

1~"~ FCON.DAT I F'DMADAT F~TREA,'Vl.DAT

NONMEM.EXE

Fig. 1. File operations performed by running NM.COM.

in the software. Optimal vector processor perfor- mance is dependent on clean loop structures (no branches, no extraneous computations which could be performed externally) and data storage schemes which reflect the natural storage strategies of the hardware. For example, if a particular com- puter normally stores arrays in a rowwise fashion, performance is degraded if the arrays are con- tinually referenced columnwise.

A single step front end was set up to help minimize the steps needed to run NONMEM. This DCL procedure, called NM.COM, handles the in- dividual steps of running NM-TRAN, compiling the generated routines and linking and running NONMEM. A schematic of file operations per- formed once NM.COM is run can be found in Fig. 1. Table 1 contains a glossary of the pertinent files. Routines found in the FREPORT.DAT file are automatically linked into the final executable. In addition, it handles and reports most errors that occur during each step of the process. After setting up a data file and control file for use with NM- TRAN, the procedure can be invoked using the command:

[email protected] CONTROL.TXT REPORT.TXT

After creating a control file and data file, NM.COM is called with the control filename on the command line. The first step done by NM.COM is passing the control and data files through NM-TRAN. NM-TRAN will create the files FCON.DAT, FDATA.DAT, FLIB.DAT, FREPORT.DAT, FSTREAM.DAT and FSUBS.FOR. Next, the compiling of the subroutines contained in the file FSUBS.FOR is completed using the DEC FORTRAN Compiler v. 1.2. The only option used with the compiler is the High Performance Option (/HPO). Once com- pleted, the file FREPORT.DAT is examined to determine the libraries and other files needed by the linker. Once these files are determined, they are linked together with the compiler FSUBS.OBJ file compiled in an earlier step to form the final NONMEM executable. Once completed, the FCON. DAT, FDATA. DAT, and FSTREAM.DAT files are passed into the NONMEM executable. Finally, the file RE- PORT.TXT will be produced. By setting up a sym-

Page 6: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

108

Table I Flowchart file descriptions

CONTROL.TXT

DATA.TXT

FCON.DAT

FDATA.DAT

FLIB.DAT

FREPORT.DAT

FSTREAM.DAT

FSUBS.FOR

FSUBS.OBJ

NONMEM.EXE

REPORT.TXT

User created control file. See NONMEM User's Guide - - Part IV, NM-TRAN Guide for more information. User created data file. See NONMEM User's Guide -- Part IV. NM-TRAN Guide for more information. Created by NM-TRAN. Contains the modified control file to be used with the final NONMEM executable. Created by NM-TRAN. Contains the modified data file to be used with the final NONMEM executable. Created by NM-TRAN. Contains the tables needed by the NM-TRAN library routines. Used with the final NONMEM executable if they are needed. Otherwise, they are ignored. Created by NM-TRAN. Contains a list of all the routines that must be present in the final NONMEM executable. Used to determine the files needed by the DEC Linker. Created by NM-TRAN. Contains a pointer to the data file for use with the final NONMEM executable. Created by NM-TRAN. Contains all user and generated FORTRAN subroutines that are needed for the final NONMEM executable. Created by the DEC FORTRAN Compiler v. 1.2. Used to create the final NONMEM ex- ecutable. Created by the DEC Linker. This is the final NONMEM executable that does all the processing of the control and data files. Created by NONMEM.EXE. This is the report file produced by the final NONMEM ex- ecutable. The file contains all the results and graphs requested in the control file.

bol to N M . C O M and using the default names of C O N T R O L . T X T for the control file and RE- P O R T . T X T for the output report, the command can be shortened even farther to:

$NM

Messages are displayed as the program is runn ing to show what progress has been made in the run. Use of this program has helped speed physical run times by minimizing the number of commands that need to be typed. The many complicated steps needed to run a complete N O N M E M job have been minimized to a one-step process, once the control and data files have been completed. This step minimizat ion helps to reduce the redundancy of typing in the individual steps.

4 . B e n c h m a r k t e s t s

4.1. Model description Elapsed time and actual CPU time were record-

ed for each of three separate control files with their

respective data files for analysis by the N O N M E M program with and without the vector switch com- piled. Benchmark times were obtained by examin- ing the log files from a submit ted batch job. This was done by using the command:

$SUBMIT R U N N O N M E M . C O M / L O G =

N O N M E M . L O G / N O P R I N T / P R I O R I T Y = 4

The file R U N N O N M E M . C O M (which runs the executable N O N M E M . E X E alone) contained the command:

$ R U N N O N M E M . E X E / I N P U T =

F C O N . D A T / O U T P U T = R E P O R T . T X T

Viewing the log file, N O N M E M . L O G , will show both the elapsed and CPU time for individual runs. All control and data files required data preprocessing and used the available routines within N M - T R A N . The control files vary in the degree of complexity and hence were chosen to yield runs of varying time length.

Test 1 is a simple one-compar tment pharmaco-

Page 7: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

kinetic model with a data set of one subject's plas- ma concentration and matching sampling time after oral administration of a drug. The data set, DATA1.TXT, contains 11 observations (records) and 3 fields (dose = amount, time, and plasma concentration). The model contains three parame- ters. Initial estimates with lower and upper bounds are supplied by the user. In addition, the overall intrasubject variability is estimated. The actual ki- netic model for this example is supplied by the PREDPP routines ADVAN2 within the $SUBROUTINES block of the control file. Data and control files used in these benchmark tests can be found in Appendix B. All of the three control files did converge. As the NONMEM-generated output is quite substantial, the report files have not been included.

Test 2 is a two-compartment model with a 4 h zero-order intravenous infusion input containing plasma concentration data from 9 subjects. The data set, DATA2.TXT, contains 121 records and 8 fields (ID, DOSE, RATE, TIME, CP, MDV, CMT, and EVID). The actual meaning of these variables is unimportant for our purposes here. They are required by NONMEM in order to specify this particular model. Test 2 requires four kinetic parameters to be estimated with initial and lower and upper bound estimates to be supplied by the user as in the previous example. This test re- quires the NONMEM supplied routines ADVAN3 and TRANS1 to be specified in the $SUBROUTINE block of the control file. In addi- tion to the four kinetic parameters, four intersub- ject variability estimates were predicted (one for each of the kinetic parameters; ETA (1) through ETA (4)) as well as the intrasubject variability, EPS (1). Initial estimates of the intersubject variability parameters are given in the $OMEGA block of the control file.

Test 3 also yields population kinetic parameters for a two-compartment model with a 4-h zero- order infusion. Likewise, the same data set, DATA2.TXT, is used as the test data for this run. Test 3, however, does not utilize the closed form solution of the two-compartment model as in test 2. Instead, the actual differential equations used to derive the closed form solutions are used with a subroutine to numerically solve differential equa-

109

tions, ADVAN8. The current version of NONMEM supplies three subroutines for the sol- ution of differential equations (ADVAN6 for gen- eral non-linear models, ADVAN8 for general non-linear models with stiff equations, and ADVAN9 for models with both algebraic and dif- ferential equations). Test 3 was designed to create run times which required longer CPU execution. The code for computing the solution of a system of differential equations (DEs) was obtained by the NONMEM Project Group under an agree- ment with IMSL (Houston, TX). The solution of DEs adds time to the NONMEM run by adding a level of subiterations within each ELS iteration. These subiterations can increase the total run times by as much as 1130% [20]. ADVAN8 was chosen arbitrarily although it is unlikely that test 3 represents a stiff system of DEs.

4.2. Run time results Table 2 contains the actual measured elapsed

time and CPU time results obtained by running each of the three test control files (CONTROLI.TXT, CONTROL2.TXT and CONTROL3.TXT) through NM.COM three times. The results were obtained by submitting the test for processing and analyzing the log file from the run. In addition, CPU time as a percentage of elapsed time was calculated. As stated earlier, times were recorded for each test with and without the vector switch compiled. While these tests in- volve relatively simple models with only a few sub- jects and a rich supply of kinetic data per subject (10-13 observations per subject), they do give some indication that the VAX 9000 is a reasonable platform to run NONMEM on. All of these tests were run during off peak hours (7 users and 16 processes).

The longest elapsed time recorded was 10 min and 53 s using test 3 with the vector processor. The mean elapsed time for this group was also the longest at 8.9 ± 1.8 min. For each of the three tests the vector processor increased both elapsed and actual CPU time as well as the % CPU time.

As stated earlier, these tests were run during off peak time. During the middle of the day with 84 users online and 106 processes active, test 3 without the vector processor took 17.65 min

Page 8: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

II0

Table 2

NONMEM benchmark tests on the VAX 9000:40 MIPS at "off peak TM usage with and without vector processor

Test No. Processor Run No. Elapsed time (min) CPU time (min) % CPU time

I Scaler 0.12 0.08 66.7

0.13 0.07 53.8

0.10 0.07 70.0 Mean ± S.D. 0.12 ± 0.04 0.07 ± 0.02 63.5 + 8.6

0.17 0.12 70.6 0.15 0.10 66.7

0.17 0.10 58.8

Mean ± S.D. 0.17 ± 0.04 0.10 ± 0.04 65.4 ± 6.0 1.42 0.67 47.2

1.47 0.78 53.1 1.12 0.75 67.0

Mean ± S.D. 1.33 ± 0.19 0.73 ± 0.07 55.9 ± 10.0

1.47 0.92 62.6 1.47 1.00 68.0

1.42 0.98 69.0

Mean ± S.D. 1.45 ± 0.03 0.97 ± 0.05 66.5 ± 3.4

4.18 2.67 63.9

4.02 2.65 65.9

4.57 2.58 56.5 Mean ± S.D. 4.25 ± 0.28 2.63 ± 0.05 62.1 ± 5.0

10.88 6.27 57.6

8.30 5.78 69.6 7.40 5.45 73.6

Mean ± S.D. 8.87 ± 1.82 5.83 ± 0.42 66.9 ± 8.3

Vector

2 Scaler

Vector

3 Scaler

Vector

a7 VAX users and 16 processes.

(elapsed time) of which 6.97 min was CPU time. This represents a 164% increase in CPU time and a 315% increase in elapsed time due to peak time processing on the VAX. Time should be expected to increase non-proportionately with the number of users due to the overhead of swapping code and data into and out of memory during task switching.

5. Discussion

Benchmark tests compiled with and without the vector processor showed that execution time for the vector processor version to be significantly higher than the non-vectorized version. After careful analysis of the respective runs, it was deter- mined that all of the N O N M E M code was vec- torized by the compiler and not just the parts that would most benefit from it. Sections of code that

would not benefit from use of the vector processor were actually taking longer to execute because of the overhead incurred by setting up the instruc- tions to be vectorized. This overhead caused the vectorized tests to take roughly twice as long to ex- ecute as the non-vectorized tests. It should be noted, however, that a code profiler would allow those sections which would benefit from vector processing to be identified and the subsequent vec- torization of this code would shorten N O N M E M execution times. As most of the source code is un- documented, and taking into account the size of the source code, this optimization would be ex- tremely tedious and time consuming.

The DCL procedures were developed to help increase productivity by minimizing the number of repetitive steps that needed to be completed to run NONMEM. The first DCL procedure, BUILD.COM, allows the individual N O N M E M FORTRAN files to be compiled, and where

Page 9: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

necessary, linked into executables or put into libraries. By utilizing this procedure, recompiling the roughly 230 files was simplified to one step. This permits modificat ions to compiler options,

such as the hpo and vector switches, to be per- formed easily.

N M . C O M minimizes the number of steps be- tween creation of the data and control files and generation of the report file. The DCL file is divid-

ed into several sections that handle each part of a complete N O N M E M run. The first section, after verifying the control file and deleting temporary files, is the passing of the control file through N O N M E M ' s preprocessor, N M - T R A N . This file turns a raw control file into the rigid structure that N O N M E M requires and also creates several other

files to help in the subsequent steps. Once com- pleted, the generated and user subrout ines are compiled. After being compiled, F R E P O R T . D A T is examined and the individual files needed for the

N O N M E M executable determined. These files are then linked into the executable form. Once linked, the control file generated by N M - T R A N is passed through N O N M E M , and the report file is produc- ed. Error checking is also performed at each step, with all errors being reported to the user and ex- ecution halted. The number of complicated indi-

vidual steps can therefore be shortened down to one simple command. The DCL procedure can also be adapted to other uses, such as submit t ing N O N M E M jobs for execution dur ing off peak hours.

While runn ing the VAX during peak hours will increase run times, this must be viewed with the knowledge that the VAX 9000 runn ing at 40 MIPS is superior to many other platforms. Test 3 run on

a 486/33 EISA PC with 4 Meg of RAM and a 80387 math coprocessor under MS Windows 3.1 with the MS F O R T R A N compiler took over 2 hours to finish execution [211. Compar isons of N O N M E M run times between the VAX and other

platforms (486, 386 PCs, IBM mainframe, workstation, and C R A Y super-computer) will be presented in a later publicat ion (unpublished fin- dings). In the end, most scientists seeking to use N O N M E M will install the source code on the fastest platform available. Unfor tunately , modifications to improve the performance of the code involve substantial effort.,

111

6. References

[1] S.L. Beal and L.B. Sheiner, The NONMEM system, Am. Stat. 34 (1980) 118-119.

[2] L.B. Sheiner, The population approach to phar- macokinetics data analysis: rationale and standard data analysis methods, Drug Metab. Rev. 15 (1984) 153-171.

[3] S.L. Beal, Population pharmacokinetics data and param- eter estimation based on their first two statistical moments, Drug Metab. Rev. 15 (1984) 173-193.

141 C.C. Peck, S.L. Beal, S.L. Sheiner and L.B. Nichols, Ex- tended least squares nonlinear regression: a possible sol- ution to the choice of weights problem in analysis of individual pharmacokinetics data, J. Pharmacokin. Biopharm. 12 (1984) 545-558.

[5] S.L. Beal, Asymptotic properties of optimization estimators for the independent not identically distributed case with application to extended least squares estimators. Technical Report (Division of Clinical Phar- macology, University of California at San Francisco, 1981).

161 C.M. Metzler, Extended least squares (ELS) for pharma- cokinetic models, J. Pharm. Sci. 76 (1987) 565-571.

[ 7] A.H. Thomson, A.W. Kelman and B. Whiting, Evalu- ation of nonlinear regression with extended least squares: simulation study, J. Pharm. Sci. 74 (1985) 1327-1330.

[8] L.B. Sheiner, B. Rosenbcrg and V.V. Marathe, Estima- tion of population characteristics of population parame- ters from routine clinical data, J. Pharmacokin. Biopharm. 5 (1977) 445-479.

[9] L.B. Sheiner and S.L. Beal, Evaluation of methods for estimating population pharmacokinetic parameters: I. Michaelis-Menten model; routine clinical pharmacoki- netic data, J. Pharmacokin. Biopharm. 8 (1980) 553-571.

[10l L.B. Sheiner and S.L. Beal, Evaluation of methods for estimating population pharmacokinetic parameters: Ii. biexponential model; experimental pharmacokinetic data, J. Pharmacokin. Biopharm. 9 (1981) 635-651.

[11] L.B. Sheiner and S.L. Beal, Evaluation of methods for estimating population pharmacokinetic parameters: III. monoexponential model; routine clinical pharmacokinet- ic data, J. Pharmacokin. Biopharm. 11 (1983)303-319.

112] S. Vozeh, M. Wenk and F. Follath, Experience with NONMEM: analysis of serum concentration data in pa- tients treated with mexilitene and lidocaine, Drug Metab. Rev. 15 (1984) 305-315.

[131 T.H. Grasela and S.M. Donn, Neonatal population pharmacokinetics of phenobarbitol derived from routine clinical data, Dev. Pharmacol. Ther. 8 (1985) 374-383.

[14] D.B. Weist, J.B. Pinson, P.S. Gal et al., Population phar- macokinetics on intravenous indomethacin in neonates with symptomatic patent ductus arteriosus, Clin. Phar- macol. Ther. 49 (1991) 550-557.

[15] P.J. Williams, J. Lane, W. Murray, M.A. Mergener and M. Kamigaki, Pharmacokinetics of the digoxin-quinidine interaction via mixed-effect modelling, Clin Phar- macokin. 22 (1992) 66-74.

[16] K. Fattinger, S. Vozeh, A. Olafsson. J. Vlcek, M. Wenk

Page 10: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

112

and F. Follath, Netilmicin in the neonate: population pharmacokinetic analysis and dosing recommendations, Clin. Pharmacol. Ther. 50 (1991) 55-65.

[171 E. Blychert, B. Edgar, D. Elmfeldt and T. Hedner, A population study of the pharmacokinetics of felodipine, Br. J. Clin. Pharmac. 31 (1991) 15-24.

[18] K. Fattinger, S. Vozeh, H.R. Ha, M. Borner and F. Follath, Population pharmacokinetics of quinidine, Br. J. Clin. Pharmacol. 31 (1991) 279-286.

[19] VAX Vector Processing Handbook, Second Edition (Digital Equipment Corporation, Maynard, MA, 1990).

[20] Intermediate Workshop in Population Pharmacokinetic Data Analysis Using the NONMEM System (May 30, 1992).

7. Appendix A

Program L i i t lna : BUILD.COM

$! Nor)mere File Bui ld~

$ WSO == "WRITE SYS$OUTPUT"

$! C~lrlpde flags

$ N O N M E M = "F" $ TRAN = "F" $ TRANUB = "F" $ PREDPP = "F" $ UTILS = "F" $~ $! Check for comm~xI line arguments $~ $ IF P1 EQS "" $ THEN $ WSO "BUILD [NONMEM] El'RAN] [TRANLIB] [PREDPP] [UTILS] [ALL]" $ GOTO END $ ENOIF $ ARG = PI $ GOSUB CHECK $ ARG = P2 $ GOSUB CHECK $ ARG = P3 $ GOSUB CHECK $ ARG = P4 $ GOSUB CHECK $ ARG = P5 $ GOSUB CHECK $ ARG = P6 $ GOSUB CHECK $ ARG = P7 $ GOSUB CHECK $ ARG = P8 $ GOSUB CHECK $CHECK: $ IF ARG EQS "" THEN GOTO RUN $ IF (ARG EQS. "NONMEM") .OR. (ARG EQS. "ALL") THEN NONMEM= "T" $ IF (ARG E Q S "TRAN") OR, {ARG EQS "ALL') THEN "I'RAN = "T" $ IF (ARG .EQS. "TRANUB") .OR (ARG .EQS "ALL") THEN TRANUB = "T ° $ IF (ARG .EQS "PREDPP') OR. (ARG EQS " A l l ' ) THEN PREDPP = "T" $ IF (ARG EQS "UTILS") OR (ARG EQS 'A l l " ) THEN UTILS = "T" $RETURN $1 $! Direct the compdes

$RUN: $ IF NONMEM EQS "T ~ THEN GOSUB NONMEM $ IF TRAN EQS. "T" THEN GOSUB TRAN $ IF TRANUB .EQS "T" THEN GOSU R TRANUB $ IF PREDPP .EQS, "T" THEN GOSUB PREDPP $ IF uTILS EOS "T" THEN GOSUB UTILS SEND: $ EXIT

$! compile the NM-Tr~I1 files

STRAN

$ WSO "Compiling the NM-Tran ~es. . " $ @COMPILE [NMTRAN}ABLOCKFOR $ @COMPILE { NMTRAN~ODTHE FOR

Follow sai'ne formal for all other files in this s u ~ r e c t o ~ ]

$ @COMPILE [ NMTRAN]TIMECRFOR $ @COMPILE [ NMTRAN}TIMEII FOR

$! u r~ the NM-Tfan files

$ WRITE SYS$OUTPUT "Unking the NM-Trall files. = $ LINK/EXEC=NMTRAN -

NMTRAN OBJ,. ABLOCI~OBJ, ADDTHE OBJ, AESX.OBJ, CFILEX.OBJ. - CHECKS,OBJ, CHKDAT.OBJ, CHKRAN OBJ. CLREXP OBJ. -

[FollOW s~ne formal for all other files in this sulxlirectory ]

SKIPBLOBJ, SYMDEROBJ. TABLEOBJ, THETASOBJ.- TIMECROBJ, TIMEII OBJ

$! De~ete unused NM-TraJ1 oblect files

$ WSO "Deleting unneeded NM-Tran OBJ files.." $ DEL ABLOCK-OBJ; °, ADDTHE OBJ;', AESX OBJ; °. CFILEX OBJ;', -

CHECKSOBJ;' . CHKDATOBJ; °, CHKRAN OSJ;'. CLREXPOBJ;' . -

[Fellow same formal for all other files in this subdireotory }

S'IMULOBJ; °. SKIPBLOBJ; °. SYMDEROBJ;*. TABLE OBJ; ° - THETASOBJ; ' , TIMECROBJ; °. TIMEII OBJ:"

S RETURN

$! Compile the NM-Tra~ lii~ary fdes

$TRANUB: $ WSO "C,:~npding the NM-Tran libraP/flies. " $ @COMPILE [NMTRANUB]AESTR FOR $ @COMPILE [ N M T ~ U B ] D E S T R F O R $ @COMPILE {.NMTRANUB}ERRORTRFOR $ @COMPILE [ NMTP, ANUB]MODELTRFOR $ @COMPILE [NMTRANMB}PKTR.FOR $ @COMPILE [,NMTRANUB]PREDTR.FOR $ @COMPILE [.NMTRANUB}TOLTRFOR $ RETURN

$! Compile the NONMEM files

$NONMEM: $ WSO "Compding the NONMEM files.." $ @COMPILE [ NONMEM]BLKDAT.FOR $ @COMPILE [NONMEM]NONMEM FOR

[Follow same formal for all other flies in this sutxlirectc~/]

$ @COMPILE [ NONMEM}ZXMIN1 FOR $ @COMPILE [ NONMEM]ZXMJN FOR

Sf Create the NONMEM l i~a~/f i le

SWRITE SYS$OUTPUT "Creating the NONMEM h~ary " $UBRARY/CREATF_JOBJECT NONMEMUB -

CFILESOBJ, CHOLOBJ. CNOBJ. CON OBJ.. CONPAROBJ CONTR OBJ. COVR OBJ, CRIT OBJ. .

[Follow sa/'ne formal for all o~her files in this subdirectoty except NONMEM OBJ

a~f BLKDAT.OBJ.]

VSORTMOBJ, VSORTPOBJ, VSORTZ OBJ. ZSRCHOBJ, - ZXMIN10BJ, ZXMJN 08J

$, $1 Delete unused NONMEM obtect files $~ $ WSO "Deleting ur~eeded NONMEM OBJ flies ." $ DEL CFILES OBJ;', CHOLOBJ:' . CN OBJ;'. CON OBJ;*, -

CONPAR OBJ; °. CONTR OBJ;', COVR OBJ; °, CRIT OBJ; °. - DAT10BJ; °. DAT20BJ; °, DAT30BJ, ° . DECN OBJ; °. -

[Follow s~Ime formal for all other files in this sulxlir~:tory except NONMEMOBJ B LKDAT OBJ,]

VSORTM OBJ; ° VSORTP,OBJ;', VSORTZ OBJ; °, ZSRCHOBJ:' , - ZXMIN10BJ;*, ZXMJNOBJ;*

$ RETURN $' Sr Cornpde the predpp files $,

Page 11: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

$PREDPP:

$ WSO "C, c m p i l ~ the PreOPP ties..." $ @COMPILE [,PREDPF~ADDAFOR $ @COMPILE [.PREDPP]ADVANtFOR

[Follow same formal for =Ill other files in this SMbdk'eCtCry.]

$ @COMPILE [,PREDPP]ZSPOWlFOR $ @COMPILE [ PREDPP]ZSPOW2 FOR $ RETURN

$! Compile the utility files

$UTILS: $ WSO "Compiling the utility files " $ @COMPtLE [,UTILS]PAD.FOR $ @COMPILE [UTILS]PRINT FOR $ @COMPILE [ UTILS]SEP.FOR $~ $! l l t ~ the utility files

$ WSO "Urn, king the utiJity files " $ LINK/EXEC=PAD PADOBJ $ LINK/EXEC=PRINT PRINT OBJ $ UNK/EXEC=SEP SEPOBJ

$! Dolete unused utility files

$ WSO "Deleting unneeded utility OBJ files. • $ DEL PAD OBJ;* PRINT OBJ;'. SEP OBJ; ° $ RETURN

Pro=ram LI I t lno: COMPILIE.COM

$! Compile a fortran file $~ SWRITE SYS$OUTPUT "Now compiling " + p l + " " SON WARNING THEN GOTO ERROR $FORTRAN/HPO 'p l ' SGOTO END

$ERROR: $1NRITE SYSSOUTPUT "Error(s) encounteced in "+pl+ ' , aborlJng ." $STOP

SEND

Proaram LI=Uno: NM,COM : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : . . . . =============== $1 Purpose: To ccnst~uct acid run a Nonmem exes~al04e : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : Sf Note: COM file cal') be calJed by passing the control file name in $! (x it will be asked for inte~actively $!===== . . . . . ========= . . . . . . . . ========== . . . . . . . ====== . . . . . . . . . ==== $~ $! Local vatialoles

$ NODENAME = FSTRNLNM('SYSSNODE') $ SOURCE DIR = "SYSSUSERC6:[LOt NONMEMSOURCE]" $ TRAN_EX-E = "NMTRANEXE" $ TRAN_OUT = "TRANREP TXT" $ TRAN_ERR = "TRANERR TXT" $ CON FILE = "CONTROL TXT" $ FCON = "FCONOAT" $ FDATA = "FDATA DAT" $ FUB = "FUB.DAT" $ FREPORT = "FREPORT DAT" $ FSTREAM = "FSTREAM DAT" $ FSUBS = "FSUBS FOR" $ FSUBS OBJ = "FSUBSOBJ" $ TEMP COM = "'PEMP£OM" $ RUN_FILE = "@"+FSENVIRONMENT('DEFAULT")+TEMP COM $ GEN SUB = "FSUBS" $ LINK~REP = "FREPORTDAT" $ NONMEM_EXE = "NONMEM EXE" $ NONMEM IN = "FCON DAT" $ NONMEM_OUT = "REPORT TXT" $ NONMEM ERR = "ERROR TXT ~ $ USER = "1 ~" $ STAT = "PRED" $ WSO = "WRITE SYSSOUTPUT" $ ESC[0.32] = % X l B $ CLS = ESC + "[1;1H" + ESC + "[0J" $~ $! I~tialize screen

$ WSO CLS $ IF P1 NES. "" THEN CON_FILE = P1

113

$ IF P2 NES "" THEN NONMEM OUT = P2 $ iF F$SEARCH(CON_FILE) E Q S " $ THEN $ WSO "The control file ".CON_FILE+" was not found, aboding " $ GOTO END $ ENDIF

$1 Run the control file and data file tl~ough NM-Tran

$ WSO "Running NM-Tran. " $ IF F$SF_ARCH(FCON) NES "" THEN DEL'FCON';" $ IF FSSEARCH(FDATA) NES. "" THEN DEL 'FDATA'; ° $ IF F$SEARCH(FUB) NES "" THEN DEL'FUB';" $ IF FSSEARCH(FREPORT) NES "" THEN DEL'FREPORT';* $ IF F$SEARCH(FSTREAM) N E S "• THEN DEL 'FSTREAM';* $ IF F$SEARCH(FSUBS) NES "" THEN DEL'FSUBS'; i $ IF F$SEARCH(TEMP_COM) N E S " THEN DEL'TEMP_COM';* $ IF F$SEARCH('rRAN_ERR) NES "" THEN DEL'TRAN_ERR';" $ IF F$SEARCH(TRAN_OUT) .NES "" THEN DEL 'I'RAN OUT';" $ OPEN/WRITFJERROR=OPEN ERROR1 OUT FILE 'TE-MP COM' $ WRITE OUT_FILE "$SUB_PR(~C = FSGETJPI("'""."""PRCC~IT""")" $ WRITE OUT FILE "RUN "+SOURCE DIR÷TRAN_EXE+"/]NPUT="+CON_FILE+"-" $ WRITE OUT-FILE " /OUTPUT='+TR~_OUT+"/ERROR='+TRAN_ERR $ WRITE OUT-FILE "$TRAN NOT DONE:" $ WRITE OUT-FILE "$1F SUB P R ~ ; N E FSGETJPI('"'."""PRCCNT ~'') -" $ WRITE OUT-FILE "THEN GOTO TRAN NOT DONE" $ CLOSE OUT, FILE $ 'RUN FILE' $ IF F$SEARCH(TEMP_COM) NES •" THEN DEL'TEMP_COM'; ° $ IF F$SEARCH(TRAN_ERR) NES "" $ THEN $ WSO "An error was encountered running NM-Tran, see "+TRAN_ERR+" arK//o#' $ WSO TRAIN_OUT+" for more information., " $ GOTO END $ END[F $ OPEN/READ/ERROR=OPEN ERROR3 IN FILE 'TRAN OUT' $ READ/END OF FILE=OPEN-ERROR3 IN_-FILE STATUS_LINE $ TOKEN = F-$EL~MENT(0," ".STATUS_LINE) $ IF TOKEN NES "FORTRAN" $ THEN $ WSO "An error was encountered in edher your control file or data fi le" $ WSO "Please see •+TRAN_OUT+ • for more information " $ CLOSE IN FiLE $ GOTO END $ ENDIF $ CLOSE IN FILE $ IF F$SEAI:~CH(TRAN_OUT) NES "" THEN DEL 'TRAN_OUT'; ° $~ $! Compqle the FSUBS rocdi~e~

$ WSO "Cornpiling g, enerated and user sut~oc~tines • $ IF F$SEARCH(FSUBS OBJ) NES "" THEN DEL 'FSUBS OBJ': ° $ IF F$SEARCH(TEMP_COM) NES "" THEN DEL'TEMP COM';" $ OPEI~ ITE/ERROR=OPEN_ERROR1 OUT_FILE 'TEMP COM' $ WRITE OUT FILE "$FORTRAN/HPONECTOR "+GEN_SUB $ CLOSE OUT-FILE $ RUN FILE =~--'@"+F$ENMIRONMENT("DEFAULT~)+TEMP_COM $ 'RUN~_FILE' $ IF F$SEARCH(TEMP_COM) NES "" THEN DEL'TEMP_COM';"

$! Process the FREPORT DAT file

$ WSO "LirW.irlg the Non~em ixogram • $ IF FSSEARCH(NONMEM_EXE) .NES "" THEN DEL 'NONMEM_EXE';" $ OPEN/READ/ERROR=OPEN ERROR2 IN FILE 'UNK REF ~ $ OPEN/WRITE~RROR=OPEf~T ERROR1 OUT FILE 'T~:MP COM" $ WRITE OUT FILE "SLINK/EXEC="+NONMEM EXE*" -" - $ WRITE OUT-_FILE SOURCE_DIR+"NONMEM. -" $ WRITE OUT FILE SOURCE_OIR+"BLKDAT. -" $READ LOOP:- $ READ/END_OF FILE=END_LOOP IN_FILE RECORD $ NUM=0 $TOKEN LOOP: $ TOKEN = F$~LEMENT(NUM," ",RECORD) S IF TOKEN .EQS "° THEN GOTO READ LOOP S IF TOKEN .EQS "NM-TRAN • THEN STA-T = "IGNORE" $ IF TOKEN EQS "SUBROUTINES" $ THEN $ TOKEN = FSELEMENT{4," ".RECORD) $ STAT = "PRED" $ IF TOKEN EQS "NM-TRAN • THEN STAT = "TRAN" $ GOTO READLOOP $ ENDIF $ IF (TOKEN EQS •GENERATED')OR (TOKEN EQS "USER") $ THEN $ STAT = •IGNORE" $ USER = "'P $ ENDIF

Page 12: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

114

$ IF TOKEN EQS "NONMEM" THEN GOTO END_LOOP $ LENGTH = FSLENGTH(TOKEN) $ IF LENGTH E Q 0 THEN GOTO CONT $ IF STAT E Q S "IGNORE" THEN GOTO READ LOOP $ IF STAT EQS "PRED" THEN WRITE OUT_FItTE SOURCE_DIR+TOKEN*" -" $ IF STAT EQS "TRAN" THEN WRITE OUT_FILE SOURCE DIR+TOKEN+'TR, -" $CONT: $ NUM = NUM + 1 $ GOTO TOKEN_LOOP SEND LOOP: $ IF L~SER EQS. "T" THEN WRITE OUT FILE "0"+GEN_SUB+", -" $ WRITE OUT_FILE SOURCE_DIR+'NOklMEMUB/UB" $ CLOSE IN_FILE $ CLOSE OUT FILE $ RUNFILE =-'@"+FSENVlRONMENT("DEFAULT")+TEMP_COM $ 'RUNFILE' $ IF F$SEARCH(TEMP_COM) N E S "" THEN DEL 'TEMP_COM'; ° $~ $! Run Nonmem $!

$ WSO "Running Nonmem.. • $ IF F$SEARCH(NONMEM_OUT} NES "" THEN DEL 'NONMEM OUT' ° $ IF F$SEARCH(NONMEM_ERR) NES "" THEN DEL 'NONMEM_ERR'; ° $ IF F$SEARCH(TEMP_COM) NES. "" THEN DEL ~EMP COM';* $ OPEN/WRITFJERROR=OPEN_ERRORI OUT FILE 'TEI~P COM' $ WRITE OUT FILE "$SUB PROC = FSGETJP~'"','"PRCCN'P"')" $ WRITE OUT-FILE "RUN "%NONMEM_EXE+"/INPUT='+NONMEM_IN+" -" $ WRITE OUT FILE "/OUTPUT='+NONMEM_OUT+"/ERROR='+NONMEM_ERR $ WRITE OUT-FILE "SNM NOT DONE:" $ WRITE OUT-FILE "SIP SUB P-ROC NE FSGETJPI('""",""PRCCNT'")-" $ WRITE OUT-FILE "THEN C,~TO NM_NOT DONE" $ CLOSE OUT-FILE $ RUNFILE =-'@'+FSENVIRONMENT('DEFAULT')+TEMP_COM $ 'RUN FILE' $ IF F$SEARCH(TEMP_COM) N E S "" THEN DEL 'TEMP COM': ° $ IF F$SEARCH(NONMEM_ERR) NES "" $ T~EN $ WSO "An error w ~ encountered running Nonmem, see "+NONMEM_ERR*" fo~ $ WSO "more irfformation" $ GOTO END $ ENDIF $ GOTO END $~ $OPEN ERROR1: $ WSO "Error opening "+'OUT_FILE'+", ~>orting " $ CLOSE OUT FILE $ IF F$SEARCH(TELL_RUN) NES "" THEN DEL 'TELL_RUN';* $ GOTO END

$OPEN ERROR2' $ WSO "Error opening "*UNK_REP+', abocling. " $ CLOSE iN FiLE $ IF F$SEAF~-CH(TELL_RUN) NES "" THEN DEL 'TELL_RUN';* $ GOTO END $! $OPEN ERROR3: $ WSO-'Error opening "+TRAN_OUT*'. abothng " $ CLOSE IN FILE $ IF F$$EAI~CH(TELL_RUN) NES "" THEN DEL 'TELL_RUN':* $ GOTO END $~ SEND: $ EXIT

8. Appendix B

Corltrol File Llstlno: CONTROLt.TXT $PROB SIMPLE NONLINEAR REGRESSION OF CP VS TIME DATA FROM ONE

SUBJECT ;TEST CORRESPONDS TO PART II1. CHAPTERS V AND VII ;DATA SET AND CONTROL FILE CAN BE FOUND IN PART IV, APPENDIX VIII ;GENERATED NM-TRAN FILES CAN BE FOUND IN PART IV. APPENDIX Viii ;RESULTS CAN BE FOUND IN PART VI, FIGURES 12-19 $1NPUT DOSE=AMT TIME CP=DV $OATA DATA TXT

$SUBROUTINES ADVAN2

SPK ;THETA(1) = ABSORPTION RATE CONSTANT (1/HR) ,THETA(2) = EUMINATION RATE CONSTANT (1/HR) ,THETA(3) = VOLUME OF DISTRIBUTION (LITRES) KA = THETA{1) K = THE3A(2)

S2 : THETA(3)

$THETA (4,1.7,7.) ( (3~5, 102,4) (10,29,80)

$ERROR Y = F + ERR(l)

$EST MAXEVAL=240 SlGDIGITS=4 PRINT=2 $COV STABLE TIME $SCAT (CP PRED RES) MS TIME SSCAT PRED MS CP UNiT

Control File Llstlno: CONTROL2.TXT SPROB TWO COMPARTMENT MODEL WITH 4 HOUR, ZERO-ORDER INFUSION

: (CIc~e(I Funm Solution)

$1NPUT ID DOSE=AMT RATE TIME CP=DV MDV CMT EVID

$DATA DATA.TXT

$SUBROUTINES ADVAN3 TRANS 1

$PK ;THETA (1) = k12 (1/MIN) ;THETA (~ : k21 (I/MIN) ;THETA (3) = Total Clearance (mUMIN) ,THETA (4) = Vl (mL)

l"VK12=THETA(1) TVK21 =THETA(2) TVCLT=THETA(3) TVV1 = THETA(4)

KI2=TVK12+(1 +ETA(l)) K21 =TMK21*(l+ ETA(2)) CLT='rVCLT*( 1 +ETA(3)) V1 ='I"VVI*( 1 + ETA(4)} K=CLT/V1 SI=V1

STHETA (001, 01,04) (.004. 015, 05) (100,300,500) (10000,4(XX)0,85000)

$OMEGA 0 25 025 0 25 0.25 $ERROR Y = F°(I*EPS(1))

&SIGMA 0.04 $EST MAXEVAL=30(X) SIGDIGITS=4 PRrNT=2 $COV STABLE ID TIME mATE AMT CMT EVID SSCAT (CP PRED RES) MS TIME &SCAT PRED VS CP UNIT

Control I=lle Llstlno: CONT~OL3.TXT SPROB Two compartment model with 4 flour, zero-or0e¢ infusion : (Differential Eq's F-.x~'nl~e )

$1NPUT ID DOSE=AMT RATE TIME CP=DV MDV CMT EMID

$DATA DATA TXT

$SUBROUTINE ADVAN=8 TRANS=I TOL=5

SMODEL NCOMPARTMENTS =2 NPARAMETERS=3 COMP= {COMP1 NOOFF DEFDOSE DEFOBS) COMP= (COMP2 NOOFF) ; COMP= CENTRAL ; COMP= CF

SPK TVK10= THETA(1) TVVI= THETA(2} TVK12= THETA(3) TVK21= TH ETA(4)

Vl= ~/VI*(I+ETA(2)) $1= Vl

P(1) = TVKIO'(1 +ETA(l)) P(2)= "TVK12*( 1+ ETA(3)) P(3)= TVK21*(1+ ETA(4))

$DES DADT(1)= P(3) * A(2) - P(2) " A(2} - P(1) " A(1) DADT(2)= P(2) * A(1) - P(3) * A(2)

SERROR

Page 13: NONMEM version III implementation on a VAX 9000: a DCL procedure for single-step execution and the unrealized advantage of a vectorizing FORTRAN compiler

Y=F°(1 +EPS(1))

$THETA (.001. 01, 06) (10000,40000,85000) (,001, 01.04) (.004.015.05) $OMEGA 0 05 0.05 005 0 05 SEST MAXEVAL=5000 SIGDIGITS=4 PRINT=2 $COV STABLE ID TIME RATE AMT CMT EVID $SCAT (CP PRED RES) VS TIME $SCAT Pl iED MS CP UNIT

Q i t l File LletlnQ: DATA1.TXT 320 0

27 1 71 .52 7 91

1 831 l g ~ 833 35 685 5 C~ 6.08 7035.4 9 4.55

12. 3 01 243 ,90

Data File LietJnQ: DATA2.TXT fData f i le for teete 2 and 3) 45,2770000,11550,0. : ,1 ,1 45, , , ,30,14.~,0,1, 45, ,.,60,20.8,0,1. 45, . ,91,2392,0,1, 45, . ,120,25 2.0,1. 45 . ,180,2634.0,1, 45 . . ,220.28.68,0,1. 45,. ,230, ,1 1, 45, ,.,240. ,1.1, 45...244.29 18,0,1. 45,.,.,260, ,1,1, 45.. ,280,1489,0,1, 45,, ,301,11 96,0.1, 45., ,360.7 36,0,1. 45,., ,420,3 47,0,1, 45., ,480,3 03,0,1, 45., .570,1 25,0,1, 46.2590000,10800,0, , 1,1,1 46,, ,30,14 48,0,1, 4~, . ,60,26 49,0,1, 46,, ,90,34 45,0,1, 46,, .120,36 54.0.1. 46,, ,180,36.82,0,1, 46..,220.47 53,0,1, 46.. ,230. ,1.1. 46, ..,240 ,I,1. 46, ,,248.32 1.0,1, 4~, .,280.23 52.0,1, 46. , ,3(X3,13,43,0,1. 46.. .360.5 39,0,1, 46,, .420,4 13.0.1. 46,, . 4 8 0 , 3 52.0,1, 46...570.1 35,0,1, 47.2450000,10200.0., 1.1,1 47. , ,30 17 97,0,1, 47 . ,62.21 85.0,1. 47, , ,90,29 69,0,1, 47. , ,120,3215,0,1. 47 , ,182.3455,0.1, 47 . ,220.48 25.0.1, 47. . ,230.. 1.1. 47 , ,240,,1.1, 47 . ,248.434.0.1. 47.. ,260.2815,0.1, 47 , ,280.24 43,0,1, 47 , ,300,22 14,0,1, 47 , ,360,12.34,0.1, 47 , ,420,6 54,0,1, 47,, ,470,5 11,0,1, 47., ,580,2 36,0,1, 50.3240000.13500,0. ,1.1.1 50. , .30,24 72,0,1. 50., .60,32 23,0,1. 50. , ,90,45 66,0,1. 50,. ,120,51 12.0,1, 50, , ,180,7113,0,1. 50, ,.220,67 84,0.1, 50, ,.230..1,1. 5 0 . ,240, ,1,1. 50,, ,254,61 75,0,1, 5 0 . ,280.39.68.0.1, 50 . ,300,35.19.0,1,

50, , ,360,23.83,0,1, 50,..420,12.53,0,1. 50...480,12.46,0.1. 50. ,.,600,3.23,0,1, 51,2160000,9000,0... 1,1,1 51...,30,1228,0,1, 51, ..,60,27,57,0,1, 51. ,.,90,32,93,0,1, 51, ,.,120.32 59.0,1, 51. ,., 180.36 49.0,1, 51 ,. .220.40 27.0.1, 51. ,.230. ,1.1. 51 .,..240.47 76.0.1, 51, ,.,260.26 63,0.1, 51.,.280.16 83,0,1, 51. ,.310,15 02,0.1, 51,,.360,7.76,0,1, 51,..4;?.0.5.66.0,1. 51.. .480.7 35,0,1. 51,., ,~00,132,0,1, 52,2480000,10350,0, ,1,1,1 52.. ,.29,1247,0,1. 52.,.60.21 84.0.1, 52,..90,27.74.0,1. 62, ,., 120,292,0,1, 52, ,..180,43 55,0.1, 52. ,.220.42 72.0.1, 52, ,.,230..,1.1, 52. ,.,240,, 1,1, 52..,247.3658,0,1, 52...260.3613,0,1, 52,, ,288.28.35,0,1, 52.. ,300,23,75,0,1. 52...360.12 17,0,1, 52. ,,.420,12 14,0.1, 52. ,.480.65.0,1, 52..,600,2.74.0.1, 53,2480000,10500,0, .1,1.1 53., ,30,10.42,0,1, 53.,..60.13 11.0.1, 53. , ,90,14 39,0,1, 53, ,,120.15 35.0.1, 53,, ,180,21 17,0,1, 53,, .220,22 17,0,1, 53,., .230, ,1,1, 53., ,24~, ,1,1, 53.. ,242.29 79,0,1, 53. , ,258.12 97.0.1. 53, , .280.10.01.0.1, 53, ,.300,821,0,1, 53, ,.,360.3.58,0,1, 53, ..,420.2.43,0,1, 53, ,.,485.152,0,1, 54.2700000.11250,0, ,1,1,1 54...30.1669,0.1, 54...60.2627.0.1. 54., ,90.36 52.,0,1, 54.. ,120,36.74.0,1. 54, , ,180.45.62.0,1. 54.. ,220.43 74.0.1. 54. , ,230, ,1.1. 54., ,240, ,1.1. 54. ,,,252,44.78,0,1, 54..,262.36 15.0,1, 54. ,..280.29 09,0,1, 54,.,,300,22 66,0,1, 54.. 360,17 18.0.1. 54.. ,42.0.9 48.0.1, 54., .480,8 01,0,1. 54,,, ,600,2 71,0,1, 56.2630000.10950.0. ,1.1.1 56., .30,18 86,0,1, 56., ,60,31 37,0,1, 56. , ,90,3~ 4.0.1. 56,. ,120.41 38.0,1, 56,, :80.5O 12.0.1. 56,, .220.51 89.0,1, 56,, ,230. ,1,1, 56., .240. ,1.1, 56,, .265,41 91.0. I. 56,, .280,35.12,0,1, 56.., ,300,27 61.0,1, 56,, ,360.15 35 0.1, 56,.. ,420,9 62,0 , I, 56.. ,480,8 36,0, I, 56, .565 4 T2.0.1.

115