Navigation: Scripting Reference Manual > Functions & Subroutines > IPCQueryStatus

 

IPCQueryStatus

 

Contact Us: fredsupport@photonengr.com

 

Description

This function queries each of the active remote nodes in a connections array and reports the status of each to the output window.  Execution of the function is immediate on the remote nodes and optional arguments exist for providing additional detailed information regarding the commands in the remote node's status list, which may be useful for debugging.

 

Output generated by the IPCQueryStatus() function will make use of the terms, Idle, Busy and Active. These terms have the following meaning:

Idle - A node is idle if its command queue is empty and is waiting for commands to be added to its queue

Busy - A node is busy if its IPC command execution queue is not empty or it is performing a distributed computing task at the time of the query

Inactive - A node is inactive if the active flag for a given node in the connections array has been cleared

 

 

Syntax

count = IPCQueryStatus(  connections(), options )

 

 

Parameters

count (Long)

Returned number of remote nodes that were successfully queried.

 

connections() As T_IPCINSTANCE

An array of T_IPCINSTANCE structures, with each structure defining the connection information for a remote node.

 

options As String

This argument is a space delimited string that can use the following options.

"detail"

For each active remote node, print a list of name and current status strings for each of the items in the node's status command list.  In particular, the status values may contain useful information about whether an error condition was encountered during execution of a particular command.

"clean"

For each active remote node, delete the items in the node's command status list which have been marked as "finished".

""

Empty string indicating that only the default information should be printed to the output window.

 

Example

The example below demonstrates how to to load the connections() array with remote node connection information stored in a configuration file and then go through a series of connect, query and reconnect commands before finally terminating the remote FRED instances.

 

Sub Main

 

    EnableTextPrinting(True)

    ClearOutputWindow()

 

    'Use a CSV file to populate the connections array

    Dim nRemoteLoad As Long

    Dim connections() As T_IPCINSTANCE

    Dim configFile As String, configLocation As String

    configLocation = GetDocDir() & "\"

    configFile     = "DCTestBed_Connections.csv"

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

 

    'Connect to the remotes

    Dim nConnect As Long

    nConnect = IPCConnect( connections() )

 

    'Query the status of the connections

    Dim nQuery As Long

    nQuery = IPCQueryStatus( connections(), "detail" )

 

    'Disconnect from the remote nodes and save a snapshot file of the connections array

    Dim nDisconnect As Long

    Dim snapShot As String

    snapShot    = configLocation & "DCTestBed_Reconnect.csv"

    nDisconnect = IPCDisconnect( connections(), snapShot )

 

    'Now reconnect

    Dim nReconnect As Long

    nReconnect = IPCReconnect( connections(), snapShot )

 

    'Query the status again

    nQuery = IPCQueryStatus( connections(), "detail" )

 

    'Terminate the connections

    Dim nTerminate As Long

    nTerminate = IPCTerminate( connections(), "sterilize", "1d" )

 

End Sub

 

The IPC commands generally report information to the output window that may be used as diagnostics.  For the example script shown above, the following output is reported:

[MASTER]IPCLoadConfigFile:  3 of 3 connections read from 'C:\temp\DCTestBed_Connections.csv'                                                            

                                                            

          index          active          speed          host                    status

          1          true          100          computer1          ---

          2          true          100          computer2          ---

          3          true          100          computer3          ---

                                                            

                                                            

[MASTER]IPCConnect:  3 of 3 Remote FRED instances connected and running                                                            

                                                            

          index          host                    result                    message

          1          computer1          connected          ---

          2          computer2          connected          ---

          3          computer3          connected          ---

                                                            

                                                            

[MASTER]IPCQueryStatus:  3 connections queried                                                            

                                                            

          index          host                              message                    

          1          computer1                    idle                    

          2          computer2                    idle                    

          3          computer3                    idle                    

                                                            

          index          host handle                    cmd handle          message

          1          NI_00000012                    HPOL                    check

                                                  PING                    

                                                   IDLE                    idle

          2          NI_00000013                    HPOL                    check

                                                   PING                    

                                                   IDLE                    idle

          3          NI_00000014                    HPOL                    check

                                                   PING                    

                                                   IDLE                    idle

                                                            

                                                            

[MASTER]IPCDisconnect:  3 of 3 Remote FRED instances disconnected but still running                                                            

                                                            

                                                            

[MASTER]IPCReconnect:  3 of 3 Remote FRED instances reconnected                                                            

                                                            

          index          host                    message                    

          1          computer1          reconnected - idle                    

          2          computer2          reconnected - idle                    

          3          computer31          reconnected - idle                    

                                                            

                                                            

[MASTER]IPCQueryStatus:  3 connections queried                                                            

                                                            

          index          host                    message                    

          1          computer1          idle                    

          2          computer2          idle                    

          3          computer3          idle                    

                                                            

          index          host handle                    cmd handle          message

          1          NI_00000015                    HPOL                    check

                                                   PING                    

                                                   IDLE                    idle

          2          NI_00000016                    HPOL                    check

                                                   PING                    

                                                   IDLE                    idle

          3          NI_00000017                    HPOL                    check

                                                   PING                    

                                                   IDLE                    idle

                                                            

                                                            

[MASTER]IPCTerminate:  3 of 3 Remote FRED instance terminations initiated                                                            

                                                            

          index          host                    message                    

          1          computer1          terminate - initiated                    

          2          computer2          terminate - initiated                    

          3          computer3          terminate - initiated                    

 

 

 

See Also

Distributed Computing Script Commands

T_IPCINSTANCE

 

 

 

 

 

Copyright © Photon Engineering, LLC