add_benchmarks, sep): dbcon = telescope.connectUsingCredentials(te_creds) with dbcon: dbcur = dbcon.cursor() with starexecpipe.StarExecPipe(se_creds, "toPopulateSpace") as pipe: telescope.populateSpace(pipe, dbcur, space_id, space_name, add_benchmarks, sep) if commit: dbcon.commit() else: dbcon.rollback() dbcon.close() parser = starexecparser.StarExecParser( 'Populates a space on star exec recursively') parser.addSpaceId() parser.addSpaceName() parser.addTelescopeCredentials() parser.addStarExecCredentials() parser.addCommit() parser.addAddBenchmarks() parser.addSeperator() parser.processArgs() space_id = parser.getSpaceId() space_name = parser.getSpaceName() te_creds = parser.getTelescopeCredentials() se_creds = parser.getStarExecCredentials() commit = parser.getCommit() add_benchmarks = parser.getAddBenchmarks()
def toAddSolver(te_creds, solver_id, space_ids, name, description, version, commit): dbcon = telescope.connectUsingCredentials(te_creds) with dbcon: dbcur = dbcon.cursor() telescope.addSolver(dbcur, solver_id, space_ids, name, description, version) if commit: dbcon.commit() else: dbcon.rollback() dbcon.close() parser = starexecparser.StarExecParser('Add a solver.') parser.addSolverId() parser.addTelescopeCredentials() parser.addOptionalName() parser.addOptionalDescription() parser.addOptionalVersion() parser.addCommit() parser.addOptionalSpaceIdList() parser.processArgs() te_creds = parser.getTelescopeCredentials() solver_id = parser.getSolverId() name = parser.getOptionalName() description = parser.getOptionalDescription() version = parser.getOptionalVersion() commit = parser.getCommit()
#!/usr/bin/env python import starexecparser import starexecpipe parser = starexecparser.StarExecParser('Download a completed getjobinfo file') parser.addJobId() parser.addStarExecCredentials() parser.addOptionalZipFile() parser.processArgs() se_creds = parser.getStarExecCredentials() job_id = parser.getJobId() zipfile = parser.getZipFile() if zipfile is None: zipfile = 'Job' + str(job_id) + '_info.zip' with starexecpipe.StarExecPipe(se_creds) as pipe: with open(zipfile, 'w') as zf: pipe.getjobinfo(job_id, zipfile, True)
with dbcon: dbcur = dbcon.cursor() return telescope.toPostprocessResultsForJob(dbcur, job_id) dbcon.close() def postProcessJob(te_creds, se_creds, job_id, num_workers, ppchoices, add_new_stats, commit): result_ids = toPostprocessResults(te_creds, job_id) print "Results to post process for", job_id print "\t", result_ids spawnWorkers(result_ids, num_workers, te_creds, se_creds, ppchoices, add_new_stats, commit) parser = starexecparser.StarExecParser('Post process a job.') parser.addJobId() parser.addTelescopeCredentials() parser.addStarExecCredentials() parser.addOptionalNumWorkers(5) parser.addCommit() parser.addAddNewStatistics() parser.addPostprocessorChoices() parser.processArgs() te_creds = parser.getTelescopeCredentials() se_creds = parser.getStarExecCredentials() job_id = parser.getJobId() num_workers = parser.getOptionalNumWorkers() commit = parser.getCommit() add_new_stats = parser.getAddNewStatistics()
import telescope def toAddConfig(te_creds, config_id, solver_id, name, description, commit): dbcon = telescope.connectUsingCredentials(te_creds) with dbcon: dbcur = dbcon.cursor() telescope.addConfig(dbcur, config_id, solver_id, name, description) if commit: dbcon.commit() else: dbcon.rollback() dbcon.close() parser = starexecparser.StarExecParser('Add a config to a solver.') parser.addConfigId() parser.addSolverId() parser.addTelescopeCredentials() parser.addOptionalName() parser.addOptionalDescription() parser.addCommit() parser.processArgs() te_creds = parser.getTelescopeCredentials() config_id = parser.getConfigId() solver_id = parser.getSolverId() name = parser.getOptionalName() description = parser.getOptionalDescription() commit = parser.getCommit()
with dbcon: dbcur = dbcon.cursor() if generate_space_paths: telescope.generateSpacePaths(dbcur, sep, space_id) telescope.addProblemSet(dbcur, space_id, name, description) if commit: dbcon.commit() else: dbcon.rollback() dbcon.close() parser = starexecparser.StarExecParser('Adds a problem set') parser.addSpaceId() parser.addTelescopeCredentials() parser.addOptionalName() parser.addOptionalDescription() parser.addGenerateSpacePaths() parser.addSeperator() parser.addCommit() parser.processArgs() te_creds = parser.getTelescopeCredentials() space_id = parser.getSpaceId() name = parser.getOptionalName() description = parser.getOptionalDescription() sep = parser.getSeperator() commit = parser.getCommit()
cpu, wc, mem, email = job_fields telescope.addJob(dbcur, job_id, problem_set_id, name, description, cpu, wc, mem, email) if gajps: telescope.addJobConfigPairs(dbcur, job_id) print config_ids if config_ids: telescope.addSubsetJobConfigPairs(dbcur, job_id, config_ids) if commit: dbcon.commit() else: dbcon.rollback() dbcon.close() parser = starexecparser.StarExecParser( 'Adds a PRE-EXISTING job to the database for an existing problem set') parser.addJobId() parser.addProblemSetId() parser.addTelescopeCredentials() parser.addOptionalName() parser.addOptionalDescription() parser.addOptionalJobFields() parser.addOptionalGenerateActiveJobPairs() parser.addOptionalConfigIdList() parser.addCommit() parser.processArgs() te_creds = parser.getTelescopeCredentials() job_id = parser.getJobId() problem_set_id = parser.getProblemSetId() name = parser.getOptionalName()
import telescope def toAddZippedCsvFile(te_creds, job_id, zipfile, internal, commit): dbcon = telescope.connectUsingCredentials(te_creds) with dbcon: dbcur = dbcon.cursor() telescope.addZippedCsvFile(dbcur, job_id, zipfile, internal) if commit: dbcon.commit() else: dbcon.rollback() dbcon.close() parser = starexecparser.StarExecParser('Add results for a completed job.') parser.addJobId() parser.addOptionalZipFile() parser.addTelescopeCredentials() parser.addCommit() parser.addOptionalInternalFile() parser.processArgs() job_id = parser.getJobId() zipfile = parser.getZipFile() te_creds = parser.getTelescopeCredentials() commit = parser.getCommit() internal = parser.getOptionalInternalFile() if zipfile is None: zipfile = 'Job' + str(job_id) + '_info.zip'