scbi_mapreduce 0.0.29 → 0.0.31
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.
data/History.txt
CHANGED
data/lib/scbi_mapreduce.rb
CHANGED
@@ -4,7 +4,7 @@ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname
|
|
4
4
|
# $: << File.join(File.dirname(__FILE__),File.basename(__FILE__,File.extname(__FILE__)))
|
5
5
|
|
6
6
|
module ScbiMapreduce
|
7
|
-
VERSION = '0.0.
|
7
|
+
VERSION = '0.0.31'
|
8
8
|
end
|
9
9
|
|
10
10
|
require 'scbi_mapreduce/manager'
|
@@ -68,6 +68,9 @@ module ScbiMapreduce
|
|
68
68
|
FileUtils.mkdir_p(File.dirname(log_file)) if ((log_file!=STDOUT) && (!File.exists?(File.dirname(log_file))))
|
69
69
|
$SERVER_LOG = Logger.new(log_file)
|
70
70
|
|
71
|
+
$SERVER_LOG.info("Local workers: #{@workers}")
|
72
|
+
$SERVER_LOG.info("Remote workers: #{@worker_names}")
|
73
|
+
|
71
74
|
|
72
75
|
$SERVER_LOG.datetime_format = "%Y-%m-%d %H:%M:%S"
|
73
76
|
|
@@ -106,6 +106,7 @@ module ScbiMapreduce
|
|
106
106
|
@@count = 0
|
107
107
|
@@chunk_count = 0
|
108
108
|
@@workers = 0
|
109
|
+
@@max_workers = 0
|
109
110
|
@@error_count = 0
|
110
111
|
@@running_jobs=[]
|
111
112
|
# @@compress=true
|
@@ -254,7 +255,7 @@ module ScbiMapreduce
|
|
254
255
|
|
255
256
|
def post_init
|
256
257
|
@@workers += 1
|
257
|
-
|
258
|
+
@@max_workers +=1
|
258
259
|
# when first worker is connected, do special config
|
259
260
|
if @@workers == 1
|
260
261
|
@@total_seconds = Time.now
|
@@ -396,6 +397,8 @@ module ScbiMapreduce
|
|
396
397
|
|
397
398
|
$SERVER_LOG.info "Number of errors: #{@@error_count}"
|
398
399
|
$SERVER_LOG.info "Chunk size: #{@@chunk_size}"
|
400
|
+
$SERVER_LOG.info "Total connected workers: #{@@max_workers}"
|
401
|
+
|
399
402
|
|
400
403
|
|
401
404
|
end
|
@@ -33,6 +33,8 @@ module ScbiMapreduce
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def launch_workers
|
36
|
+
# TODO - si aqui falla algo, no peta, se bloquea
|
37
|
+
$LAUNCHER_LOG.info "Launching #{@workers} local workers"
|
36
38
|
if @workers > 0
|
37
39
|
$LAUNCHER_LOG.info "Connecting #{@workers} local workers to #{@server_ip}:#{@server_port}"
|
38
40
|
threads = []
|
@@ -5,14 +5,11 @@ $: << File.dirname(__FILE__)
|
|
5
5
|
# load required libraries
|
6
6
|
require 'scbi_mapreduce'
|
7
7
|
|
8
|
-
|
9
|
-
require 'scbi_fastq'
|
10
|
-
|
8
|
+
require 'scbi_fastq' #to load fastq files
|
11
9
|
require 'my_worker_manager.rb'
|
12
10
|
|
13
11
|
# check arguments
|
14
12
|
if ARGV.count != 3
|
15
|
-
|
16
13
|
puts "Usage #{File.basename($0)} fastq_file workers chunk_size"
|
17
14
|
puts ""
|
18
15
|
puts "#{File.basename($0)} iterates over all sequences in fastq_file (a file in FastQ format) and removes a MID (barcode) from it"
|
@@ -26,31 +23,19 @@ if !File.exists?(fastq_file_path)
|
|
26
23
|
exit
|
27
24
|
end
|
28
25
|
|
29
|
-
# listen on
|
26
|
+
# listen on ip starting with 10.243 at first available port
|
30
27
|
server_ip='10.243'
|
31
|
-
|
32
|
-
|
33
|
-
ip=ip_list.select{|ip| ip.index(server_ip)==0}.first
|
34
|
-
|
35
|
-
if !ip
|
36
|
-
ip='0.0.0.0'
|
37
|
-
end
|
38
|
-
|
39
|
-
port = 0
|
28
|
+
port = 0
|
40
29
|
|
41
30
|
# set number of workers. You can also provide an array with worker names.
|
42
31
|
# Those workers names can be read from a file produced by the existing
|
43
32
|
# queue system, if any.
|
44
|
-
|
45
|
-
|
46
|
-
|
47
33
|
workers = 4
|
48
34
|
|
49
35
|
# read optional workers parameter
|
50
|
-
|
36
|
+
input_workers = ARGV.shift
|
51
37
|
if !input_workers.nil?
|
52
|
-
# if it is a file
|
53
|
-
if File.exists?(input_workers)
|
38
|
+
if File.exists?(input_workers) # if it is a file
|
54
39
|
# read workers into array
|
55
40
|
workers=File.read(input_workers).split("\n").map{|w| w.chomp}
|
56
41
|
else
|
@@ -59,6 +44,7 @@ if !input_workers.nil?
|
|
59
44
|
end
|
60
45
|
end
|
61
46
|
|
47
|
+
# read chunk size from args
|
62
48
|
chunk_size = ARGV.shift.to_i
|
63
49
|
|
64
50
|
# we need the path to my_worker in order to launch it when necessary
|
@@ -68,7 +54,7 @@ custom_worker_file = File.join(File.dirname(__FILE__),'my_worker.rb')
|
|
68
54
|
MyWorkerManager.init_work_manager(fastq_file_path)
|
69
55
|
|
70
56
|
# launch processor server
|
71
|
-
mgr = ScbiMapreduce::Manager.new(
|
57
|
+
mgr = ScbiMapreduce::Manager.new(server_ip, port, workers, MyWorkerManager, custom_worker_file, STDOUT,'~seqtrimnext/init_env')
|
72
58
|
|
73
59
|
# you can set additional properties
|
74
60
|
# =================================
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: scbi_mapreduce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.31
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Dario Guerrero
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-17 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: eventmachine
|