The GoldSim Distributed Processing (DP) Module is an extension to GoldSim which allows the use of multiple computers connected over a network, or multiple cores on a single computer, to share the computational burden of a single Monte Carlo simulation (i.e. a simulation with multiple realizations). Distributed processing is accomplished by having a Controller GoldSim executable connect to a number of Client GoldSim executables. Each Client executable runs as a separate process to complete one or more realizations in a Monte Carlo simulation. The Client processes can be on a single computer or on multiple computers which are connected via a network.
Client Process Working Folder
When a distributed processing simulation is started, the first thing that the Controller does is to transfer the model file (and any other required files, such as spreadsheets referenced by Spreadsheet elements, DLLs referenced by External elements, and all File elements) to each of the Client processes. The required files are copied to a working folder on the machine hosting the Client process. Each Client process requires its own working folder even if there are multiple Client processes running on the same physical (or virtual) machine.
A default location is built into GoldSim for the Client working folder. The location of the working folder varies with the operating system (i.e. Windows NT has a different location from Windows 8.1). The best way to access the root of the Client working folder is to use a variable provided by the operating system (enter these directly into the address bar for Windows Explorer):
- Windows 7 and Windows 8: %ALLUSERSPROFILE%\GTG
For Windows 7 and Windows 8, the system variable %ALLUSERSPROFILE% corresponds to the path C:\ProgramData.
By default, there will be a working folder, within the default location, called "Clientiiii", where iiii is the port number for a particular Client. If you run multiple Client processes on a single system, each Client will have both its own port number and its own working folder which is designated by port number. An index file (index.gst) is generated by GoldSim inside each working folder. This file stores information about any auxiliary files that have been saved in the folder.
While a distributed processing simulation is running, each Client sends results back to the Controller when realizations currently assigned to the Client are completed. The realization results for each Client are stored in temporary result files in the Client sub-directory of the working folder. Temporary results in the Client sub-directory are stored in the same place as the model file. One result file is created for each realization (or set of realizations), and named ModelFilename-RealX.gsr, where ModelFilename is the name of the model file, and X is the realization number (if a set of multiple realizations are saved, the filename becomes ModelFilename-RealX-Y.gsr, where X is the first realization in the set and Y is the last realization in the set). By default, these files are deleted when the Controller assembles all of the results into the model file.
Changing the Working Folder Location for a Client Process
GoldSim, like all other Windows programs, has registry (Windows Registry) settings which the software creates and controls. One of these settings is the location for the Client process working folder. The Client working folder location can be controlled by creating (or modifying) the appropriate registry key, called GoldSimDataFolder. The location of the appropriate registry key within the registry is determined by the user account which starts or runs the Client process.
Starting a Client process results in the Client running as a different user which means that a different registry key needs to be set in order to change the Client working directory for each method of starting, or spawning, a Client process. Start a client from either the Windows Run Menu or a command prompt (see this page of our documentation). The Client process is run under the user name/user credentials of the user that started the Client process.
Additionally, the GoldSim Player executable and the GoldSim executable can be used to generate Client processes. Each executable also has a different registry key location. Consequently, the executable used to start the Client process and the Client process owner both impact the registry key location for modifying the Client working directory. The registry key locations for specifying a custom Client working directory are listed in Table 1 by process owner and executable.
GoldSim Executable | Process Owner | Registry Key Location |
---|---|---|
GSPlayer.exe | SYSTEM (LSA) | HKEY_USERS\S-1-5-18\Software\GTG\GSPlayer \DistributedProcessing\GoldSimDataFolder |
GoldSim.exe | SYSTEM (LSA) | HKEY_USERS\S-1-5-18\Software\GTG\GoldSim \DistributedProcessing\GoldSimDataFolder |
GSPlayer.exe -s | Current User | HKEY_CURRENT_USER\Software\GTG\GSPlayer \DistributedProcessing\GoldSimDataFolder |
GoldSim.exe -s | Current User | HKEY_CURRENT_USER\Software\GTG\GoldSim \DistributedProcessing\GoldSimDataFolder |
Some Registry Basics
The Windows Registry is the Windows PC’s master database of preference settings. The registry keeps track of every installed program, added peripheral device, user account created, networking configuration, and pretty much everything else that happens in the Windows OS. The registry is therefore an extremely important part of the PC which is why Windows marks most of the registry files as hidden and non-deleteable and why Windows makes a backup copy of the registry every time the PC is shut down.
Windows comes with a built-in tool for editing the registry called Regedit (Regedit.exe). Regedit is only accessible by searching for it or by calling it directly by name because of concerns related to the incorrect editing of the registry. Given the importance of the registry to the general functioning of the Windows operating system, incorrect changes to the registry can have drastic consequences.
According to Microsoft, the “Registry Editor {Regedit} is a tool intended for advanced users. It's used to view and change settings in the system registry, which contains information about how your computer runs. Windows refers to this information and updates it when you make changes to your computer, such as installing a new program, creating a user profile, or adding new hardware. Registry Editor lets you view registry folders, files, and the settings for each registry file.
Ordinarily, you don't need to make changes to the registry. The registry contains complex system information that's vital to your computer, and an incorrect change to your computer's registry could render your computer inoperable. However, a corrupt registry file might require changes. We strongly recommended that you back up the registry before making any changes and that you only change values in the registry that you understand or have been instructed to change.”
The registry is organized under five root keys which look and act like folders when using Regedit. These root keys are:
- HKEY_CLASSES_ROOT
- HKEY_CURRENT_USER
- HKEY_LOCAL_MACHINE
- HKEY_USERS
- HKEY_CURRENT_CONFIG
Underneath these root keys are a vast number of inner keys or folders which contain the actual settings information which comprises the Windows Registry. The main point here is that care should be taken when editing the Windows Registry. It is preferable to have your system administrator make any desired changes to the registry.
Steps to Modify the Client Working Folder Registry Key
The GoldSimDataFolder registry key does not exist by default. If a custom Client working directory is desired, this registry key will need to be created. Once the key is created, GoldSim will read the key value each time a Client is started. The key that needs to be created and the location for the key are provided in Table 1. Also from Table 1 note that the SYSTEM user designation is typically “S-1-5-18” and that the registry keys for the SYSTEM account will be need to be modified to customize the Client working directory for Clients.
To create the desired GoldSimDataFolder registry key:
- Always backup the Registry before editing. Instructions for Registry backup and restore can be obtained from Microsoft KB 322756.
- Start Regedit.exe. Windows Key + R to get the Run Dialog and enter “Regedit.exe” and hit OK.
Figure 1: Regedit warning
- Navigate to the appropriate “DistributedProcessing” key based on user and executable from Table 1. If the “DistributedProcessing” key does not exist, have GoldSim create it by launching a Client with the desired user and executable characteristics. Do not attempt to create the higher level category keys using Regedit.
- Right-click on “DistributedProcessing” and Select New -> String Value.
Figure 2: Create new registry key - select "String Value"
- Rename the newly created key to GoldSimDataFolder.
- Right click on the GoldSimDataFolder key and select Modify. Enter the desired folder location.
Figure 3: Modify registry key string value
References
Microsoft. (2014). What is Registry Editor? Retrieved from Windows: http://windows.microsoft.com/en-us/windows/what-is-registry-editor#1TC=windows-7
Comments
0 comments
Please sign in to leave a comment.