Skip to content

Print error when multiple independent schedules are identified#245

Merged
gonuke merged 4 commits intosvalinn:mainfrom
anu1217:top_sched_err
Feb 21, 2026
Merged

Print error when multiple independent schedules are identified#245
gonuke merged 4 commits intosvalinn:mainfrom
anu1217:top_sched_err

Conversation

@anu1217
Copy link
Contributor

@anu1217 anu1217 commented Feb 19, 2026

Adds a counter to keep track of the number of schedule blocks that are not used as sub-schedules, and throws an error when more than one of these schedules is found.

fixes #221

add variable type to counter

add missing semicolon

add braces to if statement

surround condition with parentheses

fix indentation

throw error instead of writing to stdout

fix break indent

change counter value outside of while loop

add braces to if statement

Revert "add braces to if statement"

This reverts commit ab272ad.

Revert "change counter value outside of while loop"

This reverts commit 7b86f76.

don't use break to stop execution of while loop

change condition for determining if top schedule is sub
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggesting boolean rather than counter

src/Schedule.C Outdated
Comment on lines +193 to +194
counter++;
if (counter > 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this error happens as soon as counter is not 0, it is probably more sense for it to be boolean found_top_schedule that starts false and generates an error when you find another when and it's already true, or when you get to the end and it's false.

anu1217 and others added 2 commits February 20, 2026 13:59
compare not assign

correctly implement conditions
Use boolean instead of counter
@gonuke
Copy link
Member

gonuke commented Feb 20, 2026

Can we add a sample problem that causes this error to confirm it does what we want (one step closer to CI!)?

add description and change path to library

remove extra pulse history
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @anu1217

@gonuke gonuke merged commit 02e6ed1 into svalinn:main Feb 21, 2026
1 check passed
@anu1217 anu1217 deleted the top_sched_err branch February 24, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quit with error when multiple schedules are not arranged in the same hierarchy

2 participants