summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drmaa/v1/low.scm31
1 files changed, 19 insertions, 12 deletions
diff --git a/drmaa/v1/low.scm b/drmaa/v1/low.scm
index 55d699e..4e9ac55 100644
--- a/drmaa/v1/low.scm
+++ b/drmaa/v1/low.scm
@@ -296,18 +296,25 @@ not be affected by this."
(char*->string value)
error-message)))
-(define (set-vector-attribute! template name . values)
- (let ((error-message
- (make-char* (bytevector->pointer
- (make-bytevector (DRMAA 'ERROR_STRING_BUFFER)))))
- (array (make-cstr-array values)))
- (return (drmaa_set_vector_attribute template
- name
- (bytevector->pointer array)
- error-message
- (DRMAA 'ERROR_STRING_BUFFER))
- #true
- error-message)))
+(define set-vector-attribute!
+ (let ((valid (get-vector-attribute-names)))
+ (lambda (template name . values)
+ (unless (member name valid)
+ (raise (condition
+ (&formatted-message
+ (format "This DRMAA implementation does not support the vector attribute `~a'.~%")
+ (arguments (list name))))))
+ (let ((error-message
+ (make-char* (bytevector->pointer
+ (make-bytevector (DRMAA 'ERROR_STRING_BUFFER)))))
+ (array (make-cstr-array values)))
+ (return (drmaa_set_vector_attribute template
+ name
+ (bytevector->pointer array)
+ error-message
+ (DRMAA 'ERROR_STRING_BUFFER))
+ #true
+ error-message)))))
(define (get-vector-attribute template name)
(let ((error-message