qat.qlmaas.generators.QLMaaSGenerator
Remote Generators are managed by QLMaaSGenerator objects. These objects can be
built using:
qlmaas.generatorsmodule if a configuration exists on your computera
QLMaaSConnectionobject (when the connection is defined manually). Please note that, even if there is no configuration file on your computer, instantiating aQLMaaSConnectionobject enables theqlmaas.generatorsmodule
- 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.generatorsto 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
QLMaaSConnectionobject: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: int | None = None, core_usage: int | None = None, nb_nodes: int | None = None, max_time: int | timedelta | None = 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
nb_nodes (int, optional) – override default number of nodes
max_time (int | datetime.timedelta, optional) – maximum time for the job, indicated either with a timedelta, or in minutes (this argument may not be supported by the scheduler)
*args – additional arguments to generate a
Batch**kwargs – addtional keyword arguments to generate a
Batch
- Returns:
asynchronous result
- Return type: