code: def create_multi_node_checkpointer(
      name, comm, cp_interval=5, gc_interval=5, path=None
  ):
      """Create multi-node checkpointer object
  
      Generational snapshot extension to allow fault tolerance;
      It keeps several old snapshots to rollback synchronized
      snapshot at each MPI process. Snapshot files are identified
      as '<name>.<rank>.<iteration>'.
  
      - <name> ... identifier of the run where snapshot is kept for
      - <rank> ... which process owned the model
      - <iteration> ... number of iteration.
  
      This extension keeps several files for each execution and allows
      users to resume the whole job at the latest snapshots of each MPI
      process, and the iteration where all snapshots agrees.
  
      As this object is a usual Chainer extension, users can just
      create this object and pass to the trainer as an extension::
  
          checkpointer = create_multi_node_checkpointer(name=run_id, comm=comm)
          trainer.extend(checkpointer, trigger=(25, 'iteration'))
  
      To run recovery at startup, before first iteration, run
  
          checkpointer.maybe_load(trainer, optimizer)
  
      before ``trainer.run()`` . If nothing is recovered (i.e. no
      snapshot found), ``trainer.updater.iteration`` will remain ``0``
      . Otherwise it will have the value of snapshot and the training
      will resume from that iteration. ``optimizer`` is optional but
      this will let multi node optimizer avoid initial broadcast when
      all snapshot data among nodes are all in sync.
  
      .. note:: Make sure that ``checkpointer.maybe_load`` is called
                *after* all extensions with states, such as ``ExponentialShift``,
                set to the trainer.
  
      .. note:: The checkpointer is deprecated. Please use
                :func:`chainermn.extensions.multi_node_snapshot` instead.
  
      After training finished without errors all those temporary
      checkpoints will be cleaned up at all nodes.
  
      Another example to use checkpointer *without* trainer would be::
  
          checkpointer = create_multi_node_checkpointer(name=run_id, comm=comm)
          checkpointer.maybe_load(obj_you_want_to_snap, optimizer)
  
          while True: ## Training loop
              ...
              updater.update()
              ...
              checkpointer.save(obj_you_want_to_snap)  # Make a checkpoint
  
      Args:
          name (str): unique id of the run
          comm: communicater in ChainerMN
          cp_interval (int): minimum number of checkpoints to preserve
          gc_interval (int): interval to collect non-preserved checkpoints
  
      """
      warnings.warn(
          "Checkpointer is deprecated. "
          "Use chainer.extensions.multi_node_snapshot instead.",
          DeprecationWarning,
      )
      return _MultiNodeCheckpointer(
          name, comm, cp_interval, gc_interval, path
      )
  
imports: import errno
  import os
  import shutil
  import tempfile
  import time
  import warnings
  import chainer
  from chainer.training import extension
label_desc: Use image node_id 1 for calling a global function with example usage: create_multi_node_checkpointer(name, comm, cp_interval, gc_interval, path) and returns: _MultiNodeCheckpointer