Class: OSC::Reservations::Adapters::OSCMoab
- Inherits:
-
OSC::Reservations::Adapter
- Object
- OSC::Reservations::Adapter
- OSC::Reservations::Adapters::OSCMoab
- Defined in:
- lib/osc/reservations/adapters/osc_moab.rb
Overview
This adapter is designed for OSC systems using the Moab scheduler. This adapter requires the parameters torque_name
and mrsvctl
in the Batch object to work. Only tested on Torque >4.
Defined Under Namespace
Classes: CommandLineError
Instance Method Summary collapse
-
#query_reservation(batch, id) ⇒ Reservation?
Queries the batch server for a given reservation.
-
#query_reservations(batch) ⇒ Array<Reservation>
Queries the batch server for a list of reservations.
-
#submit_reservation(batch, reservation) ⇒ Reservation
Submits a given reservation to the batch server.
Methods inherited from OSC::Reservations::Adapter
Constructor Details
This class inherits a constructor from OSC::Reservations::Adapter
Instance Method Details
#query_reservation(batch, id) ⇒ Reservation?
Queries the batch server for a given reservation.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/osc/reservations/adapters/osc_moab.rb', line 20 def query_reservation(batch, id) cmd = "#{batch.mrsvctl} --host=#{batch.server} -q #{id} --xml" begin xml = get_xml(cmd, batch) rescue CommandLineError return end r_xml = xml.xpath("//rsv") rsv = parse_rsv(r_xml) query_nodes(rsv, batch) query_node_users(rsv, batch) rsv end |
#query_reservations(batch) ⇒ Array<Reservation>
Queries the batch server for a list of reservations.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/osc/reservations/adapters/osc_moab.rb', line 40 def query_reservations(batch) cmd = "#{batch.mrsvctl} --host=#{batch.server} -q ALL --xml" xml = get_xml(cmd, batch) xml = filter(xml) # filter out "fake" reservations rsv_list = [] xml.xpath("//rsv").each do |r_xml| rsv_list << parse_rsv(r_xml) end query_nodes(rsv_list, batch) query_node_users(rsv_list, batch) rsv_list end |
#submit_reservation(batch, reservation) ⇒ Reservation
Submits a given reservation to the batch server.
60 61 |
# File 'lib/osc/reservations/adapters/osc_moab.rb', line 60 def submit_reservation(batch, reservation) end |