parameters: (f, data_filename, description, ncores, gflops, max_pipes_and_stages)
docstring: f is the file to write the script to
      data_filename is the where the data ends up
      description describes the machine
      ncores is the number of cores (used to size the workload)
      gflops is the estimated GFLOPS per core (used to size the workload)
docstring_summary: f is the file to write the script to
      data_filename is the where the data ends up
      description describes the machine
      ncores is the number of cores (used to size the workload)
      gflops is the estimated GFLOPS per core (used to size the workload)
docstring_tokens: f is the file to write the script to data_filename is the where the data ends up description describes the machine ncores is the number of cores ( used to size the workload ) gflops is the estimated GFLOPS per core ( used to size the workload )
function: def write_shell_script(f, data_filename, description, ncores, gflops, max_pipes_and_stages):
      """
      f is the file to write the script to
      data_filename is the where the data ends up
      description describes the machine
      ncores is the number of cores (used to size the workload)
      gflops is the estimated GFLOPS per core (used to size the workload)
      """
  
      f.write("#!/bin/sh\n")
      f.write("(\n")
      if description:
          f.write("echo '#D %s'\n" % (description,))
  
      for npipes in range(1, max_pipes_and_stages + 1):
          for nstages in range(1, max_pipes_and_stages + 1):
              # We'd like each run of synthetic to take ~10 seconds
              desired_time_per_run = 10
              est_gflops_avail = min(nstages * npipes, ncores) * gflops
              nsamples = (est_gflops_avail * desired_time_per_run) / \
                  (512.0 * nstages * npipes)
              nsamples = int(nsamples * 1e9)
  
              cmd = "./synthetic.py -m -s %d -p %d -N %d\n" % (
                  nstages, npipes, nsamples)
              f.write(cmd)
              f.write('if test $? -ge 128; then exit 128; fi\n')
  
      f.write(") 2>&1 | grep --line-buffered -v '^>>>' | tee %s\n" %
              (data_filename,))
      f.flush()
function_tokens: def write_shell_script ( f , data_filename , description , ncores , gflops , max_pipes_and_stages ) : f . write ( "#!/bin/sh\n" ) f . write ( "(\n" ) if description : f . write ( "echo '#D %s'\n" % ( description , ) ) for npipes in range ( 1 , max_pipes_and_stages + 1 ) : for nstages in range ( 1 , max_pipes_and_stages + 1 ) : # We'd like each run of synthetic to take ~10 seconds desired_time_per_run = 10 est_gflops_avail = min ( nstages * npipes , ncores ) * gflops nsamples = ( est_gflops_avail * desired_time_per_run ) / ( 512.0 * nstages * npipes ) nsamples = int ( nsamples * 1e9 ) cmd = "./synthetic.py -m -s %d -p %d -N %d\n" % ( nstages , npipes , nsamples ) f . write ( cmd ) f . write ( 'if test $? -ge 128; then exit 128; fi\n' ) f . write ( ") 2>&1 | grep --line-buffered -v '^>>>' | tee %s\n" % ( data_filename , ) ) f . flush ( )