Expand description
Study, phase, and task orchestration.
A Study is the largest scope. It owns ordered Phase declarations,
scheduling, cancellation, recording, and display. Each phase owns its
Task declarations and scheduling policy. Each task owns one application
workload and communicates through TaskContext.
§Boundary
Study owns only orchestration concerns: task ordering, concurrency caps, cancellation, failure policy, progress reporting, and task lifecycle. It does not define scientific state schema, persistence formats, artifact identity, or RNG strategy. Applications feed workloads and state objects into the study.
Configuration remains independent: applications iterate
ResolvedConfiguration
values, capture each value in a workload, and construct tasks explicitly.
use scientific_workflow::prelude::study::*;
let task = Task::progress("simulation-0", "simulation 0", |context| {
context.set_target_iteration(100)?;
for iteration in 0..=100 {
context.set_iteration(iteration)?;
if context.is_cancelled() {
break;
}
}
Ok(())
});
let phase = Phase::builder(1, "simulation").task(task).build()?;
let summary = Study::builder("study-record.json")
.phase(phase)
.hidden()
.build()?
.run()?;
assert!(summary.is_success());Structs§
- Cancellation
Token - Shared, cheap cancellation observation for embedded schedulers and tasks.
- Phase
- Immutable nonempty execution phase and renderer section.
- Phase
Builder - Builder for one nonempty first-class phase.
- PhaseId
- Stable numeric identity of one execution phase.
- Phase
Record - Lifecycle facts for one selected phase.
- Phase
Summary - Terminal summary for one selected phase.
- Progress
Summary - Immutable aggregate captured when centralized reporting ends.
- Study
- Non-clone scheduler and display owner for one declared study plan.
- Study
Builder - Builder for one immutable study plan.
- Study
Plan - Complete serializable phase/task graph registered with one study.
- Study
Record - Durable lifecycle summary for one study execution.
- Study
Summary - Immutable aggregate for a completed study execution.
- Task
- First-class immutable task declaration owned by exactly one
Phase. - Task
Context - Read-only task identity plus reporting and cancellation.
- TaskId
- Stable task identity scoped to one phase.
- Task
Identity - Exact parameter-derived identity of one task.
- TaskKey
- Exact phase-qualified task lookup key.
- Task
Record - Lifecycle facts for one selected task.
- Task
Selector - Exact partial selector over phase, task category, and metadata.
Enums§
- Phase
Failure Policy - Scheduling behavior after the first workload failure in a phase.
- Study
Error - Task
Mode - Reporting shape of one task.
- Task
Status - Lifecycle status of one independently executing scientific task.
Type Aliases§
- Task
Result - Error-erased result returned by one task-owned workload.