# TMPDIR

I/O Options and Subcase Information Entry The TMPDIR command is used in the I/O Options section to choose the directory in which the scratch files are to be written.

## Format

TMPDIR = <option> path

## Definitions

Argument Options Description
option FILESIZE=n, SLOW=1
FILESIZE=n
Maximum allowable file size in GB.
SLOW=1
Non-zero value denotes a network drive.
path <directory path>

Default = ./

The path to the directory where scratch files are to be written.

## Windows Operating System

Local Drive
TMPDIR = FILESIZE=13,D:\Dir1\Dir2\...\DirN\Scratch
TMPDIR = FILESIZE=13,D:\Dir1\Dir2\...\DirN\Scratch Files
Network Drive
1. Map the network drive (drive on a remote machine) to a drive (Y:\) on your computer.
2. Use the path to your preferred scratch directory on the mapped network drive as the path argument for TMPDIR.
TMPDIR = FILESIZE=13,SLOW=1,Y:\Scratch
TMPDIR = FILESIZE=13,SLOW=1,Y:\Scratch Files 

## Linux Operating System

Local Drive
TMPDIR = FILESIZE=13,/Dir1/Dir2/.../DirN/Scratch
TMPDIR = FILESIZE=13,D:/Dir1/Dir2/.../DirN/Scratch Files

1. The total length of information on this card is limited to 200 characters (including the card name and spaces between arguments). This data can be on a single line or span multiple continuation lines. Refer to I/O Options and Subcase Information Entries Guidelines for an example showing how to enter long file names on multiple lines.
2. Multiple TMPDIR cards are allowed (up to 20 entries). Scratch files may be allocated in all directories depending on the options defined (see comments 3 through 8).
3. Before opening any scratch file during the solution process, the solver checks the available free space on all TMPDIRs and allocates that file on the directory which has most free space. This algorithm tends to spread disk usage between different directories, but does not guarantee full usage of each TMPDIR area. Use of multiple TMPDIR's cannot be precisely controlled by OptiStruct, there is no way to guarantee that a particular number of scratch files are allocated to a particular TMPDIR (or set of TMPDIR's). Selection of TMPDIR for each file is conducted at the beginning of a run, and it is not possible at this point to estimate the final scratch file sizes. Once a scratch file is allocated and the run is begun, it cannot be moved to other scratch directories, or split into smaller ones. Therefore, it is sometimes possible that a run goes through successfully with a single TMPDIR and fails after adding additional TMPDIR's since the scratch file to scratch directory allocation is different in the latter case (for example, if less space is available in the additional TMPDIR's compared to the initially defined TMPDIR, and if allocation is different).
4. The main scratch file used during a linear solver process (that is solution of linear system or eigen problem) can be split between multiple TMPDIRs (see SCRFMODE).
5. When TMPDIR is marked as SLOW, it is used only after other TMPDIRs are filled up. Selecting directories for TMPDIR on disk drives shared across the network (that is on different computers or on centralized file servers) is not recommended, and should be avoided if possible. Some scratch files (especially for out-of-core and minimum-core mode) are heavily used, and accessing them across the network will dramatically increase wall clock time for the solution. The main purpose of the TMPDIR command is to avoid this delay when work areas (home directories) are allocated on a central server, as is customary at many large organizations. All scratch files are stored in the specified directories. The scratch files are automatically removed at the end of the analysis unless there is a system error or core dump (in which case, the scratch file may need to be cleaned up manually).
6. See the SCRFMODE setting on the SYSSETTING I/O Option for an additional way to use multiple TMPDIR cards for large jobs.
7. The -tmpdir option can be specified on the command line (see Run Options); this overrides any information specified in the input file.
8. The filesize option is needed in rare cases when there is a file size limit imposed by operating system. This limit is large enough for all practical problems in most cases. The following cases are known to have a file size limit of 2GB:
• FAT32 file system (Windows, sometimes Linux)
• ext2 file system (older Linux distributions)
• NFS version 2

It is recommended to upgrade hardware and/or operating system in these cases.