DiCE API nvidia_logo_transpbg.gif Up
dice.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_DICE_H
8#define MI_NEURAYLIB_DICE_H
9
10#include <mi/base/handle.h>
11#include <mi/base/lock.h>
16
38#define MI_NEURAYLIB_DICE_VERSION_MAJOR 3
39
41#define MI_NEURAYLIB_DICE_VERSION_MINOR 0
42
46#define MI_NEURAYLIB_DICE_VERSION_QUALIFIER ""
47
48// This macro is defined if #MI_NEURAYLIB_DICE_VERSION_QUALIFIER is the empty string \c "".
49#define MI_NEURAYLIB_DICE_VERSION_QUALIFIER_EMPTY
50
52#define MI_NEURAYLIB_DICE_PRODUCT_VERSION_STRING "2023"
53 // end group mi_neuray_dice
55
56namespace mi {
57
58namespace neuraylib {
59
60class IDistributed_cache;
61class IElement;
62class IExecution_listener;
63class IFragmented_job;
64class IGpu_description;
65class IJob;
66class IJob_execution_context;
67class IScope;
68class ITransaction;
69class IRDMA_buffer;
70class IRDMA_context;
71
80class IDice_configuration : public
81 mi::base::Interface_declare<0xfccbf7b8,0x30d1,0x4fbf,0xbd,0xc6,0x3b,0x96,0xe1,0xfb,0x40,0x6a>
82{
83public:
99 base::Uuid class_id,
100 IUser_class_factory* factory) = 0;
101
118 template <class T>
120 {
122 return register_serializable_class( typename T::IID(), factory.get());
123 }
124
133 virtual bool unregister_serializable_class( base::Uuid class_id) = 0;
134
145 template <class T>
147 {
148 return unregister_serializable_class( typename T::IID());
149 }
150
160 virtual Sint32 set_gpu_enabled( bool value) = 0;
161
165 virtual bool get_gpu_enabled() const = 0;
166
171 virtual IRDMA_context* get_rdma_context( Uint32 host_id) = 0;
172
181 virtual Uint32 get_highest_gpu_id( Uint32 host_id = 0) = 0;
182
197 virtual const IGpu_description* get_gpu_description( Uint32 gpu_id, Uint32 host_id = 0) = 0;
198
199};
200 // end group mi_neuray_configuration
202
208class ITag_set : public
209 mi::base::Interface_declare<0xb8290f90,0x3692,0x4bb9,0x87,0x22,0x45,0x4a,0xd6,0xf1,0x1f,0xf5>
210{
211public:
213 virtual Size get_length() const = 0;
215 virtual Tag_struct get_tag( Size index) const = 0;
217 virtual void add_tag( Tag_struct tag) = 0;
218};
219
224 // end group mi_neuray_dice
226
270class IDice_transaction : public
271 mi::base::Interface_declare<0x1885cbec,0x3cfc,0x4f9d,0xb2,0xe9,0xb2,0xbe,0xdc,0xc8,0x94,0x88>
272{
273public:
283 virtual Sint32 commit() = 0;
284
289 virtual void abort() = 0;
290
299 virtual bool is_open() = 0;
300
307 static const mi::Uint8 LOCAL_SCOPE = 255;
308
348 IElement* element,
349 Tag_struct tag = NULL_TAG,
350 const char* name = 0,
351 Privacy_level privacy_level = LOCAL_SCOPE) = 0;
352
390 IJob* job,
391 Tag_struct tag = NULL_TAG,
392 const char* name = 0,
393 Privacy_level privacy_level = LOCAL_SCOPE) = 0;
394
404 IElement* element,
405 Tag_struct tag = NULL_TAG,
406 const char* name = 0,
407 Privacy_level privacy_level = LOCAL_SCOPE) = 0;
408
418 IJob* job,
419 Tag_struct tag = NULL_TAG,
420 const char* name = 0,
421 Privacy_level privacy_level = LOCAL_SCOPE) = 0;
422
434 virtual const base::IInterface* access( Tag_struct tag) = 0;
435
454 template<class T>
455 const T* access( Tag_struct tag)
456 {
457 const base::IInterface* ptr_iinterface = access( tag);
458 if ( !ptr_iinterface)
459 return 0;
460 const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
461 ptr_iinterface->release();
462 return ptr_T;
463 }
464
476 virtual base::IInterface* edit( Tag_struct tag) = 0;
477
496 template<class T>
498 {
499 base::IInterface* ptr_iinterface = edit( tag);
500 if ( !ptr_iinterface)
501 return 0;
502 T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
503 ptr_iinterface->release();
504 return ptr_T;
505 }
506
522 virtual Sint32 localize( Tag_struct tag, Privacy_level privacy_level) = 0;
523
543 virtual Sint32 remove( Tag_struct tag, bool only_localized = false) = 0;
544
559 virtual const char* get_time_stamp() const = 0;
560
575 virtual const char* get_time_stamp( Tag_struct tag) const = 0;
576
596 virtual bool has_changed_since_time_stamp( Tag_struct tag, const char* time_stamp) const = 0;
597
613 const char* time_stamp) const = 0;
614
621 virtual const char* get_id() const = 0;
622
624 virtual IScope* get_scope() const = 0;
625
632 virtual Sint32 get_privacy_level( Tag_struct tag) const = 0;
633
643 virtual void advise( Tag_struct tag) = 0;
644
652 virtual Tag_struct reserve_tag() = 0;
653
660 virtual const char* tag_to_name( Tag_struct tag) = 0;
661
668 virtual Tag_struct name_to_tag( const char* name) = 0;
669
704
729 IFragmented_job* job, Size count, IExecution_listener* listener) = 0;
730
740 virtual void invalidate_job_results( Tag_struct tag) = 0;
741};
742 // end group mi_neuray_database_access
744
752class IScheduler : public
753 mi::base::Interface_declare<0xd0754018,0xca8f,0x48e0,0x8a,0x37,0xeb,0x83,0x31,0xb7,0x85,0x20>
754{
755public:
766 IFragmented_job* job, Size count) = 0;
767
778 IFragmented_job* job, Size count, IExecution_listener* listener) = 0;
779
805 virtual void suspend_current_job() = 0;
806
816 virtual void resume_current_job() = 0;
817
824 virtual void yield() = 0;
825};
826
834class IElement : public
835 mi::base::Interface_declare<0x3f377a88,0xb7aa,0x487b,0x98,0xe6,0x70,0x53,0xc2,0xfa,0xb9,0xc9,
836 neuraylib::ISerializable>
837{
838public:
839 // Sets the embedded pointer.
840 //
841 // The embedded pointer is used for internal purposes. Users must not use this method.
842 virtual bool set_pointer( const base::IInterface* pointer) = 0;
843
844 // Returns the embedded pointer.
845 //
846 // The embedded pointer is used for internal purposes. Users must not use this method.
847 virtual const base::IInterface* get_pointer() const = 0;
848
857 virtual IElement* copy() const = 0;
858
867 virtual const char* get_class_name() const = 0;
868
877 virtual void get_references( ITag_set* result) const = 0;
878
888 virtual Size get_size() const = 0;
889
899 virtual bool get_send_to_all_nodes() const = 0;
900
915 virtual bool get_offload_to_disk() const = 0;
916};
917
954class IJob : public
955 mi::base::Interface_declare<0x0edda67e,0x8e93,0x4d41,0xa8,0xdb,0x58,0x5d,0x08,0xfd,0xb1,0xde,
956 neuraylib::ISerializable>
957{
958public:
967 virtual IJob* copy() const = 0;
968
977 virtual const char* get_class_name() const = 0;
978
988 virtual Size get_size() const = 0;
989
1003 virtual IElement* execute( IDice_transaction* transaction) const = 0;
1004
1016 virtual bool is_shared() const = 0;
1017
1030 virtual bool is_local_only() const = 0;
1031
1036 virtual bool is_parent() const = 0;
1037
1044 virtual Float32 get_cpu_load() const = 0;
1045
1052 virtual Float32 get_gpu_load() const = 0;
1053};
1054
1059 mi::base::Interface_declare<0x5700dbde,0xbe1d,0x4c07,0xa7,0x0d,0xf4,0x11,0x7e,0x9f,0x73,0xf1>
1060{
1061public:
1063 virtual void job_finished() = 0;
1064};
1065
1093class IFragmented_job : public
1094 mi::base::Interface_declare<0x037f3783,0x187c,0x4bb7,0x92,0x50,0x6d,0xfe,0x1c,0x81,0x89,0xef,
1095 neuraylib::ISerializable>
1096{
1097public:
1120 virtual void execute_fragment(
1121 IDice_transaction* transaction,
1122 Size index,
1123 Size count,
1124 const IJob_execution_context* context) = 0;
1125
1160 ISerializer* serializer,
1161 IDice_transaction* transaction,
1162 Size index,
1163 Size count,
1164 const IJob_execution_context* context) = 0;
1165
1201 IDeserializer* deserializer,
1202 IDice_transaction* transaction,
1203 Size index,
1204 Size count) = 0;
1205
1225 virtual IRDMA_buffer* get_rdma_result_buffer( IRDMA_context* rdma_context, Size index) = 0;
1226
1268 IDice_transaction* transaction,
1269 Size index,
1270 Size count,
1271 IRDMA_context* rdma_context,
1272 const IJob_execution_context* context) = 0;
1273
1306 IRDMA_buffer* buffer,
1307 IDice_transaction* transaction,
1308 Size index,
1309 Size count) = 0;
1310
1319 virtual void serialize( ISerializer* serializer) const = 0;
1320
1329 virtual void deserialize( IDeserializer* deserializer) = 0;
1330
1359 virtual void assign_fragments_to_hosts( Uint32* slots, Size nr_slots) = 0;
1360
1390 SCHEDULING_MODE_FORCE_32_BIT = 0xffffffffU
1391 };
1392
1397
1406 virtual Float32 get_cpu_load() const = 0;
1407
1416 virtual Float32 get_gpu_load() const = 0;
1417
1424 virtual void cancel() = 0;
1425
1431 virtual Sint8 get_priority() const = 0;
1432
1440 virtual Size get_thread_limit() const = 0;
1441
1443 virtual bool get_allow_non_sequential_chunks() const = 0;
1444
1445};
1446
1448
1457template <Uint32 id1, Uint16 id2, Uint16 id3
1458 , Uint8 id4, Uint8 id5, Uint8 id6, Uint8 id7
1459 , Uint8 id8, Uint8 id9, Uint8 id10, Uint8 id11
1460 , class I = base::IInterface>
1462{
1463public:
1466
1469
1475 static bool compare_iid( const base::Uuid& iid)
1476 {
1477 if( iid == IID())
1478 return true;
1479 return I::compare_iid( iid);
1480 }
1481
1492 virtual const base::IInterface* get_interface( const base::Uuid& interface_id) const
1493 {
1494 if( interface_id == IID()) {
1495 const Self* self = static_cast<const Self*>( this);
1496 self->retain();
1497 return self;
1498 }
1499 return I::get_interface_static( this, interface_id);
1500 }
1501
1512 virtual base::IInterface* get_interface( const base::Uuid& interface_id)
1513 {
1514 if( interface_id == IID()) {
1515 Self* self = static_cast<Self*>( this);
1516 self->retain();
1517 return self;
1518 }
1519 return I::get_interface_static( this, interface_id);
1520 }
1521
1523
1525 virtual base::Uuid get_class_id() const
1526 {
1527 return IID();
1528 }
1529};
1530
1537template <Uint32 id1, Uint16 id2, Uint16 id3
1538 , Uint8 id4, Uint8 id5, Uint8 id6, Uint8 id7
1539 , Uint8 id8, Uint8 id9, Uint8 id10, Uint8 id11
1540 , class I = IElement>
1541class Element : public Base<id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,I>
1542{
1543public:
1545 Element() : m_pointer( 0) { }
1546
1548 Element( const Element& /*other*/) : m_pointer( 0) { }
1549
1551 Element& operator=( const Element& other)
1552 {
1554 }
1555
1558 {
1559 mi_base_assert( m_pointer == 0);
1560 }
1561
1562 // Overrides the standard release() implementation.
1563 //
1564 // If the release count drops to 1, and the embedded pointer is set, release it.
1565 virtual Uint32 release() const
1566 {
1567 base::Lock::Block block( &m_pointer_lock);
1570 if( count == 1) {
1571 block.release();
1573 }
1574 if(( count == 2) && m_pointer) {
1575 m_pointer->release();
1576 m_pointer = 0;
1577 }
1579 }
1580
1581 // Sets the embedded pointer.
1582 //
1583 // The embedded pointer is used for internal purposes. Users must not use this method.
1584 virtual bool set_pointer( const base::IInterface* pointer)
1585 {
1586 base::Lock::Block block( &m_pointer_lock);
1587 if( m_pointer)
1588 return false;
1589 m_pointer = pointer;
1590 if( m_pointer)
1591 m_pointer->retain();
1592 return true;
1593 }
1594
1595 // Returns the embedded pointer.
1596 //
1597 // The embedded pointer is used for internal purposes. Users must not use this method.
1598 virtual const base::IInterface* get_pointer() const
1599 {
1600 base::Lock::Block block( &m_pointer_lock);
1601 if( m_pointer)
1602 m_pointer->retain();
1603 return m_pointer;
1604 }
1605
1606
1608 virtual void get_references( ITag_set* result) const
1609 {
1610 // avoid warnings
1611 (void) result;
1612 }
1613
1615 virtual Size get_size() const
1616 {
1617 return sizeof( *this);
1618 }
1619
1621 virtual bool get_send_to_all_nodes() const
1622 {
1623 return true;
1624 }
1625
1627 virtual bool get_offload_to_disk() const
1628 {
1629 return false;
1630 }
1631
1632private:
1633 // The embedded pointer.
1634 //
1635 // The embedded pointer is used for internal purposes. Users must not access the pointer.
1636 mutable const base::IInterface* m_pointer;
1637
1638 // The lock that protects the embedded pointer.
1639 mutable base::Lock m_pointer_lock;
1640};
1641
1648template <Uint32 id1, Uint16 id2, Uint16 id3
1649 , Uint8 id4, Uint8 id5, Uint8 id6, Uint8 id7
1650 , Uint8 id8, Uint8 id9, Uint8 id10, Uint8 id11
1651 , class I = IJob>
1652class Job : public Base<id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,I>
1653{
1654public:
1656 virtual Size get_size() const
1657 {
1658 return sizeof( *this);
1659 }
1660
1662 virtual bool is_local_only() const { return false; }
1663
1665 virtual bool is_shared() const { return false; }
1666
1668 virtual bool is_parent() const { return false; }
1669
1671 virtual Float32 get_cpu_load() const { return 1.0f; }
1672
1674 virtual Float32 get_gpu_load() const { return 0.0f; }
1675};
1676
1683template <Uint32 id1, Uint16 id2, Uint16 id3
1684 , Uint8 id4, Uint8 id5, Uint8 id6, Uint8 id7
1685 , Uint8 id8, Uint8 id9, Uint8 id10, Uint8 id11
1686 , class I = IFragmented_job>
1687class Fragmented_job : public Base<id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11,I>
1688{
1689public:
1692 {
1694 }
1695
1697 virtual Float32 get_cpu_load() const { return 1.0f; }
1698
1700 virtual Float32 get_gpu_load() const { return 0.0f; }
1701
1703 virtual Sint8 get_priority() const { return 0; }
1704
1706 virtual Size get_thread_limit() const { return 0; }
1707
1709 virtual bool get_allow_non_sequential_chunks() const { return false; }
1710
1713 Uint32* slots,
1714 Size nr_slots)
1715 {
1716 // avoid warnings
1717 (void) slots;
1718 (void) nr_slots;
1719 }
1720
1723 ISerializer* serializer,
1724 IDice_transaction* transaction,
1725 Size index,
1726 Size count,
1727 const IJob_execution_context* context)
1728 {
1729 // avoid warnings
1730 (void) serializer;
1731 (void) transaction;
1732 (void) index;
1733 (void) count;
1734 (void) context;
1735 }
1736
1739 IDeserializer* deserializer,
1740 IDice_transaction* transaction,
1741 Size index,
1742 Size count)
1743 {
1744 // avoid warnings
1745 (void) deserializer;
1746 (void) transaction;
1747 (void) index;
1748 (void) count;
1749 }
1750
1753 {
1754 // avoid warnings
1755 (void) rdma_context;
1756 (void) index;
1757 return 0;
1758 }
1759
1762 IDice_transaction* transaction,
1763 Size index,
1764 Size count,
1765 IRDMA_context* rdma_context,
1766 const IJob_execution_context* context)
1767 {
1768 // avoid warnings
1769 (void) transaction;
1770 (void) index;
1771 (void) count;
1772 (void) rdma_context;
1773 (void) context;
1774 return 0;
1775 }
1776
1779 IRDMA_buffer* buffer, IDice_transaction* transaction, Size index, Size count)
1780 {
1781 // avoid warnings
1782 (void) buffer;
1783 (void) transaction;
1784 (void) index;
1785 (void) count;
1786 }
1787
1789 virtual void serialize( ISerializer* serializer) const
1790 {
1791 // avoid warnings
1792 (void) serializer;
1793 }
1794
1796 virtual void deserialize( IDeserializer* deserializer)
1797 {
1798 // avoid warnings
1799 (void) deserializer;
1800 }
1801
1803 virtual void cancel() { }
1804};
1805 // end group mi_neuray_dice
1807
1808} // namespace neuraylib
1809
1810} // namespace mi
1811
1812#endif // MI_NEURAYLIB_DICE_H
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.
Multithreading locks.
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