Improve handling of nonexistent schedule groups

Issue #217 new
Ian Hinder created an issue

Currently, if a routine is scheduled in a nonexistent schedule group, there is a nonfatal warning at the time the CST is run. The reason that the warning is nonfatal is that sometimes it is desirable to schedule in a group which only exists if a certain thorn is activated, as the routine would not make sense without that thorn. However, mistyping the group name or not having a sufficiently up-to-date version of the thorn providing the group (see MoL_PseudoEvolution) will lead to the routine not being scheduled at all, with only a warning at CST time. This warning is very easy to miss.

I propose making the error a fatal error, and allowing the thorn writer to indicate in the schedule.ccl file that a function is scheduled only "optionally" in a given group, if that is the intention.

Keyword: CST

Comments (5)

  1. Erik Schnetter
    • removed comment

    The original motivation for allowing this (and not outputting any warnings -- these warnings are fairly recent) was to allow a thorn A to schedule a routine in a group defined by another thorn B, while allowing thorn A to work fine even if thorn B is not active.

    For example, there could be a web server thorn that provides a group for creating additional pages, and an analysis thorn could then create a page by scheduling in this group. The analysis thorn would work fine even if the web server is not active.

  2. Ian Hinder reporter
    • removed comment

    Yes, I know, and that is why I said "The reason that the warning is nonfatal is that sometimes it is desirable to schedule in a group which only exists if a certain thorn is activated, as the routine would not make sense without that thorn."

    However, I think that this use case is less frequent than the case of requiring the group to exist, hence I proposed making the default a fatal error, and modifying the syntax so that thorn writers could say that the scheduling of their function was only "optional" and dependent on the group actually existing. In this way, the default behaviour would be intuitive and safe for all users, and for users who need the current behaviour, it would be obvious in the schedule file that the routine might not be scheduled, as there would be an "optional" keyword there.

  3. Frank Löffler
    • removed comment

    If one thorn depends on another thorn being active, it should tell Cactus in it's interface, shouldn't it? This would turn this warning into an abort at start-time.

  4. Ian Hinder reporter
    • removed comment

    The reason this came up was because a user had not updated MoL to a version which included the MoL_PseudoEvolution group, and was using other thorns which critically scheduled functions in that group. So MethodOfLines was being inherited, indicating that the thorn is required, but the group itself did not exist.

    My proposal is to make the default that when a function is scheduled in a given group, that group must exist. If a user wants to allow the group not to exist and Cactus to still run, they should specify this explicitly in the schedule.ccl file with some syntax (e.g. "optional").

    It seems to me that this is a good way to help the code be more robust and catch user errors automatically at build time.

  5. Erik Schnetter
    • removed comment

    I like this idea. Making it explicit that something is scheduled only optionally clarifies things. I would approve a patch.

  6. Log in to comment