neuray API Programmer's Manual

inode_manager.h File Reference

Description

Node manager API.

Code Example

inode_manager.h

‎/***************************************************************************************************
 * Copyright 2024 NVIDIA Corporation. All rights reserved.
 **************************************************************************************************/

#ifndef MI_NEURAYLIB_INODE_MANAGER_H
#define MI_NEURAYLIB_INODE_MANAGER_H

#include <mi/base/interface_declare.h>

namespace mi {

class IString;
class IMap;

namespace neuraylib {



class IWorker_node_descriptor : public
    mi::base::Interface_declare<0x29a6d6a5,0xfaa9,0x48dc,0x87,0xc5,0xee,0xa5,0x83,0x2c,0xe9,0xb3>
{
public:
    virtual const IString* get_address() const = 0;

    virtual bool is_in_cluster() const = 0;

    virtual const IMap* get_properties() const = 0;
};

class ICluster_descriptor : public
    mi::base::Interface_declare<0xf83a075b,0xf3d1,0x46a9,0xb6,0x75,0x91,0x10,0x1c,0xa3,0x5a,0x9f>
{
public:
    virtual const IString* get_multicast_address() const = 0;

    virtual Float64 
               get_timeout() const = 0;

    virtual const IMap* get_properties() const = 0;

    virtual Size 
               get_number_of_worker_nodes() const = 0;

    virtual const IWorker_node_descriptor* get_worker_node( Size index) const = 0;

    virtual const IWorker_node_descriptor* get_head_node() const = 0;

    virtual Size 
               get_number_of_client_nodes() const = 0;
};

class ICluster_property_callback : public
    mi::base::Interface_declare<0x36a1317b,0xfbc1,0x4ef5,0xbf,0x38,0x57,0x1a,0xca,0x6d,0x22,0x9f>
{
public:
    virtual void property_callback(
        const ICluster_descriptor* cluster_descriptor, const char* changed_property_name) = 0;
};

class IWorker_node_property_callback : public
    mi::base::Interface_declare<0x3c14c356,0xde2c,0x4991,0x9a,0x7f,0x50,0x53,0x5d,0x2a,0x9f,0x5a>
{
public:
    virtual void property_callback(
        const IWorker_node_descriptor* worker_descriptor, const char* changed_property_name) = 0;
};

class IClient_node_callback : public
    mi::base::Interface_declare<0x441ca19c,0xa7d7,0x46fa,0x92,0xc3,0x14,0xe0,0x4b,0x66,0x13,0x55>
{
public:
    virtual void membership_callback( const char* address, bool flag) = 0;
};

class IWorker_node_callback : public
    mi::base::Interface_declare<0xd5472198,0xf755,0x4db8,0x82,0x49,0x74,0xf7,0x95,0xb5,0x58,0xee>
{
public:
    virtual void membership_callback( IWorker_node_descriptor* worker_descriptor, bool flag) = 0;
};

class IHead_node_callback : public
    mi::base::Interface_declare<0xf07bba0e,0x249f,0x4c6d,0x97,0x57,0x48,0xa7,0xf8,0xe7,0xe6,0x5a>
{
public:
    virtual void head_node_callback( IWorker_node_descriptor* worker_descriptor) = 0;
};

class INode_manager_cluster;

class IShutdown_node_managers_callback : public
    mi::base::Interface_declare<0x9e876854,0x04a9,0x467f,0x85,0xe9,0xa4,0xb4,0xd1,0x2d,0x28,0x8d>
{
public:
    virtual void shutdown_node_managers_callback() = 0;
};

class IShutdown_cluster_callback : public
    mi::base::Interface_declare<0xadf38762,0x86db,0x4ba9,0x9d,0xde,0x1d,0x13,0xee,0x85,0xa0,0x45>
{
public:
    virtual void shutdown_cluster_callback(const ICluster_descriptor* cluster) = 0;
};

class IWorker_process_started_callback : public
    mi::base::Interface_declare<0x42b4ec43,0x9562,0x42fc,0x8b,0x8d,0xc8,0x55,0x6b,0x5e,0x50,0x3c>
{
public:
    virtual void worker_process_started_callback(IWorker_node_descriptor* worker_descriptor) = 0;
};

class INode_manager_cluster : public
    mi::base::Interface_declare<0x0a58b727,0x0ed4,0x4ecf,0x90,0x9a,0x30,0x7c,0x65,0xd4,0x47,0xe8>
{
public:
    virtual const ICluster_descriptor* get_cluster_descriptor() const = 0;

    enum Cluster_status
    {
        CLUSTER_ESTABLISHED = 0, 
        CLUSTER_SHUTDOWN = 1,    
        CLUSTER_FAILURE = 2,     
        CLUSTER_FORCE_32_BIT = 0xffffffffU
    };

    virtual Cluster_status 
               get_cluster_status() const = 0;

    virtual void set_timeout( Float64 timeout) = 0;

    virtual Sint32 
               set_cluster_property( const char* name, const char* value) = 0;

    virtual Sint32 
               remove_cluster_property( const char* name) = 0;

    virtual Sint32 
               start_worker_program(
        const char* program_name,
        const char* argument_string,
        Uint32 child_process_timeout = 0) = 0;

    virtual Sint32 
               shutdown_worker_program() = 0;

    virtual Sint32 
               restart_worker_program() = 0;

    virtual void shutdown() = 0;

    virtual IWorker_node_descriptor* get_head_node() = 0;

    virtual void add_worker_property_callback( IWorker_node_property_callback* callback) = 0;

    virtual void remove_worker_property_callback( IWorker_node_property_callback* callback) = 0;

    virtual void add_cluster_property_callback( ICluster_property_callback* callback) = 0;

    virtual void remove_cluster_property_callback( ICluster_property_callback* callback) = 0;

    virtual void add_worker_node_callback( IWorker_node_callback* callback) = 0;

    virtual void remove_worker_node_callback( IWorker_node_callback* callback) = 0;

    virtual void add_client_node_callback( IClient_node_callback* callback) = 0;

    virtual void remove_client_node_callback( IClient_node_callback* callback) = 0;

    virtual void add_head_node_callback( IHead_node_callback* callback) = 0;

    virtual void remove_head_node_callback( IHead_node_callback* callback) = 0;

    virtual const IWorker_node_descriptor* grow() = 0;

    virtual Sint32 
               shrink(const IWorker_node_descriptor* remove_node) = 0;
};

mi_static_assert( sizeof( INode_manager_cluster::Cluster_status) == sizeof( Uint32));

class ICluster_filter : public
    mi::base::Interface_declare<0x63a3ced9,0x9ae6,0x4c3a,0x80,0xc2,0x80,0x6b,0x27,0xff,0x40,0xd1>
{
public:
    virtual bool is_eligible( const ICluster_descriptor* cluster_descriptor) = 0;
};

class IWorker_node_filter : public
    mi::base::Interface_declare<0x9af36fa0,0xbe40,0x4fe4,0x89,0x03,0x37,0x7e,0x12,0xaf,0xcb,0xc8>
{
public:
    virtual bool is_eligible( const IWorker_node_descriptor* worker_node_descriptor) = 0;
};

class INode_manager_client : public
    mi::base::Interface_declare<0xe8feacc5,0x1f7c,0x4abc,0x8a,0x23,0x50,0x3c,0x56,0xf4,0xa6,0x63>
{
public:
    virtual Sint32 
               start( const char* listen_address,
                          bool tcp = false,
                          const char* discovery_address = 0,
                          const char* cluster_interface = 0) = 0;

    virtual Sint32 
               shutdown() = 0;

    virtual const IString* get_listen_address() const = 0;

    virtual Sint32 
               set_multicast_base_address( const char* base_address) = 0;

    virtual const IString* get_multicast_base_address() const = 0;

    virtual Size 
               get_number_of_worker_nodes() const = 0;

    virtual const IWorker_node_descriptor* get_worker_node( Size index) const = 0;

    virtual void add_shutdown_node_managers_callback(
        IShutdown_node_managers_callback* callback) = 0;

    virtual void remove_shutdown_node_managers_callback(
        IShutdown_node_managers_callback* callback) = 0;

    virtual void add_shutdown_cluster_callback(
        IShutdown_cluster_callback* callback) = 0;

    virtual void remove_shutdown_cluster_callback(
        IShutdown_cluster_callback* callback) = 0;

    virtual void add_worker_process_started_callback(
        IWorker_process_started_callback* callback) = 0;

    virtual void remove_worker_process_started_callback(
        IWorker_process_started_callback* callback) = 0;

    virtual Sint32 
               shutdown_cluster(
        const ICluster_descriptor* cluster_descriptor) = 0;

    static const Uint32 
               SIGNAL_STARTUP_ONLY = 0xffffffff;

    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,
        bool reusable = false,
        Uint32 child_process_timeout = 0) = 0;

    virtual Size 
               get_number_of_clusters() const = 0;

    virtual const ICluster_descriptor* get_cluster(Size index) const = 0;

    virtual void shutdown_node_managers() = 0;

    virtual void set_head_node_interface( const char* address) = 0;

    virtual const IString* get_head_node_interface() = 0;
};

class IChild_process_resolver : public
    mi::base::Interface_declare<0xbd1ab5cb,0x2794,0x4cd8,0x99,0xa9,0x30,0x36,0x32,0x8a,0xca,0xff>
{
public:
    virtual const IString* resolve_process(
        const char* program_name, const char* program_arguments) = 0;
};

class INode_manager_worker : public
    mi::base::Interface_declare<0xeb232bd5,0x0abf,0x4872,0xab,0x18,0x92,0x49,0x31,0x36,0xf9,0x91>
{
public:
    virtual Sint32 
               start( const char* listen_address = 0,
                          bool tcp = false,
                          const char* discovery_address = 0,
                          const char* cluster_interface = 0) = 0;

    virtual Sint32 
               shutdown() = 0;

    virtual const IString* get_listen_address() const = 0;

    virtual Sint32 
               set_multicast_base_address( const char* base_address) = 0;

    virtual const IString* get_multicast_base_address() const = 0;

    virtual Sint32 
               set_property( const char* name, const char* value) = 0;

    virtual const IString* get_property( const char* name) const = 0;

    virtual Sint32 
               remove_property( const char* name) = 0;

    virtual void set_child_process_resolver( IChild_process_resolver* child_process_resolver) = 0;

    virtual IChild_process_resolver* get_child_process_resolver() const = 0;

    virtual void add_shutdown_node_managers_callback(
        IShutdown_node_managers_callback* callback) = 0;

    virtual void remove_shutdown_node_managers_callback(
        IShutdown_node_managers_callback* callback) = 0;
};

class INode_manager_factory : public
    mi::base::Interface_declare<0xd54aaa9c,0x4798,0x4405,0xa4,0x58,0xd8,0x63,0x44,0xb4,0xb1,0xdd>
{
public:
    virtual INode_manager_client* create_client() = 0;

    virtual INode_manager_worker* create_worker() = 0;
};
 // end group mi_neuray_node_manager

} // namespace neuraylib

} // namespace mi

#endif // MI_NEURAYLIB_INODE_MANAGER_H

Namespaces

namespace 
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH. More...
namespace 
Namespace for the neuray API. More...

Classes

class 
A filter used to decide if a command string to start a child process is eligible for execution. More...
class 
Abstract interface for signaling changed cluster members. More...
class 
This interface describes a cluster and its properties. More...
class 
A filter used to decide whether a cluster is eligible to be joined. More...
class 
Abstract interface for signaling changed cluster properties. More...
class 
Abstract interface for signaling a change of the cluster application head node. More...
class 
The node manager client allows to start or join clusters built from worker nodes. More...
class 
The interface to a cluster created and managed by the node manager. More...
class 
Factory to create node manager client and worker instances. More...
class 
The node manager worker class allows to set properties and announce them to other nodes. More...
class 
Abstract interface for signaling a request to shutdown a cluster. More...
class 
Abstract interface for signaling a request to shutdown all clients and workers. More...
class 
Abstract interface for signaling changed cluster members. More...
class 
This interface describes a worker node and its properties. More...
class 
A filter used to decide whether a worker node is eligible to be included in a cluster. More...
class 
Abstract interface for signaling changed worker node properties. More...
class 
Abstract interface for indicating that a worker process has been fully started. More...