DataSlingers/clustRviz

Increase Frequency of Interrupt Checks

Opened this issue · 4 comments

For some long running operations, I was unable to stop the calculations once they started. Might want to check that Rcpp::checkUserInterrupt() gets called semi-frequently in the main looping operations as recommended in the Best Practices section of R Packages.

Hmmmm.... That doesn't seem right - we call Rcpp::checkUserInterrupt() every 50 iterations or so (see [1]) depending on a preprocessor macro.

I wonder if that's just not frequent enough for larger data sets where the iterations are slower. (They shouldn't be that slow though - a few matrix multiplies, a pair of triangular solves, and a threshold operator.) This might be exacerbated in the back-tracking versions since I think the interrupt check is outside the back-track loop, so it might only get checked every 15 * 50 = 650 iterations or so...

Is this the same data set you mentioned in #54? I can time an individual iteration.

[1] https://github.com/DataSlingers/clustRviz/blob/master/src/carp.cpp#L148

Yeah, same dataset. This could have been a combination of me being impatient and my computer being a potato.

FYI -- the current develop (post #65) tries to check for user interrupts every 0.2s. (Though for enormous problems it still won't do that since we won't interrupt in the middle of linear algebra steps)

Unfortunately, the develop -> master automated build is busted for reasons I don't understand, so it's a bit tricky to try out right now.

The develop -> master build is now (finally...) working again, so you can test things out.

With your data set: CARP(tf, alg.type = "carp", X.scale = TRUE) takes about 6 minutes on my machine, which is still a bit slow, but not insane.