Useful Tips in FE Software Development


Useful Tips

Some frequently asked questions about programming languages, operating systems, hardware and so on in FE software development.

(Q)- For a scalable FE code, is it more efficient to rely on the memory manager of the operating system or should the programmer use blocked read and write routines?

(A) - Modern operating systems such as Windows 95/98/NT have their own memory management systems that use paging techniques to swap memory between the high-speed memory (RAM) and the low-speed memory in the hard disk. Often users can also specify the size of this area in the hard-disk also called "swap-file". During the assembly and solution of system equation phase in FE runs, the operating system stores part or all of the stiffness array in the "virtual memory" and reads it back whenever needed.

In the 70s and early to mid 80s (prior to the introduction of Windows and Linux OS), most FE software for desktop applications were written using the programmer's own blocked read and write routines. The need for such a solution has now practically ended. There are some who argue that for certain operations that act on segments of an array that are closely spaced, the blocked technique might perform better. However, this particular advantage rarely translates to actual run-time saving. In modern software engineering practice, low-level operation such as memory management should be delegated to the operating system. The programmer should concentrate on high-level implementations instead.

(Q)- Do Windows 95/98/NT operating systems have a limit to the size of an array that can be allocated with a single "alloc" or "new" call?

(A) - While Microsoft claims in its literature that its 32-bit OS extend the limit on flat-memory addressing up to 5GigaBytes, programmers who work with large arrays and matrices have many times seen their codes bomb with the OS failing to allocate memory. Using many simple test codes, one could see that Windows 95 has actually a limit around 350 Mbytes. However, NT lives up to expectation based on results from a series of rigorous tests. Therefore it is a good practice to include some exception handling whenever memory is requested in FE programs written for PC application.

(Q)- So what will be the way around in Windows 95 to allocate memory for an array larger than 350 MBytes?

(A) - The best solution is to use a linked list of pointers. The array could be divided into an optimum number of smaller sub-arrays. Elements in these arrays will be accessed through pointers just like in linked lists. This, by the way, was the same solution used in large-scale FE programs in 16-bit OS.

(Q)- What is the Pre-conditioned Gradient method and why is it touted as faster than traditional decomposition methods? What are its limitations?

(A) - The Pre-conditioned Gradient method is an iterative method that can be used to solve large systems of equations. Its major shortcoming is the fact that it works only for a single load case at a given run. For FE runs with a number of load cases, the method is not applicable and resort has to be made to the traditional decomposition methods such as Cholesky method.

 

| (back to first page)  |