neuray API Programmer's Manual

mi::neuraylib::INode_manager_worker Class Reference

[Node manager]

Description

The node manager worker class allows to set properties and announce them to other nodes. It also allows a client node to start child processes. It should be used in a process running on the worker nodes.

Public Member Functions

virtual void add_shutdown_node_managers_callback( IShutdown_node_managers_callback* callback) =0
Adds a callback to be called when a request to shutdown all clients and workers is received. More...
virtual IChild_process_resolverget_child_process_resolver() const =0
Returns the child process resolver. More...
virtual const IStringget_listen_address() const =0
Returns the listen address used by the node manager. More...
virtual const IStringget_multicast_base_address() const =0
Returns the multicast base address. More...
virtual const IStringget_property( const char* name) const =0
Returns a property of a worker node. More...
virtual Sint32 remove_property( const char* name) =0
Removes a property of a worker node. More...
virtual void remove_shutdown_node_managers_callback( IShutdown_node_managers_callback* callback) =0
Removes a previously added callback to be called when a request to shutdown all clients and workers is received. More...
virtual void set_child_process_resolver( IChild_process_resolver* child_process_resolver) =0
Sets the child process resolver. More...
virtual Sint32 set_multicast_base_address( const char* base_address) =0
Sets the multicast base address. More...
virtual Sint32 set_property( const char* name, const char* value) =0
Sets a property of a worker node. More...
virtual Sint32 shutdown() =0
Shuts down the operation of the node manager. More...
virtual Sint32 start( const char* listen_address = NULL, bool tcp = false, const char* discovery_address = NULL, const char* cluster_interface = NULL) =0
Starts the operation of the node manager. More...

Member Functions

virtual void mi::​neuraylib::​INode_manager_worker::add_shutdown_node_managers_callback( IShutdown_node_managers_callback* callback) [pure virtual]

Adds a callback to be called when a request to shutdown all clients and workers is received.

See also:

remove_shutdown_node_managers_callback()

Parameters

callback
The callback to be added.
virtual IChild_process_resolver* mi::​neuraylib::​INode_manager_worker::get_child_process_resolver() const [pure virtual]

Returns the child process resolver.

See also:

set_child_process_resolver()

Returns

The child process resolver.

virtual const IString* mi::​neuraylib::​INode_manager_worker::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_worker::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.

See also:

set_multicast_base_address(), mi::neuraylib::ICluster_descriptor::get_multicast_address()

Returns

The currently set multicast base address.

virtual const IString* mi::​neuraylib::​INode_manager_worker::get_property( const char* name) const [pure virtual]

Returns a property of a worker node.

See also:

set_property(), remove_property()

Parameters

name
The name of the property to get.

Returns

A string representing the value of the property, or NULL if there is no property with the given name.

virtual Sint32 mi::​neuraylib::​INode_manager_worker::remove_property( const char* name) [pure virtual]

Removes a property of a worker node. This change will be forwarded immediately to all clients.

See also:

set_property(), get_property()

Parameters

name
The name of the property to remove.

Returns

  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no property with the given name.
virtual void mi::​neuraylib::​INode_manager_worker::remove_shutdown_node_managers_callback( IShutdown_node_managers_callback* callback) [pure virtual]

Removes a previously added callback to be called when a request to shutdown all clients and workers is received.

See also:

add_shutdown_node_managers_callback()

Parameters

callback
The callback to be removed.
virtual void mi::​neuraylib::​INode_manager_worker::set_child_process_resolver( IChild_process_resolver* child_process_resolver) [pure virtual]

Sets the child process resolver.

See also:

get_child_process_resolver()

Parameters

child_process_resolver
The new child process resolver. The value NULL can be used to remove the current child process resolver (which effectively is the same as a child process resolver instance that returns its first argument unchanged).
virtual Sint32 mi::​neuraylib::​INode_manager_worker::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.

See also:

get_multicast_base_address(), mi::neuraylib::ICluster_descriptor::get_multicast_address()

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

virtual Sint32 mi::​neuraylib::​INode_manager_worker::set_property( const char* name, const char* value) [pure virtual]

Sets a property of a worker node. This change will be forwarded immediately to all clients.

See also:

get_property(), remove_property()

Parameters

name
The name of the property.
value
The value to set for the property.

Returns

  • 0: Success.
  • -1: Invalid parameters (NULL pointers).
virtual Sint32 mi::​neuraylib::​INode_manager_worker::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_worker::start( const char* listen_address = NULL, bool tcp = false, const char* discovery_address = NULL, const char* cluster_interface = NULL) [pure virtual]

Starts the operation of the node manager. For the optional cluster_interface parameter, the address can also be specified as a sub net using the CIDR notation a.b.c.d/xx. If there is an interface on the host with an address inside this range the first match will be used. This is useful for example when configuring several hosts. This means that on a host which has the address 192.168.1.1, specifying the address as 192.168.0.0/16:10000 would make the host bind to the 192.168.1.1 address on port 10000.

Parameters

listen_address
The address used to communicate with other node manager instances. Should be a multicast address unless TCP networking is selected.
tcp
Indicates whether TCP or UDP should be used.
discovery_address
The address of the TCP head node used for host discovery. If this is the same as the listen address, the node will be head node.
cluster_interface
The address of the cluster interface for listening.

Returns

0 in case of success, -1 otherwise