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

Comparing COMP/CRAB/python/SchedulerCondor.py (file contents):
Revision 1.1 by ewv, Mon Apr 28 21:18:06 2008 UTC vs.
Revision 1.6 by ewv, Thu May 29 19:20:40 2008 UTC

# Line 20 | Line 20 | class SchedulerCondor(SchedulerLocal) :
20      Scheduler.__init__(self,"CONDOR")
21      return
22  
23 +
24    def configure(self, cfg_params):
25      SchedulerLocal.configure(self, cfg_params)
26      self.environment_unique_identifier ='${HOSTNAME}_${CONDOR_ID}_' + common._db.queryTask('name')
27      return
28  
29 +
30    def sched_parameter(self,i,task):
31      """
32      Return scheduler-specific parameters
# Line 37 | Line 39 | class SchedulerCondor(SchedulerLocal) :
39  
40      return sched_param
41  
42 <  def loggingInfo(self, id):
43 <    """ return logging info about job nj """
44 <    cmd = 'something'
45 <    #cmd_out = runCommand(cmd)
46 <    return ''
42 >
43 >  def realSchedParams(self,cfg_params):
44 >    """
45 >    Return dictionary with specific parameters, to use
46 >    with real scheduler
47 >    """
48 >
49 >    tmpDir = os.path.join(common.work_space.shareDir(),'.condor_temp')
50 >    params = {'tmpDir':tmpDir}
51 >    return  params
52 >
53 >
54 >  def decodeLogInfo(self, file):
55 >    """
56 >    Parse logging info file and return main info
57 >    """
58 >    import CondorGLoggingInfo
59 >    loggingInfo = CondorGLoggingInfo.CondorGLoggingInfo()
60 >    reason = loggingInfo.decodeReason(file)
61 >    return reason
62 >
63 >
64 >  def wsExitFunc(self):
65 >    """
66 >    """
67 >    txt = '\n'
68 >    txt += '#\n'
69 >    txt += '# EXECUTE THIS FUNCTION BEFORE EXIT \n'
70 >    txt += '#\n\n'
71 >
72 >    txt += 'func_exit() { \n'
73 >    txt += '    if [ $PYTHONPATH ]; then \n'
74 >    txt += '        update_fjr\n'
75 >    txt += '    fi\n'
76 >    txt += '    for file in $filesToCheck ; do\n'
77 >    txt += '        if [ -e $file ]; then\n'
78 >    txt += '            echo "tarring file $file in  $out_files"\n'
79 >    txt += '        else\n'
80 >    txt += '            echo "WARNING: output file $file not found!"\n'
81 >    txt += '        fi\n'
82 >    txt += '    done\n'
83 >    txt += '    final_list=$filesToCheck\n'
84 >    txt += '    echo "JOB_EXIT_STATUS = $job_exit_code"\n'
85 >    txt += '    echo "JobExitCode=$job_exit_code" >> $RUNTIME_AREA/$repo\n'
86 >    txt += '    dumpStatus $RUNTIME_AREA/$repo\n'
87 >    txt += '    tar zcvf ${out_files}.tgz  ${final_list}\n'
88 >    txt += '    cp  ${out_files}.tgz $ORIG_WD/\n'
89 >    txt += '    cp  crab_fjr_$NJob.xml $ORIG_WD/\n'
90 >
91 >    txt += '    exit $job_exit_code\n'
92 >    txt += '}\n'
93 >
94 >    return txt
95 >
96 >  def wsInitialEnvironment(self):
97 >    """
98 >    Returns part of a job script which does scheduler-specific work.
99 >    """
100 >
101 >    txt  = '\n# Written by SchedulerCondor::wsInitialEnvironment\n'
102 >    txt += 'echo "Beginning environment"\n'
103 >    txt += 'printenv | sort\n'
104 >
105 >    txt += 'middleware='+self.name()+' \n'
106 >    txt += """
107 > if [ $_CONDOR_SCRATCH_DIR ] && [ -d $_CONDOR_SCRATCH_DIR ]; then
108 >    ORIG_WD=`pwd`
109 >    echo "Change from $ORIG_WD to Condor scratch directory: $_CONDOR_SCRATCH_DIR"
110 >    if [ -e ../default.tgz ] ;then
111 >      echo "Found ISB in parent directory (Local Condor)"
112 >      cp ../default.tgz $_CONDOR_SCRATCH_DIR
113 >    fi
114 >    cd $_CONDOR_SCRATCH_DIR
115 > fi
116 > """
117 >
118 >    return txt

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines