juliapluto / malt.jl Goto Github PK
View Code? Open in Web Editor NEWSimple multiprocessing for Julia
Home Page: https://juliapluto.github.io/Malt.jl/
License: MIT License
Simple multiprocessing for Julia
Home Page: https://juliapluto.github.io/Malt.jl/
License: MIT License
Malt consistently fails on windows because the behavior for half-open TCP connections differs from that of Linux and macOS.
Consider the following scenario:
Two things can happen:
If the manager reads the response before the socket is closed, nothing happens.
If the manager hasn't read the response, and the socket closes, windows will have the worker send an RST (reset signal) to the manager, causing an IOError in the manager.
Solution attempts:
UPDATE: Solution 2 only fails when there's a signal that kills the process, using a dedicated message instead of an interrupt solves this issue, but it still cannot stop tight loops.
Maybe also related: libuv/libuv#3034
Something we sometimes use in Pluto is the ability to do a remote call, waiting for it to finish, but without having the result sent over the network. This is useful when the result of the computation uses types that are not defined in the main process, hence it cannot be serialized.
julia> using Distributed
julia> p = Distributed.addprocs(1) |> only
2
julia> Distributed.remotecall_eval(Main, p, :(1 + 1))
2
julia> Distributed.remotecall_eval(Main, [p], :(1 + 1))
julia> ans === nothing
true
Perhaps remote_do
can return a Task
that resolves to nothing
when the call finishes?
Some things are very performance-crucial, like Malt.remotecall_eval(:(1+1))
. Can you use BenchmarkTools.jl and compare performance with Distributed? Can you put these scripts in the repository? <3
What happens when a worker throws an exception during a remote call? Can we add tests for this behaviour?
It would be awesome!
Distributed does this very well. With Base.atexit
perhaps?
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
In the terminal, Ctrl+C will interrupt some code, like sleep(1000)
, but not number-crunching code like tight loops. For this, the Julia client has special code that checks for quickly repeating interrupt signals, which creates a "super interrupt":
In Pluto, we have the following code to repeat the Ctrl+C signal:
This sort-of works (not on Windows), but it will occasionally kill the entire Julia process.
Can you create an example of interrupting while true end
using Malt.jl? Can you consistently repeat this multiple times in the same process? Maybe this can be included in the tests?
Maybe this could be included in Malt.jl API, like interrupt(worker; aggressive=true)
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.