Navigation: Scripting Reference Manual > Data Structures > T_IPCINSTANCE

 

T_IPCINSTANCE

 

Contact Us: fredsupport@photonengr.com

 

Description

This data structure defines the information used to establish and maintain a communication connection between the master and a single remote in a distributed computing calculation.

 

Definition

Type T_IPCINSTANCE

active_node As Boolean

base_dir As String

fred_exec_and_path As String

host_name As String

instance_name As String

node_handle As String

ray_buf_frame_count As Long

ray_buf_rays_per_frame As Long

speed As Long

startup_method As String

status As String

thread_count As Long

transfer_dir As String

working_dir As String

End Type

 

Members

active_node As Boolean

When True (or "active" in a CSV configuration file), the remote node will be active for IPC commands issued by the master.  When False (or blank in a CSV configuration file), the remote will not be active for IPC commands issued by the master.

 

base_dir As String

Specifies the base directory on the remote machine in the local file system.  When using the FRED Remote Service, a unique working directory for the remote will be created in base_dir.

 

fred_exec_and_path As String

Specifies the local path on the remote machine to the location of the Fred.exe.  For a default installation this will be C:\Program Files\Photon Engineering\FRED XX.XXX.X\Bin, where XX.XXX.X should be replaced with whatever version of FRED you intend to run on the remotes (must be 14.110.1 or newer).

 

host_name As String

Specifies the name of the remote machine as known to the network.  The remote FRED instance will be started on this machine.

 

instance_name As String

NOT INITIALIZED BY THE USER

This is a local handle (name) assigned to the remote instance that is unique for the given remote machine.

 

node_handle As String

NOT INITIALIZED BY THE USER

This is a global handle (name) assigned to the remote instance that is unique across all remotes for the given distributed computation.

 

ray_buf_frame_count As Long

The number of ray buffer frames that should be used by the remote instance.  The product of ray_buf_frame_count and ray_buf_rays_per_frame is the total number of rays that can be stored in RAM at any given time (rays beyond this number will be temporarily written to pagefiles on disk).

 

ray_buf_rays_per_frame As Long

The number of rays per ray buffer frame that should be used by the remote instance.  The product of ray_buf_frame_count and ray_buf_rays_per_frame is the total number of rays that can be stored in RAM at any given time (rays beyond this number will be temporarily written to pagefiles on disk).

 

speed As Long

Specifies the relative speed/capability of the remote instance.  If the speed values of all remotes are summed together and given by SpeedTotal, work units (when used) will be distributed to each remote in proportion to speed/SpeedTotal.  For example, two remotes are configured such that Remote1 has speed=100 and Remote2 has speed=50.  If there are 9 work units defined, Remote1 would receive 6 work units and Remote2 would receive 3 work units.

 

startup_method As String

Specifies the method used to launch the remote FRED instances, using either the FRED Remote Service or MPI.  The startup_method setting of the first T_IPCINSTANCE in the connections() array will be used for all remote instance connections regardless of whether the first T_IPCINSTANCE in the connections() array is active or not.  The startup_method values for the other elements of the connections() array are ignored.

To specify the FRED Remote Service: set startup_method to any value not containing the substring "mpi", or simply leave empty.

To specify MPI: set startup_method to any value containing the substring "mpi" (see comments below)

 

The following special rules apply if the startup method is configured for MPI:

The value of working_dir may be specified for each remote node.

If the value of working_dir is unspecified, the value of base_dir is used in its place

If the substring "mpi" is used in startup_method, the value of startup_method is used exactly as-is by the MPI command line to launch remote FRED instances.  This means that the value of startup_method can contain any optional command line arguments appropriate for your flavor of MPI.

 

status As String

NOT INITIALIZED BY THE USER

Indicates the status of the remote instance.

 

thread_count As Long

Reserved for future use.

 

transfer_dir As String

Directory, as known by its full network path, that will be used to transfer files between master and remote.  The value of transfer_dir may be unique to each remote, common to all remotes, or any combination therein.

 

working_dir As String

When using the FRED Remote Service, this is not specified by the user.  In the case of the FRED Remote Service, the working_directory specification is handled automatically.

When using MPI, this specifies the working directory of the remote instance.

 

Example

The following script uses IPCLoadConfigFile to read the remote node configuration settings into an array called "connections", then loops over the array and reports the settings of each remote connection to the output window.

 

Sub Main

 

    'Read the configuration file

    Dim nRemoteLoad As Long

    Dim connections() As T_IPCINSTANCE

    Dim configFile As String, configLocation As String

    configLocation = GetDocDir() & "\"

    configFile     = "FredRemoteConnections.csv"

    nRemoteLoad    = IPCLoadConfigFile( connections(), configLocation & configFile )

 

    'For each remote, print a listing of its connection information to the output window

    Dim curRemote As Long

    For curRemote = 0 To nRemoteLoad-1

 

        Print ""

        Print "Connection " & curRemote+1

 

        With connections(curRemote)

            Print "Active node: " & Chr(9) & .active_node

            Print "Host name: " & Chr(9) & .host_name

            Print "Base dir: "    & Chr(9) & .base_dir

            Print "Transfer dir: " & Chr(9) & .transfer_dir

            Print "Fred executable path: " & Chr(9) & .fred_exec_and_path

            Print "Ray buf frames : " & Chr(9) & .ray_buf_frame_count

            Print "Rays per frame: " & Chr(9) & .ray_buf_rays_per_frame

            Print "Speed: " & Chr(9) & .speed

            Print "Startup method: " & Chr(9) & .startup_method

            If InStr(.startup_method, "mpi") Then

                Print "Working dir: " & Chr(9) & .working_dir

            End If

        End With

 

    Next

 

End Sub

 

 

See Also

Distributed Computing Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC