Preference Optimization


When FRED is installed on a computer for the first time, the default preference settings will not be optimized to leverage the resources available on the machine.  Rather, the default preference settings are deliberately chosen for program stability.  This knowledge base article discusses the various Preference settings that you should visit after installing FRED to optimize the GUI experience and raytracing/analyses performance. 
It is recommended that you start FRED, make the changes described in this document, then close FRED.  This process ensures that the changes made to the FRED installation are saved to the registry.
  • GUI Preferences
  • Ray Buffer Preferences

Graphical User Interface Settings

Start by navigating to the View menu and toggling the Cells option of the Output Window sub-menu.  This option allows you to view the Output Window as a spreadsheet (which it is) rather than as an empty text window.

Next, open up the Preferences dialog by navigating to Tools > Preferences.
The Output Window tab allows you to control how many rows and columns are available at any given time.  Personally, I like to keep a lot of history in the Output Window so that I can scroll back through the FRED output and look for information.  I generally keep my settings at 10,000 rows and 24 columns.  Additionally, I disable the formula engine since I generally don’t use it and have encountered obscure problems with it in the past.

Next, move to the Visualization tab and make the following changes:
  • Pixel Format = Fast
  • Allow multi-threaded tessellation = Checked
  • Screen background = It’s up to you, obviously, but typically black or white.   Just wanted to point out that was where you change this setting.
The Pixel Format setting controls whether the 3D view uses a “software” rendering mode or hardware acceleration using your graphics card.  The Fast option tells FRED to use the graphics card acceleration.
Multi-threaded tessellation is exactly what it indicates. When the 3D view needs to redraw, FRED will use as many CPU cores as are available.

Move to the Miscellaneous tab of the Preferences dialog and duplicate the options below.
  • Enable IntelliMouse in Grids – this option allows mouse wheel scrolling in dialogs which use grids.  This includes the Output Window!
  • Enable Formula Engine in certain dialogs – uncheck this for the reason mentioned above
  • Enter Curvatures – uncheck this, unless you are a crazy person and prefer to think in a manner that is the reciprocal of the way rational people think
  • Use isotropic scaling in analysis windows – opens chart windows with the view scaled proportionally to the analysis grid axes
  • Display enhanced raytrace statistics – toggle this and you will get additional information printed to the output window following a raytrace
  • Generate curve enclosure masks – make sure this is toggled so that certain surface types with complex apertures use “enclosure masks” to help with raytrace efficiency

Ray Buffer Preferences

The most important settings for maximizing FRED’s performance are found on the Ray Buffer tab of the Preferences dialog.  Before we get to the specific settings, we will briefly comment on how the ray buffer works.
Ideally, all ray data would be stored in RAM so that it can be accessed as quickly as possible.  However, it is also dangerous to use up all of the RAM on a computer since this has the potential to cause unpredictable program behavior and system failure (despite Windows doing its best to detect and manage this situation).  When FRED is installed, the default behavior is to allocate some small amount of RAM to be used for storing ray information.  While this is predictably safe, it means that you cannot store very many rays in the small amount of RAM that is allocated for use by FRED.  Consequently, it is easy to generate more ray data during a trace in FRED than you have allocated RAM to store the data in.  In this case, FRED will temporarily store ray information in “pagefiles” on hard disk and then swap data between the pagefiles and RAM as needed when the ray information needs to be operated on.  While this behavior isn’t necessarily bad, it does impact the performance of raytracing since accessing data in RAM is significantly faster than accessing data on a hard disk (though the gap is narrowing).
Conceptually, we can depict this operation with the graphic shown below.  In FRED, a “frame” is a finite sized block of RAM that stores some number of rays.  The user gets to specify the total number of frames and the number of rays stored in each frame as preference settings, the product of these two values being the total ray count that can be stored in RAM at any single time (effectively dictating the amount of RAM being allocated for use by FRED’s ray buffer).  The image below indicates that we have specified 6 rays to be stored in each frame and 24 frames allowed in RAM, giving us 6 x 24 = 144 rays in RAM at any given time.
Now, what happens if we trace more than 144 rays through our FRED model?  The additional ray data cannot be stored in RAM, so it gets temporarily written out to a location on your hard disk and stored in “pagefiles”.  The ray data then waits there until FRED needs to access the information, at which time the data is swapped back into memory.

So what are the general rules for optimizing the ray buffer preferences?
  • Allocating more RAM is better, since accessing data in RAM is fast.  Depending on what else you want to do with the computer while FRED is running, consider leaving 2-4GB of RAM free on your computer.
  • Don’t over-allocate RAM to FRED!  If you allocate too much RAM, your system may become very sluggish or unstable.  In this condition, Windows handles the data swapping rather than FRED and is generally undesirable.
  • FRED doesn’t store an infinite number of rays in RAM.  As of version 16.112, a maximum of 1 billion rays can be stored in RAM at any given time.  The combination of the number of frames in memory and the number of rays per frame needs to be less than or equal to 1 billion. Note for 32bit versions of FRED the limit is 5 million.
  • If you have an SSD that can be used to store the pagefiles, do so.  SSD have much faster read/write speeds than traditional platter drives.
  • When allocating RAM to FRED you have a choice to adjust the number of frames in memory and/or the number of rays per frame.  There is no rule to say which adjustment is better and you may opt to test different configurations on your system.
  • Incoherent rays contain the least amount of information and are therefore more compact than polarized or coherent rays.  The type of rays you are tracing affects how much RAM is allocated for the same number of rays being traced.
Given the above statements regarding the allocation of RAM to FRED, let us look at a particular case.  The Ray Buffer tab of the Preferences dialog is shown below with its default settings.

This copy of FRED is installed on a computer having a total of 8GB RAM.  The C: drive is an SSD.  As shown in the dialog above, FRED will store 20,000 rays in each frame and use 200 frames for a total of 200*20,000 = 4,000,000 rays being stored in RAM at any given moment.  If more than 4M rays are generated during a raytrace, the excess rays will be temporarily stored in pagefiles in the C:\Users\ryani\AppData\Local\ directory.  Furthermore, the 4M rays would consume ~915MB of RAM if they are all incoherent and ~2.9GB of RAM if the rays are all coherent.
Let us now modify the ray buffer preferences to take advantage of the 8GB of RAM available on this computer.  We don’t want FRED to use all 8GB of RAM, since Windows needs a certain amount of RAM to operate by itself (say 2-3GB) and we may want the computer running other applications in addition.  So, let us say that we want FRED to use 5GB of RAM for storing ray data (and assume these are incoherent rays).   Additionally, we will modify the pagefile directory to be some location more accessible than the default location.  While this has no impact on performance in this case, since the C: drive is an SSD, but it does allow put the pagefiles in a directory that is easier for me to find and keep an eye on.

The only other option on this dialog that you may want to change is the “Min free diskspace (in GB)” entry, which by default requires 2GB of free disk space available in the pagefile directory in order to start a raytrace.  Generally speaking, this error isn’t encountered very often.

Still need help? Contact Us Contact Us