database_client_interface module reference

Data Types

dataset_type

Dummy type for dataset

dbclient_type

Stores all data and methods associated with the communication client that is used to communicate with the database

Functions/Subroutines

SR_error_parser

Decode a response code from an API function

initialize_client

Initializes a new instance of a communication client

isinitialized

Check whether the client has been initialized

destructor

A destructor for the communication client

put_tensor_float_1d

Put a 32-bit real 1d tensor into the database

put_tensor_float_2d

Put a 32-bit real 2d tensor into the database

put_tensor_float_3d

Put a 32-bit real 3d tensor into the database

put_tensor_float_4d

Put a 32-bit real 4d tensor into the database

put_tensor_double_1d

Put a 64-bit real 1d tensor into the database

put_tensor_double_2d

Put a 64-bit real 2d tensor into the database

put_tensor_double_3d

Put a 64-bit real 3d tensor into the database

put_tensor_double_4d

Put a 64-bit real 4d tensor into the database

put_tensor_int32_1d

Put a 32-bit integer 1d tensor into the database

put_tensor_int32_2d

Put a 32-bit integer 2d tensor into the database

put_tensor_int32_3d

Put a 32-bit integer 3d tensor into the database

put_tensor_int32_4d

Put a 32-bit integer 4d tensor into the database

unpack_tensor_float_1d

Unpack a 32-bit real 1d tensor from the database

unpack_tensor_float_2d

Unpack a 32-bit real 2d tensor from the database

unpack_tensor_float_3d

Unpack a 32-bit real 3d tensor from the database

unpack_tensor_float_4d

Unpack a 32-bit real 4d tensor from the database

unpack_tensor_double_1d

Unpack a 64-bit real 1d tensor from the database

unpack_tensor_double_2d

Unpack a 64-bit real 2d tensor from the database

unpack_tensor_double_3d

Unpack a 64-bit real 3d tensor from the database

unpack_tensor_double_4d

Unpack a 64-bit real 4d tensor from the database

unpack_tensor_int32_1d

Unpack a 32-bit integer 1d tensor from the database

unpack_tensor_int32_2d

Unpack a 32-bit integer 2d tensor from the database

unpack_tensor_int32_3d

Unpack a 32-bit integer 3d tensor from the database

unpack_tensor_int32_4d

Unpack a 32-bit integer 4d tensor from the database

rename_tensor

Move a tensor to a new name

delete_tensor

Delete a tensor

copy_tensor

Copy a tensor to the destination name

get_model

Retrieve the model from the database

set_model_from_file

Load the machine learning model from a file and set the configuration

set_model_from_file_multigpu

Load the machine learning model from a file and set the configuration for use in multi-GPU systems

set_model

Establish a model to run

set_model_multigpu

Set a model from a byte string to run on a system with multiple GPUs

run_model

Run a model in the database using the specified input and output tensors

run_model_multigpu

Run a model in the database using the specified input and output tensors in a multi-GPU system

delete_model

Remove a model from the database

delete_model_multigpu

Remove a model from the database

get_script

Retrieve the script from the database

set_script_from_file

Set a script (from file) in the database for future execution

set_script_from_file_multigpu

Set a script (from file) in the database for future execution in a multi-GPU system

set_script

Set a script (from buffer) in the database for future execution

set_script_multigpu

Set a script (from buffer) in the database for future execution in a multi-GPU system

run_script

run_script_multigpu

delete_script

Remove a script from the database

delete_script_multigpu

Remove a script_multigpu from the database

put_dataset

Store a dataset in the database

get_dataset

Retrieve a dataset from the database

rename_dataset

Rename a dataset stored in the database

copy_dataset

Copy a dataset within the database to a new name

delete_dataset

Delete a dataset stored within a database

append_to_list

Appends a dataset to the aggregation list When appending a dataset to an aggregation list, the list will automatically be created if it does not exist (i.e. this is the first entry in the list). Aggregation lists work by referencing the dataset by storing its key, so appending a dataset to an aggregation list does not create a copy of the dataset. Also, for this reason, the dataset must have been previously placed into the database with a separate call to put_dataset().

delete_list

Delete an aggregation list

copy_list

Copy an aggregation list

rename_list

Rename an aggregation list

Type Documentation

type, public :: dataset_type

Dummy type for dataset

type, public :: dbclient_type

Stores all data and methods associated with the communication client that is used to communicate with the database

Functions/Subroutine Documentation

function SR_error_parser(self, response_code) result(is_error)

Decode a response code from an API function

Parameters
  • self [in]

    Receives the initialized client

  • response_code [in]

    The response code to decode

  • is_error

    Indicates whether this is an error response

function initialize_client(self, cluster)

Initializes a new instance of a communication client

Parameters
  • self [inout]

    Receives the initialized client

  • cluster [in]

    If true, client uses a database cluster (Default: .false.)

logical function isinitialized(this)

Check whether the client has been initialized

function destructor(self)

A destructor for the communication client

function put_tensor_float_1d(self, name, data, dims) result(code)

Put a 32-bit real 1d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_float_2d(self, name, data, dims) result(code)

Put a 32-bit real 2d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_float_3d(self, name, data, dims) result(code)

Put a 32-bit real 3d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_float_4d(self, name, data, dims) result(code)

Put a 32-bit real 4d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_double_1d(self, name, data, dims) result(code)

Put a 64-bit real 1d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_double_2d(self, name, data, dims) result(code)

Put a 64-bit real 2d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_double_3d(self, name, data, dims) result(code)

Put a 64-bit real 3d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_double_4d(self, name, data, dims) result(code)

Put a 64-bit real 4d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_int32_1d(self, name, data, dims) result(code)

Put a 32-bit integer 1d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_int32_2d(self, name, data, dims) result(code)

Put a 32-bit integer 2d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_int32_3d(self, name, data, dims) result(code)

Put a 32-bit integer 3d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function put_tensor_int32_4d(self, name, data, dims) result(code)

Put a 32-bit integer 4d tensor into the database

Parameters
  • data [in]

    Data to be sent

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_float_1d(self, name, data, dims) result(code)

Unpack a 32-bit real 1d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_float_2d(self, name, data, dims) result(code)

Unpack a 32-bit real 2d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_float_3d(self, name, data, dims) result(code)

Unpack a 32-bit real 3d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_float_4d(self, name, data, dims) result(code)

Unpack a 32-bit real 4d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_double_1d(self, name, data, dims) result(code)

Unpack a 64-bit real 1d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_double_2d(self, name, data, dims) result(code)

Unpack a 64-bit real 2d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_double_3d(self, name, data, dims) result(code)

Unpack a 64-bit real 3d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_double_4d(self, name, data, dims) result(code)

Unpack a 64-bit real 4d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_int32_1d(self, name, data, dims) result(code)

Unpack a 32-bit integer 1d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_int32_2d(self, name, data, dims) result(code)

Unpack a 32-bit integer 2d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_int32_3d(self, name, data, dims) result(code)

Unpack a 32-bit integer 3d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function unpack_tensor_int32_4d(self, name, data, dims) result(code)

Unpack a 32-bit integer 4d tensor from the database

Parameters
  • data [out]

    Data to be received

  • self [in]

    Fortran communication client

  • name [in]

    The unique name used to store in the database

  • dims [in]

    The length of each dimension

function rename_tensor(self, old_name, new_name) result(code)

Move a tensor to a new name

Parameters
  • self [in]

    The initialized Fortran communication client

  • old_name [in]

    The current name for the tensor excluding null terminating character

  • new_name [in]

    The new tensor name

function delete_tensor(self, name) result(code)

Delete a tensor

Parameters
  • self [in]

    The initialized Fortran communication client

  • name [in]

    The name associated with the tensor

function copy_tensor(self, src_name, dest_name) result(code)

Copy a tensor to the destination name

Parameters
  • self [in]

    The initialized Fortran communication client

  • src_name [in]

    The name associated with the tensor excluding null terminating character

  • dest_name [in]

    The new tensor name

function get_model(self, name, model) result(code)

Retrieve the model from the database

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name associated with the model

  • model [out]

    The model as a continuous buffer

function set_model_from_file(self, name, model_file, backend, device, batch_size, min_batch_size, tag, inputs, outputs) result(code)

Load the machine learning model from a file and set the configuration

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the model

  • model_file [in]

    The file storing the model

  • backend [in]

    The name of the backend (TF, TFLITE, TORCH, ONNX)

  • device [in]

    The name of the device (CPU, GPU, GPU:0, GPU:1...)

  • batch_size [in]

    The batch size for model execution

  • min_batch_size [in]

    The minimum batch size for model execution

  • tag [in]

    A tag to attach to the model for information purposes

  • inputs [in]

    One or more names of model input nodes (TF models)

  • outputs [in]

    One or more names of model output nodes (TF models)

function set_model_from_file_multigpu(self, name, model_file, backend, first_gpu, num_gpus, batch_size, min_batch_size, tag, inputs, outputs) result(code)

Load the machine learning model from a file and set the configuration for use in multi-GPU systems

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the model

  • model_file [in]

    The file storing the model

  • backend [in]

    The name of the backend (TF, TFLITE, TORCH, ONNX)

  • first_gpu [in]

    The first GPU (zero-based) to use with the model

  • num_gpus [in]

    The number of GPUs to use with the model

  • batch_size [in]

    The batch size for model execution

  • min_batch_size [in]

    The minimum batch size for model execution

  • tag [in]

    A tag to attach to the model for information purposes

  • inputs [in]

    One or more names of model input nodes (TF models)

  • outputs [in]

    One or more names of model output nodes (TF models)

function set_model(self, name, model, backend, device, batch_size, min_batch_size, tag, inputs, outputs) result(code)

Establish a model to run

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the model

  • model [in]

    The binary representation of the model

  • backend [in]

    The name of the backend (TF, TFLITE, TORCH, ONNX)

  • device [in]

    The name of the device (CPU, GPU, GPU:0, GPU:1...)

  • batch_size [in]

    The batch size for model execution

  • min_batch_size [in]

    The minimum batch size for model execution

  • tag [in]

    A tag to attach to the model for information purposes

  • inputs [in]

    One or more names of model input nodes (TF models)

  • outputs [in]

    One or more names of model output nodes (TF models)

function set_model_multigpu(self, name, model, backend, first_gpu, num_gpus, batch_size, min_batch_size, tag, inputs, outputs) result(code)

Set a model from a byte string to run on a system with multiple GPUs

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the model

  • model [in]

    The binary representation of the model

  • backend [in]

    The name of the backend (TF, TFLITE, TORCH, ONNX)

  • first_gpu [in]

    The first GPU (zero-based) to use with the model

  • num_gpus [in]

    The number of GPUs to use with the model

  • batch_size [in]

    The batch size for model execution

  • min_batch_size [in]

    The minimum batch size for model execution

  • tag [in]

    A tag to attach to the model for information purposes

  • inputs [in]

    One or more names of model input nodes (TF models)

  • outputs [in]

    One or more names of model output nodes (TF models)

function run_model(self, name, inputs, outputs) result(code)

Run a model in the database using the specified input and output tensors

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the model

  • inputs [in]

    One or more names of model input nodes (TF models)

  • outputs [in]

    One or more names of model output nodes (TF models)

function run_model_multigpu(self, name, inputs, outputs, offset, first_gpu, num_gpus) result(code)

Run a model in the database using the specified input and output tensors in a multi-GPU system

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the model

  • inputs [in]

    One or more names of model input nodes (TF models)

  • outputs [in]

    One or more names of model output nodes (TF models)

  • offset [in]

    Index of the current image, such as a processor ID or MPI rank

  • first_gpu [in]

    The first GPU (zero-based) to use with the model

  • num_gpus [in]

    The number of GPUs to use with the model

function delete_model(self, name) result(code)

Remove a model from the database

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to remove the model

function delete_model_multigpu(self, name, first_gpu, num_gpus) result(code)

Remove a model from the database

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to remove the model

  • first_gpu [in]

    The first GPU (zero-based) to use with the model

  • num_gpus [in]

    The number of GPUs to use with the model

function get_script(self, name, script) result(code)

Retrieve the script from the database

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the script

  • script [out]

    The script as a continuous buffer

function set_script_from_file(self, name, device, script_file) result(code)

Set a script (from file) in the database for future execution

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the script

  • device [in]

    The name of the device (CPU, GPU, GPU:0, GPU:1...)

  • script_file [in]

    The file storing the script

function set_script_from_file_multigpu(self, name, script_file, first_gpu, num_gpus) result(code)

Set a script (from file) in the database for future execution in a multi-GPU system

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the script

  • script_file [in]

    The file storing the script

  • first_gpu [in]

    The first GPU (zero-based) to use with the model

  • num_gpus [in]

    The number of GPUs to use with the model

function set_script(self, name, device, script) result(code)

Set a script (from buffer) in the database for future execution

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the script

  • device [in]

    The name of the device (CPU, GPU, GPU:0, GPU:1...)

  • script [in]

    The file storing the script

function set_script_multigpu(self, name, script, first_gpu, num_gpus) result(code)

Set a script (from buffer) in the database for future execution in a multi-GPU system

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the script

  • script [in]

    The file storing the script

  • first_gpu [in]

    The first GPU (zero-based) to use with the model

  • num_gpus [in]

    The number of GPUs to use with the model

function run_script(self, name, func, inputs, outputs) result(code)

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the script

  • func [in]

    The name of the function in the script to call

  • inputs [in]

    One or more names of script input nodes (TF scripts)

  • outputs [in]

    One or more names of script output nodes (TF scripts)

function run_script_multigpu(self, name, func, inputs, outputs, offset, first_gpu, num_gpus) result(code)

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to place the script

  • func [in]

    The name of the function in the script to call

  • inputs [in]

    One or more names of script input nodes (TF scripts)

  • outputs [in]

    One or more names of script output nodes (TF scripts)

  • offset [in]

    Index of the current image, such as a processor ID or MPI rank

  • first_gpu [in]

    The first GPU (zero-based) to use with the model

  • num_gpus [in]

    The number of GPUs to use with the model

function delete_script(self, name) result(code)

Remove a script from the database

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to delete the script

function delete_script_multigpu(self, name, first_gpu, num_gpus) result(code)

Remove a script_multigpu from the database

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    The name to use to delete the script_multigpu

  • first_gpu [in]

    The first GPU (zero-based) to use with the model

  • num_gpus [in]

    The number of GPUs to use with the model

function put_dataset(self, dataset) result(code)

Store a dataset in the database

Parameters
  • self [in]

    An initialized communication client

  • dataset [in]

    Dataset to store in the dataset

function get_dataset(self, name, dataset) result(code)

Retrieve a dataset from the database

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    Name of the dataset to get

  • dataset [out]

    receives the dataset

function rename_dataset(self, name, new_name) result(code)

Rename a dataset stored in the database

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    Original name of the dataset

  • new_name [in]

    New name of the dataset

function copy_dataset(self, name, new_name) result(code)

Copy a dataset within the database to a new name

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    Source name of the dataset

  • new_name [in]

    Name of the new dataset

function delete_dataset(self, name) result(code)

Delete a dataset stored within a database

Parameters
  • self [in]

    An initialized communication client

  • name [in]

    Name of the dataset to delete

function append_to_list(self, list_name, dataset) result(code)

Appends a dataset to the aggregation list When appending a dataset to an aggregation list, the list will automatically be created if it does not exist (i.e. this is the first entry in the list). Aggregation lists work by referencing the dataset by storing its key, so appending a dataset to an aggregation list does not create a copy of the dataset. Also, for this reason, the dataset must have been previously placed into the database with a separate call to put_dataset().

Parameters
  • self [in]

    An initialized communication client

  • list_name [in]

    Name of the dataset to get

  • dataset [in]

    Dataset to append to the list

function delete_list(self, list_name) result(code)

Delete an aggregation list

Parameters
  • self [in]

    An initialized communication client

  • list_name [in]

    Name of the aggregated dataset list to delete

function copy_list(self, src_name, dest_name) result(code)

Copy an aggregation list

Parameters
  • self [in]

    An initialized communication client

  • src_name [in]

    Name of the dataset to copy

  • dest_name [in]

    The new list name

function rename_list(self, src_name, dest_name) result(code)

Rename an aggregation list

Parameters
  • self [in]

    An initialized communication client

  • src_name [in]

    Name of the dataset to rename

  • dest_name [in]

    The new list name

API generated with Flint · Rendered from reStructuredText