Coder Social home page Coder Social logo

Comments (6)

ChristianTackeGSI avatar ChristianTackeGSI commented on July 17, 2024

I added #1551 to improve the logging of this. (I had this patch around for a while anyway. So a good opportunity to turn it into a PR).

@karabowi and I had a quick chat two days ago. And we agreed, that this error is generally a good thing. And users who know what they're doing (@TobiasStockmanns that's you) should be able to turn a knob and disable this error in a fine granular way.

This error happens in FairParSet::init(). This member function is virtual (whether is was a good design or not… other topic).

Options:

  1. So the most quickest (and probably a bit dirty) way: Override this function in PndEmcGeoPar and implement it like you want, maybe by copying anything interesting from the original (possibly dropping all the init(io) logic from the original?).

  2. We split up the current init() into more peaces and make them available as helper functions that don't throw errors but have the "important" logic and let them be re-used in our main, provided init(). So that you can re-arrange those helpers as needed and implement different error handling.

  3. We add another knob (probably something like virtual bool NotBeingAbleToLoadFromIoIsOk() { return false; } – yes, this long, you're not supposed to have an easy live disabling errors) and call it from the current init().

TBH, I have no particular preference.

from fairroot.

ChristianTackeGSI avatar ChristianTackeGSI commented on July 17, 2024

Next possible option:

FairParSet seems to have a "static" mode:

void setStatic(Bool_t flag = kTRUE) { status = flag; }
Bool_t isStatic() { return status; }

This completely disables running init() (and thus avoid the error completely by not even trying to initialize things):

if (!cont->isStatic()) {
rc = cont->init() && rc;
}

But it also disables resetInputVersions:

if (!cont->isStatic()) {
cont->resetInputVersions();
}

If I understood @karabowi correctly in a private chat, then this "static" feature is meant for something else anyway?

from fairroot.

ChristianTackeGSI avatar ChristianTackeGSI commented on July 17, 2024

After having thought about option (1) above, I consider it quite useful.

There are some options:

struct PndEmcGeoPar : public FairParGenericSet {
  bool do_not_call_init_at_all{false};  //!
  bool ignore_errors_from_init{false};  //!

  bool init() override {
    if (do_not_call_init_at_all) {
      return true;
    }
    return FairParGenericSet::init();
// or:
    bool retval = FairParGenericSet::init();
    if (ignore_errors_from_init && !retval) {
      LOG(info) << "The previous error is just informational, please ignore\n"
      return true;
    }
    return retval;
  }
}

from fairroot.

fuhlig1 avatar fuhlig1 commented on July 17, 2024

@karabowi,

could you please have a look at the issue since you already discussed with @TobiasStockmanns .

from fairroot.

karabowi avatar karabowi commented on July 17, 2024

The issue has been solved in PR #1551.
@TobiasStockmanns , can you check the solution?

from fairroot.

ChristianTackeGSI avatar ChristianTackeGSI commented on July 17, 2024

#1551 improves the situation by moving the error out of init() to the caller of init(). So if it returns true (by overriding it), then no error will be printed. Maybe a warning is printed for init(io) return values.

The above mentioned override variants should still work on older versions, just their output might be a bit confusing (that's why I put the "The previous error is just informational, please ignore" there).

from fairroot.

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.