batch_experiment 2.1.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/lib/batch_experiment.rb +10 -1
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb21aced236afeab6cb877512fbee1ada7ab2dde
4
- data.tar.gz: 3bad54b770bfa6ca0c0e6911d664ae0103fc6c1e
3
+ metadata.gz: 193dd9c4b80ffc484d36387cf6f5a890fb94fc9f
4
+ data.tar.gz: 964b09bb90d7561781aea92aedceea75d51fa39d
5
5
  SHA512:
6
- metadata.gz: 3f865e8ad58621ace9b857ec921f92136b441c7ebe3efd798e0d32146262a93f0131f7451ff02a424bd096dba635eb31ae6ec2c0f6dd65d5cb816b950355c82d
7
- data.tar.gz: 6f3883e158f47949c2337e0f9fd3e43d5a9777ac133f1ecab86b9eec25a91f133ccb6128601e1bbe2bf85d18511230defaf90d65e096ad61c49c6be2479e6f69
6
+ metadata.gz: 7958d2968951167115da3b6a44ed3760b381a55e994a72420d6ea3039a9c8281644515a38436f766f3bc7dd20f8f467ee95a9ff906eede69842bdeb22c846c77
7
+ data.tar.gz: bd359497c5eb6878ad90178b1909533917fc6c67dd0be709ded77baccb4705ebf4976873d17cc866c058d13d390bc6528233bceacf0054ba5517a92e4ee483dc
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --no-private
@@ -1,5 +1,6 @@
1
1
  require 'childprocess'
2
2
  require 'pathname'
3
+ require 'socket'
3
4
 
4
5
  # The main module, the two main utility methods offered are ::batch and
5
6
  # ::experiment.
@@ -97,6 +98,11 @@ module BatchExperiment
97
98
  free_cpus.push(job[:cpu])
98
99
  File.delete(job[:lockfname])
99
100
  comms_executed << job[:command]
101
+ out = job[:out_file]
102
+ out.write("\ncommand: " + job[:command])
103
+ out.write("\ndate_before: " + job[:date_before].utc.to_s)
104
+ out.write("\ndate_after: " + Time.now.utc.to_s)
105
+ out.write("\nhostname: " + Socket.gethostname)
100
106
  end
101
107
  exited # bool returned to delete_if
102
108
  end
@@ -246,13 +252,16 @@ module BatchExperiment
246
252
  cproc.io.stdout = out
247
253
  cproc.io.stderr = err
248
254
 
255
+ date_before = Time.now
249
256
  cproc.start
250
257
 
251
258
  comms_running << {
252
259
  proc: cproc,
253
260
  cpu: cpu,
254
261
  lockfname: lockfname,
255
- command: command
262
+ command: command,
263
+ date_before: date_before,
264
+ out_file: out,
256
265
  }
257
266
 
258
267
  # The lock file now stores the process pid for debug reasons.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batch_experiment
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique Becker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-30 00:00:00.000000000 Z
11
+ date: 2016-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: childprocess
@@ -30,6 +30,7 @@ executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
+ - ".yardopts"
33
34
  - README.md
34
35
  - examples/bible.txt
35
36
  - examples/debug_batch.rb
@@ -45,8 +46,7 @@ licenses:
45
46
  - Unlicense
46
47
  metadata: {}
47
48
  post_install_message:
48
- rdoc_options:
49
- - "--no-private"
49
+ rdoc_options: []
50
50
  require_paths:
51
51
  - lib
52
52
  required_ruby_version: !ruby/object:Gem::Requirement