Configuring Adams > Using Memory Models > Setting Custom Memory Model Size

Setting Custom Memory Model Size

Custom Memory Models

You must have a FORTRAN compiler to create a custom memory model.
Hexagon provides several standard memory models for you to use as explained in Memory Model Sizes. Often, when you are simulating very large models, however, you receive the following message:
! ERROR: ***** ADAMS MEMORY OVERFLOW *****
! A larger MD array is required.
! The error occurred in subroutine "OPMAIN" while allocating "DOUB" space
! from "TEMP" for the "IZ".
! Space Available: 348496 Space Requested: 7651872
In the message, Space Available is the amount of space that is left to run with the current memory model. Space Requested is the space that is needed for the simulation to continue. Therefore, the space needed to run the simulation is:
Space Requested - Space Available + Current Memory Model
For example, if you are running with the memory model set to HUGE and you get the following error message:
! ERROR: ***** ADAMS MEMORY OVERFLOW *****
! A larger MD array is required.
! The error occurred in subroutine "OPMAIN" while allocating "DOUB" space
! from "TEMP" for the "IZ".
! Space Available: 348496 Space Requested: 7651872
The amount of memory necessary to run the simulation is:
7651872-348496 + 20000000 = 27.4e6
If you already have your memory model set to HUGE, you need to create a custom memory model to accommodate the large memory requirements.
Remember that selecting a memory size affects the machine and every user. Consult with other users before decreasing the allocated size.
On Windows, by default, Adams places the custom memory model in the directory install_dir/win64/uconfg_user. When Adams starts, it searches the following locations in the following order for a custom memory model:
The location where the user executable is found, if used.
install_dir/win64/uconfg_user directory.
On Linux, when you create a custom memory model, the Adams Toolbar saves the parameters in the Adams registry, and creates a FORTRAN subroutine for the platform on which you are currently running the Adams Toolbar. The Adams Toolbar uses a directory structure under $HOME/.msca/cmm to store the FORTRAN subroutines and corresponding libraries. Do not change the contents or structure of the memory model directory.

Maintaining Custom Memory Models on Linux

This topic explains how to maintain your custom memory models. Select one of the following topics:

Creating a custom memory model

To create a memory model:

1. Right-click the Adams Toolbar tool, point to Manage Custom Memory, and then select Create Memory Model.
2. Click name, and enter a name for the memory model.
3. Adjust the array values in the options. Refer to the tables in Memory Model Sizes for explanations of each of the array values.
4. Select OK to build the necessary directories, source file, and library.
A window displays a list of build parameters as the library creation takes place.

Deleting a memory model

To delete a memory model:

1. Right-click the Adams Toolbar tool, point to Manage Custom Memory, and then select Delete Memory Model.
2. In the treeview, click the name of the memory model that you want to delete.
3. Select OK.
 
Note:  
This deletes the model parameters in the registry, the model directory, and all libraries.

Rebuilding a memory model

Occasionally, you have to rebuild your custom memory models. For example, you may have to rebuild if you switch to a new architecture or if something goes wrong with your current model directory.

To rebuild a memory model:

Right-click the Adams Toolbar tool, point to Manage Custom Memory, and then select Rebuild Memory Models.
A shell window displays each custom memory model being rebuilt as needed.

Changing a memory model

To change a memory model:

1. Right-click the Adams Toolbar tool, point to Manage Custom Memory, and then select either View/Change Memory Model.
2. In the treeview, click the name of the memory model that you want to change.
3. Adjust the array values in the options. Refer to the tables in Memory Model Sizes for explanations of each of the array values.
4. Select OK.
A shell window displays each custom memory model being rebuilt as needed.

Setting Custom Memory Model Size on Linux

To set a custom memory size on Linux:

1. The 'cmm' is a non-visible option in the start script on Linux.
2. Syntax: /top_dir/mdi -c cmm
Update the 8 values when prompted, and create a name for the memory model. Help is available by specifying ' -h' (note that, this help argument cannot be used on Windows, it is only available on Linux).
3. mdi -c cmm -h
This routine will create a custom memory model library.
4. The order of the inputs are:
MDSIZ OSSIZ CDSIZ LDSIZ LCEXPR FPSIZE NINSIZ MXSTAK model_name
For example,
cmm 60000001 200002 16003 50004 1005 3006 15007 308 name1
If less than the full list of variables are input, then defaults will be used, for example to update CDSIZ:
cmm 60000000 200000 16001

Setting Custom Memory Model Size on Windows

To set a custom memory size on Windows:

1. From the Start menu, point to Programs, point to Adams x (where x is the release number, for example Adams 2024.1), and then select Settings & License.
The Adams registry editor appears.
2. Set the memory model size for both Adams View and Adams Solver to Custom.
3. Select OK.
4. Run adams2024_1 cmm and select your uconfg parameter sizes.
A new uconfg_user.dll is created in the install_dir/win64/uconfg_user directory.
Your memory model size is set.
Set the custom memory setting as the default as explained in Adams Environment.