phone/fax (801) 446-1426
sales@nittany-scientific.com

 

 

Frequently Asked Questions


Running Large Models with NEC

Theoretically, it is possible to run any size problem using the optimized 32-bit NEC4 core. The limitations in the problem size are controlled by the amount of virtual memory you have available (Windows NT) or the amount of virtual memory and swap space available (Windows 95). Temporary files are written to swap space.

It is important to note that virtual memory is usually a combination of physical RAM and hard drive space. This means that a problem may use virtual memory (RAM plus hard drive) plus swap files (more hard drive). Because of the need for the core to use swap files there is now an option to be able to specify the swap drive. Currently, this option is only availble in the NEC4 core (GNEC). A description of how to set this parameter is given below.

In Windows 95, the NEC core can only allocate 4095 segments in virtual memory. Any problem larger than 4095 will have to swap to disk. The 4095 segment limit means that it can only allocate 256 megs of virtual memory to run the problem. This limitation occurs no matter how large you have set the virtual memory and/or how much physical RAM is available on the system. The bottom line is that within Windows 95, any problems larger than 4095 will use virtual memory and swap space.

Windows NT v4.0 with service pack 3 does not have any problems with virtual memory and the complete problem, no matter what size, can utilize virtual memory. Obviously, the more RAM you have the better.

Understanding that both operating systems have different methodologies it is still possible to optimize the run and even more important: Complete the run!

The following applies for both operating systems. (Window 95 and Windows NT). GNEC user's on either system should also read the last section in this file for a description on how to specify the location that the core will use for file swapping.

To prepare for a large run you should first view the model with Necvu and get the segment count. To get the number of segments start up Necvu and choose Display from the main menu then choose Information. The dialog box that is displayed will contain the total number of segments in the model. Make a note of this value. After you get the total number of segments in the problem you need to edit the file dnec4dma.par (NEC4) or nec2d.par (NEC2). The parameters you will be changing are the first two. Please refer to the Installation section of the User's manual for more information about this file.

Because of the limitations with the operating systems it will be beneficial to discuss a problem which has more than 4095 segments. Lets use 4980 as our problem size. This problem will need approximately 397 megs of memory to run. (total number of segments squared times 16) The reason for the approximation is because memory is needed for internal variables and options such as sources and loads.

Now it is time to edit the file dnec4dma.par or nec2d.par. This file is located in the program \bin directory and can be directly opened and saved within the NEC-Win Pro/GNEC editor. The parameter file contains multiple entries for controlling the NEC run. The ones that we are interested in are the first two.

INTEGER MAXSEG ! Maximum # of segments

       2200
INTEGER MAXMAT ! Maximum core storage IRSERV = MAXMAT*MAXMAT
       1000

The first parameter controls the total number of segments that the core can allocate. The second parameter controls how many of these segments will be done in virtual memory. The interaction matrix for segments not using virtual memory (the difference between the two parameters (first - second)) will use swap files.

By making the first two parameters equal you ensure that the complete model will run in virtual memory. This will decrease the run-time as well as reduce the disk space needed for the problem (no swapping).

Now is where the difference in operating systems becomes an issue. Using Windows NT the complete problem can be done in virtual memory. Therefore a good value to set the virtual memory in Windows NT would be 500 megs. This leaves about 100 megs of memory for the operating system and any other tasks. Since Windows 95 can not allocate more than 256 megs of virtual memory for the problem it does not make sense to set your virtual memory much higher than 350 megs. These settings are dependent upon your setup and will vary from system to system.

Note: Please see your Microsoft Windows User's Guide for information on changing virtual memory settings.

For the problem described above the recommended settings would be:

**************Windows NT

For Windows NT you should take the value from Necvu and make the first two parameters in the dnec4dma.par file equal to this value.

INTEGER MAXSEG ! Maximum # of segments

     4980
INTEGER MAXMAT ! Maximum core storage IRSERV = MAXMAT*MAXMAT
     4980

Note: It is not necessary to make the second parameter the same as the first because Windows NT can also write swap files to disk. The advantage in making both the same value is that large amounts of data are not written to the disk. When NEC writes swap files the amount of space needed on the drive is much larger than if only virtual memory is used. The only disadvantage with using total virtual memory is that you will need to modify your virtual memory setttings.

*****************Windows 95

For Windows 95 you should take the value from Necvu and make the first parameter equal to the total number of segments (4980) but the second parameter should be set to 4095. This is the maximum value that can be allocated in virtual memory using Windows 95.

INTEGER MAXSEG ! Maximum # of segments

      4980
INTEGER MAXMAT ! Maximum core storage IRSERV = MAXMAT*MAXMAT
      4095

Note: If the problem were less than or equal to 4095 than both parameters could be the same value. The advantage in making both the same value is that large amounts of data will not be written to the disk. When NEC writes swap files the amount of space needed on the drive is much larger than if only virtual memory is used.

****************Setting the Swap Location

The 32-bit NEC4 core allows you to specify the location for writing swap files. This can be done by choosing Options from the main GNEC menu and then choosing Swap Directory.

You should choose a drive and location where there is a large amount of free space. The location can be just a drive letter or a drive letter plus a path.

e.g.

D:
D:\NECTEMP

Note: You should not place a trailing backslash after the drive or path name.

If the swap location is set to default then temporary files are written to the location specified in the environment string TEMP. If TEMP is not set, then the program will write temporary files to the same location as the NEC executable (GNEC\bin).


tech_support@nittany-scientific.com

Last Modified: 19 December, 2008