qat.qlmaas.generators.QLMaaSGenerator
Remote Generators are managed by QLMaaSGenerator
objects. These objects can be
built using:
qlmaas.generators
module if a configuration exists on your computera
QLMaaSConnection
object (when the connection is defined manually). Please note that, even if there is no configuration file on your computer, instantiating aQLMaaSConnection
object enables theqlmaas.generators
module
- class qat.qlmaas.generators.QLMaaSGenerator(connection, name: str, constructor: SerializedArguments, description: str)
Class decribing a BatchGenerator defined on a remote server.
If a configuration is present on your computer, you can use the module
qlmaas.generators
to instantiate a remote BatchGeneratorfrom qlmaas.generators import MaxCutGenerator # Define a generator max_cut = MaxCutGenerator()
Otherwise, if no configuration file is set on your machine, you can use a
QLMaaSConnection
object:from qat.qlmaas import QLMaaSConnection # Connect to the server conn = QLMaaSConnection() # Get remote BatchGenerator MaxCutGenerator = conn.get_generator("qat.generators:MaxCutGenerator") max_cut = MaxCutGenerator()
- generate(specs, *args, mem_usage: Optional[int] = None, core_usage: Optional[int] = None, nb_nodes: Optional[int] = None, **kwargs)
Generate a batch. This batch will be generated on the server using an asynchronous mode.
- Parameters
specs (
HardwareSpecs
) – hardware specsmem_usage (int, optional) – override the memory usage (in MB)
core_usage (int, optional) – override the core usage
*args – additional arguments to generate a
Batch
**kwargs – addtional keyword arguments to generate a
Batch
- Returns
asynchronous result
- Return type