ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/SchedulerEdg.py
(Generate patch)

Comparing COMP/CRAB/python/SchedulerEdg.py (file contents):
Revision 1.73.2.3 by spiga, Wed Jul 19 14:57:09 2006 UTC vs.
Revision 1.73.2.4 by spiga, Thu Jul 20 18:32:30 2006 UTC

# Line 154 | Line 154 | class SchedulerEdg(Scheduler):
154          except:
155              self._taskId = ''
156  
157 +        try: self.jobtypeName = cfg_params['CRAB.jobtype']
158 +        except KeyError: self.jobtypeName = ''
159 +
160 +        try: self.schedulerName = cfg_params['CRAB.scheduler']
161 +        except KeyError: self.scheduler = ''
162 +
163          return
164      
165  
# Line 514 | Line 520 | class SchedulerEdg(Scheduler):
520          Check the compatibility of available resources
521          """
522          self.checkProxy()
523 <        jdl = common.job_list[nj].jdlFilename()
524 <        cmd = 'edg-job-list-match ' + self.configOpt_() + jdl
523 >        jdl = common.work_space.shareDir()+"fake.jdl"
524 >        cmd = 'edg-job-list-match ' + self.configOpt_() + str(jdl)
525          cmd_out = runCommand(cmd,0,10)
526          if not cmd_out:
527              raise CrabException("ERROR: "+cmd+" failed!")
# Line 684 | Line 690 | class SchedulerEdg(Scheduler):
690          cmd = 'edg-job-cancel --noint ' + id
691          cmd_out = runCommand(cmd)
692          return cmd_out
693 +
694 +    def createFakeJdl(self,nj):  # TMP Just waiting listmatch functionalitly  
695 +                                  # implementation into BOSS4   Daniele
696 +        """                          
697 +        Create a fake jdl considering
698 +        only requirements  
699 +        """
700 +        job = common.job_list[nj]
701 +        jbt = job.type()
702 +        inp_storage_subdir = ''
703 +        
704 +        
705 +        SPL = inp_storage_subdir
706 +        if ( SPL and SPL[-1] != '/' ) : SPL = SPL + '/'
707 +
708 +        jdl = open(common.work_space.shareDir()+"fake.jdl","w")
709  
710 +        script = job.scriptFilename()
711 +        jdl.write('Executable = "' + os.path.basename(script) +'";\n')
712 +
713 +        req='Requirements = '
714 +        noreq=req
715 +        req = req + jbt.getRequirements()
716 +        #### and USER REQUIREMENT
717 +        if self.EDG_requirements:
718 +            if (req != noreq):
719 +                req = req +  ' && '
720 +            req = req + self.EDG_requirements
721 +        #### FEDE #####
722 +        if self.EDG_ce_white_list:
723 +            ce_white_list = string.split(self.EDG_ce_white_list,',')
724 +            #print "req = ", req
725 +            for i in range(len(ce_white_list)):
726 +                if i == 0:
727 +                    if (req != noreq):
728 +                        req = req +  ' && '
729 +                    req = req + '((RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))'
730 +                    pass
731 +                else:
732 +                    req = req +  ' || (RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))'
733 +            req = req + ')'
734 +        
735 +        if self.EDG_ce_black_list:
736 +            ce_black_list = string.split(self.EDG_ce_black_list,',')
737 +            for ce in ce_black_list:
738 +                if (req != noreq):
739 +                    req = req +  ' && '
740 +                req = req + '(!RegExp("' + ce + '", other.GlueCEUniqueId))'
741 +                pass
742 +
743 +        ###############
744 +        clockTime=480
745 +        if self.EDG_clock_time:
746 +            clockTime= self.EDG_clock_time
747 +        if (req != noreq):
748 +            req = req + ' && '
749 +        req = req + '((other.GlueCEPolicyMaxWallClockTime == 0) || (other.GlueCEPolicyMaxWallClockTime>='+str(clockTime)+'))'
750 +
751 +        cpuTime=1000
752 +        if self.EDG_cpu_time:
753 +            cpuTime=self.EDG_cpu_time
754 +        if (req != noreq):
755 +            req = req + ' && '
756 +        req = req + '((other.GlueCEPolicyMaxCPUTime == 0) || (other.GlueCEPolicyMaxCPUTime>='+str(cpuTime)+'))'
757 +
758 +        if (req != noreq):
759 +            req = req + ';\n'
760 +            jdl.write(req)
761 +                                                                                                                                                            
762 +        jdl.write('VirtualOrganisation = "' + self.VO + '";\n')
763 +
764 +        if ( self.EDG_retry_count ):              
765 +            jdl.write('RetryCount = '+self.EDG_retry_count+';\n')
766 +            pass
767 +
768 +        jdl.write('MyProxyServer = "' + self.proxyServer + '";\n')
769 +
770 +        jdl.close()
771 +        return
772 +        
773  
774      def createXMLSchScript(self, nj):
775          """
# Line 692 | Line 777 | class SchedulerEdg(Scheduler):
777          """
778          job = common.job_list[nj]
779          jbt = job.type()
780 +
781          inp_sandbox = jbt.inputSandbox(nj)
782          out_sandbox = jbt.outputSandbox(nj)
783 <        
783 >  
784          title = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'
785          jt_string = ''
786          
787 <        xml_fname = 'orca.xml'
787 >        xml_fname = str(self.jobtypeName)+'.xml'
788          xml = open(common.work_space.shareDir()+'/'+xml_fname, 'a')
789  
790          #TaskName  
# Line 785 | Line 871 | class SchedulerEdg(Scheduler):
871                  pass
872              pass
873    
874 <        xml.write('<chain scheduler="edg">\n')
874 >        xml.write('<chain scheduler="'+str(self.schedulerName)+'">\n')
875          xml.write(jt_string)
876  
877          #executable

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines