@@ -122,8 +122,60 @@ function _new_environment_additions(params_env::Dict{String, String})
122
122
return env2
123
123
end
124
124
125
+ function warn_if_unexpected_params (params:: Dict )
126
+ params_that_we_support = [:dir , :exename , :exeflags ]
127
+ upstreams_defaults = Distributed. default_addprocs_params ()
128
+ for (k, v) in pairs (params)
129
+ if k == :env
130
+ # We special-case `:env`, because our support status depends on the Julia version
131
+ if v == []
132
+ # Either the user didn't provide the `:env` kwarg,
133
+ # or the user provided `env=[]`.
134
+ #
135
+ # Either way, in this case, we don't print a log message.
136
+ # @debug "k == :env and v == []" k v
137
+ else
138
+ # In this case, the user has provided the `:env` kwarg, and it is nonempty.
139
+ if Base. VERSION < v " 1.6.0"
140
+ @warn " The user provided the `env` kwarg, but SlurmClusterManager.jl's support for the `env` kwarg requires Julia 1.6 or later" Base. VERSION
141
+ else
142
+ # Here, the Julia version is >= 1.6, so we do support `:env`,
143
+ # and there is no problem.
144
+ end
145
+ end
146
+ elseif k in params_that_we_support
147
+ # We support this param, so no problem.
148
+ else
149
+ # We don't support this param.
150
+
151
+ # So let's see if this is something that Distributed.jl would provide by default.
152
+ if haskey (upstreams_defaults, k)
153
+ # This is a param that Distributed.jl would provide by default.
154
+ # So now the question is: is this the default value provided by Distributed.jl,
155
+ # or did the user override the value?
156
+ this_is_upstreams_default_value = v == upstreams_defaults[k]
157
+ if this_is_upstreams_default_value
158
+ # So now the question is: is this the default value provided by Distributed.jl,
159
+ # This IS the default value provided by Distributed.jl, so we won't print a log message.
160
+ # @debug "" k v this_is_upstreams_default_value
161
+ else
162
+ # This is NOT the default value provided by Distributed.jl.
163
+ # So the user must have overriden the value.
164
+ @warn " SlurmClusterManager.jl does not support this kwarg: $(k) " kwarg= k value= v
165
+ end
166
+ else
167
+ # This is not a param that Distributed.jl provides by default.
168
+ @warn " SlurmClusterManager.jl does not support this custom kwarg: $(k) " kwarg= k value= v
169
+ end
170
+ end
171
+ end
172
+ return nothing
173
+ end
174
+
125
175
function Distributed. launch (manager:: SlurmManager , params:: Dict , instances_arr:: Array , c:: Condition )
126
176
try
177
+ warn_if_unexpected_params (params)
178
+
127
179
exehome = params[:dir ]
128
180
exename = params[:exename ]
129
181
exeflags = params[:exeflags ]
0 commit comments