Print Friendly and PDF

Specifying the Slave Working Directory

Jason -

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 Master GoldSim executable connect to a number of Slave GoldSim executables. Each Slave executable runs as a separate process to complete one or more realizations in a Monte Carlo simulation. The Slave processes can be on a single computer or on multiple computers which are connected via a network.

Slave Process Working Folder

When a distributed processing simulation is started, the first thing that the Master 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 Slave processes. The required files are copied to a working folder on the machine hosting the Slave process. Each Slave process requires its own working folder even if there are multiple Slave processes running on the same physical (or virtual) machine.

A default location is built into GoldSim for the Slave 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 Slave 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 "Slaveiiii", where iiii is the port number for a particular Slave. If you run multiple Slave processes on a single system, each Slave 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 Slave sends results back to the Master when realizations currently assigned to the Slave are completed. The realization results for each Slave are stored in temporary result files in the Slave sub-directory of the working folder. Temporary results in the Slave 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 Master assembles all of the results into the model file.

Changing the Working Folder Location for a Slave 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 Slave process working folder. The Slave 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 Slave process.

There are two different ways to start a Slave executable/process. Each method of starting a Slave process results in the Slave running as a different user which means that a different registry key needs to be set in order to change the Slave working directory for each method of starting, or spawning, a Slave process.

  1. Manually from either the Windows Run Menu or a command prompt (see this Knowledge Base article)
    • In this case, the Slave process is run under the user name/user credentials of the user that started the Slave process.
  2. Automatically with the GoldSim Slave Manager (see this Knowledge Base article).
    • In this case, the Slave process is typically run under the Local System Account (LSA), “SYSTEM”, which is the default owner of processes started by the GoldSim Slave Manager.

Additionally, the GoldSim Player executable and the GoldSim executable can be used to generate Slave processes. Each executable also has a different registry key location. Consequently, the executable used to start the Slave process and the Slave process owner both impact the registry key location for modifying the Slave working directory. The registry key locations for specifying a custom Slave working directory are listed in Table 1 by process owner and executable.

GoldSim ExecutableProcess OwnerRegistry Key Location
Table 1: Registry key locations
AnchorGSPlayer.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 (Pogue, 2010).

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 (Microsoft, 2014).”

The registry is organized under five root keys which look and act like folders when using Regedit. These root keys are:

  1. HKEY_CLASSES_ROOT
  2. HKEY_CURRENT_USER
  3. HKEY_LOCAL_MACHINE
  4. HKEY_USERS
  5. 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 Slave Working Folder Registry Key

The GoldSimDataFolder registry key does not exist by default. If a custom Slave 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 Slave 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 Slave working directory for Slaves spawned by the GoldSim Slave Manager.

To create the desired GoldSimDataFolder registry key:

  1. Always backup the Registry before editing. Instructions for Registry backup and restore can be obtained from Microsoft KB 322756.
  2. Start Regedit.exe. Windows Key + R to get the Run Dialog and enter “Regedit.exe” and hit OK.

 

Figure 1: Regedit warning

 

  1. 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 Slave with the desired user and executable characteristics. Do not attempt to create the higher level category keys using Regedit.
  2. Right-click on “DistributedProcessing” and Select New -> String Value.

 

Figure 2: Create new registry key - select "String Value"

 

  1. Rename the newly created key to GoldSimDataFolder.
  2. 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

Pogue, D. (2010). Windows 7: the missing manual. Sebastopol, CA: O'Reilly.

 

Tags:

  • path
  • DP
  • distributed
  • Processing
  • Slave
  • directory
Have more questions? Submit a request

Comments