code: def pre_basic(args, tid, read_op):
      io_string = "Read" if read_op else "Write"
      num_bytes = (
          os.path.getsize(args.read_file)
          if read_op
          else args.write_size
      )
      file = args.read_file if read_op else f"{args.write_file}.{tid}"
  
      task_log(tid, f"Allocate tensor of size {num_bytes} bytes")
      buffer = torch.empty(
          num_bytes, dtype=torch.uint8, device="cpu"
      ).pin_memory()
      task_log(
          tid,
          f"{io_string} file {file} of size {num_bytes} bytes from buffer on device {buffer.device}",
      )
  
      ctxt = {}
      ctxt["file"] = file
      ctxt["num_bytes"] = num_bytes
      ctxt["buffer"] = buffer
      ctxt["elapsed_sec"] = 0
  
      return ctxt
  
file_path: H2O/h2o_flexgen/benchmark/third_party/DeepSpeed/csrc/aio/py_test/ds_aio_basic.py
imports: import torch
  import os
  import time
  from deepspeed.ops.aio import AsyncIOBuilder
  from multiprocessing import Pool, Barrier
  from test_ds_aio_utils import report_results, task_log, task_barrier
label_desc: Use image node_id 1 for calling a global function with example usage: pre_basic(args, tid, read_op) and returns: ctxt