7#ifndef MI_NEURAYLIB_DICE_H
8#define MI_NEURAYLIB_DICE_H
38#define MI_NEURAYLIB_DICE_VERSION_MAJOR 3
41#define MI_NEURAYLIB_DICE_VERSION_MINOR 0
46#define MI_NEURAYLIB_DICE_VERSION_QUALIFIER ""
49#define MI_NEURAYLIB_DICE_VERSION_QUALIFIER_EMPTY
52#define MI_NEURAYLIB_DICE_PRODUCT_VERSION_STRING "2023"
60class IDistributed_cache;
62class IExecution_listener;
64class IGpu_description;
66class IJob_execution_context;
81 mi::base::Interface_declare<0xfccbf7b8,0x30d1,0x4fbf,0xbd,0xc6,0x3b,0x96,0xe1,0xfb,0x40,0x6a>
209 mi::base::Interface_declare<0xb8290f90,0x3692,0x4bb9,0x87,0x22,0x45,0x4a,0xd6,0xf1,0x1f,0xf5>
271 mi::base::Interface_declare<0x1885cbec,0x3cfc,0x4f9d,0xb2,0xe9,0xb2,0xbe,0xdc,0xc8,0x94,0x88>
350 const char* name = 0,
392 const char* name = 0,
406 const char* name = 0,
420 const char* name = 0,
458 if ( !ptr_iinterface)
460 const T* ptr_T =
static_cast<const T*
>( ptr_iinterface->
get_interface(
typename T::IID()));
500 if ( !ptr_iinterface)
502 T* ptr_T =
static_cast<T*
>( ptr_iinterface->
get_interface(
typename T::IID()));
613 const char* time_stamp)
const = 0;
753 mi::base::Interface_declare<0xd0754018,0xca8f,0x48e0,0x8a,0x37,0xeb,0x83,0x31,0xb7,0x85,0x20>
835 mi::base::Interface_declare<0x3f377a88,0xb7aa,0x487b,0x98,0xe6,0x70,0x53,0xc2,0xfa,0xb9,0xc9,
836 neuraylib::ISerializable>
955 mi::base::Interface_declare<0x0edda67e,0x8e93,0x4d41,0xa8,0xdb,0x58,0x5d,0x08,0xfd,0xb1,0xde,
956 neuraylib::ISerializable>
1059 mi::base::Interface_declare<0x5700dbde,0xbe1d,0x4c07,0xa7,0x0d,0xf4,0x11,0x7e,0x9f,0x73,0xf1>
1094 mi::base::Interface_declare<0x037f3783,0x187c,0x4bb7,0x92,0x50,0x6d,0xfe,0x1c,0x81,0x89,0xef,
1095 neuraylib::ISerializable>
1390 SCHEDULING_MODE_FORCE_32_BIT = 0xffffffffU
1465 typedef Base<id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,I> Self;
1468 typedef base::Uuid_t<id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11> IID;
1479 return I::compare_iid( iid);
1494 if( interface_id ==
IID()) {
1495 const Self* self =
static_cast<const Self*
>(
this);
1499 return I::get_interface_static(
this, interface_id);
1514 if( interface_id ==
IID()) {
1515 Self* self =
static_cast<Self*
>(
this);
1519 return I::get_interface_static(
this, interface_id);
1540 ,
class I = IElement>
1541class Element :
public Base<id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,I>
1574 if(( count == 2) && m_pointer) {
1589 m_pointer = pointer;
1617 return sizeof( *this);
1652class Job :
public Base<id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,I>
1658 return sizeof( *this);
1686 ,
class I = IFragmented_job>
1687class Fragmented_job :
public Base<id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,I>
1745 (void) deserializer;
1755 (void) rdma_context;
1772 (void) rdma_context;
1799 (void) deserializer;
Handle class template for interfaces, automatizing the lifetime control via reference counting.
Definition: handle.h:113
The basic extensible interface.
Definition: iinterface.h:103
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Mixin class template for deriving interface implementations.
Definition: interface_implement.h:41
Utility class to acquire a lock that is released by the destructor.
Definition: lock.h:61
Non-recursive lock class.
Definition: lock.h:49
Class template for a compile-time representation of universally unique identifiers (UUIDs or GUIDs).
Definition: uuid.h:122
This mixin class can be used to implement the mi::base::IInterface interface.
Definition: dice.h:1462
virtual base::IInterface * get_interface(const base::Uuid &interface_id)
Acquires a mutable interface.
Definition: dice.h:1512
virtual const base::IInterface * get_interface(const base::Uuid &interface_id) const
Acquires a const interface.
Definition: dice.h:1492
static bool compare_iid(const base::Uuid &iid)
Compares the interface ID iid against the interface ID of this interface and its ancestors.
Definition: dice.h:1475
virtual base::Uuid get_class_id() const
Returns the class ID corresponding to the template parameters of this mixin class.
Definition: dice.h:1525
Base< id1, ... > Self
Own type.
Definition: dice.h:1465
base::Uuid_t< id1, ... > IID
Declares the interface ID.
Definition: dice.h:1468
This mixin class can be used to implement the mi::neuraylib::IElement interface.
Definition: dice.h:1542
virtual bool get_send_to_all_nodes() const
By default, multicast distribution for database elements is enabled.
Definition: dice.h:1621
Element()
Default constructor.
Definition: dice.h:1545
virtual bool get_offload_to_disk() const
By default, offloading to disk is disabled.
Definition: dice.h:1627
Element & operator=(const Element &other)
Assignment operator.
Definition: dice.h:1551
~Element()
Destructor.
Definition: dice.h:1557
virtual void get_references(ITag_set *result) const
Empty body, i.e., leaves result unaltered.
Definition: dice.h:1608
Element(const Element &)
Copy constructor.
Definition: dice.h:1548
virtual Size get_size() const
Assumes that the size of the database element is given by sizeof.
Definition: dice.h:1615
virtual Uint32 release() const
Decrements the reference count.
Definition: dice.h:1565
This mixin class can be used to implement the mi::neuraylib::IFragmented_job interface.
Definition: dice.h:1688
virtual void receive_remote_result(IDeserializer *deserializer, IDice_transaction *transaction, Size index, Size count)
Empty body. Not used since get_scheduling_mode() requests local execution.
Definition: dice.h:1738
virtual Float32 get_gpu_load() const
Returns 0.0.
Definition: dice.h:1700
virtual IRDMA_buffer * get_rdma_result_buffer(IRDMA_context *rdma_context, Size index)
Empty body. Not used since get_scheduling_mode() requests local execution.
Definition: dice.h:1752
virtual bool get_allow_non_sequential_chunks() const
Returns false.
Definition: dice.h:1709
virtual void cancel()
Empty body, i.e., canceling is not supported.
Definition: dice.h:1803
virtual Size get_thread_limit() const
Returns 0.
Definition: dice.h:1706
virtual IRDMA_buffer * execute_fragment_remote_rdma(IDice_transaction *transaction, Size index, Size count, IRDMA_context *rdma_context, const IJob_execution_context *context)
Empty body. Not used since get_scheduling_mode() requests local execution.
Definition: dice.h:1761
virtual void deserialize(IDeserializer *deserializer)
Empty body, i.e., no member data is deserialized.
Definition: dice.h:1796
virtual Sint8 get_priority() const
Returns 0.
Definition: dice.h:1703
virtual void execute_fragment_remote(ISerializer *serializer, IDice_transaction *transaction, Size index, Size count, const IJob_execution_context *context)
Empty body. Not used since get_scheduling_mode() requests local execution.
Definition: dice.h:1722
virtual void receive_remote_result_rdma(IRDMA_buffer *buffer, IDice_transaction *transaction, Size index, Size count)
Empty body. Not used since get_scheduling_mode() requests local execution.
Definition: dice.h:1778
virtual IFragmented_job::Scheduling_mode get_scheduling_mode() const
Returns mi::neuraylib::IFragmented_job::LOCAL.
Definition: dice.h:1691
virtual void assign_fragments_to_hosts(Uint32 *slots, Size nr_slots)
Empty body, i.e., leaves slots unaltered.
Definition: dice.h:1712
virtual Float32 get_cpu_load() const
Returns 1.0.
Definition: dice.h:1697
virtual void serialize(ISerializer *serializer) const
Empty body, i.e., no member data is serialized.
Definition: dice.h:1789
Source for deserializing objects from byte streams.
Definition: ideserializer.h:35
This interface allows configuration of DiCE.
Definition: dice.h:82
virtual bool register_serializable_class(base::Uuid class_id, IUser_class_factory *factory)=0
Registers a serializable class with DiCE.
virtual bool get_gpu_enabled() const =0
Returns if GPU detection is enabled.
virtual bool unregister_serializable_class(base::Uuid class_id)=0
Unregisters a serializable class with DiCE.
virtual Uint32 get_highest_gpu_id(Uint32 host_id=0)=0
Returns the highest GPU ID.
virtual const IGpu_description * get_gpu_description(Uint32 gpu_id, Uint32 host_id=0)=0
Returns the description of a GPU with a given ID.
bool register_serializable_class()
Registers a serializable class with DiCE.
Definition: dice.h:119
bool unregister_serializable_class()
Unregisters a serializable class with DiCE.
Definition: dice.h:146
virtual Sint32 set_gpu_enabled(bool value)=0
Enables or disables GPU detection.
virtual IRDMA_context * get_rdma_context(Uint32 host_id)=0
Returns the RDMA context to be used for generating RDMA buffers.
A transaction provides a consistent view on the database.
Definition: dice.h:272
const T * access(Tag_struct tag)
Retrieves an element from the database.
Definition: dice.h:455
virtual const char * get_id() const =0
Returns the ID of this transaction.
virtual Tag_struct store_for_reference_counting(IElement *element, Tag_struct tag=NULL_TAG, const char *name=0, Privacy_level privacy_level=LOCAL_SCOPE)=0
Stores a new database element in the database (for reference counting).
virtual Tag_struct name_to_tag(const char *name)=0
Returns the tag associated with a name in the database.
virtual base::IInterface * edit(Tag_struct tag)=0
Retrieves an element from the database and returns it ready for editing.
virtual const base::IInterface * access(Tag_struct tag)=0
Retrieves an element from the database.
virtual bool is_open()=0
Indicates whether the transaction is open.
T * edit(Tag_struct tag)
Retrieves an element from the database and returns it ready for editing.
Definition: dice.h:497
virtual Tag_struct store(IElement *element, Tag_struct tag=NULL_TAG, const char *name=0, Privacy_level privacy_level=LOCAL_SCOPE)=0
Stores a new database element in the database.
virtual void advise(Tag_struct tag)=0
Advises the database that a given tag is required soon.
virtual IScope * get_scope() const =0
Returns the scope of this transaction.
virtual Sint32 remove(Tag_struct tag, bool only_localized=false)=0
Marks a tag for removal from the database.
virtual void invalidate_job_results(Tag_struct tag)=0
Invalidates the results of a database job.
static const mi::Uint8 LOCAL_SCOPE
Symbolic privacy level for the privacy level of the scope of this transaction.
Definition: dice.h:307
virtual Sint32 commit()=0
Commits the transaction.
virtual const char * tag_to_name(Tag_struct tag)=0
Returns the name associated with a tag in the database.
virtual Sint32 execute_fragmented(IFragmented_job *job, Size count)=0
Executes a fragmented job synchronously.
virtual Tag_struct reserve_tag()=0
Reserves a tag.
virtual bool has_changed_since_time_stamp(Tag_struct tag, const char *time_stamp) const =0
Checks whether an element has been stored or changed in the database since a given time stamp.
virtual Tag_struct store_for_reference_counting(IJob *job, Tag_struct tag=NULL_TAG, const char *name=0, Privacy_level privacy_level=LOCAL_SCOPE)=0
Stores a new database job in the database (for reference counting).
virtual const ITag_set * get_changed_elements_since_time_stamp(const char *time_stamp) const =0
Returns all elements (of type mi::neuraylib::IElement) that have been stored or changed in the databa...
virtual Sint32 execute_fragmented_async(IFragmented_job *job, Size count, IExecution_listener *listener)=0
Executes a fragmented job asynchronously.
virtual Tag_struct store(IJob *job, Tag_struct tag=NULL_TAG, const char *name=0, Privacy_level privacy_level=LOCAL_SCOPE)=0
Stores a new database job in the database.
virtual const char * get_time_stamp() const =0
Returns the time stamp describing the current "time".
virtual Sint32 get_privacy_level(Tag_struct tag) const =0
Returns the privacy level of the element with a given tag.
virtual Sint32 localize(Tag_struct tag, Privacy_level privacy_level)=0
Localizes a tag to the given privacy level.
virtual const char * get_time_stamp(Tag_struct tag) const =0
Returns the time stamp of the last change of a database element.
virtual void abort()=0
Aborts the transaction.
This interface represents the abstract base class for all database elements.
Definition: dice.h:837
virtual IElement * copy() const =0
Creates a copy of the database element.
virtual bool get_send_to_all_nodes() const =0
Indicates how the database element should be distributed in the cluster.
virtual Size get_size() const =0
Returns the size of the database element in bytes.
virtual void get_references(ITag_set *result) const =0
Returns the set of referenced tags for reference counting.
virtual bool get_offload_to_disk() const =0
Indicates how the database element is handled when received via the network without being explicitly ...
virtual const char * get_class_name() const =0
Returns a human readable identifier for the class this database element belongs to.
A callback interface used for asynchronous execution of fragmented jobs.
Definition: dice.h:1060
virtual void job_finished()=0
Called when the execution of the job has been finished.
This interface represents the base class for all fragmented jobs.
Definition: dice.h:1096
virtual void assign_fragments_to_hosts(Uint32 *slots, Size nr_slots)=0
Static assignment of fragments to hosts in the cluster.
virtual void execute_fragment_remote(ISerializer *serializer, IDice_transaction *transaction, Size index, Size count, const IJob_execution_context *context)=0
Executes one of many fragments of the fragmented job on a remote host.
virtual void deserialize(IDeserializer *deserializer)=0
Deserializes the fragmented job to enable remote job execution of fragments.
virtual IRDMA_buffer * execute_fragment_remote_rdma(IDice_transaction *transaction, Size index, Size count, IRDMA_context *rdma_context, const IJob_execution_context *context)=0
Executes one of many fragments of the fragmented job on a remote host (RDMA variant).
virtual void cancel()=0
Cancels the execution of not yet completed jobs.
virtual void receive_remote_result_rdma(IRDMA_buffer *buffer, IDice_transaction *transaction, Size index, Size count)=0
Receives the result generated by the remote execution of a fragment (RDMA variant).
virtual void receive_remote_result(IDeserializer *deserializer, IDice_transaction *transaction, Size index, Size count)=0
Receives the result generated by the remote execution of a fragment.
virtual Size get_thread_limit() const =0
Returns the maximum number of threads that should be used to execute the fragments of this job.
virtual Scheduling_mode get_scheduling_mode() const =0
Returns the scheduling mode.
Scheduling_mode
Constants for possible scheduling modes.
Definition: dice.h:1364
@ USER_DEFINED
The job implements an explicit assignment of fragments to hosts and must implement the assign_fragmen...
Definition: dice.h:1389
@ ONCE_PER_HOST
At most one fragment will be done per remote host.
Definition: dice.h:1384
@ LOCAL
All fragments will be done on the local host.
Definition: dice.h:1368
@ CLUSTER
The fragments will be spread across all hosts in the cluster.
Definition: dice.h:1375
virtual Float32 get_gpu_load() const =0
Returns the GPU load per fragment of the fragmented job.
virtual IRDMA_buffer * get_rdma_result_buffer(IRDMA_context *rdma_context, Size index)=0
Returns an RDMA buffer to be used for the result of the fragment.
virtual bool get_allow_non_sequential_chunks() const =0
Indicates whether chunks can be delivered out of order.
virtual void execute_fragment(IDice_transaction *transaction, Size index, Size count, const IJob_execution_context *context)=0
Executes one of many fragments of the fragmented job on the local host.
virtual Float32 get_cpu_load() const =0
Returns the CPU load per fragment of the fragmented job.
virtual void serialize(ISerializer *serializer) const =0
Serializes the fragmented job to enable remote job execution of fragments.
virtual Sint8 get_priority() const =0
Returns the priority of the job.
This interface describes a GPU.
Definition: igpu_description.h:27
Provides information about the context in which a job is executed.
Definition: iserializer.h:291
This interface represents the base class for all database jobs.
Definition: dice.h:957
virtual Float32 get_gpu_load() const =0
Returns the GPU load of the database job.
virtual Float32 get_cpu_load() const =0
Returns the CPU load of the database job.
virtual bool is_local_only() const =0
Indicates whether the database job shall be executed on the local host only.
virtual const char * get_class_name() const =0
Returns a human readable identifier for the class this database job belongs to.
virtual Size get_size() const =0
Returns the size of the database job in bytes.
virtual bool is_shared() const =0
Indicates whether the database job is shared between transactions.
virtual bool is_parent() const =0
Indicates whether the database job creates and stores database elements and/or database jobs.
virtual IJob * copy() const =0
Creates a copy of the database job.
virtual IElement * execute(IDice_transaction *transaction) const =0
Executes the database job and returns the resulting database element.
An RDMA buffer represents a piece of pinned memory which can be used to transfer data over RDMA.
Definition: irdma_context.h:52
The RDMA context works as a cache for RDMA buffers.
Definition: irdma_context.h:121
The scheduler allows to execute fragmented jobs.
Definition: dice.h:754
virtual Sint32 execute_fragmented(IFragmented_job *job, Size count)=0
Executes a fragmented job synchronously (without transaction).
virtual Sint32 execute_fragmented_async(IFragmented_job *job, Size count, IExecution_listener *listener)=0
Executes a fragmented job asynchronously (without transaction).
virtual void resume_current_job()=0
Notifies the scheduler that this worker thread resumes job execution (because it waited for some even...
virtual void suspend_current_job()=0
Notifies the scheduler that this thread suspends jobs execution (because it is going to wait for some...
virtual void yield()=0
Notifies the thread pool that this worker thread is willing to give up its resources for a while in f...
A scope is the context which determines the visibility of database elements.
Definition: iscope.h:48
Target for serializing objects to byte streams.
Definition: iserializer.h:171
Used to store a set of tags.
Definition: dice.h:210
virtual Tag_struct get_tag(Size index) const =0
Returns the index -th element of the tag set.
virtual void add_tag(Tag_struct tag)=0
Adds tag to the tag set.
virtual Size get_length() const =0
Returns the number of elements in the tag set.
Abstract interface for user class factories.
Definition: iuser_class_factory.h:31
This mixin class can be used to implement the mi::neuraylib::IJob interface.
Definition: dice.h:1653
virtual bool is_local_only() const
Returns false.
Definition: dice.h:1662
virtual bool is_shared() const
Returns false.
Definition: dice.h:1665
virtual bool is_parent() const
Returns false.
Definition: dice.h:1668
virtual Size get_size() const
Assumes that the size of the database job is given by sizeof.
Definition: dice.h:1656
virtual Float32 get_cpu_load() const
Returns 1.0.
Definition: dice.h:1671
virtual Float32 get_gpu_load() const
Returns 0.0.
Definition: dice.h:1674
This mixin class provides a default implementation of the IUser_class_factory interface.
Definition: iuser_class_factory.h:66
#define mi_base_assert(expr)
Base API assertion macro (without message).
Definition: assert.h:94
#define mi_static_assert(expr)
Compile time assertion that raises a compilation error if the constant expression expr evaluates to f...
Definition: assert.h:65
virtual const IInterface * get_interface(const Uuid &interface_id) const =0
Acquires a const interface from another.
virtual Uint32 release() const
Decrements the reference count.
Definition: interface_implement.h:103
virtual Uint32 retain() const =0
Increments the reference count.
const T * get_interface() const
Acquires a const interface from another.
Definition: iinterface.h:169
Interface_implement<I> & operator=(const Interface_implement<I> &other)
Assignment operator.
Definition: interface_implement.h:66
Interface * get() const
Access to the interface. Returns 0 for an invalid interface.
Definition: handle.h:294
virtual Uint32 release() const =0
Decrements the reference count.
virtual Uint32 retain() const
Increments the reference count.
Definition: interface_implement.h:93
void release()
Releases the lock.
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
unsigned char Uint8
8-bit unsigned integer.
Definition: types.h:47
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
signed char Sint8
8-bit signed integer.
Definition: types.h:44
float Float32
32-bit float.
Definition: types.h:51
unsigned short Uint16
16-bit unsigned integer.
Definition: types.h:48
signed int Sint32
32-bit signed integer.
Definition: types.h:46
const Tag NULL_TAG
This value of the tag represents an invalid tag which can not be accessed.
Definition: iserializer.h:128
Uint8 Privacy_level
The privacy level is an unsigned 8 bit integer.
Definition: dice.h:223
Smart-pointer handle class for interfaces, const and non-const version.
Mixin class template for deriving new interface declarations.
Mixin class template for deriving interface implementations.
Serialization of objects to a byte stream.
Abstract interface for factories for user-defined class.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: dice.h:89
A 128 bit representation of a universally unique identifier (UUID or GUID).
Definition: uuid.h:26
A tag represents a unique identifier for database elements in the database.
Definition: iserializer.h:45