-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String Interpolation and Immutable Errors #25
String Interpolation and Immutable Errors #25
Conversation
cc: @amitmurthy |
@@ -68,7 +70,7 @@ function launch(manager::Union{PBSManager, SGEManager}, params::Dict, instances_ | |||
end | |||
|
|||
function manage(manager::Union{PBSManager, SGEManager}, id::Integer, config::WorkerConfig, op::Symbol) | |||
if op == :finalize | |||
if op == :interrupt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? Shouldn't :interrupt
send a message that simulates a SIGINT? And :finalize
should kill the workers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it wasn't killing the workers, closing just dumped a bunch of random stuff to no end on STDOUT that I had to Ctrl+Z and kill, Ctrl+C did nothing. In the current implementation op SSHManagers there is no finalize op, just an interrupt so I changed it to this and it kills the worker properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default implementation of kill(manager, pid, config)
executes a exit()
on the remote worker. So rmprocs(workers())
should result in the killing of workers. Can you try it out?
If not, you can implement kill(manager::Union{PBSManager, SGEManager}, id::Integer, config::WorkerConfig)
and manually manage the killing of workers as you are doing here.
:finalize
is called when the manager
objects is gc
ed - the timing of which is not predictable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using rmprocs(workers())
with the current implementation of qsub (with :finalize
to kill workers) returns :ok
but when you Ctrl+D to exit julia also prints to STDOUT unending stream of commands and must be killed by hand.
I tried implementing
function kill(manager::Union{PBSManager, SGEManager}, id::Integer, config::WorkerConfig)
kill(config.userdata[:process])
end
And the same happens with :finalinze
.
If you look in managers.jl, there the killing of workers is never handled in a :finalize
op, always in an :interrupt
. Finalizers just show up in multi.jl:
# install a finalizer to perform cleanup if necessary
finalizer(w, (w)->if myid() == 1 manage(w.manager, w.id, w.config, :finalize) end)
So we could follow this model and keep my implementation of the manage
function as is, which is the only thing currently working for me, and do any cleanup in a finalize. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:interrupt
is for Ctrl-C, i.e., SIGINT. In managers.jl it sends a kill -2
which is the command line way of sending a SIGINT to a process.
Don't do anything with :finalize
In your implementation of kill
do the following:
remotecall(exit, id)
close(config.io)
kill(config.userdata[:process])
if isfile(config.userdata[:iofile]
rm(config.userdata[:iofile])
end
This ought to work.
So my current implementation of
The gets are necessary because
I tried wrapping in a try/catch but that did not help. |
You don't need
This would kill the workers when I guess the problem with Ctrl-D is that the spawned What about on an |
So I should leave the manage method empty? This was happening before, just realized they are the same problem. |
Yes, leave the manage method empty. Changing |
It did not, should I also have the finalizer in there? |
No. Does not kill 15 kill the spawned tail commands? |
No, the tail commands are not killed either after |
I think I found the issue. We need to export Without it your Can you change
to
and try again. |
Nailed it, the Everything seems to be working, at least for SGE. |
Thanks for your patience. Can you also squash all the commits before we merge. |
Done. |
String Interpolation and Immutable Errors
Fixed string interpolation errors and new types in Julia 0.4