In this article we show how to optimise SIMetrix for processing large data files.
For information on controlling the size of large data files, please see Handling Simulation Data
"Thanks for the lightning fast reply and thank you very much for creating the best spice product on the market"
SIMetrix stores data in a binary file in an efficient format that allows the data to be retrieved very rapidly. The format requires the data to be buffered in RAM before writing to disk and there are two settings that control the size of the buffers used. The larger the buffer the faster the data retrieval but at the expense of RAM consumption while the simulation is running.
As explained in the Simulator Reference Manual, there are two option settings that control the size of the buffer used for each vector. These are MaxVectorBufferSize and TotalVectorBufferSize. The first controls the maximum size that will be used for each buffer while the second controls the total amount of RAM that will be used for all buffers. Note that both settings are in bytes.
The default settings for the buffer size were defined some years ago when disk data transfer speeds were much slower than they are now and typical memory installations were much smaller. If you often create very large data files (>100MBytes) you will benefit from altering these settings. This is particularly so if you have a high performance SATA or SCSI disk drive. The following table shows the default values along with the new recommended values.
| Setting | Default value | Recommended value |
| MaxVectorBufferSize | 32768 | 1000000 |
| TotalVectorBufferSize | 10% of system RAM (in bytes) | See notes |
You can increase TotalVectorBufferSize if you don't use other applications while SIMetrix simulations are running. We suggest a maximum of 50% of system RAM. Note that you will probably notice a substantial increase in RAM usage even for small circuits if you increase the above settings.
To set the option settings, use the Set command at the command shell command line (the edit box below the menu bar). This is only available with the full production version and is not available with the free SIMetrix Intro. For example, to set TotalVectorBufferSize to 200 million bytes, type at the command line:
Set TotalVectorBufferSize=200000000
Be sure to spell this correctly as there will be no error message if you get it wrong.
We did some measurements to show the benefits of increasing buffer sizes. In our test, we measured the time to retrieve a 14Mbyte vector from a 1GByte data file. The tests were performed with three different buffer sizes on two different systems. One system was a relatively old notebook computer with an IDE disk system. The other was a modern machine with a high performance SCSI Ultra 320 disk. All measurements were performed after clearing the system cache. The results are shown in the following tables:
| System | Buffer size | Read time |
| IDE | 32768 (default) | 8.1 secs |
| 250K | 3.1 secs | |
| 1Meg | 2.8 secs | |
| Ultra 320 | 32768 (default) | 4.1 secs |
| 250K | 0.75 secs | |
| 1Meg | 0.23 secs |