Skip to content

Commit 3a2c582

Browse files
committed
parse new cluster manager worker arugments
1 parent a7dad31 commit 3a2c582

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

base/client.jl

+7-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,13 @@ let reqarg = Set(UTF8String["--home", "-H",
247247
exit(0)
248248
end
249249
# startup worker
250-
if bool(opts.worker)
250+
if opts.worker != C_NULL
251+
w = bytestring(opts.worker)
252+
if w != "custom"
253+
println(STDERR, "julia: unknown worker argument `$w`")
254+
exit(1)
255+
end
256+
else
251257
start_worker() # does not return
252258
end
253259
# load file immediately on all processors

base/options.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ immutable JLOptions
2727
depwarn::Int8
2828
can_inline::Int8
2929
fast_math::Int8
30-
worker::Int8
30+
worker::Ptr{Cchar}
3131
bindto::Ptr{Cchar}
3232
end
3333

examples/clustermanager/simple/UnixDomainCM.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function launch(manager::UnixDomainCM, params::Dict, launched::Array, c::Conditi
99
for i in 1:manager.np
1010
sockname = tempname()
1111
try
12-
cmd = `$(params[:exename]) --worker custom $(@__FILE__) worker $sockname`
12+
cmd = `$(params[:exename]) --worker=custom $(@__FILE__) worker $sockname`
1313
io, pobj = open (cmd, "r")
1414

1515
wconfig = WorkerConfig()

src/init.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jl_options_t jl_options = { 0, // version
111111
1, // depwarn
112112
1, // can_inline
113113
JL_OPTIONS_FAST_MATH_DEFAULT,
114-
0, // worker
114+
NULL, // worker
115115
NULL, // bindto
116116
};
117117

src/julia.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ typedef struct {
14251425
int8_t depwarn;
14261426
int8_t can_inline;
14271427
int8_t fast_math;
1428-
int8_t worker;
1428+
const char *worker;
14291429
const char *bindto;
14301430
} jl_options_t;
14311431

ui/repl.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void parse_opts(int *argcp, char ***argvp)
133133
{ "math-mode", required_argument, 0, opt_math_mode },
134134
// hidden command line options
135135
{ "build", required_argument, 0, 'b' },
136-
{ "worker", no_argument, 0, opt_worker },
136+
{ "worker", optional_argument, 0, opt_worker },
137137
{ "bind-to", required_argument, 0, opt_bind_to },
138138
{ "lisp", no_argument, &lisp_prompt, 1 },
139139
{ 0, 0, 0, 0 }
@@ -323,14 +323,17 @@ void parse_opts(int *argcp, char ***argvp)
323323
else {
324324
jl_errorf("julia: invalid argument to --math-mode (%s)\n", optarg);
325325
}
326-
break;
326+
break;
327327
case 'b': // build
328328
jl_options.build_path = strdup(optarg);
329329
if (!imagepathspecified)
330330
jl_options.image_file = NULL;
331331
break;
332332
case opt_worker:
333-
jl_options.worker = 1;
333+
if (optarg != NULL)
334+
jl_options.worker = strdup(optarg);
335+
else
336+
jl_options.worker = NULL;
334337
break;
335338
case opt_bind_to:
336339
jl_options.bindto = strdup(optarg);

0 commit comments

Comments
 (0)