Comments (8)
Thanks for reporting this issue, Martin! Because pbmcapply
hands over the actual parallel computation to a new process (via future
), by killing the progress monitor (your main process), the newly created process is not affected.
I'll look into handling SIGINT signals in the main process and relay it to the parallel process. I'll post updates once I make some progress.
from pbmcapply.
Hi @kvnkuang ,
I'd like to first thank you for pbmcapply
package, it's really helpful! 👍
This issue is actually the major problem I'm having when using pbmcapply
and I'm really keen to see it fixed, so I've given it a try. I noticed future
creates a child process and this child process creates its own descendants when calling mclapply
as well. To kill all these processes when interrupted, I found this blog post provides a solution to this. Basically, we can assign a group process id to the processMonitor
and kill it and its descendants based on the group process id on interruption. Here is what I did:
- I noticed the
futureCall
givenplan(multiprocess)
callsmcparallel
under the hook so I replaced it withmcparallel
. - Another reason I did this is that in order to assign the group process id I need to copy the
mcparallel
source code and insert the assignment code in between. - I added the
on.exit
call to clean up processes based on the group process id.
This works on both on my macbook and ubuntu desktop so far from my tests. If you are interested in this solution, I would be more than happy to work a bit more to tidy up my code in terms of error handling and create a pull request. Keen to contribute to this 😄
Cheers,
Quyu
from pbmcapply.
Hi Quyu,
Thank you so much for your research and fix on this issue. It looks pretty promising and I've been thinking about replacing future
with native code as we're only using a very small portion of its functions.
It would be much appreciated if you could initiate a pull request. Once tested, I will accept it and push an update to CRAN as soon as possible.
Regards,
Kevin
from pbmcapply.
Hi Quyu,
I've merged your pull request (and a series of subsequent pushes I made) into the dev
branch. Could you please help me test it around to make sure everything works?
Also, I updated the contribution sections to include your name (also in the dev
branch currently). Thanks again for your contribution!
Regards,
Kevin
from pbmcapply.
Hi Kevin,
Thanks! I just tested your dev branch on both Mac and Ubuntu regarding pbmclapply
and pbmcmapply
running completely and running with interruption, all worked as expected. I also tested compilation on Windows (didn't realize my code didn't compile on windows but you fixed that 😄 ).
While testing, I noticed another trivial bug. As i'm used to pbmclapply
, I sometimes forgot the difference in argument order between pbmclapply
and pbmcmapply
where FUN is the first argument. This might cause the program hanging forever at ReadBin
. So I guess we should handle that at the beginning of the progressMonitor
function block with FUN <- match.fun(FUN)
. But since this is a separate problem, we can handle it in another issue.
Regards,
Quyu
from pbmcapply.
Thanks again for your feedback! I've included the code you suggested to improve function handling.
Regards,
Kevin
from pbmcapply.
Hi!
I just encountered this same error (Ctrl-C not stopping pbcmlapply) under Linux using rscript.
Perhaps the fix by @qykong does not work anymore since the addition of ignore.interactive
? Since I am using it from the terminal I need to switch ignore.interactive
to T
in order to see the progress bar, but then Ctrl-C does not work (at least in version 1.5.0)
Thank you!
from pbmcapply.
I have the same problem. I cannot interrupt the pbcmlapply under linux. I must close R to stop it
from pbmcapply.
Related Issues (20)
- mc.preschedule HOT 2
- progressBar() error after the 5/11/2018 update HOT 2
- Width calculation problems for short and long durations HOT 8
- provide a pbmcapply version of apply (not only mapply and lapply) HOT 3
- Object 'mcinteractive' not found HOT 9
- pbmclapply hangs if cores is undefined HOT 8
- Address "cannot wait for child %d as it does not exist" warning HOT 4
- pbmclapply slow down HOT 5
- not supported by MRO? HOT 1
- pbmcapply not showing in Rscript mode HOT 3
- Execution cannot be interrupted with Ctrl-C since ignore.interactive was added HOT 1
- reproducibility
- progressBar(max=0): throws error on 'missing value where TRUE/FALSE needed'
- Custom progress bar?
- If warning, return of pbmclapply has different return format if length of X is 1 HOT 1
- pbmclapply fails to return list where lapply, pbapply, and mclapply have no issue
- learning resources for possible contributor
- Issue with differing behaviour from mcapply
- WISH: Option for outputting progress bar to standard error (stderr)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pbmcapply.