o
    z“©io	  ã                   @   s$   d dl mZmZ G dd„ deƒZdS )é    )ÚABCÚabstractmethodc                   @   sü   e Zd ZdZeedefdd„ƒƒZeedefdd„ƒƒZ	eede
fdd„ƒƒZeedefd	d
„ƒƒZede
fdd„ƒZede
ddfdd„ƒZede
fdd„ƒZede
ddfdd„ƒZede
fdd„ƒZede
fdd„ƒZde
de
ddfdd„Zd dd„ZdS )!ÚClusterEnvironmentz'Specification of a cluster environment.Úreturnc                 C   ó   dS )z8Whether the environment creates the subprocesses or not.N© ©Úselfr   r   úm/home/ubuntu/.local/lib/python3.10/site-packages/lightning_fabric/plugins/environments/cluster_environment.pyÚcreates_processes_externally   ó    z/ClusterEnvironment.creates_processes_externallyc                 C   r   )zEThe main address through which all processes connect and communicate.Nr   r   r   r   r
   Úmain_address   r   zClusterEnvironment.main_addressc                 C   r   )zUAn open and configured port in the main node through which all processes communicate.Nr   r   r   r   r
   Ú	main_port   r   zClusterEnvironment.main_portc                   C   r   )zbDetects the environment settings corresponding to this cluster and returns ``True`` if they match.Nr   r   r   r   r
   Údetect#   r   zClusterEnvironment.detectc                 C   r   )z5The number of processes across all devices and nodes.Nr   r   r   r   r
   Ú
world_size(   r   zClusterEnvironment.world_sizeÚsizeNc                 C   ó   d S ©Nr   )r	   r   r   r   r
   Úset_world_size,   ó   z!ClusterEnvironment.set_world_sizec                 C   r   )zOThe rank (index) of the currently running process across all nodes and devices.Nr   r   r   r   r
   Úglobal_rank0   r   zClusterEnvironment.global_rankÚrankc                 C   r   r   r   )r	   r   r   r   r
   Úset_global_rank4   r   z"ClusterEnvironment.set_global_rankc                 C   r   )zMThe rank (index) of the currently running process inside of the current node.Nr   r   r   r   r
   Ú
local_rank8   r   zClusterEnvironment.local_rankc                 C   r   )z?The rank (index) of the node on which the current process runs.Nr   r   r   r   r
   Ú	node_rank<   r   zClusterEnvironment.node_rankÚnum_devicesÚ	num_nodesc                 C   r   )z‚Validates settings configured in the script against the environment, and raises an exception if there is an
        inconsistency.Nr   )r	   r   r   r   r   r
   Úvalidate_settings@   s   z$ClusterEnvironment.validate_settingsc                 C   r   )z0Clean up any state set after execution finishes.Nr   r   r   r   r
   ÚteardownE   r   zClusterEnvironment.teardown)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr   Úboolr   Ústrr   Úintr   Ústaticmethodr   r   r   r   r   r   r   r   r   r   r   r   r
   r      s8    r   N)Úabcr   r   r   r   r   r   r
   Ú<module>   s   