[Gems-users] Please help to check my scripts for cache warming up


Date: Tue, 27 Oct 2009 09:44:01 +0800
From: ruzhu kao <kaoruzhu@xxxxxxxxx>
Subject: [Gems-users] Please help to check my scripts for cache warming up
Hi all:
     I have read the relating topics in ISCA-tutorial and this list. I
assume it needs three steps and then I write these scripts for cold,
warm and run respectively. However, it seems that I should miss some
points which lead to some failure.  The warm and run steps take a long
time and show strange behavior. Can you help to check my scripts and
point out the problem.

#***************below is the cold simics script******************#
@import microbench, workloads, mfacet

@processors = 16
@ruby_proc_map = (1, 2, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16)
@if(processors <= 16):
    ruby_procs = ruby_proc_map[processors]
    proc_no = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
elif (processors <= 32):
    ruby_procs = 32
    proc_no = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]
else:
    processors = -1

@transactions = 1
@dump_interval = 1

@print "running simics with %d processors" % ruby_procs

#############################################
# Load a clean checkpoint                   #
#############################################
@mfacet.run_sim_command('read-configuration
"../../../checkpoints/conf_files/2G_16p/step_2.conf"')
@mfacet.run_sim_command('magic-break-enable')


@sys.path.append("../../gen-scripts")

@hostpath = "/host" + os.getcwd() +
"/../../../microbenchmarks/transactional/stamp/ssca2/"


@command_lines = [
    "bash\n",
    "cp " + hostpath + "ssca2" + " ./\n",
    "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib\n",
    "export PATH=$PATH:/usr/local/bin\n",
    "./ssca2 -s13 -i1.0 -u1.0 -l3 -p3 -t16\n" ]

@mfacet.console_commands(command_lines,"#")

############################################################################
# Copy the binary and execute it in vm  till the first magic breakpoint    #
############################################################################
@mfacet.run_sim_command('instruction-fetch-mode instruction-fetch-trace')
@mfacet.run_sim_command('istc-disable')
@mfacet.run_sim_command('dstc-disable')
@mfacet.run_sim_command('cpu-switch-time 1')
@mfacet.run_sim_command('c')
@print "encounter the first magic breakpoint"

######################################################################
# Continue the executing because it is just for a cold checkpoint    #
######################################################################
@mfacet.setup_run_for_n_transactions(transactions, dump_interval)
@print "running ssca2 on simics + ruby with %d transactions" % transactions
@mfacet.run_sim_command('c')
@print "encounter the second magic breakpoint"

#############################################################
# Execute till the third breakpoint                         #
#############################################################
@mfacet.run_sim_command('c')
@print "encounter the third magic breakpoint"

##############################################################
# Save a cold checkpoint [App]-cold-[clean-checkpoint].conf  #
##############################################################
@mfacet.run_sim_command('write-configuration
"../../../checkpoints/conf_files/2G_16p/ssca2-cold-step_2.conf"')


quit
#-----------------
#***************above is the cold simics script******************#

-------------------------------------------------------------------------------------------------------


#***************below is the warm simics script******************#
@import microbench, workloads, mfacet

@env_dict = workloads.prepare_env_dictionary(simics = 1)
@processors = 16
@ruby_proc_map = (1, 2, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16)
@if(processors <= 16):
    ruby_procs = ruby_proc_map[processors]
    proc_no = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
elif (processors <= 32):
    ruby_procs = 32
    proc_no = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]
else:
    processors = -1

@print "running simics with %d processors" % ruby_procs


@lock_type = 'TM'
@transactions = 1
@dump_interval = 1
@env_dict = workloads.prepare_env_dictionary(simics = 1)
@visualizer = 0

#############################################
# Load the cold checkpoint                  #
#############################################
@mfacet.run_sim_command('read-configuration
"../../../checkpoints/conf_files/2G_16p/ssca2-cold-step_2.conf"')
@mfacet.run_sim_command('magic-break-enable')


@sys.path.append("../../gen-scripts")

@hostpath = "/host" + os.getcwd() +
"/../../../microbenchmarks/transactional/stamp/ssca2/"


@command_lines = [
    "bash\n",
    "cp " + hostpath + "ssca2" + " ./\n",
    "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib\n",
    "export PATH=$PATH:/usr/local/bin\n",
    "psrset -i\n",
    "./ssca2 -s13 -i1.0 -u1.0 -l3 -p3 -t16\n" ]

@mfacet.console_commands(command_lines,"#")

############################################################################
# Copy the binary and execute it in vm  till the first magic breakpoint    #
############################################################################
@mfacet.run_sim_command('c')
@print "encounter the first magic breakpoint"

#################################################
# Configure simics and load ruby                #
#################################################
@microbench.start_ruby(debug=0)

######################################################################
# Warmup the cache to run the parallel part of the application       #
######################################################################
@mfacet.setup_run_for_n_transactions(transactions, dump_interval)
@print "running ssca2 on simics + ruby with %d transactions" % transactions
@mfacet.run_sim_command('c')
@print "encounter the second magic breakpoint"

#########################################
# Save the cache file                   #
#########################################
@cache_filename_prefix = os.getcwd() +
"/../../../microbenchmarks/transactional/stamp/ssca2/" + "ssca2-warm"
@mfacet.run_sim_command('ruby0.save-caches %s.cache.save' %
cache_filename_prefix)

@filename_prefix = os.getcwd() +
"/../../../microbenchmarks/transactional/stamp/ssca2/" +
"ssca2-warm-dump"
@if visualizer == 1:
  mfacet.run_sim_command('ruby0.xact-visualizer-file %s.visual' %
filename_prefix)
@mfacet.run_sim_command('ruby0.dump-stats %s.stats' % filename_prefix)

##############################################################
# Save a warm checkpoint [App]-warm-[clean-checkpoint].conf  #
##############################################################
@mfacet.run_sim_command('write-configuration
"../../../checkpoints/conf_files/2G_16p/ssca2-warm-step_2.conf"')


quit
#-----------------
#***************above is the warm simics script******************#

---------------------------------------------------------------------------------------------------


#***************below is the run simics script******************#
@import microbench, workloads, mfacet

@env_dict = workloads.prepare_env_dictionary(simics = 1)
#@processors = int(workloads.get_var(env_dict, "PROCESSORS"))
@processors = 16
#                 0  1  2  3  4  5  6  7  8   9  10  11  12  13  14  15
@ruby_proc_map = (1, 2, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16)
@if(processors <= 16):
    ruby_procs = ruby_proc_map[processors]
    proc_no = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
elif (processors <= 32):
    ruby_procs = 32
    proc_no = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]
else:
    processors = -1

@print "running simics with %d processors" % ruby_procs


@lock_type = 'TM'
@transactions = 1
@dump_interval = 1
@env_dict = workloads.prepare_env_dictionary(simics = 1)
@visualizer = 0



@mfacet.run_sim_command('read-configuration
"../../../checkpoints/conf_files/2G_16p/ssca2-warm-step_2.conf"')
@mfacet.run_sim_command('magic-break-enable')


@sys.path.append("../../gen-scripts")

@hostpath = "/host" + os.getcwd() +
"/../../../microbenchmarks/transactional/stamp/ssca2/"


@command_lines = [
    "bash\n",
    "cp " + hostpath + "ssca2" + " ./\n",
    "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib\n",
    "export PATH=$PATH:/usr/local/bin\n",
    "psrset -i\n",
    "./ssca2 -s13 -i1.0 -u1.0 -l3 -p3 -t16\n" ]

@mfacet.console_commands(command_lines,"#")
@mfacet.run_sim_command('c')
@print "first magic break point"

@microbench.start_ruby(debug=0)

###############################
# Load cache data             #
###############################
@warmed_cache_file = os.getcwd() +
"/../../../microbenchmarks/transactional/stamp/ssca2/" +
"ssca2-warm.cache.save"
@mfacet.run_sim_command('ruby0.load-caches %s' % warmed_cache_file)
@mfacet.run_sim_command('ruby0.clear-stats')
@mfacet.setup_run_for_n_transactions(transactions, dump_interval)
@print "running ssca2 on simics + ruby with %d transactions" % transactions
@mfacet.run_sim_command('c')

@print "second magic break point"
@filename_prefix = os.getcwd() +
"/../../../microbenchmarks/transactional/stamp/ssca2/" +
"ssca2-warmed-result"
@if visualizer == 1:
  mfacet.run_sim_command('ruby0.xact-visualizer-file %s.visual' %
filename_prefix)
@mfacet.run_sim_command('ruby0.dump-stats %s.stats' % filename_prefix)


quit
#-----------------
#***************above is the run simics script******************#

-----------------------------------------------------------------------------------------------------

  When I use run simics scripts load step_2.conf, the stats file
generated shows counters work well like this.
 XACT CYCLE BREAKDOWN
 XACT_BREAKDOWN_NON_TRANS_CYCLES:  48557592
 XACT_BREAKDOWN_TRANS_CYCLES:      3398260
 XACT_BREAKDOWN_GOOD_TRANS_CYCLES: 3357808
 XACT_BREAKDOWN_ABORTING_CYCLES:   89996
 XACT_BREAKDOWN_COMMITING_CYCLES:  0
 XACT_BREAKDOWN_BACKOFF_CYCLES:    5051407
 XACT_BREAKDOWN_BARRIER_CYCLES:    22622226
 XACT_BREAKDOWN_STALL_CYCLES:      110658
However, when I check the stats file from warm scripts, these counters
look strange like this:
 XACT CYCLE BREAKDOWN
 XACT_BREAKDOWN_NON_TRANS_CYCLES:  122136
 XACT_BREAKDOWN_TRANS_CYCLES:      0
 XACT_BREAKDOWN_GOOD_TRANS_CYCLES: 0
 XACT_BREAKDOWN_ABORTING_CYCLES:   0
 XACT_BREAKDOWN_COMMITING_CYCLES:  0
 XACT_BREAKDOWN_BACKOFF_CYCLES:    0
 XACT_BREAKDOWN_BARRIER_CYCLES:    672
 XACT_BREAKDOWN_STALL_CYCLES:      0

Any suggestions would be welcomed.
    Thanks in advance.


Sincerely yours:
Ruzhu
[← Prev in Thread] Current Thread [Next in Thread→]