class_docstr: The Slurm Evaluator is a class designed to continuously monitor VISSL pretrainings
  and launch evaluations as checkpoints become available. The method takes a
  config dictionary consisting of the training checkpoint directory, an array of
  benchmarks, and information on how often to evaluate the trainings.
code: def _monitor_benchmark_job(self, benchmark):
      if not benchmark["job_id"]:
          return  # Do nothing, the job has not yet started.
  
      # Create SlurmJob object.
      job_id = str(benchmark["job_id"])
      folder = Path(benchmark["slurm_log_dir"])
      job = submitit.SlurmJob(job_id=job_id, folder=folder, tasks=[0])
  
      if job.state in _SLURM_JOB_TERMINAL_STATES:
          # Job is in terminal state, mark job as finished.
          self.evaluation_jobs_finished.add(job.job_id)
  
      if job.state != benchmark["slurm_state"]:
          # Job state has changed, log transition, and update state in json file.
          checkpoint_str = os.path.split(
              benchmark["weights_init_params_file"]
          )[-1]
  
          current_time = datetime.now().strftime("%H:%M:%S %z")
          log = f"""
                  Slurm Evaluation job changed states. Time: { current_time }
                  job_id: { job.job_id }, num_retries: { benchmark["num_retries"] }
                  evaluation_name: { benchmark["evaluation_name"] },
                  checkpoint_str: { checkpoint_str },
                  state_prev: { benchmark["slurm_state"] }, state_curr: { job.state }
              """
  
          logging.info(log)
          # Benchmark Job state has changed. Update the benchmark state.
          self._update_benchmark_state(benchmark, job)
          self.save_evaluation_benchmarks()
  
imports: import collections
  import json
  import logging
  import os
  import time
  from datetime import datetime
  from pathlib import Path
  from typing import List
  import submitit
  from iopath.common.file_io import g_pathmgr
  from vissl.config.attr_dict import AttrDict
  from vissl.utils.distributed_launcher import launch_distributed_on_slurm
  from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict
  from vissl.utils.io import load_file, makedir
  from vissl.utils.misc import flatten_dict, retry
label_desc: Use image node_id 16 for calling the BenchmarkSuiteScheduler obj's underlying member method code with example usage: obj._monitor_benchmark_job(benchmark) without return types