miga-base 1.2.6.0 → 1.2.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a68d83e5dac07c94aa2bafe0eda06ba074d5b87f9d7bf97e521a5be3e59aa296
4
- data.tar.gz: d9309d82f51e9bfce7cc18c8b32de6ab1491cf1fc3fd9b5af660298490bac2b8
3
+ metadata.gz: 424c00c37c64745ef9bf6441793fa8ec030756c5f1c248b6195cb95cd057729d
4
+ data.tar.gz: f29892c2dfe4d28258e5dc31b93d15f8ce3026eafd8159940faa00681e820ece
5
5
  SHA512:
6
- metadata.gz: 9a88c56adfc6fe0b32a708605aca18f798fdfe94a2d4ae62b5dda27b1bd85f8b7d2be4a6fb589c8cd8c56de6c3bdef3b271a2c61112092e01c01058aa7b68f7b
7
- data.tar.gz: d71d65c936ee269d4f7f582f39e680452bf818d4fac827178ccb97ca0b468f5fa0a381148d40b5f92c25b1e57b9a93220e95a510309134b07fe484801cd75210
6
+ metadata.gz: 2792556398cd31e961e34a205ab9783d7377bab9418789323dfe2c9316eca998d7f37e82ee84442b529e3aca4dc7835cb90cf0c1e4d1822559b9666b24791741
7
+ data.tar.gz: a2d323f7f013d1e042f5d68a323585e646b671f68a6fa6dd980584d4352fe32138db049466b335c07c174d110225e55003c02a6564975ba0bb109465118858d4
@@ -35,6 +35,7 @@ module MiGA::Cli::Action::Init::DaemonHelper
35
35
  v[:latency] = cli.ask_user('How long should I sleep? (in secs)', '2').to_i
36
36
  v[:maxjobs] = cli.ask_user('How many jobs can I launch at once?', '6').to_i
37
37
  v[:ppn] = cli.ask_user('How many CPUs can I use per job?', '2').to_i
38
+ v[:nodelist] = nil # <- To enable non-default with default SSH
38
39
  cli.puts 'Setting up internal daemon defaults.'
39
40
  cli.puts 'If you don\'t understand this just leave default values:'
40
41
  v[:cmd] = cli.ask_user(
@@ -100,6 +101,7 @@ module MiGA::Cli::Action::Init::DaemonHelper
100
101
  v[:latency] = cli.ask_user('How long should I sleep? (in secs)', '150').to_i
101
102
  v[:maxjobs] = cli.ask_user('How many jobs can I launch at once?', '300').to_i
102
103
  v[:ppn] = cli.ask_user('How many CPUs can I use per job?', '2').to_i
104
+ v[:nodelist] = nil # <- To enable non-default with default SSH
103
105
  cli.puts 'Setting up internal daemon defaults'
104
106
  cli.puts 'If you don\'t understand this just leave default values:'
105
107
  v[:cmd] = cli.ask_user(
@@ -135,18 +137,32 @@ module MiGA::Cli::Action::Init::DaemonHelper
135
137
 
136
138
  def configure_qsub_msub_daemon(v)
137
139
  queue = cli.ask_user('What queue should I use?', nil, nil, true)
140
+ flavor = v[:type] == 'msub' ? 'msub' :
141
+ cli.ask_user('Select qsub flavor', 'torque', %w[torque sge])
138
142
  v[:latency] = cli.ask_user('How long should I sleep? (in secs)', '150').to_i
139
143
  v[:maxjobs] = cli.ask_user('How many jobs can I launch at once?', '300').to_i
140
144
  v[:ppn] = cli.ask_user('How many CPUs can I use per job?', '2').to_i
145
+ v[:nodelist] = nil # <- To enable non-default with default SSH
141
146
  cli.puts 'Setting up internal daemon defaults.'
142
147
  cli.puts 'If you don\'t understand this just leave default values:'
143
- v[:cmd] = cli.ask_user(
144
- "How should I launch tasks?\n" \
145
- " {{variables}}: script, vars, cpus, log, task_name\n ",
146
- "#{v[:type]} -q '#{queue}' -v '{{vars}}' -l nodes=1:ppn={{cpus}} " \
147
- "{{script}} -j oe -o '{{log}}' -N '{{task_name}}' -l mem=9g " \
148
- "-l walltime=12:00:00 | grep ."
149
- )
148
+ if flavor == 'sge'
149
+ v[:cmd] = cli.ask_user(
150
+ "How should I launch tasks?\n" \
151
+ " {{variables}}: script, vars, cpus, log, task_name, task_name_simple\n ",
152
+ "#{v[:type]} -q '#{queue}' -v '{{vars}}' -pe openmp {{cpus}} " \
153
+ "-j y -o '{{log}}' -N '{{task_name_simple}}' -l h_vmem=9g " \
154
+ "-l h_rt=walltime=12:00:00 '{{script}}' | grep . " \
155
+ "| perl -pe 's/^Your job (\S+) .*/$1/'"
156
+ )
157
+ else
158
+ v[:cmd] = cli.ask_user(
159
+ "How should I launch tasks?\n" \
160
+ " {{variables}}: script, vars, cpus, log, task_name, task_name_simple\n ",
161
+ "#{v[:type]} -q '#{queue}' -v '{{vars}}' -l nodes=1:ppn={{cpus}} " \
162
+ "-j oe -o '{{log}}' -N '{{task_name}}' -l mem=9g " \
163
+ "-l walltime=12:00:00 '{{script}}' | grep ."
164
+ )
165
+ end
150
166
  v[:var] = cli.ask_user(
151
167
  "How should I pass variables?\n" \
152
168
  " {{variables}}: key, value\n ",
@@ -156,13 +172,23 @@ module MiGA::Cli::Action::Init::DaemonHelper
156
172
  'What should I use to separate variables?', ','
157
173
  )
158
174
  if v[:type] == 'qsub'
159
- v[:alive] = cli.ask_user(
160
- "How can I know that a process is still alive?\n" \
161
- " Output should be 1 for running and 0 for non-running\n" \
162
- " {{variables}}: pid\n ",
163
- "qstat -f '{{pid}}' | grep ' job_state =' | perl -pe 's/.*= //' " \
164
- "| grep '[^C]' | tail -n 1 | wc -l | awk '{print $1}'"
165
- )
175
+ if flavor == 'sge'
176
+ v[:alive] = cli.ask_user(
177
+ "How can I know that a process is still alive?\n" \
178
+ " Output should be 1 for running and 0 for non-running\n" \
179
+ " {{variables}}: pid\n ",
180
+ "qstat -j '{{pid}}' -s pr 2>/dev/null | head -n 1 | wc -l " \
181
+ "| awk '{print $1}'"
182
+ )
183
+ else
184
+ v[:alive] = cli.ask_user(
185
+ "How can I know that a process is still alive?\n" \
186
+ " Output should be 1 for running and 0 for non-running\n" \
187
+ " {{variables}}: pid\n ",
188
+ "qstat -f '{{pid}}' | grep ' job_state =' | perl -pe 's/.*= //' " \
189
+ "| grep '[^C]' | tail -n 1 | wc -l | awk '{print $1}'"
190
+ )
191
+ end
166
192
  v[:kill] = cli.ask_user(
167
193
  "How should I terminate tasks?\n" \
168
194
  " {{variables}}: pid\n ",
data/lib/miga/daemon.rb CHANGED
@@ -257,6 +257,7 @@ class MiGA::Daemon < MiGA::MiGA
257
257
  cpus: ppn(what),
258
258
  log: File.join(log_dir, "#{to_run[:ds_name]}.log"),
259
259
  task_name: to_run[:task_name],
260
+ task_name_simple: to_run[:task_name].gsub(/[^A-Za-z0-9_]/, '-'),
260
261
  miga: File.join(MiGA::MiGA.root_path, 'bin/miga').shellescape
261
262
  }
262
263
  runopts_for(:cmd, what).miga_variables(var_hsh)
data/lib/miga/version.rb CHANGED
@@ -12,7 +12,7 @@ module MiGA
12
12
  # - String indicating release status:
13
13
  # - rc* release candidate, not released as gem
14
14
  # - [0-9]+ stable release, released as gem
15
- VERSION = [1.2, 6, 0].freeze
15
+ VERSION = [1.2, 6, 3].freeze
16
16
 
17
17
  ##
18
18
  # Nickname for the current major.minor version.
@@ -20,7 +20,7 @@ module MiGA
20
20
 
21
21
  ##
22
22
  # Date of the current gem relese.
23
- VERSION_DATE = Date.new(2022, 5, 23)
23
+ VERSION_DATE = Date.new(2022, 6, 24)
24
24
 
25
25
  ##
26
26
  # References of MiGA
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6.0
4
+ version: 1.2.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-23 00:00:00.000000000 Z
11
+ date: 2022-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons