#!/usr/bin/python # expCompare [ <expId_spec> ] [ <viewType> ] [ -m <expMetric_list> ] [ <target_list> ] import openss my_file = openss.FileList("../../usability/phaseII/fred 900") my_exptype = openss.ExpTypeList("usertime") my_expid_1 = openss.expCreate(my_file, my_exptype) openss.expGo() openss.wait() my_file = openss.FileList("../../usability/phaseII/fred 1500") my_expid_2 = openss.expCreate(my_file, my_exptype) my_viewtype = openss.ViewTypeList("usertime") my_metric_list = openss.MetricList(["time"]) my_modifier = openss.ModifierList("function") my_ids = openss.ExpId data = openss.expCompare(my_modifier, my_viewtype, my_metric_list) openss.dumpInfo(data) openss.exit()
# <ListOf_expMetric> = listMetrics [ <expId_spec> || all || <expType_list> ] import openss list_type = openss.ModifierList("metrics") my_file = openss.FileList("../../usability/phaseII/fred") my_exptype = openss.ViewTypeList("pcsamp") my_id = openss.expCreate(my_file, my_exptype) my_modifer = openss.ModifierList("all") output = openss.list(list_type) print output output = openss.list(list_type, my_id) print output output = openss.list(list_type, my_exptype) print output output = openss.list(list_type, my_modifer) print output openss.exit()
# <expId> = expRestore <file_spec> import openss data_file = "file_1.dat" my_data_file = openss.FileList(data_file) # Run and save and experiment to read in. my_file = openss.FileList("../../usability/phaseII/fred 900") my_viewtype = openss.ViewTypeList("pcsamp") my_expid = openss.expCreate(my_file, my_viewtype) openss.expGo() openss.wait() openss.expSave(my_data_file) try: my_file = openss.FileList("bad_name") exp1 = openss.expRestore(my_file) print exp1 except openss.error, message: print "Expected error: ", message try: exp1 = openss.expRestore(my_data_file) print exp1 info = openss.expView(exp1) print info except openss.error, message: print "Unexpected error: ", message openss.exit()
openss.expView(exp1,"vtop88") my_cluster = openss.ClusterList("cluster_1") my_cluster.add(["cluster_2"]) my_cluster += ["cluster_3","cluster_4"] my_id = openss.expCreate(my_cluster) my_thread = openss.ThreadList(987) my_thread += 765 my_thread.add((22,33)) my_id = openss.expCreate(my_thread) my_file = openss.FileList("file_1") my_file.add(["file_2"]) my_file += ["file_3","file_4"] my_id = openss.expCreate(my_file) my_pid = openss.PidList(387) my_pid += 2600 my_pid.add((1,25)) my_id = openss.expCreate(my_pid) my_line = openss.LineList(22222) my_line += 222999 my_line.add((333,444))
import openss # Create a FileList object with the name of # the application to analyze. my_file = openss.FileList("../../../executables/fred/fred") # Determine the type of experiment to run. my_exptype = openss.ExpTypeList("pcsamp") # Register the experiment to be run. my_id = openss.expCreate(my_file, my_exptype) # Run the instrumented application openss.expGo() # expGo is the only asynchronous command. We may need # to wait until our app is done before harvesting # the data. openss.wait() # Describe the type of view we want and get the # results of the experiment. my_viewtype = openss.ViewTypeList() my_viewtype += "pcsamp" result = openss.expView(my_id, my_viewtype) # Print out the results. In this case the results are # in a double array. Normally either the structure of # the return value will be known or one will have to # query each of the object elements. r_count = len(result)
# expSave [ <expId_spec> ] [ copy ] <file_spec> import openss import os my_file = openss.FileList("../../usability/phaseII/fred 900") my_viewtype = openss.ViewTypeList("pcsamp") my_expid = openss.expCreate(my_file, my_viewtype) openss.expGo() openss.wait() my_modifer = openss.ModifierList("copy") my_file = openss.FileList("file_1.dat") os.system("rm -f file_1.dat") os.system("ls file_1.dat") openss.expSave(my_expid, my_modifer, my_file) os.system("ls file_1.dat") my_file = openss.FileList("file_2.dat") os.system("rm -f file_2.dat") openss.expSave(my_modifer, my_file) os.system("ls file_2.dat") my_file = openss.FileList("file_3.dat") os.system("rm -f file_3.dat") openss.expSave(my_expid, my_file) os.system("ls file_3.dat")