135 |
|
try: self.EDG_cpu_time = cfg_params['EDG.max_cpu_time'] |
136 |
|
except KeyError: self.EDG_cpu_time = '' |
137 |
|
|
138 |
+ |
|
139 |
+ |
try: self.schedulerName = cfg_params['CRAB.scheduler'] |
140 |
+ |
except KeyError: self.schedulerName = '' |
141 |
+ |
|
142 |
+ |
try: self.jobtypeName = cfg_params['CRAB.jobtype'] |
143 |
+ |
except KeyError: self.jobtypeName = '' |
144 |
+ |
|
145 |
|
# Add EDG_WL_LOCATION to the python path |
146 |
|
try: |
147 |
|
path = os.environ['EDG_WL_LOCATION'] |
437 |
|
Check the compatibility of available resources |
438 |
|
""" |
439 |
|
self.checkProxy() |
440 |
< |
jdl = common.job_list[nj].jdlFilename() |
440 |
> |
# jdl = common.job_list[nj].jdlFilename() |
441 |
> |
jdl = common.work_space.shareDir()+"fake.jdl" |
442 |
|
cmd = 'glite-job-list-match ' + self.configOpt_() + jdl |
443 |
|
cmd_out = runCommand(cmd,0,10) |
444 |
|
if not cmd_out: |
609 |
|
return cmd_out |
610 |
|
|
611 |
|
|
612 |
+ |
def createFakeJdl(self,nj): # TMP Just waiting listmatch functionalitly |
613 |
+ |
# implementation into BOSS4 Daniele |
614 |
+ |
""" |
615 |
+ |
Create a fake jdl considering |
616 |
+ |
only requirements |
617 |
+ |
""" |
618 |
+ |
job = common.job_list[nj] |
619 |
+ |
jbt = job.type() |
620 |
+ |
inp_storage_subdir = '' |
621 |
+ |
|
622 |
+ |
|
623 |
+ |
SPL = inp_storage_subdir |
624 |
+ |
if ( SPL and SPL[-1] != '/' ) : SPL = SPL + '/' |
625 |
+ |
|
626 |
+ |
jdl = open(common.work_space.shareDir()+"fake.jdl","w") |
627 |
+ |
|
628 |
+ |
script = job.scriptFilename() |
629 |
+ |
jdl.write('Executable = "' + os.path.basename(script) +'";\n') |
630 |
+ |
|
631 |
+ |
req='Requirements = ' |
632 |
+ |
noreq=req |
633 |
+ |
req = req + jbt.getRequirements() |
634 |
+ |
#### and USER REQUIREMENT |
635 |
+ |
if self.EDG_requirements: |
636 |
+ |
if (req != noreq): |
637 |
+ |
req = req + ' && ' |
638 |
+ |
req = req + self.EDG_requirements |
639 |
+ |
#### FEDE ##### |
640 |
+ |
if self.EDG_ce_white_list: |
641 |
+ |
ce_white_list = string.split(self.EDG_ce_white_list,',') |
642 |
+ |
#print "req = ", req |
643 |
+ |
for i in range(len(ce_white_list)): |
644 |
+ |
if i == 0: |
645 |
+ |
if (req != noreq): |
646 |
+ |
req = req + ' && ' |
647 |
+ |
req = req + '((RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))' |
648 |
+ |
pass |
649 |
+ |
else: |
650 |
+ |
req = req + ' || (RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))' |
651 |
+ |
req = req + ')' |
652 |
+ |
|
653 |
+ |
if self.EDG_ce_black_list: |
654 |
+ |
ce_black_list = string.split(self.EDG_ce_black_list,',') |
655 |
+ |
for ce in ce_black_list: |
656 |
+ |
if (req != noreq): |
657 |
+ |
req = req + ' && ' |
658 |
+ |
req = req + '(!RegExp("' + ce + '", other.GlueCEUniqueId))' |
659 |
+ |
pass |
660 |
+ |
|
661 |
+ |
############### |
662 |
+ |
clockTime=480 |
663 |
+ |
if self.EDG_clock_time: |
664 |
+ |
clockTime= self.EDG_clock_time |
665 |
+ |
if (req != noreq): |
666 |
+ |
req = req + ' && ' |
667 |
+ |
req = req + '((other.GlueCEPolicyMaxWallClockTime == 0) || (other.GlueCEPolicyMaxWallClockTime>='+str(clockTime)+'))' |
668 |
+ |
|
669 |
+ |
cpuTime=1000 |
670 |
+ |
if self.EDG_cpu_time: |
671 |
+ |
cpuTime=self.EDG_cpu_time |
672 |
+ |
if (req != noreq): |
673 |
+ |
req = req + ' && ' |
674 |
+ |
req = req + '((other.GlueCEPolicyMaxCPUTime == 0) || (other.GlueCEPolicyMaxCPUTime>='+str(cpuTime)+'))' |
675 |
+ |
|
676 |
+ |
if (req != noreq): |
677 |
+ |
req = req + ';\n' |
678 |
+ |
jdl.write(req) |
679 |
+ |
|
680 |
+ |
jdl.write('VirtualOrganisation = "' + self.VO + '";\n') |
681 |
+ |
|
682 |
+ |
if ( self.EDG_retry_count ): |
683 |
+ |
jdl.write('RetryCount = '+self.EDG_retry_count+';\n') |
684 |
+ |
pass |
685 |
+ |
|
686 |
+ |
jdl.write('MyProxyServer = "' + self.proxyServer + '";\n') |
687 |
+ |
|
688 |
+ |
jdl.close() |
689 |
+ |
return |
690 |
|
def createXMLSchScript(self, nj): |
691 |
|
""" |
692 |
|
Create a XML-file for BOSS4. |
699 |
|
title = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n' |
700 |
|
jt_string = '' |
701 |
|
|
702 |
< |
xml_fname = 'orca.xml' |
702 |
> |
xml_fname = str(self.jobtypeName)+'.xml' |
703 |
|
xml = open(common.work_space.shareDir()+'/'+xml_fname, 'a') |
704 |
|
|
705 |
|
#TaskName |
786 |
|
pass |
787 |
|
pass |
788 |
|
|
789 |
< |
xml.write('<chain scheduler="glite">\n') |
789 |
> |
xml.write('<chain scheduler="'+str(self.schedulerName)+'">\n') |
790 |
|
xml.write(jt_string) |
791 |
|
|
792 |
|
#executable |