Skip to main content
The query interface for the DVS Reader API. An instance of this object can be initially created by calling DVS::CREATE_QUERY_INSTANCE(). A URI must then be added via DVS::IQuery::add_uri(). Then you can either start querying the dataset or you can add filters by chaining queries via DVS::IQuery::filter(). When finished to clean up memory call DVS::IQuery::release(). IMPORTANT: Calling DVS::IQuery::release() destroys all chained queries as well and any object references retrieved from the query from calls such as DVS::IQuery::get_part() The overall intended usage would be something like:
See Cache URIs and Query Stanzas) for more information on cache URIs and queries.

Members

Public functions

Function IQuery

default Return type:

Function ~IQuery

default Return type:

Function IQuery

default Parameters:
  • IQuery &&
Return type:

Function operator=

default Parameters: Return type: IQuery &

Function IQuery

support copying Parameters:
  • const IQuery &
Return type:

Function operator=

default Parameters: Return type: IQuery &

Function release

Release the memory of the query. This will release the memory of the query, any objects returned from it (i.e. parts/plots/variables) and release the memory of any chained queries. Return type: void

Function set_logger

Set the logger object. Set a logger interface for the client to use. This object will have DVS::ILogger::release() invoked on it. If release() is not implemented the memory should be destroyed by the caller after the query is released. Parameters: Parameters: Return type: void

Function add_uri

Add a URI for the reader API to iterate over. This method will only “set” the current URI. In the future we will support multiple URIs queried at once. IMPORTANT: Calling this will invalidate any objects returned from the query and any chained queries. Errors:
  • DVS_NONE: Success
  • DVS_PARAM_NULL: uri passed in was nullptr
  • DVS_QUERY_HAS_CHILDREN: Cannot add a uri to a query which already has children
  • DVS_QUERY_INVALID_URI: URI passed in did not parse, invalid uri
  • DVS_QUERY_INVALID_FILTER: Filter in URI did not parse, invalid filter
Parameters: Returns: dvs_ret DVS_NONE on success, otherwise see method description Parameters:
  • const char * uri
Return type: dvs_ret

Function get_num_servers

Get the num servers object. Get the number of servers the cache in the uri was written with. Errors:
  • DVS_NONE: Success
  • DVS_PARAM_NULL: uri passed in was nullptr
  • DVS_INVALID_CACHE: uri passed in was invalid or cache isn’t accessible
  • DVS_CACHE_MISSING_SERVERS: Cache has a gap in the number of servers, bad cache?
  • DVS_CACHE_EMPTY: No server folders in cache
  • DVS_UNKNOWN: Internal unhandled case
Parameters:
  • uri: URI of a cache. See Cache URIs
  • num_servers: number of servers this cache was written with
Returns: dvs_ret DVS_NONE on success, otherwise see method description Parameters:
  • const char * uri
  • uint32_t & num_servers
Return type: dvs_ret

Function set_server_mod

Set a filter based on the server number and a modulus. Data in DVS is normally splitup between multiple servers. This method lets you setup the parallelism paradigm for reading in the server data. I.E. if the data was written with 4 servers but you want to read it back in with 2 servers you should have one reader use set_server_mod(0, 2) and the other use set_server_mod(1, 2). This will round robin the data so reader “0” will reader the data from 0 and 2 and server “1” will read the data from 1 and 3. To set it so that a server will read only its data set server_mod=0. Use get_num_servers() to determine the number of servers to use Parameters:
  • server_num: the base server number to read from the cache
  • server_mod: the modulus for round-robining server data between queries/readers
Parameters:
  • uint32_t server_num
  • uint32_t server_mod
Return type: void

Function filter

The filter method will allocate a new chained query with the passed in filter appended to it. The filter method allocates a new chained query with the passed in filter appended to it. The current query is not modified. This query however is a chained child of the current query meaning that any changes to the parent will invalidate the objects of the child. IQuery::release() will release any child chained queries created from the it. This lets a user create a top level query, say for a specific dataset name. Then have multiple chained queries that filter for specific parts etc which can be iterated over in parallel. IMPORTANT: Chained queries will have all of their objects destroyed when a parent query changes. Parameters: Returns: DVS::IQuery* a pointer to a newly allocated chained child query Parameters:
  • const char * filter
Return type: DVS::IQuery *

Function get_num_ranks

Get the number of ranks for this filtered query. This call will return all of the unique ranks across all datasets. I.E. if you are loading 2 datasets one with ranks: 0, 1, 2 and one with 0, 1, 2, 3, 4, this will return 5 representing 0,1,2,3,4. Errors:
  • DVS_NONE: Success
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
Parameters: Returns: dvs_ret DVS_NONE on success, otherwise see method description Parameters:
  • uint32_t & num_ranks
Return type: dvs_ret

Function get_ranks

Get the unique ranks for this filtered query. This call will return all of the unique ranks across all datasets. I.E. if you are loading 2 datasets one with ranks: 0, 1, 2 and one with 0, 1, 2, 3, 4, this will return 5 representing 0,1,2,3,4. Errors:
  • DVS_NONE: Success
  • DVS_PARAM_NULL: ranks passed in is nullptr
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
Parameters: Returns: dvs_ret DVS_NONE on success, otherwise see method description Parameters:
  • uint32_t * ranks
Return type: dvs_ret

Function get_num_chunks_per_rank

Get the number of chunks for each rank. This method returns the size of the buffer needed to pass in for get_chunks_per_rank. This will be of the same size as IQuery::get_num_ranks(). This call will return all of the chunk information for every rank returned from IQuery::get_ranks(). Errors:
  • DVS_NONE: Success
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
Parameters: Returns: dvs_ret DVS_NONE on success, otherwise see method description Parameters:
  • uint32_t & num_chunks
Return type: dvs_ret

Function get_chunks_per_rank

Get an array of the number of chunks for every rank for this query. This method will return an array of max number of chunks for every rank. The size of the buffer needed can be retrieved from IQuery::get_num_chunks_per_rank(). These values correspond to the ranks returned from IQuery::get_ranks(). Since there might be multiple datasets in the query this will return the max for each rank across the datasets and parts. This call will return all of the chunk information for every rank returned from IQuery::get_ranks(). Errors:
  • DVS_NONE: Success
  • DVS_PARAM_NULL: chunks passed in is nullptr
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
Parameters:
  • chunks: buffer to save chunk information in, an array of the chunks for each rank
Returns: dvs_ret DVS_NONE if success, otherwise see method description Parameters:
  • uint32_t * chunks
Return type: dvs_ret

Function get_num_datasets

Get the number of datasets objects. IMPORTANT: The number of datasets will be invalid if this query or any parent queries’ filters are modified. Errors:
  • DVS_NONE: Success
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
Parameters:
  • num_datasets: if success, returns the number of datasets for this query
Returns: DVS_NONE on success, else see method description Parameters:
  • uint32_t & num_datasets
Return type: dvs_ret

Function get_dataset

Get the dataset object. IMPORTANT: This object will be destroyed if this query or parent queries’ filters are modified. Parameters:
  • index: index of the dataset to retrieve
Returns: DVS::IDataset* dataset for the index, or nullptr if not found Parameters:
  • uint32_t index
Return type: DVS::IDataset *

Function get_num_parts

Get the number of parts for this query. IMPORTANT: The number of parts will be invalid if this query or any parent queries’ filters are modifed. Errors:
  • DVS_NONE: Success
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
Parameters:
  • num_parts: if success, returns the number of parts for this query
Returns: dvs_ret DVS_NONE on success, else see method description Parameters:
  • uint32_t & num_parts
Return type: dvs_ret

Function get_part

Get the part based on the index. IMPORTANT: This object will be destroyed if this query or parent queries’ filters are modified. Parameters:
  • index: index of the part to retrieve
Returns: DVS::IObject* part based on the index, or nullptr if not found Parameters:
  • uint32_t index
Return type: const DVS::IObject *

Function get_num_plots

Get the number of plots for this query. IMPORTANT: The number of plots will be invalid if this query or any parent queries’ filters are modifed. Errors:
  • DVS_NONE: Success
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
Parameters:
  • num_plots: if success, returns the number of plots for this query
Returns: dvs_ret dvs_ret DVS_NONE on success, else see method description Parameters:
  • uint32_t & num_plots
Return type: dvs_ret

Function get_plot

Get the plot object based on the index. IMPORTANT: This object will be destroyed if this query or parent queries’ filters are modified. Parameters:
  • index: index of the plot to retrieve
Returns: DVS::IObject* plot based on the index, or nullptr if not found Parameters:
  • uint32_t index
Return type: const DVS::IObject *

Function get_variable_data

Get variable values for dataset and part objects. Dataset (Case) or part objects can have variable values per timestep. This method retrieves those values or returns if they do not exist. There does not need to be a value set for every part variable on every part. DVS_NO_DATA will be returned in this case. Error Codes:
  • DVS_NONE: No error
  • DVS_PARAM_NULL: Null param passed in
  • DVS_PARAM_INVALID_VAR: Invalid variable passed in, should not be possible
  • DVS_PARAM_INVALID_VAR_LOC: Variable passed in not a case or part variable
  • DVS_PARAM_INVALID_OBJECT_TYPE: Object passed in not a case or part object
  • DVS_PARAM_INVALID_OBJECT: Invalid object passed in, should not be possible
  • DVS_PARAM_INVALID_TIME: Timestep does not exist for the dataset the object belongs to
  • DVS_PARAM_OBJECT_DATASET_MISMATCH: Object and variable are from different datasets
Parameters:
  • object: The case/dataset or part object to find values for
  • var: the variable to retrieve the data for
  • time: the time value to retrieve the variable data for
  • values: the array of data to return, should be of size DVS::IVar::get_float_count_per_value()
Returns: dvs_ret DVS_NONE if no errors, DVS_NO_DATA if no data found, otherwise see method description Parameters: Return type: dvs_ret

Function get_num_variables

Get the number of variables for this query. IMPORTANT: The number of variables will be invalid if this query or any parent queries’ filters are modifed. Errors:
  • DVS_NONE: Success
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
Parameters:
  • num_vars: if success, returns the number of variables for this query
Returns: dvs_ret dvs_ret DVS_NONE on success, else see method description Parameters:
  • uint32_t & num_vars
Return type: dvs_ret

Function get_variable

Get the variable object based on the index. IMPORTANT: This object will be destroyed if this query or parent queries’ filters are modified. Parameters:
  • index: index of the variable to retrieve
Returns: DVS::IVar* variable based on the index, or nullptr if not found Parameters:
  • uint32_t index
Return type: const DVS::IVar *

Function get_num_timesteps

Get the number of timesteps. NOT YET IMPLEMENTED IMPORTANT: The number of timesteps will be invalid if this query or any parent queries’ filters are modified. Errors:
  • DVS_NONE: Success
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
  • DVS_QUERY_INVALID_FILTER: Invalid filter for query
  • DVS_METADATA_ERROR: Error loading metadata
Parameters: Returns: dvs_ret dvs_ret DVS_NONE on success, else see method description Parameters:
  • uint32_t & num_timesteps
Return type: dvs_ret

Function get_timesteps

Get the timesteps object. NOT YET IMPLEMENTED IMPORTANT: The timesteps will be invalid if this query or any parent queries’ filters are modified. Errors:
  • DVS_NONE: Success
  • DVS_PARAM_NULL: timesteps param is nullptr
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
  • DVS_QUERY_INVALID_FILTER: Invalid filter for query
  • DVS_METADATA_ERROR: Error loading metadata
Parameters: Returns: dvs_ret DVS_NONE on success, else see method description Parameters:
  • float * timesteps
Return type: dvs_ret

Function get_num_mesh_chunks

Get the number of mesh chunks for this query. NOT YET IMPLEMENTED IMPORTANT: The number of mesh chunks will be invalid if this query or any parent queries’ filters are modified. Errors:
  • DVS_NONE: Success
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
  • DVS_QUERY_INVALID_FILTER: Invalid filter for query
  • DVS_METADATA_ERROR: Error loading metadata
Parameters:
  • num_mesh_chunks: if success, returns the number of mesh chunks for this query
Returns: dvs_ret dvs_ret DVS_NONE on success, else see method description Parameters:
  • uint32_t & num_mesh_chunks
Return type: dvs_ret

Function get_mesh_chunk

Get the mesh chunk based on the index. IMPORTANT: This object will be destroyed if this query or parent queries’ filters are modified. Parameters:
  • index: the index of the mesh chunk to retrieve
Returns: DVS::IMeshChunk* the mesh chunk for the index, or nullptr if not found Parameters:
  • uint32_t index
Return type: DVS::IMeshChunk *

Function get_num_plot_chunks

Get the number of plot chunks for this query. NOT YET IMPLEMENTED IMPORTANT: The number of plot chunks will be invalid if this query or any parent queries’ filters are modified. Errors:
  • DVS_NONE: Success
  • DVS_INVALID_CACHE: Problem accessing cache
  • DVS_DATA_FAILED_LOAD: Problem reading cache, data bad/corrupt
  • DVS_QUERY_INVALID_FILTER: Invalid filter for query
  • DVS_METADATA_ERROR: Error loading metadata
Parameters:
  • num_plot_chunks: if success, returns the number of plot chunks for this query
Returns: dvs_ret dvs_ret DVS_NONE on success, else see method description Parameters:
  • uint32_t & num_plot_chunks
Return type: dvs_ret

Function get_plot_chunk

Get the plot chunk based on the index. IMPORTANT: This object will be destroyed if this query or parent queries’ filters are modified. Parameters:
  • index: index of the plot chunk to retrieve
Returns: DVS::IPlotChunk* the plot chunk based on the index, or nullptr if not found Parameters:
  • uint32_t index
Return type: DVS::IPlotChunk *

Function get_hash_available

Get if the hash is available in the blobstore. Checks the blobstore to see if the hash is available or not. This is mainly used for validation purposes. Errors:
  • DVS_NONE: Success
  • DVS_PARAM_NULL: hash passed in nullptr
  • DVS_INVALID_CACHE: Invalid cache, bad data
  • DVS_INVALID_HASH: Hash passed in invalid
Parameters: Returns: dvs_ret DVS_NONE on success, else see method description Parameters:
  • const char * hash
  • bool & available
Return type: dvs_ret

Function clear_data

Clear the current query. Return type: void