Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:37

0001 import subprocess
0002 import sys
0003 def submit(dataset, run):
0004     cfg=""
0005     with open("crabConfig.py","r") as f:
0006         cfg=f.readlines()
0007         cfg[0]="runNumber = "+str(run)+'\n'
0008         cfg[1]="dataset = "+'\"'+str(dataset)+'\"\n'
0009         
0010     with open("crabConfig.py","w") as f:
0011         f.writelines(cfg)
0012             
0013         
0014     subprocess.run(["crab", "submit", "-c", "crabConfig.py"])
0015     
0016 submit_child=os.fork()  
0017 if submit_child==0: 
0018     if sys.argv[2]=="range":
0019         for run in range(int(sys.argv[3]),int(sys.argv[4])+1):
0020             submit(sys.argv[1], run)
0021     else:
0022         for run in sys.argv[2:]:
0023             submit(sys.argv[1], run)
0024 else:
0025     print("submission process detached")
0026