Chapter 19: Memory Management and Configuration

Go to the Previous Chapter
Go to the Table of Contents for This Manual
Go to the Guides Master Index

Chapter 1 * Chapter 2 * Chapter 3 * Chapter 4 * Chapter 5 * Chapter 6 * Chapter 7 * Chapter 8 * Chapter 9 * Chapter 10 * Chapter 11 * Chapter 12 * Chapter 13 * Chapter 14 * Chapter 15 * Chapter 16 * Chapter 17 * Chapter 18 * Chapter 19


19.1 Memory Management

This chapter presents an overview of the ANSYS memory management scheme and defines some frequently used terms.

19.2 Basic Concepts

The memory available on your computer is called real memory-the amount of actual, physical memory (RAM) available through memory chips. The minimum amount of real memory recommended for the ANSYS program varies from system to system and is listed in your ANSYS Installation and Configuration Guide.

19.2.1 ANSYS Work and Swap Space Requirements

The ANSYS program requires some space to reside in memory, plus additional work space. The ANSYS work space defaults to 64 MB on most systems, 32 MB on Windows systems. As shown in Figure 19-1, the total memory required for the ANSYS program usually exceeds the amount of real memory available. The additional memory comes from system virtual memory, which is simply a portion of the computer's hard disk used by the system in place of physical memory. The disk space used for system virtual memory is called swap space, and the file is called the swap file. The amount of swap space required for the ANSYS program depends on the amount of real memory available, the size of the ANSYS executable, and the amount of ANSYS work space.

Figure 19-1 Comparing memory available (computer) and memory required (ANSYS). System virtual memory is used to satisfy additional ANSYS memory requirements.

19.2.2 How ANSYS Uses its Work Space

To understand how the program uses the ANSYS work space (the shaded portion in Figure 19-1), you need to know that this space is divided into two parts: database space and scratch space, as shown in Figure 19-2. Database space is used to work with the ANSYS database (model geometry, material properties, loads, etc.). Scratch space is where all internal calculations are done-element matrix formulation, frontal solution, Boolean calculations, and so on. On most systems, the default total work space is 64 MB. Of this, 16 MB are assigned to database space, and 48 MB are assigned to scratch space. (Part of the scratch space stores binary file buffers; see the description of NUM_BUFR later in this chapter.)

Figure 19-2 How ANSYS work space is divided

If your model database is too big to fit in the database space, the ANSYS program uses ANSYS virtual memory, which is, again, a portion of the hard disk used for data overflow. The main difference between system virtual memory and ANSYS virtual memory is that the former uses system functions to swap data between memory and disk, whereas the latter uses ANSYS programming instructions. The file used for ANSYS virtual memory is called the page file and has the name Jobname.PAGE. Its size depends entirely on the size of the database. When the page file is first written, the program issues a message to that effect. Use of the page file is not desirable because it is a less efficient way of processing data. You may be able to prevent it by allocating more database space (discussed in Section 19.3).

If internal calculations can't fit in the scratch space, the ANSYS program will attempt to allocate additional memory to meet these requirements. If this occurs, you'll see an alert message informing you that the problem has grown beyond the specified memory allocation and that ANSYS has allocated additional memory. Because of internal architectural considerations (not related to the platform or memory available), at Release 5.5 some portions of ANSYS can't always use the additional memory that was allocated or allocate the memory when needed. Should this occur, ANSYS will usually issue an "out of memory" message (and will abort in batch mode). This can happen, for instance, if you request a Boolean operation among several volumes (such as VADD,ALL). This is obviously not desirable, and you may be able prevent it by allocating more scratch space. The next section discusses methods for estimating the amount of scratch space required..

19.3 How and When to Do Memory Management

On most systems, the ANSYS program starts with a default work space of 64 MB-16 MB for database space, and 48 MB for scratch space. Normally, you do not need to change these defaults, but in some situations you may need to change the total work space or simply divide it differently (or both).

If you wish to check how much memory a particular problem will require, ANSYS will provide a conservative estimate you can use as a starting point for memory settings. To do this, you must first build your model, apply all loads, and set all of the solution parameters (but not initiate the solution). To generate the estimates, enter the /RUNST processor and then issue the RMEMRY command.

Should ANSYS alert you that it has allocated additional memory during a solution, a good practice is to check how much scratch memory was required for the problem and reset the ANSYS memory allocations somewhat higher than these statistics. To generate this statistic, after the solution is complete you can run the /STAT,MEM command. You should allocate additional scratch memory beyond what the /STAT,MEM command reports to allow for program overhead and the effects of memory segmentation.

19.3.1 Changing the Amount of ANSYS Work Space

The easiest way to do this is to use the work space entry option (-m) while activating the program, either via the ANSYS launcher or via the ANSYS execution command. For example, to request 80 MB of ANSYS work space (instead of the default 64 MB), the ANSYS execution command would read:

ansys55 -m 80
(The execution command syntax is system-dependent.)

When you use the -m option, system virtual memory is allocated at run time to achieve the work space requested.

Other ways to change the maximum ANSYS work space are:

Caution: Be careful when specifying a value for the -m option. Entering an amount larger than needed will waste system resources and degrade system performance.

Note-On the following systems, one word of memory consists of four bytes of memory: Digital Alpha, HP, IBM RISC System/6000, Silicon Graphics Inc., Sun SPARC (Solaris), and Sun UltraSPARC (Solaris).

By changing the amount of ANSYS work space, you are in effect changing the available scratch space. This is because the database space is held constant at 16 MB, as illustrated in the following figure.

Figure 19-3 The effect of changing ANSYS work space. Only scratch space is changed, and database space is held constant.

The following list describes situations in which you may need to change ANSYS work space:

The following tables show the relationship between the work space requested, approximate swap space requirements, and approximate wavefront size obtained. All the values in both tables are in MB.

Table 19-1 ANSYS work space, wavefront, nodes for PowerSolver, swap space requirements for UNIX systems

ANSYS Work Space (specified via the -m option)

Approximate
Maximum Static Wavefront (DOF)

PowerSolver
Number of Nodes

Swap Space
Requirements

Suggested Total Page File Size for 32 MB RAM

241

1230

2100

65

105

322

1640

4200

73

113

48

2430

8500

89

129

642

3000

12800

105

145

128

4650

29800

169

209

1. Minimum amount

2. Default amount

Table 19-2 ANSYS work space, wavefront, nodes for PowerSolver, swap space requirements for Windows systems

ANSYS Work Space (specified via the -m Option, in MB)

Approximate Maximum Static Wavefront (DOF)

PowerSolver Number of Nodes 1.

Swap/Page Space
Requirements

Suggested Total Page File Size for 32 MB RAM

24 3.

1340

2100

61

105

32 4.

1970

4200

69

113

48

2840

8500

85

129

64

3500

12800

101

145

128

5390

29800

165

209

1. 3 DOFs per node

2. Paging file calculation does not include other processes or the operating system's own requirements.

3. Minimum amount

4. Default amount

Note-On Windows NT systems, use the System icon in the Control Panel to set virtual paging file size.

19.3.2 Reallocating Database Space

This is done by allocating more or less database space. Given a fixed amount of ANSYS work space, allocating more database space leaves less for scratch space and vice versa, as illustrated in the following figure.

Figure 19-4 Dividing work space differently. Allocating more database space leaves less for scratch space, and vice versa.

To allocate more or less database space, use the database space entry option (-db) while starting up the program, either on the ANSYS launcher or on the ANSYS execution command.

Another way to change the amount of database space is to modify the size of each database page with a different SIZ_VPAG value in the CONFIG5x.ANS file. However, the product of the SIZ_VPAG X NUM_VPAG cannot exceed 2 gigawords, except on Cray systems, which do not have this restriction. The database space stores data in chunks called database pages. On most systems, the default number of database pages is 256, each 64-KB long (256 x 64 KB = 16384 KB; 16384 KB /1024 KB/MB = 16 MB).

You may need to divide work space differently in these situations:

19.3.3 Allocating Memory on Systems with 64-Bit Architecture

On some 64-bit UNIX systems, such as the Digital ALPHA or Silicon Graphics systems, you may encounter memory problems when running very large models. Such problems typically occur with models that require 4 GB or more of scratch space. Should this occur, you'll see the following error message:

The memory (-m) size requested cannot currently be addressed using dynamic memory
mode. ANSYS addressing can be changed by turning on fixed memory via the -f command
line option.
To remedy this problem, you can issue the -f ANSYS command line switch with no arguments. For your reference, the -f switch takes the following arguments:

nogrow

no | off

(no argument)

19.4 The Configuration File (CONFIG5x.ANS)

When you execute the ANSYS program, it reads a configuration file, CONFIG5x.ANS, if one exists. This file controls system-dependent settings such as the size of each file buffer, maximum number of database pages in memory, etc. On computer systems that support mixed-case file names, such as UNIX systems, the file name is assumed to be in lower case: config5x.ans.

ANSYS searches for the CONFIG5x.ANS file first in the current (working) directory, next in the login (home) directory, and finally in the ANSYS documentation directory. The search path for CONFIG5x.ANS is identical to the START5x.ANS and STOP5x.ANS files.

The configuration file is a fixed-format file, consisting of a list of keywords followed by an equals (=) sign and a number. The keyword must begin in column 1, the equals sign must be in column 9, and the number must begin in column 10. A sample CONFIG5x.ANS file is shown next, followed by a brief explanation of each of the keywords.

Sample CONFIG5x.ANS File

NUMRESLT=1000
NUM_BUFR=2
SIZE_BIO=4096
VIRTM_MB=64
NUM_VPAG=128
SIZ_VPAG=16384
NUM_DPAG=8192
MEM_GROW=12
NUM_PROC=1
LOCALFIL=0
CONTACTS=1000
ORDERER_=2
EXT_FILE=1
MX_NODES=5000
MX_ELEMS=2000
MX_KEYPT=500
MX_LINES=1000
MX_AREAS=300
MX_VOLUS=200
MX_REALS=10
MX_COUPS=10
MX_CEQNS=10
FILESPLT=128
Note-Since many of the values for CONFIG5x.ANS are dependent on the system being used, a range of values for each keyword is provided. Note that on most computer systems, 1 integer word = 4 bytes.

NUMRESLT is the maximum number of result sets (substeps) allowed on the results file: 10 minimum. It defaults to 1000 and can be changed at the Begin level with the /CONFIG,NRES command.

NUM_BUFR is the number of buffers per file stored in scratch space: 1 to 32. A buffer is a chunk of space used to "hold" data in memory before they are written to the hard disk. The program waits for the buffer to be completely "filled up" and only then "empties" it onto the hard disk. This prevents frequent disk input-output activity, which can be time consuming.

NUM_BUFR defaults to 4 and can be changed at the Begin level with the /CONFIG,NBUF command. It is used for the EROT, ESAV, EMAT, FULL, and TRI files. On systems with a large amount of real memory, you can increase NUM_BUFR or SIZE_BIO (or both) to keep ANSYS solution files in memory rather than on disk. This can save a significant amount of disk input-output activity and may be practical for small problems with many substeps.

SIZE_BIO is the size of each file buffer: 1024 to 4194304 integer words (4 KB to 16 MB). It defaults to 16384 and can be changed (on most systems) at the Begin level with the /CONFIG,SZBIO command. See NUM_BUFR for details.

VIRTM_MB is the amount of total ANSYS work space requested for the current ANSYS session: 24 MB minimum. It defaults to 64 MB and can be changed with the work space entry option, as explained in the basic concepts section earlier in this chapter. (See Figure 19-5.) You can also use VIRT_MEM in place of VIRTM_MB to specify the ANSYS work space in integer words.

NUM_VPAG is the maximum number of database pages in memory: 16 to 512, defaults to 256. You can change NUM_VPAG or SIZ_VPAG (or both) to change the amount of database space; see Section 19.3 in this chapter, and Figure 19-5.

Figure 19-5 Memory diagram in terms of CONFIG5x.ANS keywords

SIZ_VPAG is the size of each database page: 4096 to 131072 integer words (16 to 512 KB), defaults to 16384 (64 KB). You can change SIZ_VPAG or NUM_VPAG (or both) to change the amount of database space. SIZ_VPAG also affects the size of the page file; see NUM_DPAG.

Note-However, the product of the SIZ_VPAG X NUM_VPAG cannot exceed 2 gigawords (except on Cray systems, which do not have this restriction). If you increase one of those values, you may need to decrease the other to stay within this limit. The maximum value is also the default.

NUM_DPAG is the number of database pages on disk: NUM_VPAG to 65536, defaults to 8192. This number times SIZ_VPAG determines the maximum size of the page file (Jobname.PAGE), which is written only if the database becomes too large to fit in the database space in memory. If the page file is written, sufficient disk space must be available to accommodate it, or the program will abort.

MEM_GROW is the starting size of the memory block (in MB) that ANSYS will attempt to allocate should a problem grow larger than will fit in the current scratch space allocation. If ANSYS attempts to allocate additional scratch space, it will start with a memory block size equal to MEM_GROW and then reduce this by halves until it can allocate additional memory. If not specified, MEM_GROW defaults to one-half the initial scratch space. To turn off dynamic memory allocation (use a fixed-memory model), set MEM_GROW=0.

NUM_PROC is the number of processors to be used. NUM_PROC defaults to 1 but can be changed at the Begin level with the /CONFIG,NPROC command. This affects only multi-processing computers with the appropriate parallel versions of the ANSYS program (versions of the ANSYS program specifically programmed for parallel processing). The value of NUM_PROC must be less than or equal to the total number of available processors.

If the value of NUM_PROC exceeds the number of available processors, the maximum number of available processors will be used. On some systems, an additional user specified environmental variable (NCPUS) may also be required to select the number of processors available. Most systems will utilize a single processor by default. See the installation guide for your computer system for more information on your system's default configuration.

LOCALFIL is a key that determines when files are to be closed: 0 (globally closed) or 1 (locally closed). It defaults to 0 (globally closed) and can be changed at the Begin level with the /CONFIG,LOCFL command. This key is applicable only to the EROT, ESAV, EMAT, FULL, and TRI files. Locally closed files (LOCALFIL=1) may be deleted earlier during solution if requested with the /FDELE command. This may be helpful while running large problems. Globally closed files are closed at the end of the run and are not opened and closed each substep. This saves time in analyses with many substeps.

CONTACTS is the number of contact elements that are expected to be in contact at any given time. It defaults to 1000 and can be changed at the Begin level with the /CONFIG,NCONT command. This is not the same as the total number of contact elements in the model.

ORDERER_ is a key that determines the automatic element reordering scheme: 0 (WSORT,ALL), 1 (WAVES), or 2 (both). It defaults to 2 and can be changed at the Begin level with the /CONFIG,ORDER command.

EXT_FILE is a key that determines the format of binary files: 0 (internal format) or 1 (external format). It defaults to 1 (external format) and can be changed at the Begin level with the /FTYPE command. (On some systems, internal format and external format are identical.)

Any of the following nine keywords that you do not specify is set to 100 the first time ANSYS encounters it. Whenever the current maximum is exceeded, the keyword value automatically doubles. The maximum values are dynamically expanded, even at first encounter.

FILESPLT is the integer value indicating the file split point in megawords. All files that are eligible for splitting will be split into a new file every increment of xxxx megawords (where xxxx is the value specified with this keyword). See Section 6.3 of the ANSYS Operations Guide for more information on splitting files.

You can change many of the configuration settings at program start-up using ANSYS entry options, at the Begin level with the /CONFIG command, or with other ANSYS commands. In most cases, therefore, there is no need to create your own CONFIG5x.ANS file. Also, the default settings for each computer system have been chosen for efficient running of "typical" models on typical system configurations. Change them only for atypical models or atypical systems.


Go to the beginning of this chapter