Created
June 4, 2011 06:14
-
-
Save gadamc/1007651 to your computer and use it in GitHub Desktop.
start jobs on cc GE cluster and use the database to get files that are ready for analysis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from couchdbkit import Server,Database | |
import os, subprocess, sys | |
def main(): | |
datadir = '/sps/edelweis/kdata/data/current' | |
firstRun = 'le26a000' | |
lastRun = 'zz99z999' | |
detectorlist = ['FID802', 'FID804', 'FID803', 'FID806'] | |
s = Server('http://edwdbik.fzk.de:5984') | |
db = s['edwdb'] | |
vr = db.view('proc/tier1', startkey = firstRun, endkey = lastRun) | |
commandbase = 'qsub -P P_edelweis -o $HOME/analysis/tempVtime/qsubOut -e $HOME/analysis/tempVtime/qsubOut -l sps=1 $HOME/analysis/tempVtime/plotVtime.sh' | |
print commandbase | |
for row in vr: | |
doc = db.get(row['id']) | |
for bolo in detectorlist: | |
command = commandbase + ' ' + doc['tier0']['file'] + ' ' + bolo | |
print command | |
p = subprocess.Popen(command, shell=True, stdout = subprocess.PIPE, stderr = subprocess.PIPE) | |
print p.communicate()[0] | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment