86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
# File 'lib/pwrake/master/master_application.rb', line 86
def standard_rake_options
opts = super
opts.each_with_index do |a,i|
if a[0] == '--version'
a[3] = lambda { |value|
if defined? RAKEVERSION
puts "rake, version #{RAKEVERSION}"
elsif defined? Rake::VERSION
puts "rake, version #{Rake::VERSION}"
end
puts "pwrake, version #{Pwrake::VERSION}"
exit
}
end
end
opts.concat(
[
['-F', '--hostfile FILE',
"[Pw] Read hostnames from FILE",
lambda { |value|
options.hostfile = value
}
],
['-j', '--jobs [N]',
"[Pw] Number of threads at localhost (default: # of processors)",
lambda { |value|
if value
if /^[+-]?\d+$/ =~ value
options.num_threads = value.to_i
else
raise ArgumentError,"Invalid argument for -j: #{value}"
end
else
options.num_threads = 0
end
}
],
['-L', '--log', '--log-dir [DIRECTORY]', "[Pw] Write log to DIRECTORY",
lambda { |value|
if value.kind_of? String
options.log_dir = value
else
options.log_dir = ""
end
}
],
['--ssh-opt', '--ssh-option OPTION', "[Pw] Option passed to SSH",
lambda { |value|
options.ssh_option = value
}
],
['--filesystem FILESYSTEM', "[Pw] Specify FILESYSTEM (nfs|gfarm)",
lambda { |value|
options.filesystem = value
}
],
['--gfarm', "[Pw] FILESYSTEM=gfarm",
lambda { |value|
options.filesystem = "gfarm"
}
],
['-A', '--disable-affinity', "[Pw] Turn OFF affinity (AFFINITY=off)",
lambda { |value|
options.disable_affinity = true
}
],
['-S', '--disable-steal', "[Pw] Turn OFF task steal",
lambda { |value|
options.disable_steal = true
}
],
['-d', '--debug',
"[Pw] Output Debug messages",
lambda { |value|
options.debug = true
}
],
['--pwrake-conf [FILE]',
"[Pw] Pwrake configuation file in YAML",
lambda {|value| options.pwrake_conf = value}
],
['--subdir "dir1 dir2 ..."',
"[Pw] Join workflows in subdirectories",
lambda { |value|
options.subdir = value.split(/[\s,;:]+/)
}
],
['--show-conf','--show-config',
"[Pw] Show Pwrake configuration options",
lambda {|value| options.show_conf = true }
],
['--report LOGDIR',"[Pw] Generate `report.html' (Report of workflow statistics) in LOGDIR and exit.",
lambda {|value| options.report_dir = value }
],
['--report-image IMAGE_TYPE',"[Pw] Gnuplot output format (png,jpg,svg etc.) in report.html.",
lambda {|value| options.report_image = value }
],
['--clear-gfarm2fs',"[Pw] Clear gfarm2fs mountpoints left after failure.",
lambda { |value|
Option.new.clear_gfarm2fs
exit
}
],
])
opts
end
|