Git Product home page Git Product logo

Comments (5)

nrnhines avatar nrnhines commented on May 29, 2024

from nrn.

pramodk avatar pramodk commented on May 29, 2024

thanks Michael for detailed info!

Is this a bug? Could we update/fix this?

Yes and yes. Of course the VERBATIM contents have to make sense in the c code
which may involve several copies into different areas of the code.

I was just looking at StochKv.mod :

DERIVATIVE states {

    trates(v)

    n' = a - (a + b)*n
    .........
    P_a = strap(a*dt)
    P_b = strap(b*dt)

    : check that will represent probabilities when used
    ChkProb( P_a)
    ChkProb( P_b)
}

: ChkProb - Check that number represents a probability
PROCEDURE ChkProb(p) {
  if (p < 0.0 || p > 1.0) {
    VERBATIM
    fprintf(stderr, "StochKv.mod:ChkProb: argument not a probability.\n");
    ENDVERBATIM
  }
}

And after procedure inlining, nocmdol / mod2c_core wasn't able to translate it. Hence I was looking into the behaviour.

so it should suffice to replace

case STRING:
with
case STRING:
case VERBATIM:

in the void copy items

Yes, this is sufficient!

from nrn.

nrnhines avatar nrnhines commented on May 29, 2024

from nrn.

nrnhines avatar nrnhines commented on May 29, 2024

from nrn.

pramodk avatar pramodk commented on May 29, 2024

From another view, since output is not allowed for GPU, it may be good idea to think
about a standard way to raise an error and then when getting back to the cpu checking
the status and printing a message. or should we think in terms of buffering using
sprintf and then copy back to cpu and printing.

I don't think we should have buffering mechanism for copying error messages. Might be sufficient to set error code from kernel running on GPU / Accelerator (but may be we have to list all use cases ).

from nrn.

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.