Coder Social home page Coder Social logo

Comments (7)

mtmorgan avatar mtmorgan commented on August 20, 2024

I think SnowParam should be a generic, SnowParam(cl) creating a SnowParam appropriate populated.

from biocparallel.

DarwinAwardWinner avatar DarwinAwardWinner commented on August 20, 2024

What about starting/stopping such a SnowParam object? If SnowParam is handed an already-running cluster, it can't know how to restart it. And also, stopping such a cluster would have external effects, since that cluster might be used elsewhere. Should we have a subclass that makes bpstart/bpstop into no-ops?

from biocparallel.

mtmorgan avatar mtmorgan commented on August 20, 2024

The analogy is with file connections, where if you're given an open connection then you return an open collection, otherwise you're free to do with it what you will.

if (!bpisup(param)) {
    param = bpstart(param)
    on.exit(bpstop(param))
}
## else do nothing

from biocparallel.

DarwinAwardWinner avatar DarwinAwardWinner commented on August 20, 2024

Yes, but I'm saying that if a SnowParam is created with an already-running cluster, stopping that cluster via bpstop should not be allowed at all. Maybe BiocParallel functions will handle it correctly by never trying to call bpstop unless the cluster was initially stopped, but the user could still call bpstop manually on the SnowParam object, in which case it should do nothing, perhaps with a warning. Because otherwise you could stop a cluster that might still be in use elsewhere.

Or, to put things more simply, bpstop should only work on a cluster if that cluster was started via bpstart.

from biocparallel.

mtmorgan avatar mtmorgan commented on August 20, 2024

I understand and wouldn't object to a flag that says 'don't stop me' but we are starting to second guess the user, making work for us and putting obstacles up for them.

from biocparallel.

DarwinAwardWinner avatar DarwinAwardWinner commented on August 20, 2024

I guess I'm working from the principle that any operation on a BiocParallel object should not have effects outside of BiocParallel. So if the cluster was created externally and passed to SnowParam, then SnowParam should not modify it, but only use it.

from biocparallel.

mtmorgan avatar mtmorgan commented on August 20, 2024

OK I added a .controlled field to BiocParallelParam and check that it is TRUE in bpstart / bpstop on SnowParam; this is meant for internal, read-only use. I also added a coerce method so as(cl, "SnowParam") creates a SnowParam instance from a previously established SOCKcluster, setting .controlled=FALSE.

from biocparallel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.