Modify

Opened 8 years ago

Last modified 8 years ago

#217 new enhancement

Improve handling of nonexistent schedule groups

Reported by: Ian Hinder Owned by:
Priority: minor Milestone:
Component: Cactus Version:
Keywords: CST Cc:

Description

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.

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by Erik Schnetter

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.

comment:2 Changed 8 years ago by Ian Hinder

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.

comment:3 Changed 8 years ago by Frank Löffler

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.

comment:4 Changed 8 years ago by Ian Hinder

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.

comment:5 Changed 8 years ago by Erik Schnetter

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
Next status will be 'review'.
as The resolution will be set.
to The owner will be changed from (none) to the specified user.
Next status will be 'confirmed'.
The owner will be changed from (none) to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.