def generate_runscript()

in scripts/load_testing/server_config.py [0:0]


def generate_runscript(binary, instances, pmem_paths_count, engine):
  # create bring-up.sh
  fname = 'bring-up.sh'
  numa_node_count = pmem_paths_count if pmem_paths_count > 0 else 2
  with open(fname, 'w') as the_file:
    for i in range(instances):
      config_file = os.path.join('config', '{engine}-{server_port}.config'.format(engine=engine, server_port=PELIKAN_SERVER_PORT+i))
      if BIND_TO_NODES:
        the_file.write('sudo numactl --cpunodebind={numa_node} --preferred={numa_node} '.format(
            numa_node=i%numa_node_count))
      elif BIND_TO_CORES:
        the_file.write('sudo numactl --physcpubind={physical_thread},{logical_thread} '.format(
            physical_thread=i,
            logical_thread=i+THREAD_PER_SOCKET))
      the_file.write('{binary_file} {config_file}\n'.format(
          binary_file=binary,
          config_file=config_file))
  os.chmod(fname, 0o777)

  # create warm-up.sh
  fname = 'warm-up.sh'
  prefill_opt = "prefilling cuckoo" if engine == "slimcache" else "prefilling slab"
  with open(fname, 'w') as the_file:
    the_file.write("""