class_docstr: Environment for PTL training on a Ray cluster.
class_docstr_tok: ["Environment","for","PTL","training","on","a","Ray","cluster","."]
docstr: An open and configured port in the main node through which all processes communicate.
docstr_tok: ["An","open","and","configured","port","in","the","main","node","through","which","all","processes","communicate","."]
code: def main_port(self) -> int:
      """An open and configured port in the main node through which all processes communicate."""
      if self._main_port == -1:
          self._main_port = int(os.environ.get("MASTER_PORT", 0))
      return self._main_port
  
file_path: BigDL/python/nano/src/bigdl/nano/deps/ray/ray_envbase.py
imports: import os
  from pytorch_lightning.plugins.environments import ClusterEnvironment
  from pytorch_lightning.utilities import rank_zero_only
label_desc: Use image node_id 4 for calling the RayEnvironment obj's underlying member method code with example usage: obj.main_port() and returns: self