Base class for machine groups.
Bases: BaseMachineGroup
Create an ElasticMachineGroup object.
An ElasticMachineGroup is a set of identical machines that can automatically scale based on CPU load. The group starts with a minimum number of machines and adjusts its size as needed scaling to the maximum number of machines, ensuring both optimal performance and cost efficiency. Note: The machine group becomes active after calling the ‘start’ method, and billing commences once the machines are initiated.
Returns a string representation of the number of machines currently running.
Returns the maximum number of vCPUs that can be used on a task.
On a machine group with 2 machines, each with 4 vCPUs, this will return 4. On an elastic machine group, this will also return 4. On an MPI cluster this will return the total number of vcpus because we can run on the total number of vcpus.
Check if the resource can be started.
This method checks if the resource can be started by checking the available quotas and resource usage.
Estimates a cost per hour of min and max machines in US dollars.
these are the estimted costs of having minimum and the maximum number of machines up in the cloud. The final cost will vary depending on the total usage of the machines.
Creates a MachineGroup object from an API response.
Get the MPI configuration for the cluster.
Returns the number of GPUs available in the resource.
Check if the machine group has a GPU.
Resource idle time in seconds.
Returns the number of vCPUs available in the resource.
Returns a tuple with the total number of vCPUs and the number of vCPUs per machine. For a machine group with 2 machines, each with 4 vCPUs, this will return (8, 4). In a case of an Elastic machine group, the total number of vCPUs is the maximum number of vCPUs that can be used at the same time.
Set the MPI configuration for the cluster. mpi_config: An MPIConfig object containing the MPI configuration.
Will take precedence over other arguments if provided.
Starts a machine group.
Terminates a machine group.
Bases: BaseMachineGroup
Create a MPICluster object.
A MPI cluster is a collection of homogenous machines all working together on
: a common task given the configurations that are launched in Google Cloud.
Note: The cluster will be available only after calling ‘start’ method.
The billing will start only after the machines are started.
Args:
: machine_type: The type of GC machine to launch. Ex: “e2-standard-4”.
: Check https://cloud.google.com/compute/docs/machine-resource for
information about machine types.
zone: The zone where the machines will be launched.
provider: The cloud provider of the machine group.
threads_per_core: The number of threads per core (1 or 2).
data_disk_gb: The size of the disk for user data (in GB).
max_idle_time: Time without executing any task, after which the
> resource will be terminated.
auto_terminate_minutes: Duration, in minutes, the MPICluster will be
: kept alive. After auto_terminate_minutes minutes the machine
will be terminated. This time will start counting after calling
this method.
auto_terminate_ts: Moment in which the resource will be
: automatically terminated.
num_machines: The number of virtual machines to launch.
Return the number of machines currently running.
Returns the number of vCPUs available to the resource.
For a mpi cluster with 2 machines, each with 4 vCPUs, this will return 8.
Check if the resource can be started.
This method checks if the resource can be started by checking the available quotas and resource usage.
Estimates a cost per hour of min and max machines in US dollars.
these are the estimted costs of having minimum and the maximum number of machines up in the cloud. The final cost will vary depending on the total usage of the machines.
Creates a MachineGroup object from an API response.
Get the MPI configuration for the cluster.
Returns the number of GPUs available in the resource.
Check if the machine group has a GPU.
Resource idle time in seconds.
Returns the number of vCPUs available in the resource.
Returns a tuple with the total number of vCPUs and the number of vCPUs per machine. For a machine group with 2 machines, each with 4 vCPUs, this will return (8, 4). In a case of an Elastic machine group, the total number of vCPUs is the maximum number of vCPUs that can be used at the same time.
Set the MPI configuration for the cluster. mpi_config: An MPIConfig object containing the MPI configuration.
Will take precedence over other arguments if provided.
Starts a machine group.
Terminates a machine group.
Bases: BaseMachineGroup
Create a MachineGroup object.
A machine group is a collection of homogenous machines with given the configurations that are launched in Google Cloud. Note: The machine group will be available only after calling ‘start’ method. The billing will start only after the machines are started.
Return the number of machines currently running.
Returns the maximum number of vCPUs that can be used on a task.
On a machine group with 2 machines, each with 4 vCPUs, this will return 4. On an elastic machine group, this will also return 4. On an MPI cluster this will return the total number of vcpus because we can run on the total number of vcpus.
Check if the resource can be started.
This method checks if the resource can be started by checking the available quotas and resource usage.
Estimates a cost per hour of min and max machines in US dollars.
these are the estimted costs of having minimum and the maximum number of machines up in the cloud. The final cost will vary depending on the total usage of the machines.
Creates a MachineGroup object from an API response.
Get the MPI configuration for the cluster.
Returns the number of GPUs available in the resource.
Check if the machine group has a GPU.
Resource idle time in seconds.
Returns the number of vCPUs available in the resource.
Returns a tuple with the total number of vCPUs and the number of vCPUs per machine. For a machine group with 2 machines, each with 4 vCPUs, this will return (8, 4). In a case of an Elastic machine group, the total number of vCPUs is the maximum number of vCPUs that can be used at the same time.
Set the MPI configuration for the cluster. mpi_config: An MPIConfig object containing the MPI configuration.
Will take precedence over other arguments if provided.
Starts a machine group.
Terminates a machine group.
Returns a list of ‘Resource’ objects.
Returns the machine group corresponding to machine_name.
Functions to manage or retrieve user resources.
Estimate the cloud cost of one machine per hour in US dollars.
Get all available machine types from a specified provider, allowing for multiple filtering parameters.