# oar-team/oar architecture

> Architecture diagram of the GitHub repository oar-team/oar, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oar-team/oar
- Repository: https://github.com/oar-team/oar

## Overview

OAR is an HPC cluster resource manager and batch scheduler. A user submits or manages a job through command-line tools or the REST API; server-side admission and lifecycle modules manage it, and the scheduler selects resources and records planned execution in the database. The runner and node services carry out jobs, while monitoring and Gantt views expose cluster state. The graph emphasizes documented capabilities and the sampled C++ scheduler implementation; many Perl server modules and integration details are represented at directory level because their source was not excerpted.

Main entry points: [`sources/core/database`](https://github.com/oar-team/oar/tree/2.5/sources/core/database) (Job and resource DB), [`sources/extra/cpp-scheduler/Oar_sched_gantt_with_timesharing_and_fairsharing.cc`](https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Oar_sched_gantt_with_timesharing_and_fairsharing.cc) (Gantt scheduler), [`sources/extra/cpp-scheduler/Oar_iolib.cc`](https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Oar_iolib.cc) (Scheduler DB access), [`sources/core/qfunctions/oarsub`](https://github.com/oar-team/oar/blob/2.5/sources/core/qfunctions/oarsub) (Job commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_submission["Job access"]
  node_cli["Job commands"]
  node_api["REST API"]
end

subgraph group_control["Server control"]
  node_admission["Admission rules"]
  node_daemon["Almighty server<br/>[almighty.pl]"]
  node_lifecycle["Job lifecycle"]
  node_nodechanges["Node state"]
  node_database[("Job and resource DB")]
end

subgraph group_scheduling["Scheduling"]
  node_scheduler["Gantt scheduler"]
  node_io["Scheduler DB access<br/>[Oar_iolib.cc]"]
  node_gantt["Gantt allocation"]
  node_resource_tree["Resource tree"]
  node_scheduler_config["Scheduler configuration<br/>[Oar_conflib.cc]"]
end

subgraph group_execution["Execution"]
  node_runner["Job runner<br/>[bipbip.in]"]
  node_node_service["Node service"]
  node_resource_control["Resource controls"]
end

subgraph group_visibility["Monitoring"]
  node_monitoring["Status commands"]
  node_monika["Monika interface"]
  node_gantt_view["Gantt visualization"]
  node_accounting["Accounting"]
end

node_users(("Users"))

node_users -->|"submit or manage"| node_cli
node_users -->|"submit via API"| node_api
node_cli -.->|"request admission"| node_admission
node_api -.->|"request admission"| node_admission
node_admission -.->|"persist jobs"| node_database
node_daemon -->|"dispatches modules"| node_lifecycle
node_lifecycle -.->|"updates job state"| node_database
node_nodechanges -.->|"updates resources"| node_database
node_scheduler -->|"loads settings"| node_scheduler_config
node_scheduler -->|"loads resources"| node_io
node_scheduler -->|"checks allocations"| node_gantt
node_scheduler -->|"builds resource requests"| node_resource_tree
node_scheduler -.->|"records schedule"| node_io
node_io -->|"queries scheduling data"| node_database
node_runner -.->|"starts jobs"| node_node_service
node_node_service -.->|"controls node resources"| node_resource_control
node_monitoring -.->|"reads status"| node_database
node_monika -.->|"displays cluster state"| node_database
node_gantt_view -.->|"renders schedule"| node_database
node_accounting -.->|"reads usage"| node_database

click node_cli "https://github.com/oar-team/oar/blob/2.5/sources/core/qfunctions/oarsub"
click node_api "https://github.com/oar-team/oar/tree/2.5/sources/api"
click node_daemon "https://github.com/oar-team/oar/blob/2.5/sources/core/modules/almighty.pl"
click node_lifecycle "https://github.com/oar-team/oar/tree/2.5/sources/core/modules"
click node_nodechanges "https://github.com/oar-team/oar/blob/2.5/sources/core/modules/node_change_state.pl"
click node_database "https://github.com/oar-team/oar/tree/2.5/sources/core/database"
click node_scheduler "https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Oar_sched_gantt_with_timesharing_and_fairsharing.cc"
click node_io "https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Oar_iolib.cc"
click node_gantt "https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Gantt_hole_storage.cc"
click node_resource_tree "https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Oar_resource_tree.cc"
click node_scheduler_config "https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Oar_conflib.cc"
click node_runner "https://github.com/oar-team/oar/blob/2.5/sources/core/modules/runner/bipbip.in"
click node_node_service "https://github.com/oar-team/oar/blob/2.5/sources/core/scripts/oar-node-service"
click node_resource_control "https://github.com/oar-team/oar/tree/2.5/sources/core/tools"
click node_monitoring "https://github.com/oar-team/oar/blob/2.5/sources/core/qfunctions/oarstat"
click node_monika "https://github.com/oar-team/oar/tree/2.5/sources/visualization_interfaces/Monika"
click node_gantt_view "https://github.com/oar-team/oar/tree/2.5/sources/visualization_interfaces/DrawGantt-SVG"
click node_accounting "https://github.com/oar-team/oar/blob/2.5/sources/core/qfunctions/oaraccounting"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_api,node_users toneBlue
class node_admission,node_daemon,node_lifecycle,node_nodechanges,node_database toneAmber
class node_scheduler,node_io,node_gantt,node_resource_tree,node_scheduler_config toneMint
class node_runner,node_node_service,node_resource_control toneRose
class node_monitoring,node_monika,node_gantt_view,node_accounting toneIndigo
```

## Components

### Job access

- [Job commands](https://github.com/oar-team/oar/blob/2.5/sources/core/qfunctions/oarsub): `sources/core/qfunctions/oarsub`
- [REST API](https://github.com/oar-team/oar/tree/2.5/sources/api): `sources/api`

### Server control

- **Admission rules**
- [Almighty server](https://github.com/oar-team/oar/blob/2.5/sources/core/modules/almighty.pl): `sources/core/modules/almighty.pl`
- [Job lifecycle](https://github.com/oar-team/oar/tree/2.5/sources/core/modules): `sources/core/modules`
- [Node state](https://github.com/oar-team/oar/blob/2.5/sources/core/modules/node_change_state.pl): `sources/core/modules/node_change_state.pl`
- [Job and resource DB](https://github.com/oar-team/oar/tree/2.5/sources/core/database): `sources/core/database`

### Scheduling

- [Gantt scheduler](https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Oar_sched_gantt_with_timesharing_and_fairsharing.cc): `sources/extra/cpp-scheduler/Oar_sched_gantt_with_timesharing_and_fairsharing.cc`
- [Scheduler DB access](https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Oar_iolib.cc): `sources/extra/cpp-scheduler/Oar_iolib.cc`
- [Gantt allocation](https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Gantt_hole_storage.cc): `sources/extra/cpp-scheduler/Gantt_hole_storage.cc`
- [Resource tree](https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Oar_resource_tree.cc): `sources/extra/cpp-scheduler/Oar_resource_tree.cc`
- [Scheduler configuration](https://github.com/oar-team/oar/blob/2.5/sources/extra/cpp-scheduler/Oar_conflib.cc): `sources/extra/cpp-scheduler/Oar_conflib.cc`

### Execution

- [Job runner](https://github.com/oar-team/oar/blob/2.5/sources/core/modules/runner/bipbip.in): `sources/core/modules/runner/bipbip.in`
- [Node service](https://github.com/oar-team/oar/blob/2.5/sources/core/scripts/oar-node-service): `sources/core/scripts/oar-node-service`
- [Resource controls](https://github.com/oar-team/oar/tree/2.5/sources/core/tools): `sources/core/tools`

### Monitoring

- [Status commands](https://github.com/oar-team/oar/blob/2.5/sources/core/qfunctions/oarstat): `sources/core/qfunctions/oarstat`
- [Monika interface](https://github.com/oar-team/oar/tree/2.5/sources/visualization_interfaces/Monika): `sources/visualization_interfaces/Monika`
- [Gantt visualization](https://github.com/oar-team/oar/tree/2.5/sources/visualization_interfaces/DrawGantt-SVG): `sources/visualization_interfaces/DrawGantt-SVG`
- [Accounting](https://github.com/oar-team/oar/blob/2.5/sources/core/qfunctions/oaraccounting): `sources/core/qfunctions/oaraccounting`

### Other components

- **Users**

## Connections

- Users → Job commands: submit or manage (evidence: `README`)
- Users → REST API: submit via API
- Job commands → Admission rules: request admission
- REST API → Admission rules: request admission
- Admission rules → Job and resource DB: persist jobs
- Almighty server → Job lifecycle: dispatches modules
- Job lifecycle → Job and resource DB: updates job state
- Node state → Job and resource DB: updates resources
- Gantt scheduler → Scheduler configuration: loads settings (evidence: `sources/extra/cpp-scheduler/Oar_sched_gantt_with_timesharing_and_fairsharing.cc`)
- Gantt scheduler → Scheduler DB access: loads resources (evidence: `sources/extra/cpp-scheduler/Oar_sched_gantt_with_timesharing_and_fairsharing.cc`)
- Gantt scheduler → Gantt allocation: checks allocations (evidence: `sources/extra/cpp-scheduler/Oar_sched_gantt_with_timesharing_and_fairsharing.cc`)
- Gantt scheduler → Resource tree: builds resource requests
- Gantt scheduler → Scheduler DB access: records schedule
- Scheduler DB access → Job and resource DB: queries scheduling data (evidence: `sources/extra/cpp-scheduler/Oar_iolib.cc`)
- Job runner → Node service: starts jobs
- Node service → Resource controls: controls node resources
- Status commands → Job and resource DB: reads status
- Monika interface → Job and resource DB: displays cluster state
- Gantt visualization → Job and resource DB: renders schedule
- Accounting → Job and resource DB: reads usage
