00001 #!/usr/bin/env ganga 00002 00003 import time 00004 import sys 00005 import os 00006 00007 #load BOSS Ganga libraries 00008 from GangaBoss.Lib.BossDataSet.BossDataSet import BossDataSet 00009 from GangaBoss.Lib.Boss import InterpretJob 00010 from GangaBoss import * 00011 00012 from Ganga.Core.exceptions import * 00013 00014 ##********************************************************************************** 00015 j=Job() 00016 j.name='BossSim' 00017 j.application = Boss(JobOptions= os.environ['HOME']+'/boss/Generator/Ekhara/Ekhara-00-00-09/run/gen_sim.txt') 00018 00019 ##********************************************************************************** 00020 #choose maximum number of events 00021 ##********************************************************************************** 00022 j.application.EvtMax=-1 00023 00024 ##********************************************************************************** 00025 ##Specify type of job: 'Rec/Ana' or 'Sim' 00026 ##********************************************************************************** 00027 j.application.JobType='Sim' 00028 00029 ##********************************************************************************** 00030 ##choose splitter 00031 ##********************************************************************************** 00032 #j.splitter = None 00033 j.splitter = BoostSplitter(eventsPerJob=4000, numberOfJobs=250) 00034 00035 merger = CustomMerger() 00036 merger.files = ['test.rtraw'] 00037 merger.ignorefailed = True 00038 merger.overwrite = True 00039 merger.module = '/data/work/kpha1/prencipe/local/raid0/bes3/Ganga/gencardMerger.py' 00040 j.merger = merger 00041 00042 ##********************************************************************************** 00043 ##choose backend 00044 ##********************************************************************************** 00045 #j.backend = Local() 00046 ##choose queue: 'batch' or 'batch_x86_64' 00047 #j.backend = PBS(queue='batch_x86_64') 00048 j.backend = PBS() 00049 00050 ##********************************************************************************** 00051 ##select files stored in output directory 00052 ##********************************************************************************** 00053 j.outputsandbox = ['*.rtraw','*.root','*.txt','*.dst'] 00054 00055 ##********************************************************************************** 00056 ##finally sumbit job 00057 ##********************************************************************************** 00058 j.submit() 00059 00060 00061 00062 00063 #while not j.status in ['completed','failed']: 00064 # print "*"*38 00065 # print 'job.status====',j.status 00066 # print('job still running') 00067 # time.sleep(10) 00068 #if j.status=='completed': 00069 # print "*"*38 00070 # print "we have finished this job" 00071 # print "*"*38 00072 # print "log out ,waiting.........." 00073 # print "you can find the outputfile in your gangadir outputfile" 00074 # time.sleep(5) 00075 # sys.exit()