The node manager client allows to start or join Iray clusters built from worker nodes.
More...
|
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 bool |
compare_iid (const Uuid &iid) |
|
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
|
|
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.
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.