#!/usr/bin/env python
import cStringIO
import MySQLdb as mdb
import argparse
import string
import plot_utilities as util
import benchmarking_utilities as bu

(server, user, password, table) = bu.loadConfiguration()

parser = argparse.ArgumentParser(description='Generates a cactus plot comparing several jobs.')
parser.add_argument('-j', '--jobids',type=int, nargs='+',
                    help='the ids of jobs to compare', required=True)
parser.add_argument('-f', '--file', type=str,
                    help='the file where to dump the .dat file.', required=True)

args = parser.parse_args()
job_ids=args.jobids
data_file_name = args.file

    
con = mdb.connect(server, user, password, table);

with con:
    cur = con.cursor()
    plot_xlabel = "benchmarks solved"
    plot_ylabel = "cummulative time"

    gnuplot_command = cStringIO.StringIO()

    data_file = open(data_file_name, 'w')
#!/usr/bin/env python

import MySQLdb as mdb
import cStringIO
import argparse
import string
import benchmarking_utilities as bu
import plot_utilities as util

(server, user, password, database) = bu.loadConfiguration()

parser = argparse.ArgumentParser(description='Generates a scatter plot comparing two jobs.')
parser.add_argument('-xj', '--xjob',type=int,
                    help='the job to be plotted on the x axis', required=True)
parser.add_argument('-yj', '--yjob',type=int,
                    help='the job to be plotted on the y axis', required=True)
parser.add_argument('-d', '--datafile', type=str,
                    help='the temporary file where the data will be dumped', required=True)
parser.add_argument('-f', '--family', type=str,
                    help='select only this family when plotting', required=False) 
parser.add_argument('-j', '--javascript', type=str,
                    help='the temporary javascript file where array for benchmark names will be dumped', required=True)

args = parser.parse_args()
xjob=args.xjob
yjob=args.yjob
input_family = args.family

data_file_name = args.datafile
javascript_file_name = args.javascript