Skip to main content

Module study

Module study 

Source
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§

CancellationToken
Shared, cheap cancellation observation for embedded schedulers and tasks.
Phase
Immutable nonempty execution phase and renderer section.
PhaseBuilder
Builder for one nonempty first-class phase.
PhaseId
Stable numeric identity of one execution phase.
PhaseRecord
Lifecycle facts for one selected phase.
PhaseSummary
Terminal summary for one selected phase.
ProgressSummary
Immutable aggregate captured when centralized reporting ends.
Study
Non-clone scheduler and display owner for one declared study plan.
StudyBuilder
Builder for one immutable study plan.
StudyPlan
Complete serializable phase/task graph registered with one study.
StudyRecord
Durable lifecycle summary for one study execution.
StudySummary
Immutable aggregate for a completed study execution.
Task
First-class immutable task declaration owned by exactly one Phase.
TaskContext
Read-only task identity plus reporting and cancellation.
TaskId
Stable task identity scoped to one phase.
TaskIdentity
Exact parameter-derived identity of one task.
TaskKey
Exact phase-qualified task lookup key.
TaskRecord
Lifecycle facts for one selected task.
TaskSelector
Exact partial selector over phase, task category, and metadata.

Enums§

PhaseFailurePolicy
Scheduling behavior after the first workload failure in a phase.
StudyError
TaskMode
Reporting shape of one task.
TaskStatus
Lifecycle status of one independently executing scientific task.

Type Aliases§

TaskResult
Error-erased result returned by one task-owned workload.