[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] igraph/C: is there a facility for interrupting computations?
From: |
Szabolcs Horvát |
Subject: |
[igraph] igraph/C: is there a facility for interrupting computations? |
Date: |
Sat, 29 Aug 2015 22:28:26 +0200 |
Dear All,
Does the C interface to igraph have any facility for
aborting/interrupting computations that take very long?
I assume it does because interrupting is possible with igraph/R. E.g.
the following takes a long time:
rewire(erdos.renyi.game(1000, 0.5, 'gnp'), keeping_degseq(niter=10000000))
But pressing the stop button in R cancels it without killing the R session.
How is this implemented?
So far I tried setting a status handler as follows:
int igStatusHandler(const char *, void *) { return IGRAPH_INTERRUPTED; }
igraph_set_status_handler(igStatusHandler);
But igraph_rewire() still runs to the finish without interruption.
Use case: I am working on a (partial) Mathematica interface and the
ability to interrupt would be a big usability improvement. I was
using igraph through the R interface from Mathematica before
(https://github.com/szhorvat/IGraphR) but that has its limitations.
Szabolcs
- [igraph] igraph/C: is there a facility for interrupting computations?,
Szabolcs Horvát <=