DiCE API nvidia_logo_transpbg.gif Up
mi::neuraylib::IDatabase_configuration Class Referenceabstract

This interface is used to query and change the database configuration. More...

#include <idatabase_configuration.h>

Inheritance diagram for mi::neuraylib::IDatabase_configuration:

Public Member Functions

virtual Sint32 set_memory_limits (Size low_water, Size high_water)=0
 Sets the limits for memory usage of the database. More...
 
virtual void get_memory_limits (Size *low_water, Size *high_water) const =0
 Returns the limits for memory usage of the database. More...
 
virtual Sint32 set_memory_usage_tracking (bool flag)=0
 Configures tracking of memory usage of the database. More...
 
virtual bool get_memory_usage_tracking () const =0
 Indicates whether tracking of memory usage of the database is enabled. More...
 
virtual Sint32 set_disk_swapping (const char *path)=0
 Configures the directory for disk swapping. More...
 
virtual const char * get_disk_swapping () const =0
 Returns the configured directory for disk swapping. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x8f725100, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x8f725100, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

This interface is used to query and change the database configuration.

Member Function Documentation

 get_disk_swapping()

virtual const char * mi::neuraylib::IDatabase_configuration::get_disk_swapping ( ) const
pure virtual

Returns the configured directory for disk swapping.

See also
set_disk_swapping(), set_memory_limits(), get_memory_limits()
mi::neuraylib::IElement::get_offload_to_disk()
Returns
The configured directory, or NULL if disabled.

 get_memory_limits()

virtual void mi::neuraylib::IDatabase_configuration::get_memory_limits ( Size low_water,
Size high_water 
) const
pure virtual

Returns the limits for memory usage of the database.

See also
set_memory_limits(), set_disk_swapping(), get_disk_swapping()
Parameters
[out]low_waterThe current low water mark (in bytes).
[out]high_waterThe current high water mark (in bytes).

 get_memory_usage_tracking()

virtual bool mi::neuraylib::IDatabase_configuration::get_memory_usage_tracking ( ) const
pure virtual

Indicates whether tracking of memory usage of the database is enabled.

See also
set_memory_usage_tracking()

 set_disk_swapping()

virtual Sint32 mi::neuraylib::IDatabase_configuration::set_disk_swapping ( const char *  path)
pure virtual

Configures the directory for disk swapping.

If no directory is configured (the default) disk swapping is disabled.

Note
The configured directory must be used exclusively from one instance of this API component. Sharing the directory between multiple nodes in a network, or between different instances of this API component on the same node (same or different processes) leads to wrong behavior.
See also
get_disk_swapping(), set_memory_limits(), get_memory_limits()
mi::neuraylib::IElement::get_offload_to_disk()
Parameters
pathThe path to the directory to use for disk swapping.
Returns
0, in case of success, -1 in case of failure.

 set_memory_limits()

virtual Sint32 mi::neuraylib::IDatabase_configuration::set_memory_limits ( Size  low_water,
Size  high_water 
)
pure virtual

Sets the limits for memory usage of the database.

The database attempts to keep the total amount of memory used by database elements and jobs below a configurable limit called high water mark. If that limit is exceeded the database takes actions to reduce the memory usage until another limit, the low water mark, is reached (or no further memory reduction is possible). An internal binary format is used which can be read into the database again very fast. This method can be called at any time from any thread but no guarantee can be given if and when the new memory limits will be reached.

Possible actions taken by the database to reduce memory usage are:

  • Discarding results of database jobs.
  • Discarding local copies of elements and jobs that are not required (some copies might be required to meet the configured redundancy level).
  • If disk swapping is enabled, offload database elements to disk.
Note
Memory limits are ignored if memory usage tracking is not enabled (
See also
set_memory_usage_tracking()).
get_memory_limits(), set_disk_swapping(), get_disk_swapping(), mi::neuraylib::INetwork_configuration::set_redundancy_level(), mi::neuraylib::INetwork_configuration::get_redundancy_level()
mi::neuraylib::IElement::get_size(), mi::neuraylib::IJob::get_size()
Parameters
low_waterFlushing stops when memory usage (in bytes) drops below this value.
high_waterFlushing starts when memory usage (in bytes) exceeds this value. The value 0 disables flushing completely.
Returns
0 in case of success, -1 in case of failure (low_water not less than high_water unless high_water equals zero).

 set_memory_usage_tracking()

virtual Sint32 mi::neuraylib::IDatabase_configuration::set_memory_usage_tracking ( bool  flag)
pure virtual

Configures tracking of memory usage of the database.

Tracking the memory usage of the database incurs a small overhead, and is disabled by default. It is only needed if memory limits are enabled (

See also
set_memory_limits()), or for debugging.

This can only be configured before DiCE has been started.

See also
get_memory_usage_tracking()
Parameters
flagtrue to enable, false to disable memory usage tracking.
Returns
0, in case of success, -1 in case of failure.