Change Memory Allocation Parameters
<ul><li><a name="tex2html2" href="#SECTION00020000000000000000">The Memory Allocation Parameters</a> <ul><li><a name="tex2html3" href="#SECTION00021000000000000000">Creating a Parameters File</a> </li><li><a name="tex2html4" href="#SECTION00022000000000000000">Descriptions of Memory Allocation Parameters</a> </li><li><a name="tex2html5" href="#SECTION00023000000000000000">Determining the Appropriate Values for Dimension Parameters</a> </li><li><a name="tex2html6" href="#SECTION00024000000000000000">Editing the Parameters File</a> </li><li><a name="tex2html7" href="#SECTION00025000000000000000">Reading the New Parameters Into CMISS</a> </li></ul> </li><li><a name="tex2html8" href="#SECTION00030000000000000000">Sparsity Structures</a> </li></ul> <!--End of Table of Contents-->
<p>
</p><h1><a name="SECTION00020000000000000000"> The Memory Allocation Parameters</a> </h1>
<p> The memory allocation parameters control the sizes of arrays used by CMISS. The parameters are set by default in CMISS, however, often a users may need change the parameters to suit their requirements. For example, one might find when solving a finite element problem that more elements than the default maximum number are required. Alternatively the default sizes may be excessively large for a particular application, to save memory the user can decrease the size of some parameters or not allocate memory for applications of CMISS that are never used.
</p><p> To set the memory allocation parameters one must create a parameters file, edit the desired values, and read the new parameters into CMISS. Each of these steps is explained fully in the following sections.
</p><p>
</p><h2><a name="SECTION00021000000000000000"> Creating a Parameters File</a> </h2>
<p> In order to change the memory allocation parameters one must first create a parameters file. The command to create or overwrite a parameters file is
</p><p> FEM define parameters;w
</p><p> or to give the created file a name other than the default
</p><p> FEM define parameters;w;name
</p><p> The file created will have the extension <tt>.ippara</tt>.
</p><p>
</p><h2><a name="SECTION00022000000000000000"> Descriptions of Memory Allocation Parameters</a> </h2>
<p> The parameters file described above contains full list of memory allocation parameters and a short description. A more detailed description of each parameter may be obtained by looking up the name in the <a href="http://cmiss.bioeng.auckland.ac.nz/Groups/Bioengineering/CMISS/scripts/cmiss-lookup.cgi"> CMISS Viewer</a>.
</p><p> There are two major types of memory allocation parameters: dimension parameters and switch parameters.
</p><p> The parameters beginning with N and ending in M are dimension parameters. They determine the dimensions of arrays. The values should generally be positive integers, or sometimes can be 0. If an array is not used in an optimized version of CMISS its dimension can be set to 0 but this may cause problems in the debug version. The maximum allowable parameter value is governed by the capabilities of the hardware but the parameters should be kept close to as small as possible.
</p><p> The parameters beginning with USE_ are switch parameters and must either have the value 0 or 1. They specify whether or not to allocate memory for array required for various features of CMISS. The value needs to be 1 if the feature is going to be used, but, if the feature is not used, it can be set to 0 to save memory. USE_VORONOI should only be set to one if Voronoi triangulations are going to be used.
</p><p>
</p><h2><a name="SECTION00023000000000000000"> Determining the Appropriate Values for Dimension Parameters</a> </h2>
<p> One of the most common reasons that memory allocation parameters may need to be changed is an error message like this
</p><p> Error: >>Increase NP_R_M>IPMESH9_DYNAM>IPMESH9>IPMESH>DEMESH> <br> FEMA>FEM>SYNTAX>PARSE
</p><p> This means that the dimension parameter NP_R_M (the maximum number of nodes in a region) must be increased. For a guide to the required value for a dimension parameter use the command
</p><p> FEM list parameters
</p><p> or to list specific dimension parameters <em>e.g.,</em> np, those related to the number of nodes
FEM list parameters np
</p><p> A portion of the resulting listing for this case is as follows <br> </p><div align="center">
<table cellpadding="3">
<tbody><tr><td align="left">NPM =</td> <td align="right">200</td> <td align="left">NPT(0..nr) =</td> <td align="center">312</td> <td align="right">312</td> </tr> <tr><td align="left">NP_R_M =</td> <td align="right">200</td> <td align="left">NPNODE(0,0..nr) =</td> <td align="center">312</td> <td align="right">312</td> </tr> <tr><td align="left">NPTM =</td> <td align="right">1</td> <td align="left"> </td> <td align="center"> </td> <td align="right"> </td> </tr> </tbody></table> </div> <br> In the first column are the parameters current values; In the second column the parameters ending with T are a guide to the required value. For example from the error message and the parameters listing above we can see that presently the maximum number of global nodes (NPM) is 200, but the required number is 312 (NPT). Therefore the value of the parameters NPM and NP_R_M (the maximum number of global nodes and the maximum number of nodes in a region) must be increased to at least 312.
<p> The parameter listing may also be used to determine the minimum required values for the memory allocation parameters.
</p><p> NOTE: This provides some guide to the required values, but may not be useful in some cases.
</p><p>
</p><h2><a name="SECTION00024000000000000000"> Editing the Parameters File</a> </h2>
<p> Once a parameters file has been created it can be edited using any text editor. Do not use tabs or alter the format of the file, change only the values of the parameters or CMISS will be unable to read the file back in.
</p><p> In the example above it was determined that the maximum number of global nodes and the maximum number of nodes in a region needed to be increased. To do this the following lines need to be found in the parameters file <br> </p><div align="center">
<table cellpadding="3">
<tbody><tr><td align="left">Max global nodes</td> <td align="right">(NPM)[1]:</td> <td align="right">200</td> </tr> <tr><td align="left">Max global nodes in a region</td> <td align="right">(NP_R_M)[1]:</td> <td align="right">200</td> </tr> </tbody></table> </div> <br>
<p> and changed to <br> </p><div align="center">
<table cellpadding="3">
<tbody><tr><td align="left">Max global nodes</td> <td align="right">(NPM)[1]:</td> <td align="right">312</td> </tr> <tr><td align="left">Max global nodes in a region</td> <td align="right">(NP_R_M)[1]:</td> <td align="right">312</td> </tr> </tbody></table> </div> <br>
<p> Save and close the file
</p><p>
</p><h2><a name="SECTION00025000000000000000"> Reading the New Parameters Into CMISS</a> </h2>
<p> To use the memory allocation parameters to set up the required arrays, the parameters must first be read into CMISS. The parameters are read in with the command
</p><p> FEM define parameters;r
</p><p> or if the file has a name other than the default
</p><p> FEM define parameters;r;name
</p><p> This will erase all arrays and reallocate memory using the new parameters.
</p><p>
</p><h1><a name="SECTION00030000000000000000"> Sparsity Structures</a> </h1>
- <p>
- </p><p>
- COMPRESSED-ROW FORMAT:
- </p>
- The sparsity scheme is based on storing a NxN matrix, GX, as a
one dimensional array of length NZT (where nz=sxNxN, s is the sparsity of the array) that stores only the non-zero elements of GX. Two additional arrays ISR and ISC store the positions of the non-zero elements. ISR is of length N+1 and ISC is of length NZT. ISR(i) stores the position in ISC of the start of row i. The N+1 position of ISR stores the size of ISC+1 ie. NZT+1. The number of non-zero elements in row i can be found from ISR(i+1)-ISR(i). ISC(nz) gives the column number for non-zero element nz.
Example of sparsity storage scheme on a NxN matrix (N=6). Here the sparsity is 8/36 or 22% <pre> <br> GX 1 2 3 4 5 6 <br> ____________ GX(nz) <br> 1| 0 A 0 B 0 0 A B C D E F G H <br> 2| 0 0 C 0 0 0 <br> 3| 0 0 0 0 D E ISR(i)<br> 4| F 0 0 0 0 0 1 3 4 6 7 8 9<br> 5| 0 0 G 0 0 0 ISC(i) <br> 6| 0 0 0 0 0 H 2 4 3 5 6 1 3 6<br> <br> </pre> <p>
- ROW-COLUMN FORMAT:
- </p><p>
- The sparsity scheme is based on storing a NxN matrix, GX, as a
one dimensional array of length NZT (where nz=sxNxN, s is the sparsity of the array) that stores only the non-zero elements of GX. Two additional arrays ISC and ISR store the positions of the non-zero elements. Both ISR and ISC are of length NZT. ISR(nz) stores the row number of the non-zero element nz and ISC(nz) stores the column number of the element.
Example of sparsity storage scheme on a NxN matrix (N=6). Here the sparsity is 8/36 or 22% </p><pre> <br> GX 1 2 3 4 5 6 <br> ____________ GX(nz) <br> 1| 0 A 0 B 0 0 A B C D E F G H <br> 2| 0 0 C 0 0 0 <br> 3| 0 0 0 0 D E ISR(i)<br> 4| F 0 0 0 0 0 1 1 2 3 3 4 5 6 <br> 5| 0 0 G 0 0 0 ISC(i) <br> 6| 0 0 0 0 0 H 2 4 3 5 6 1 3 6<br> </pre>