Bug fixes. Update timing intervals. Improve output.

This commit is contained in:
David Arndt 2019-03-27 19:57:13 -06:00
parent 0afcbba267
commit 3f0bb8cbac
1 changed files with 15 additions and 18 deletions

View File

@ -156,9 +156,8 @@ module ClassyFireAPI
f = File.open(absolute_path, 'r')
input = []
lines = File.readlines(absolute_path)
puts lines.length, lines[0]
i = 0
lines.uniq.each do |line|
i += 1
@ -181,19 +180,19 @@ module ClassyFireAPI
i = start
if i < initial_nr_of_jobs
while i < initial_nr_of_jobs
while i <= initial_nr_of_jobs
title = File.basename(absolute_path).split(".")[0] + "_yannick" + "_part_#{i}"
title = File.basename(absolute_path).split(".")[0] + "_part_#{i}"
if i <= subdivised_groups.length
puts "\n\n\n\n---------------------- -----------"
puts "\n---------------------------------"
begin
puts "submitting #{title}"
# puts subdivised_groups[i-1].join("\n")
q = submit_query(title,subdivised_groups[i-1].join("\n"),type)
puts JSON.parse(q)['id']
puts "Query ID: " + JSON.parse(q)['id'].to_s
query_ids << JSON.parse(q)['id']
sleep(10)
sleep(20)
rescue Exception => e
puts e.message
puts e.backtrace.inspect
@ -202,38 +201,36 @@ module ClassyFireAPI
else
break
end
query_ids
end
puts "Going to sleep at #{Time.now - @start_time} for #{sleeping_time} s."
sleep(sleeping_time)
puts "Waking up at #{Time.now - @start_time}"
end
while i >= initial_nr_of_jobs && i < subdivised_groups.length
k = 0
for k in (i...(i + initial_nr_of_jobs))
title = File.basename(absolute_path).split(".")[0] + "_yannick" + "_part_#{k}"
title = File.basename(absolute_path).split(".")[0] + "_part_#{k}"
begin
puts "submitting #{title}"
q = submit_query(title,subdivised_groups[k-1].join("\n"),type)
puts JSON.parse(q)['id']
puts "Query ID: " + JSON.parse(q)['id'].to_s
query_ids << JSON.parse(q)['id']
sleep(10)
sleep(20)
rescue Exception => e
puts e.message
puts e.backtrace.inspect
end
i = i + 1
end
i = k
puts "Going to sleep at #{Time.now - @start_time} for #{sleeping_time} s."
sleep(sleeping_time)
puts "Waking up at #{Time.now - @start_time}"
if i >= initial_nr_of_jobs && i < subdivised_groups.length
puts "Going to sleep at #{Time.now - @start_time} for #{sleeping_time} s."
sleep(sleeping_time)
puts "Waking up at #{Time.now - @start_time}"
end
end
puts "Done at #{Time.now - @start_time}"
end
# Takes each file in a folder, and submit the contained structures in bluks of a given size.