class_docstr: The main entry point for any training or feature extraction workflows in VISSL.
  
  The trainer constructs a train_task which prepares all the components of the
  training (optimizer, loss, meters, model etc) using the settings specified by user
  in the yaml config file. See the vissl/trainer/train_task.py for more details.
  
  Args:
      cfg (AttrDict): user specified input config that has optimizer, loss, meters etc
                      settings relevant to the training
      dist_run_id (str): For multi-gpu training with PyTorch, we have to specify
                         how the gpus are going to rendezvous. This requires specifying
                         the communication method: file, tcp and the unique rendezvous
                         run_id that is specific to 1 run.
                         We recommend:
                              1) for 1node: use init_method=tcp and run_id=auto
                              2) for multi-node, use init_method=tcp and specify
                              run_id={master_node}:{port}
      checkpoint_path (str): if the training is being resumed from a checkpoint, path to
                        the checkpoint. The tools/run_distributed_engines.py automatically
                        looks for the checkpoint in the checkpoint directory.
      checkpoint_folder (str): what directory to use for checkpointing. The
                        tools/run_distributed_engines.py creates the directory based on user
                        input in the yaml config file.
      hooks (List[ClassyHooks]): the list of hooks to use during the training. The hooks
                        vissl/engines/{train, extract_features}.py determine the hooks.
code: def _sync_and_print_meters(self, task):
      for meter in task.meters:
          meter.sync_state()
          logging.info("Meters synced")
      if is_primary():
          rank, _ = get_machine_local_and_dist_rank()
          for meter in task.meters:
              if len(task.meters) > 0 and (
                  (
                      task.train
                      and task.config["METERS"]["enable_training_meter"]
                  )
                  or (not task.train)
              ):
                  meter_value = meter.value
                  metric_key = f"{meter.name}"
                  if metric_key not in task.metrics:
                      task.metrics[metric_key] = []
                  task.metrics[metric_key].append(meter_value)
                  logging.info(
                      f"Rank: {rank}, name: {metric_key}, value: {meter_value}"
                  )
  
imports: import gc
  import itertools
  import logging
  import os
  import socket
  import time
  from types import SimpleNamespace
  from typing import Any, Dict, List, Tuple
  import numpy
  import torch
  import torch.distributed
  from classy_vision.generic.distributed_util import barrier, is_primary, set_cpu_device, set_cuda_device_index
  from classy_vision.hooks.classy_hook import ClassyHook
  from classy_vision.tasks import ClassyTask, TASK_REGISTRY
  from vissl.config import AttrDict
  from vissl.hooks import SSLClassyHookFunctions
  from vissl.models.model_helpers import get_trunk_output_feature_names
  from vissl.trainer.train_steps import get_train_step
  from vissl.utils.distributed_utils import all_gather_heterogeneous, all_gather_sizes
  from vissl.utils.env import get_machine_local_and_dist_rank
  from vissl.utils.io import save_file
label_desc: Use image node_id 10 for calling the SelfSupervisionTrainer obj's underlying member method code with example usage: obj._sync_and_print_meters(task) without return types