pbs 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c42c7352f3bed19c09615d1478787d9a806c1231
4
- data.tar.gz: e97cd9bbecb3f5c3cc032a8c6d98eda8e48228b0
3
+ metadata.gz: 57460fc7fac20af4c859698d601fc5b8ea3ec53b
4
+ data.tar.gz: f60a0a6ac99e28696b9569bbb94bee38d1ec3114
5
5
  SHA512:
6
- metadata.gz: c54720352ae8cb8fa44a2c00738bfba451cdfebad7d73b00a310e5e88d6083bd6db9271dccb48918ba64df9b3dd8083101125fafa5fc0a30264f1f31ca3df89e
7
- data.tar.gz: a50902c7b82d77d6e17d502b6f19e7a6aa36f346478831728b5edea822aaebb01c7740cf860bf16b737539382ea4b4d610df983cd820e6b0403913dcd28ee81c
6
+ metadata.gz: a23bc11cabe603ce5cfef73be6a0d9e2da756010e17e25d288abaee633ae85e87c4641e160f19fc2d98a75715477c842c388483e0ce0f56b228e8b579df94169
7
+ data.tar.gz: 898aec140d814a5bdcbfbd11efa47e87c2ec24803f03d851d4a7a5554336e048079ee18039ceb4aede07140d3655826e12f00d9071fec5b5a523953e55e7e776
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 2.0.3 (2016-11-04)
4
+
5
+ Bugfixes:
6
+
7
+ - better support `qsub` CLI arguments
8
+
3
9
  ## 2.0.2 (2016-08-17)
4
10
 
5
11
  Bugfixes:
data/lib/pbs/batch.rb CHANGED
@@ -319,19 +319,62 @@ module PBS
319
319
  end
320
320
  end
321
321
 
322
+ # Mapping of Torque attribute to `qsub` arguments
323
+ def qsub_arg(key, value)
324
+ case key
325
+ # common attributes
326
+ when :Execution_Time
327
+ ['-a', value.to_s]
328
+ when :Checkpoint
329
+ ['-c', value.to_s]
330
+ when :Error_Path
331
+ ['-e', value.to_s]
332
+ when :fault_tolerant
333
+ ['-f']
334
+ when :Hold_Types
335
+ ['-h']
336
+ when :Join_Path
337
+ ['-j', value.to_s]
338
+ when :Keep_Files
339
+ ['-k', value.to_s]
340
+ when :Mail_Points
341
+ ['-m', value.to_s]
342
+ when :Output_Path
343
+ ['-o', value.to_s]
344
+ when :Priority
345
+ ['-p', value.to_s]
346
+ when :Rerunable
347
+ ['-r', value.to_s]
348
+ when :job_array_request
349
+ ['-t', value.to_s]
350
+ when :User_List
351
+ ['-u', value.to_s]
352
+ when :Account_Name
353
+ ['-A', value.to_s]
354
+ when :Mail_Users
355
+ ['-M', value.to_s]
356
+ when :Job_Name
357
+ ['-N', value.to_s]
358
+ when :Shell_Path_List
359
+ ['-S', value.to_s]
360
+ # uncommon attributes
361
+ when :job_arguments
362
+ ['-F', value.to_s]
363
+ when :init_work_dir
364
+ ['-d', value.to_s] # sets PBS_O_INITDIR
365
+ # everything else
366
+ else
367
+ ['-W', "#{key}=#{value}"]
368
+ end
369
+ end
370
+
322
371
  # Submit a script using Torque binary
323
372
  # NB: The binary includes many useful filters and is preferred
324
373
  def qsub_submit(script, queue, headers, resources, envvars)
325
374
  params = ["-q", "#{queue}@#{host}"]
326
- params += resources.map{|k,v| ["-l", "#{k}=#{v}"]}.flatten unless resources.empty?
375
+ params += headers.map {|k,v| qsub_arg(k,v)}.flatten
376
+ params += resources.map{|k,v| ["-l", "#{k}=#{v}"]}.flatten
327
377
  params += ["-v", envvars.map{|k,v| "#{k}=#{v}"}.join(",")] unless envvars.empty?
328
- params += headers.map do |k,v|
329
- if param = ATTR.key(k) and param.length == 1
330
- ["-#{param}", "#{v}"]
331
- else
332
- ["-W", "#{k}=#{v}"]
333
- end
334
- end.flatten
335
378
  params << script
336
379
 
337
380
  env = {
data/lib/pbs/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PBS
2
2
  # The current version of PBS
3
- VERSION = "2.0.2"
3
+ VERSION = "2.0.3"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Nicklas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-17 00:00:00.000000000 Z
11
+ date: 2016-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi