code: def set_env(num_threads: int):
      print("multiprocessing.cpu_count():", multiprocessing.cpu_count())
      print("os.cpu_count():", os.cpu_count())
      print(
          "len(os.sched_getaffinity(0):", len(os.sched_getaffinity(0))
      )
  
      # parameters settings
      kmp_affinity = "granularity=fine"  # "disabled"
      kmp_blocktime = "200"
      env_update = {
          "OMP_NUM_THREADS": str(num_threads),
          "KMP_AFFINITY": kmp_affinity,
          "KMP_BLOCKTIME": kmp_blocktime,
      }
      os.environ.update(env_update)
  
      for k in env_update:
          print(k, os.environ[k])
  
file_path: BigDL/python/friesian/example/recall/utils.py
imports: import time
  import os
  import multiprocessing
label_desc: Use image node_id 2 for calling a global function with example usage: set_env(num_threads) without return types