62 Running NONMEM
1 Invoking NONMEM
NONMEM 7.5 can be invoked using one of the supplied scripts:
nmfe75.batfor Windowsnmfe75for Linux/Unix
These script files take at least two arguments, the control stream file name, and the main report file name, such as:
Windows:
nmfe75 mycontrol.ctl myresults.res
Unix:
./nmfe75 mycontrol.ctl myresults.res
The control stream file name is passed to NONMEM as its first argument. Write and print statements supplied by the user in verbatim code will be routed as follows:
- Unit
*prints to console - Unit
6prints to report file WRITE(*,...orPRINT *,...: to consoleWRITE(6,...to report file.
If you wish to reroute all console output to a file, the execution statement could have a redirection added to it:
Windows:
nmfe75 mycontrol.ctl myresults.res >console.txt
Linux:
./nmfe75 mycontrol.ctl myresults.res >console.txt
To prevent NONMEM from polling the standard input for ctrl key characters (a new feature described later):
Windows:
nmfe75 mycontrol.ctl myresults.res -background>console.txt
Linux:
./nmfe75 mycontrol.ctl myresults.res -background>console.txt
In Unix/Linux, you can additionally append & to the command to execute it in the background (you must also use -background option when using &):
./nmfe75 mycontrol.ctl myresults.res -background >& console.txt &
And periodically monitor the rerouted file:
tail -f console.txt
For the more adventurous user, you may modify the nmfe75 scripts for alternative behaviors.
Additional options are available to make execution of the nmfe75 script more flexible. From the nmfe75 command line, the user may enter a run directory that is different from the directory in which the nmfe75 script is launched:
-rundir=c:\my_favorite_dir
Where rundir is the run directory if it is different from the present working directory (you must make sure all user dependent input files, control stream file, msf files, and data files, are available in that run directory).
The user may also enter an alternative name for the constructed executable:
-nmexec=nonmem2
specifies an alternative executable name, than the default nonmem.exe (windows) or nonmem (Linux).
To turn off production of the XML output file root.xml, where root is the root name of the control stream file, use the option -xmloff. Activities that take a short period of time (less than a minute, for example) such as simulations of simple models or small data sets, particularly when only simulations are performed ($SIM ONLYSIM) can benefit from setting -xmloff.
Also, new in nm74, -flushtime=x will cause file updating (flushing) to occur not more frequently than every x seconds. So, using the command line options
-xmloff -flushtime=10.0
may increase the speed considerably for simulations. File flushes for the MSF system are not affected, and continue to be updated every PRINT iterations during estimation. The default setting of flushtime is 1 second, suitable for most problems, but you can change this as needed (fractional seconds are also allowed). If you prefer file updates occurring as frequently as possible, you can set flushtime to 0.0, but this could cause considerable slowing of execution for small problems and data sets.
Beginning in NM73, an additional feature of the execution script file is that the path to the fortran compiler system and MPI system that is appropriate for NONMEM may be retrieved from a script file that could have the following environment variables defined:
compilerpathmpibinpathmpilibpathmpilibname
Comments in these files are provided for instructions about each of these environment variables. These paths will be temporarily added to the front of the PATH environment variable, so that the appropriate compiler or MPI system is called to service NONMEM. In the past, conflicts with other installed fortran compilers from other applications would prevent the appropriate compiler from being used for the NONMEM system. This location file method allows NONMEM to be forced to look in a particular location.
The location file should be called nmloc.bat or nmloc by convention (see ..\util\nmlocoriginal.* as templates). It may be specified at the nmfe7x command line by the -locfile option, for example:
nmfe75 myfile.ctl myfile.res -locfile=nmloc.bat
If -locfile is not specified, the nmfe7x script looks in the present working directory for nmloc.bat (windows) or nmloc (linux). If this file is not found, it looks in the top directory of the NONMEM installed directory. Thus, the file nmloc.bat (Windows) or nmloc (Linux) in the top nonmem installed directory serves as the default location file, and may be modified, or used as a template and placed in the working directory or specified in the -locfile option on the command line. If a particular environment variable in the above list is not found or is not defined, then nmfe7x will behave as in earlier versions, and rely on the presently existing PATH for finding the compiler and MPI system. The nmfe7x script will display a statement as to what path it will use.
To find environment variables for your fortran compiler, you can use the “which” command in Linux based operating systems. Open a terminal window and type the command
which gfortran
or
which ifort
depending on your compiler.
As an example, this may return
/usr/local/bin/gfortran
Next, locate the file nmloc in the top directory of your NONMEM installation. The environment variable compilerpath needs to be modified to point to this directory, for example:
compilerpath=/usr/local/bin:/usr/bin
You can do the same for finding the path to your MPI system:
which mpiexec
or whatever the executable name of your MPI system is, and populate the environment variable mpibinpath in the nmloc file.
The Intel FORTRAN compiler system on Windows can have an elaborate setup, and typically creates an icon on the desktop for a specialized command window, and this window must be opened and from which NONMEM should be run. However, some GUI software, such as PDx-Pop, cannot make use of this special command window. In such cases, part of the command in the properties section of the desktop icon, which is usually something like:
C:\Windows\System32\cmd.exe /K {location of ifortvars.bat}\ifortvars.bat intel64 vs2010
can be placed in the nmloc.bat file, in the following manner:
call {location of ifortvars.bat}\ifortbvars.bat intel64 vs2010
and setting the compilerpath environment variable is not necessary:
rem set compilerpath=
2 Dynamic Memory Allocation (NM72)
With NONMEM 7.2.0 and higher versions, the user need no longer specify “big” or “reg” when using SETUP72 (or SETUP73) to install NONMEM. (The reg/big/same choice is ignored. It is in effect always “same” and is shown as “same” in all examples. However, some constants in SIZES are not dynamically allocated, for example, LSTEXT or PNM_MAXNODES. See help entry for sizes, or see comments regarding the various parameters in resource\SIZES.f90). NMTRAN sizes each NONMEM executable only as large as it needs to be for the specific control stream run. NONMEM 7.2.0 has the ability to dynamically size the main arrays in NONMEM, according to the number of subjects, and number of parameters described in the control stream file, etc. To do this, NMTRAN determines the appropriate sizes for arrays, and puts this information in a subroutine called FSIZESR in the FSUBS file. NONMEM dynamically allocates the sizes of arrays at run-time, based on the values in FSIZESR. Although unnecessary for most problems, the user may override the size that NMTRAN assesses for a select number of arrays, by including a $SIZES statement as the first non-comment line of the control stream file. For example:
$SIZES MAXIDS=230 NO=300 LTH=50 LVR=30The following is an example of FSIZESR information from a run with CONTROL5. All parameters can be changed with $SIZES (see resource/sizes.f90 for descriptions and default values), except NTT, NOMEG, NSIGM, PPDT, which are always evaluated properly by NMTRAN and should not be over-ridden.
LTH 3
LVR 4
LVR2 0
LPAR 10
LPAR3 0
NO 0
MMX 1
LNP4 0
LSUPP 1
LIM7 0
LWS3 0
MAXIDS 12
LIM1 0
LIM2 0
LIM3 0
LIM4 0
LIM5 0
LIM6 0
LIM8 0
LIM10 0
LIM11 0
LIM13 0
LIM15 0
LIM16 0
MAXRECID 0
PC 0
PCT 1
PIR 1
PD 7
PAL 0
MAXFCN 0
MAXIC 0
PG 0
NPOPMIXMAX 0
MAXOMEG 3
MAXPTHETA 4
MAXITER 20
ISAMPLEMAX 0
DIMTMP 0
DIMCNS 0
DIMNEW 0
PDT 4
LADD_MAX 0
MAXSIDL 0
NTT 3
NOMEG 3
NSIGM 1
PPDT 3
The file FSIZES is also produced that contains the same contents as the FSIZESR routine in FSUBS. The FSIZES file is produced for easy reading for the user, and is not used by the NONMEM system. Those parameters with a 0 cannot be determined or are not given by NMTRAN and will default to the values hard-coded in resource\SIZES.f90. See the file SIZES.f90 itself, or on-line help entry for sizes, for these values. On occasion, NMTRAN mis-interprets the true scope of the run, and NONMEM may stop the run because one of the sizing parameters was too low. The user should then insert a $SIZES record in the control stream file, set the offending sizing parameter to the appropriate value, and run the problem again.
SIZES.f90 no longer contains parameters DIMPKS and DIMRHS and DIMRV for NMTRAN. The arrays sized by these parameters are dynamically allocated to whatever size is necessary for the abbreviated code in the current control stream. All other arrays for NMTRAN can be increased in size if necessary with $SIZES.
As of NM73, NMTRAN determines the maximum number of observation records (MDV=0) that occur in any subject, among all data files used in the entire control stream file. If this value is greater than the NO value listed in SIZES.f90, it will set NO to this larger size. Thus, users no longer have to be conscientious of sizing the NO parameter. However, there is no guarantee that NMTRAN will correctly assess NO for the entire scope of the control stream file for all types of problems. Should this occur, NONMEM may issue an error, and the user will need to set the NO value with a $SIZES record.
When PREDPP ($PK, $ERROR, $INFN, etc.) is used, NMTRAN also creates a sizes file called prsizes.f90. This file contains sizing and other parameters needed by PREDPP. Some parameters (PD, LVR which sets the prsizes parameter PE) are the same as in FSIZES and have the same values. Some (PC, PCT, PIR, PAL, MAXFCN, MAXRECID) are unique to PREDPP and prsizes.f90. All may be changed with $SIZES. For example, $SIZES MAXFCN=9000000 might be used with General Non-Linear models ADVAN6, ADVAN8, ADVAN9, ADVAN13, ADVAN14, ADVAN15, ADVAN16, ADVAN17, ADVAN18) to request more function evaluations than the default value in resource\SIZES.f90, which is MAXFCN=1000000. As of NM73, PCT and PIR are assessed by NMTRAN and submitted to NONMEM, if -prdefault is not used.
Usually a parameter value needs to be specified in $SIZES when the problem is bigger than what is specified in sizes.f90. For example, if LTH=40 in sizes.f90, and your problem needs only 35 THETAs, then NONMEM executable will be built to size for 35 THETAs, and $SIZES was not needed. If, however, the problem requires 45 THETAs, then
$SIZES LTH=45or greater needs to be specified, and then NONMEM will be set to a size of LTH=45 as well.
For the following parameters LTH, LVR, PD, PC, DIMTMP, MMX, DIMCNS, and/or PDT, NMTRAN must anticipate a maximum size, because it needs to set up internal arrays that stores the information it will gather from the control stream file. It will get this maximum size from the values in sizes.f90, or from the user specifying the required size in $SIZES. If the user does not specify in $SIZES, then NMTRAN will determine the best size for the problem and construct the NONMEM executable accordingly. But if the user specifies a size in $SIZES, then this is also the size by which the NONMEM executable will be constructed.
To anticipate large sizes without needing to specify values in $SIZES, then set LTH, LVR, PD, PC, DIMTMP, MMX, DIMCNS, and/or PDT in sizes.f90 to the maximum you think you will ever need. NTMRAN will still create a NONMEN executable that is sized to fit the problem. Be aware, however, that if parameter values are set too large, NMTRAN may not run, as it uses sizes.90 to set its array sizes at the beginning, before it knows the actual size of the problem.
As of NM73, as an alternative to modifying sizes.f90 to very large maximum sizes, you can tell NMTRAN the maximum size that may be needed by specifying a $SIZES parameter as a negative value. Thus, a user can give NMTRAN permission to deal with all problems that have data input files that have up to 1000 data items, and up to 150 OMEGAs, and up to 200 THETAs, by the following:
$SIZES PD=-1000 LVR=-150 LTH=-200but the size of these parameters when the NONMEM executable is constructed will be only what is needed for the particular problem. In contrast,
$SIZES PD=1000 LVR=150 LTH=200will result in sizing the NONMEM executable with these values, and won’t make a “tailor fit”. This would result in a very large executable regardless of the model size. Thus, $SIZES PD=-1000 tells NMTRAN that you may need as many as 1000 data items in a data file, whereas $SIZES PD=1000 tells NMTRAN that you need exactly that size.
With nonmem 7.1.2 and earlier releases, only FSUBS is compiled at run time. With NONMEM 7.2.0 and higher (nmfe72 and higher) or certain of the PREDPP files in the ..\pr directory are also compiled at run time, with the sizes and values given in prsizes.f90. Thus, arrays internal to PREDPP are statically allocated. In contrast, the NONMEM source code in ..\nm are precompiled and the main NONMEM arrays are allocated dynamically. PREDPP source code is not pre-compiled and dynamically allocated due to significant increase in run times. Many compilers produce a much more elaborate binary code in order to deal with variables that are dynamically shaped, which occurs with dynamically sized variables that have more than one dimension to them, and this slows down execution considerably with routines that are accessed very frequently, such as PREDPP routines.
The nmfe75 script file copies the required PREDPP routines from the nonmem ..\pr directory into a temporary folder (called temp_dir) under the user’s run directory, and compiles the routines there. The resulting object files are then linked with NONMEM, and the nonmem executable is created. The compilation of the PREDPP routines may take some time (about 10 to 50 seconds). If you are repeatedly running the same problem, by default the nmfe75 script will skip the PREDPP recompilation. It does this by testing that all of the PREDPP files listed in the file LINK.LNK from the previous run are appropriate for the present run, and testing that the present prsizes.f90 is not different from the present run.
Typically, you can expect that the nmfe75 script will do a PREDPP recompile when any of the following sizes change LVR, PD, PC, PCT, PIR, PAL, MAXFCN. This could happen if the user changes the values via $SIZES. Also, NMTRAN will resize LVR if the number of $OMEGA entries changes, and it will resize PD if the number of data items listed in $DATA changes. Size changes are all listed in prsizes.f90 in the PREDPP temporary recompile directory. The PREDPP files selected for linking (listed in LINK.LNK) can change if the $SUBROUTINES statement, which specifies ADVAN/TRAN, is changed.
You may force PREDPP recompilation, in case the run does not appear to execute properly when no recompilation occurs, by setting the -prcompile switch:
nmfe75 mycontrol.ctl myresults.res -prcompile
On the other hand, if the nmfe75 script for some reason believes there is a change in the previous run from the present run, but you are convinced there is not a change, you may force the skipping of the PREDPP compilation step and use the compiled files from the previous run by adding the argument -prsame, at the end of the command line. For example,
nmfe75 mycontrol.ctl myresults.res -prsame
If you are repeatedly going between two or more problems, so that often they need to be PREDPP recompiled, and you want to save time, you can specify a unique temporary directory for the PREDPP compilation for a given problem, by using -runpdir option at the nmfe75 command line. For example,
You may run problem A as
nmfe75 mycontrolA.ctl myresults.res -runpdir=mycontrolA
and then follow with problem B as
nmfe75 mycontrolB.ctl myresults.res -runpdir=mycontrolB
When you return to rerunning problem A at some later time:
nmfe75 mycontrolA.ctl myresults.res -runpdir=mycontrolA
it won’t need to recompile (assuming your PREDPP sizings and PREDPP model did not change for problem A), as its PREDPP recompile directory was not overwritten by the intervening call to problem B.
Finally, if you feel that it is sufficient to use default sizes in sizes.f90 for the various PREDPP parameters, and therefore use the precompiled routines in ..\pr of the NONMEM installed directory, you may use the -prdefault option:
nmfe75 mycontrol.ctl myresults.res -prdefault
As of nm73, you may also use the -tprdefault option, which tests if -prdefault is acceptable, and if so, will use it, otherwise, it will perform a PREDPP recompile:
nmfe75 mycontrol.ctl myresults.res -tprdefault
If you enter
nmfe75 mycontrol.ctl myresults.res -tprdefault -prcompile
then if -prdefault is not acceptable, and will act on the -prcompile option.
If you enter
nmfe75 mycontrol.ctl myresults.res -tprdefault -prsame
then if -prdefault is not acceptable, and will act on the -prsame option.
As of nm7.5.1, the option -do2test is available that has NMTRAN check the control stream file for requirement of analytical 2nd derivatives. If required, NMTRAN will build FSUBS with analytical 2nd derivatives, otherwise it will build FSUBS without it, equivalent to the user entering $ABBR DERIV2=NO. For complicated control streams, inserting analytical 2nd derivative equations can take a long time to produce the FSUBS code. Problems use 2nd derivatives when $EST LAPLACE NOINTERACTION without NUMERICAL, or $SIM REQUESTSECOND.
As of nm75, the option -prseq is available to cause the PREDPP files to be compiled sequentially, rather than in parallel (default). Sometimes the parallel method of compiling may actually take longer, or the compiler license may limit the number of simultaneous instances of the compiler that are permitted to be operating at once.
You may skip the NMTRAN step using the -trskip switch:
nmfe75 mycontrol.ctl myresults.res -background -trskip
The -trskip option is useful if you wish to modify FSUBS created by a previous run, and insert extra debug lines into FSUBS, and prevent your modified FSUBS from being over-written by NMTRAN (it will still be compiled). The trskip and any one of prsame, prcompile, or prdefault switches may be used together.
Conversely, as of nm74, you may skip recompiling and rebuilding a new nonmem executable with the option -nobuild:
nmfe75 mycontrol.ctl myresults.res -nobuild
This is particularly useful if you are performing a series of bootstrap nonmem runs, which only differ in a starting seed, or initial parameters, etc., but otherwise, the model and the sizing remains the same as the previous run.
The -nobuild option causes nmfe75 script to rerun NMTRAN so it can make fresh FDATA, FCON, FMSG, and FSTREAM, and FSIZES files. None of these should change with each run except FDATA (for new data, but which must have identical data column structure with previous runs) and FCON (new theta, omega, sigma inputs). Therefore do not change $SIZES, or model code ($PK, $ERROR, $DES, etc.), between -nobuild calls.
For the Pirana environment as an example (courtesy of Devin Pastoor), don’t delete the nonmem executable, and point to existing folder for subsequent calls:
# first run
execute run007.mod -mod -clean=0
# subsequent runs
execute run007.mod -directory=run007.dir1/ -nmfe_options="-nobuild"
3 Changing the Size of NONMEM Buffers
The entire data set is not necessarily stored in memory at one time. It may be stored in a temporary disk file, and parts of it are brought into a memory buffer as needed. Some other large arrays are also stored on disk files. Of course, memory-file swapping of data set information leads to increased computer run-time. So the bigger the buffer size, the shorter may be the run time. The sizes of the NONMEM buffers are set by constants LIM1 to LIM16. The default settings of these constants are set in SIZES.f90. If these constants are not adequate, NONMEM will produce error messages such as the following.
TOT NO. OF DATA RECS IN BUFFER 1 IS LESS THAN
NO. OF DATA RECS IN INDIVIDUAL REC NO. 1 (IN INDIVIDUAL REC ORDERING)
Unlike most of the other dynamically changeable parameters, NMTRAN does not determine the most appropriate LIM value for the problem, but instructs NONMEM to use the default value specified in resource\SIZES.f90 by default. For many problems, the default LIM values are high enough that all of the data may reside in memory without resorting to the buffer files. For large data sets, buffer files are likely to be used. The user may, however, select a LIM value that is different from that specified in sizes.f90, via the $SIZES record in the control stream file, e.g.:
$SIZES LIM1=20000It is not necessary to recompile NONMEM, just rerun the nmfe75 script, and the appropriate arrays will be allocated according to the user specified LIM value.
It is most desirable to set the LIM value that is the proper size for the run, so that the buffer file does not have to be used. With today’s very large memory computers, this should usually be alright to do without running out of memory. Below is a table describing the minimal allowable value for each LIM, and the value needed to prevent using the buffer file for a particular problem:
LIM |
Minimum Value | Maximum Value needed to prevent buffer file usage | Buffer files used (FILExx) |
|---|---|---|---|
| 1 | MAXDREC |
TOTDREC |
10,13,20,33 |
| 2 | MAXDREC |
TOTDREC |
39,14 |
| 3 | 2 | MAXIDS |
12 |
| 4 | 2 | MAXIDS |
15,16 |
| 5 | 2 | MAXIDS |
17,18 |
| 6 | MAXDREC |
TOTDREC |
7,19 |
| 7 | 2 | MAXDREC |
21,22 |
| 8 | 2 | MAXIDS |
23,24 |
9 (nm74, uses LIM1) |
MAXDREC |
TOTDREC |
For simulation REWIND: 41,42,43,44 |
| 10 (nm74) | 10 | MAXIDS*(NPNIND+1) |
45,46 |
| 11 | 2 | NPROB |
31,32 |
12 (nm74, uses LIM6) |
MAXDREC |
TOTDREC |
47,48 |
| 13 | 2 | MAXIDS |
11 |
| 14 | NOT USED | ||
| 15 | 2 | MAXIDS |
26,27 |
| 16 | MAXDREC |
TOTDREC |
26,27 |
MAXIDS= Largest total number of individual records (subjects) in a data set used in the runMAXDREC= Largest number of data records in any one individual record (in any one subject)TOTDREC= total number of data records (lines) in largest data set to be used.NPNIND= Larger ofMAXIDSandNPSUPP/NPSUPPEgiven on$NONPrecord.NPROB= Total number of problems in the control stream.LVR= Largest number of etas in any problem (including those listed in$PRIOR)
As of NM73, the values for MAXDREC and TOTDREC are assessed by NMTRAN, and the user may take advantage of NMTRAN’s evaluation by using the -maxlim option to the nmfe75 script (see below). But NMTRAN may not always correctly assess these values. Thus, it is best if the user ascertains these values ahead of time by inspection of his largest data set among all of the problems to be used by the control stream file, and the largest number of parameters to be used. Then set the LIM values accordingly via the $SIZES record.
One can alternatively assess empirically whether file buffers are used, by beginning the run, allowing perhaps one iteration to transpire, then from another command window do a directory search for FILE*, (or WK* for worker files in parallelization problems, section I.75 Parallel Computing (NM72)). If any of the FILExx do not have 0 size, then they are being used. Interrupt the analysis, then increase the appropriate LIM value with the $SIZES record, delete the FILE* in case some remain due to a ctrl-C interrupt, rerun the problem, and look again for any non-zero sized FILE* again. Repeat as needed.
By default (-maxlim=0), NMTRAN will set the LIM values to those listed in sizes.f90, or to the minimum required, whichever is larger. As of NM73, if you set -maxlim=1 on the command line, then LIM1, LIM3, LIM4, LIM13, and LIM15 (those used during estimation, and therefore by workers in a parallelization problem), will be set to the size needed to assure no buffer files are used, and everything is stored in memory, for the particular problem. If you set -maxlim=2, then LIM1, LIM2, LIM3, LIM4, LIM5, LIM6, LIM7, LIM8, LIM10, LIM11, LIM13, LIM15, and LIM16 are also sized to what is needed to assure that buffer files are not needed.
If you set -maxlim=3, then MAXRECID will also be sized, to MAXDREC, the largest number of records in any individual. MAXRECID sizes arrays involved in storing state variables during partial derivative estimates of SIGMAs and sigma like THETAs, to improve efficiency of the EM and Monte Carlo methods. When setting -maxlim=3, it is preferred to also use -tprdefault, or -prcompile, but not -prdefault, as NMTRAN’s optional resizing of the PREDPP size parameter MAXRECID may conflict with the -prdefault option.
To specify only a subset of LIM’s to be sized by NMTRAN, set -maxlim to a number list enclosed within parentheses, such as -maxlim=(1,2,3,11-16), which will have NMTRAN find size requirements for LIM1, LIM2, LIM3, LIM11, LIM13, LIM15, and LIM16 (LIM12 and LIM14 are not used). Enclosing the option in quotes "-maxlim=(1,2,3,11-16)" is required for some operating systems. For sizing MAXRECID, use the number 17. Setting -maxlim=(1-17) is equivalent to -maxlim=3, whereas -maxlim=(3) means to have NMTRAN size only LIM3.
3.1 Description of Buffers
A number of contiguous data records are stored in memory at any one time in buffers. If a large enough memory area can be made available for this purpose, then the entire data set can be stored in memory throughout the NONMEM run, and computing costs can be decreased. The following discussion of NONMEM buffers should not be confused with I/O buffers which are used by the operating system.
The size of buffer 1 is related to the number, LIM1, of data records stored in memory at any one time. A large proportion of data sets will consist of no more than 10000 data records. Consequently, the size of buffer 1 has been set to allow LIM1=10000 data records. The least number of data records allowable must exceed the largest number of data records used with any one subject, which rarely will be as large as 10000. Each data record consists of PD 8 byte double precision computer words, and the allocation of memory for buffer 1 is PD*(LIM1+3)*8 bytes.
Buffer 2 holds a number of contiguous residual records. For each data record, NONMEM generates prediction, residual and weighted residual data items, NPDE, EWRES, etc.; these data items comprise the residual record. The default size of buffer 2 is related to the number, LIM2, of residual records, stored in memory at any one time. The size of buffer 2 has been set to allow LIM2=100,000 residual records, for up to 100,000 data records. The least number of residual records allowable must exceed the largest number of data records used with any one subject. Each residual data record consists of 19 eight byte double precision computer words. The allocation of memory for buffer 2 is 19*(LIM2+3)*8 bytes.
Buffer 3 holds a number of contiguous subject header records for input data. The size of buffer 3 is related to the number, LIM3, of subject header records stored in memory at any one time. The default size of buffer 3 has been set to allow LIM3=1000 subject header records. Each subject header record consists of four 8 byte computer words. The allocation of memory for buffer 3 is 4*(LIM3+1)*8 bytes.
Buffer 4 holds a number of contiguous ETA records. For each subject, NONMEM generates values for ETA variables. The size of buffer 4 is related to the number, LIM4, of ETA records stored in memory at any one time. The size of buffer 4 has been set to allow LIM4=1000 ETA records. Each ETA record consists of MMX*LVR 8 byte double precision computer words. The allocation of memory for buffer 4 is MMX*LVR*(LIM4+3)*8.
Buffer 5 holds a number of contiguous mixture model records. For each subject record, NONMEM generates information about the component models of a mixture model; this information constitutes the mixture model record. The size of buffer 5 is related to the number, LIM5, of mixture model records stored in memory at any one time. The default size of buffer 5 has been set to allow LIM5=200 mixture model records. Each mixture model record consists of five 8 byte single precision computer words. The allocation of memory for buffer 5 is (MMX+1)*(LIM5+3)*8 bytes.
Buffer 6 holds a number of contiguous PRED-defined records. For each data record of a given subject record, NONMEM stores the values found in module NMPRD4; these values comprise the NMPRD4 record. The size of buffer 6 is related to the number, LIM6, of PRED-defined records stored in memory at any one time. The size of buffer 6 has been set to allow LIM6=400 PRED-defined records. The least number of PRED-defined records allowable must exceed the largest number of data records used with any one subject, which rarely will be as large as 400. Each PRED-defined record consists of PDT 8 byte double precision computer words. The allocation of memory for buffer 6 is PDT*(LIM6+3)*8 bytes.
Buffer 7 holds a number of contiguous NMPRD4 records for a single individual only. For each problem in a NONMEM run, NONMEM generates information about the problem; this constitutes the problem header record. The size of buffer 7 is related to the number, LIM7, of NMPRD4 records stored in memory at any one time. The size of buffer 7 has been set to allow LIM7=2 NMPRD4 records, which is generally fewer than the number of NMPRD4 records existing for any given subject. Each NMPRD4 record consists of (LIM7+2)*LNP4 8 byte double precision computer words. The default allocation of memory for buffer 7 is 4*LNP4*8 bytes.
The memory allocation of Buffer 8 is (LVR+1)*(LIM8+3) double precision values. The memory allocation of Buffer 10 is (LIM10+3) double precision values.
Buffer 11 holds a number of contiguous problem header records. The size of buffer 11 is related to the number, LIM11, of problem header records stored in memory at any one time. The size of buffer 11 has been set to allow LIM11=25 problem header records. Each problem header record consists of forty-two 8 byte integer computer words. The allocation of memory for buffer 11 is 42*(LIM11+3)*8 = 9408 bytes.
The memory allocation of Buffer 13 is 404*(LIM13+3) double precision values.
After NONMEM VI, there are also buffers 15 and 16. The sizes of these buffers are related to constants LIM15 and LIM16. These buffers are used in DAT15 and DAT16. If LIM16 is not adequate, NONMEM will produce error messages such as the following.
TOT NO. OF RESIDUAL RECS IN BUFFER 16 IS LESS THAN
NO. OF DATA RECS WITH SOME INDIVIDUAL
The memory allocation of Buffer 15 is LCM110*(LIM15+3) double precision values. The memory allocation of Buffer 16 is MMX*4*(LIM16+3) double precision values.
Buffers 1, 3, 4, 13, and 15 are used during an estimation step. To obtain the fastest analysis, even when the estimation is parallelized, you may want to optimize their LIM sizes.
4 Multiple Runs
As of NONMEM 7, there is decreased likelihood of early termination of runs using multiple problems and/or the “Super Problem” feature.
5 Improvements in Control Stream File input limits
By default, there may be up to 50 data items per data record. In NM72, set
PDin$SIZESrecord to change this.Data labels may be up to 20 characters long.
Numerical values in the data file may now be up to 24 characters long.
ID values in the data file may be up to 14 digits long.
The numerical values in
$THETA,$OMEGA, and$SIGMAmay be each up to 30 characters long, and may be described in E field notation.By default, you may have up to 50 items printed in tables. In NM72, set
PDTin$SIZESrecord to change this.
6 Interactive Control of a NONMEM batch Program
A NONMEM run can now be controlled to some extent from the console by issuing certain control characters.
Console iteration printing on/off during any Estimation analysis (ctrl-J from console NONMEM, Iterations button from PDx-POP). Exit analysis at any time, which completes its output, and goes on to next mode or estimation method (ctrl-K from console, or Next button in PDx-POP). Exit program gracefully at any time (ctrl-E or Stop button). Monitor the progress of each individual during an estimation by toggling ctrl-T. Wait 15 seconds or more to observe a subject’s ID, and individual objective function value. It is also good to test that the problem did not hang if a console output had not been observed for a long while.
Control console printing of parallelization information with Ctrl-B. Control log file parallelization information with ctrl-F.
If you run NONMEM from PDx-POP, you can get graphical view of objective function or any model parameter progress during the run. The parameter and objective function progress is written in a root.ext file (where root is base name of control stream file), which may also be monitored by a text editor during the run.
If you run NONMEM from PDx-POP, Bayesian sample histories of the population parameters can be viewed after analysis is done. The sample history file is written to that specified by the $EST FILE= option, which can be also monitored by a text editor during or after the run.
Sometimes NONMEM does not respond to user input. This may occur during a parallel distribution run using MPI, or if the user began NONMEM with the -background switch. The user may open another console window, copy the program sig.exe from the NONMEM installed ..\util directory to your run directory, then enter any one of these commands:
Print toggle (monitor estimation progress):
Sig J
Sig R
Sig P
Console paraprint toggle (monitor parallel processing traffic):
Sig B
Sig A
Sig P
Sig PA
Sig PP
Next (move on to next estimation mode or next estimation):
sig K
sig N
Stop (end the present run cleanly):
Sig E
Sig S
Subject print toggle:
sig T
sig U
sig SU
Parallelization log-file parafprint toggle:
Sig PARAF
Sig PF
Alternatively, you may execute the sig program from another directory if you specify the run directory in which you want the signal file created:
sig next \nonmem\run\
Make sure you terminate the directory name with a directory parse symbol appropriate for the operating system.