NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::INode_manager_client Class Referenceabstract

The node manager client allows to start or join Iray clusters built from worker nodes. More...

Inheritance diagram for mi::neuraylib::INode_manager_client:
Inheritance graph
[legend]

Public Member Functions

virtual Sint32  start (const char *listen_address, bool tcp=false, const char *cluster_interface=NULL)=0
  Starts the operation of the node manager. More...
 
virtual Sint32  shutdown ()=0
  Shuts down the operation of the node manager. More...
 
virtual const IString get_listen_address () const =0
  Returns the listen address used by the node manager. More...
 
virtual Sint32  set_multicast_base_address (const char *base_address)=0
  Sets the multicast base address. More...
 
virtual const IString get_multicast_base_address () const =0
  Returns the multicast base address. More...
 
virtual Size  get_number_of_worker_nodes () const =0
  Returns the number of worker nodes currently known to the node manager. More...
 
virtual const
IWorker_node_descriptor
get_worker_node (Size index) const =0
  Returns a descriptor for a worker node currently known to the node manager. More...
 
virtual INode_manager_cluster join_or_create_cluster (Size min_number_of_requested_worker_nodes, Size max_number_of_requested_worker_nodes, ICluster_filter *cluster_filter, IWorker_node_filter *worker_node_filter, const char *program_name, const char *argument_string, Uint32 child_process_timeout=0)=0
  Joins an existing cluster or creates a new one. More...
 
virtual Size  get_number_of_clusters () const =0
  Returns the number of existing clusters. More...
 
virtual const ICluster_descriptor get_cluster (Size index) const =0
  Returns a descriptor for a cluster. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xe8feacc5, 0x1f7c, 0x4abc, 0x8a, 0x23, 0x50, 0x3c, 0x56, 0xf4, 0xa6, 0x63 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xe8feacc5, 0x1f7c, 0x4abc, 0x8a, 0x23, 0x50, 0x3c, 0x56, 0xf4, 0xa6, 0x63 >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

The node manager client allows to start or join Iray clusters built from worker nodes.

It should be used in a process running on a client node.

Member Function Documentation

virtual const ICluster_descriptor* mi::neuraylib::INode_manager_client::get_cluster ( Size  index) const
pure virtual

Returns a descriptor for a cluster.

Note
The set of clusters can change at any time. This function can therefore return NULL even if index is smaller than the result of the last call to get_number_of_clusters().
Parameters
index The index of the cluster (from 0 to get_number_of_clusters()-1).
Returns
The descriptor for the specified cluster, or NULL if index is out of bounds.
virtual const IString* mi::neuraylib::INode_manager_client::get_listen_address ( ) const
pure virtual

Returns the listen address used by the node manager.

Returns
The listen address and port.
virtual const IString* mi::neuraylib::INode_manager_client::get_multicast_base_address ( ) const
pure virtual

Returns the multicast base address.

The node manager reserves a unique multicast address for each cluster that it manages. These multicast addresses start at the multicast base address and are obtained by incrementing the last octet, then the second-last octet, and so on.

Returns
The currently set multicast base address.
See Also
set_multicast_base_address(), mi::neuraylib::ICluster_descriptor::get_multicast_address()
virtual Size mi::neuraylib::INode_manager_client::get_number_of_clusters ( ) const
pure virtual

Returns the number of existing clusters.

virtual Size mi::neuraylib::INode_manager_client::get_number_of_worker_nodes ( ) const
pure virtual

Returns the number of worker nodes currently known to the node manager.

virtual const IWorker_node_descriptor* mi::neuraylib::INode_manager_client::get_worker_node ( Size  index) const
pure virtual

Returns a descriptor for a worker node currently known to the node manager.

Note
The set of worker nodes in the cluster can change at any time. That is, this function can return NULL even if index is smaller than the result of the last call to get_number_of_worker_nodes().
Parameters
index The index of the worker node (from 0 to get_number_of_worker_nodes()-1).
Returns
The descriptor for the specified worker node, or NULL if index is out of bounds.
virtual INode_manager_cluster* mi::neuraylib::INode_manager_client::join_or_create_cluster ( Size  min_number_of_requested_worker_nodes,
Size  max_number_of_requested_worker_nodes,
ICluster_filter cluster_filter,
IWorker_node_filter worker_node_filter,
const char *  program_name,
const char *  argument_string,
Uint32  child_process_timeout = 0 
)
pure virtual

Joins an existing cluster or creates a new one.

This function will do the following:

  • For all existing clusters:
    • Check if the cluster size matches the minimum and maximum number of requested worker nodes.
    • Check if the program name and argument string of the cluster nodes match the values given in program_name and argument_string.
    • Check if calling the cluster_filter callback returns true.
    • If all above conditions are met, the calling node joins the existing cluster as a new client node. An interface describing the existing cluster is returned. The function terminates.
  • If no matching cluster was found, then for all existing worker nodes:
    • Check if worker_node_filter returns true, if yes reserve the worker node. Leave the loop if the number of reserved worker nodes meets the maximum number of requested nodes.
  • If at least the minimum number of requested worker nodes have been reserved, create the cluster, and an interface describing the newly created cluster is returned.
  • Otherwise, the reservation of worker nodes is released, and NULL is returned.

If the flag child_process_watchdog is set to true, the child process started on worker nodes will be under closer scrutiny by the node manager. The node manager will substitute any occurance of the placeholder w in the command line used to start the child process with the string identifier of the named pipe the child process is supposed to write to. The child process may open the pipe for writing and may write PDUs from the watchdog protocol to it. The watchdog is activated, once the first PDU has been written to the pipe. The child process needs to keep writing PDUs in intervals of n seconds from that moment on or the node manager will give up on the child process and will terminate it.

Parameters
min_number_of_requested_worker_nodes The minimum number of worker nodes expected in the cluster.
max_number_of_requested_worker_nodes The maximum number of worker nodes expected in the cluster.
cluster_filter A filter specifying required cluster properties. If NULL, no existing cluster will be joined.
worker_node_filter A filter specifying required worker node properties. If NULL, no cluster will be created.
program_name The name of the program to run on the worker nodes. If NULL, a cluster is created without child processes being forked by the worker nodes.
argument_string Arguments to program_name. The string may include the substring %m which will be replaced by the multicast address of the cluster (use %% to escape percent signs). It may also contain the substring %h which will be expanded into the head node, a node marked within the cluster for applications that need support for it.
child_process_timeout A parameter indicating whether there should be a watchdog controlling the child process on worker nodes. The value specifies the timeout in milliseconds after which the node manager assumes the child process is dead. This parameter only has an effect when creating new clusters.
Returns
An interface to the joined or created cluster, or NULL in case of failure.
virtual Sint32 mi::neuraylib::INode_manager_client::set_multicast_base_address ( const char *  base_address)
pure virtual

Sets the multicast base address.

The node manager reserves a unique multicast address for each cluster that it manages. These multicast addresses start at the multicast base address and are obtained by incrementing the last octet, then the second-last octet, and so on.

Parameters
base_address A multicast address to be used as a base when reserving cluster multicast addresses.
Returns
0 in case of success, -1 otherwise
See Also
get_multicast_base_address(), mi::neuraylib::ICluster_descriptor::get_multicast_address()
virtual Sint32 mi::neuraylib::INode_manager_client::shutdown ( )
pure virtual

Shuts down the operation of the node manager.

Returns
0 in case of success, -1 otherwise.
virtual Sint32 mi::neuraylib::INode_manager_client::start ( const char *  listen_address,
bool  tcp = false,
const char *  cluster_interface = NULL 
)
pure virtual

Starts the operation of the node manager.

Parameters
listen_address The address used to communicate with other node manager instances. Should be a multicast address unless TCP networking is selected. In case of TCP networking, if the address is the local IP address, the host will become the head node which is used to discover the other hosts.
tcp Indicates whether TCP or UDP should be used.
cluster_interface The address of the cluster interface for listening.
Returns
0 in case of success, -1 otherwise