diff options
Diffstat (limited to 'drmaa/v1/high.scm')
-rw-r--r-- | drmaa/v1/high.scm | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/drmaa/v1/high.scm b/drmaa/v1/high.scm index 042f404..f3edda9 100644 --- a/drmaa/v1/high.scm +++ b/drmaa/v1/high.scm @@ -299,6 +299,13 @@ (define-method (lower-job-template (instance <job-template>)) (define klass (class-of instance)) + (define implemented-attributes + (let ((result #false)) + (lambda () + (or result + (begin + (set! result (low:get-attribute-names)) + result))))) (define t #false) (catch #true (lambda () @@ -321,7 +328,31 @@ ((pair? transformed) (apply low:set-vector-attribute! t drmaa transformed)) (else - (low:set-attribute! t drmaa transformed))))))) + (if (member drmaa (implemented-attributes)) + (low:set-attribute! t drmaa transformed) + ;; Use native specification if possible + (cond + ((and (grid-engine?) + (eq? drmaa (low:DRMAA 'DURATION_HLIMIT))) + (add-to-native-specification! t + (format #false "-h_rt ~a" transformed))) + ((and (grid-engine?) + (eq? drmaa (low:DRMAA 'DURATION_SLIMIT))) + (add-to-native-specification! t + (format #false "-s_rt ~a" transformed))) + ((and (grid-engine?) + (eq? drmaa (low:DRMAA 'WCT_HLIMIT))) + (add-to-native-specification! t + (format #false "-h_rt ~a" transformed))) + ((and (grid-engine?) + (eq? drmaa (low:DRMAA 'WCT_SLIMIT))) + (add-to-native-specification! t + (format #false "-s_rt ~a" transformed))) + (else + (raise (condition + (&formatted-message + (format "This DRMAA implementation does not support the attribute `~a'.~%") + (arguments (list drmaa)))))))))))))) (class-slots klass)) t) (lambda (key . args) |