Class: DRMAA::JobTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/ood_core/job/adapters/drmaa.rb

Overview

DRMAA job template as required by drmaa_run_job() and drmaa_run_bulk_jobs()

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeJobTemplate

Returns a new instance of JobTemplate.



851
852
853
854
# File 'lib/ood_core/job/adapters/drmaa.rb', line 851

def initialize
    @ptr = DRMAA.allocate_job_template
    ObjectSpace.define_finalizer(self, self.method(:finalize).to_proc)
end

Instance Attribute Details

#ptrObject (readonly)

Returns the value of attribute ptr.



850
851
852
# File 'lib/ood_core/job/adapters/drmaa.rb', line 850

def ptr
  @ptr
end

Instance Method Details

#argObject



988
989
990
# File 'lib/ood_core/job/adapters/drmaa.rb', line 988

def arg() 
    return vget("drmaa_v_argv") 
end

#arg=(argv) ⇒ Object

job arguments



985
986
987
# File 'lib/ood_core/job/adapters/drmaa.rb', line 985

def arg=(argv) 
    vset("drmaa_v_argv", argv) 
end

#block_mail=(block) ⇒ Object



960
961
962
963
964
965
966
# File 'lib/ood_core/job/adapters/drmaa.rb', line 960

def block_mail=(block)
    if block
        set("drmaa_block_email", "1") 
    else
        set("drmaa_block_email", "0") 
    end
end

#categoryObject



884
885
886
# File 'lib/ood_core/job/adapters/drmaa.rb', line 884

def category()
    return set("drmaa_job_category") 
end

#category=(cat) ⇒ Object

DRMAA job category



881
882
883
# File 'lib/ood_core/job/adapters/drmaa.rb', line 881

def category=(cat)
    set("drmaa_job_category", cat) 
end

#commandObject



876
877
878
# File 'lib/ood_core/job/adapters/drmaa.rb', line 876

def command()
    return get("drmaa_remote_command") 
end

#command=(cmd) ⇒ Object

path of the command to be started as a job



873
874
875
# File 'lib/ood_core/job/adapters/drmaa.rb', line 873

def command=(cmd)
    set("drmaa_remote_command", cmd) 
end

#env=(env) ⇒ Object

job environment



993
994
995
# File 'lib/ood_core/job/adapters/drmaa.rb', line 993

def env=(env) 
    vset("drmaa_v_env", env) 
end

#finalize(id) ⇒ Object



855
856
857
858
# File 'lib/ood_core/job/adapters/drmaa.rb', line 855

def finalize(id)
    # STDERR.puts "... releasing job template"
    DRMAA.delete_job_template(@ptr)
end

#get(name) ⇒ Object



862
863
864
# File 'lib/ood_core/job/adapters/drmaa.rb', line 862

def get(name)
    DRMAA.get_attribute(@ptr, name)
end

#hold=(hold) ⇒ Object

jobs can be submitted in hold state and released later-on



948
949
950
951
952
953
954
# File 'lib/ood_core/job/adapters/drmaa.rb', line 948

def hold=(hold)
    if hold
        set("drmaa_js_state", "drmaa_hold") 
    else
        set("drmaa_js_state", "drmaa_active") 
    end
end

#hold?Boolean

Returns:

  • (Boolean)


955
956
957
958
# File 'lib/ood_core/job/adapters/drmaa.rb', line 955

def hold?
    if get("drmaa_js_state") == "drmaa_hold" 
        true else false end
end

#join=(join) ⇒ Object

join jobs stdout/stderr



969
970
971
972
973
974
975
# File 'lib/ood_core/job/adapters/drmaa.rb', line 969

def join=(join) 
    if join
        set("drmaa_join_files", "y") 
    else
        set("drmaa_join_files", "n") 
    end
end

#join?Boolean

Returns:

  • (Boolean)


976
977
978
979
980
981
982
# File 'lib/ood_core/job/adapters/drmaa.rb', line 976

def join?() 
    if  get("drmaa_join_files") == "y" 
        return true
    else
        return false
    end
end

#mail=(mail) ⇒ Object

mail receipants



998
999
1000
# File 'lib/ood_core/job/adapters/drmaa.rb', line 998

def mail=(mail) 
    vset("drmaa_v_email", mail) 
end

#nameObject



930
931
932
# File 'lib/ood_core/job/adapters/drmaa.rb', line 930

def name
    return get("drmaa_job_name") 
end

#name=(name) ⇒ Object

job name



927
928
929
# File 'lib/ood_core/job/adapters/drmaa.rb', line 927

def name=(name)
    set("drmaa_job_name", name) 
end

#nativeObject



893
894
895
# File 'lib/ood_core/job/adapters/drmaa.rb', line 893

def native()
    return get("drmaa_native_specification") 
end

#native=(nat) ⇒ Object

an opaque string that is interpreted by the DRM refer to DRM documentation for what can be specified here



890
891
892
# File 'lib/ood_core/job/adapters/drmaa.rb', line 890

def native=(nat)
    set("drmaa_native_specification", nat) 
end

#set(name, value) ⇒ Object



859
860
861
# File 'lib/ood_core/job/adapters/drmaa.rb', line 859

def set(name, value)
    DRMAA.set_attribute(@ptr, name, value)
end

#start_time=(time) ⇒ Object

set jobs start time (format “”[[[[CC]YY/]MM/]DD] hh:mm [-|+UU:uu])“)



943
944
945
# File 'lib/ood_core/job/adapters/drmaa.rb', line 943

def start_time=(time)
    set("drmaa_start_time", time) 
end

#stderrObject



917
918
919
# File 'lib/ood_core/job/adapters/drmaa.rb', line 917

def stderr()
    return get("drmaa_error_path") 
end

#stderr=(host_path) ⇒ Object

jobs stderr path (format “[<hostname>]:<file_path>”)



914
915
916
# File 'lib/ood_core/job/adapters/drmaa.rb', line 914

def stderr=(host_path)
    set("drmaa_error_path", host_path) 
end

#stdinObject



901
902
903
# File 'lib/ood_core/job/adapters/drmaa.rb', line 901

def stdin()
    get("drmaa_input_path") 
end

#stdin=(host_path) ⇒ Object

jobs stdin path (format “[<hostname>]:<file_path>”)



898
899
900
# File 'lib/ood_core/job/adapters/drmaa.rb', line 898

def stdin=(host_path)
    set("drmaa_input_path", host_path) 
end

#stdoutObject



909
910
911
# File 'lib/ood_core/job/adapters/drmaa.rb', line 909

def stdout()
    return get("drmaa_output_path") 
end

#stdout=(host_path) ⇒ Object

jobs stdout path (format “[<hostname>]:<file_path>”)



906
907
908
# File 'lib/ood_core/job/adapters/drmaa.rb', line 906

def stdout=(host_path)
    set("drmaa_output_path", host_path) 
end

#transfer=(transfer) ⇒ Object

specifies which files need to be transfered



922
923
924
# File 'lib/ood_core/job/adapters/drmaa.rb', line 922

def transfer=(transfer)
    set("drmaa_transfer_files", transfer) 
end

#vget(name) ⇒ Object



868
869
870
# File 'lib/ood_core/job/adapters/drmaa.rb', line 868

def vget(name)
    DRMAA.get_vector_attribute(@ptr, name)
end

#vset(name, values) ⇒ Object



865
866
867
# File 'lib/ood_core/job/adapters/drmaa.rb', line 865

def vset(name, values)
    DRMAA.set_vector_attribute(@ptr, name, values)
end

#wdObject



938
939
940
# File 'lib/ood_core/job/adapters/drmaa.rb', line 938

def wd
    return get("drmaa_wd") 
end

#wd=(path) ⇒ Object

jobs working directory



935
936
937
# File 'lib/ood_core/job/adapters/drmaa.rb', line 935

def wd=(path)
    set("drmaa_wd", path) 
end