# How codes are recognised

> How HiveBoard tells which simulation code a job folder holds: file names and the top of a few files, read in one command, and what decides between codes.

Source: https://hiveboard.dev/docs/codes/how-codes-are-recognised · Section: Simulation codes · HiveBoard 0.1.7 · Updated 2026-10-19

## In short

- HiveBoard looks inside a job's folder — the file names and the first few kilobytes of the likely input and output files — in one read-only command.
- A signature inside a file beats a tell-tale file name, which beats an extension many codes share; a tie goes to the code with the higher priority.
- Once the code is known, its engine says what to read for progress, numbers, charts, warnings and the 3-D structure.
- A folder that no code matches still shows wall-clock progress, its output and its files.

HiveBoard does not ask you which program a job runs, and it does not ask the
scheduler either. It looks at the job's folder on the cluster: the names of the
files in it, and the first few kilobytes of the files that could be an input or
an output. That is enough to tell the code and the kind of calculation —
relaxation, molecular dynamics, single point — in one short, read-only command.

Each code HiveBoard knows is described by an **engine**: one YAML file, its
*spec*, that says which files a folder of that code holds, how to recognise
them, and what to read once they are recognised. HiveBoard 0.1.7 carries twenty
([the supported codes](/docs/codes/supported-codes)), and you can add your own
([adding your own code](/docs/codes/your-own-codes)).

## What HiveBoard reads from a folder

The first look at a folder is its **fingerprint**, one command that opens
nothing beyond this:

- the names of the first 200 files in the folder;
- the first 6 kB of each input with a fixed name that some code uses
  (`INCAR`, for example), and of the 3 newest files that match any code's
  input patterns;
- the first 1.5 kB of the 2 newest files that match any code's output patterns.

No program is started and nothing is written. HiveBoard does not ask the
scheduler or the module system which program ran: the folder alone decides.

## How it decides between codes

Every code is scored on the folder, and the evidence counts in this order:

1. **A signature inside a file** — text the program always writes, such as its
   banner in the output or a typical block in the input, found in the first
   bytes of the file.
2. **A tell-tale file name** — one that belongs to that code and no other:
   `INCAR` for VASP, `*.pwi` for Quantum ESPRESSO.
3. **An extension many codes share** — `*.inp`, `*.out`, `*.log`. On its own it
   counts only for a code that has no signature to check.

A code is a candidate only when a file name in the folder points to it; its
signature is then what settles it. The extension `.inp`, for example, is the
input of ORCA, CP2K, GAMESS, Q-Chem and MOLPRO alike — HiveBoard tells them
apart by what the files say, not by their names. A code that has nothing to
check but a name nobody else uses ranks with the surest; VASP's `INCAR` is one.
When two codes are equally sure, the one whose spec has the higher priority
wins.

The kind of calculation comes from the same look. Each spec lists its kinds,
each with a pattern on the input, and the first that matches wins; the last kind
is the default. In the job list only the top of the input is available, so a
kind that depends on anything else is filled in when you open the job.

## When it happens

| When | What is read |
|---|---|
| After a queue refresh | Folders of your own jobs not yet known, up to 16 per command and 60 per refresh |
| You open a job | Its fingerprint, then the code's reads; again every 15 s while Overview or Output shows |
| You open the Structure tab | The files the code names as geometry |
| You browse Folders | One listing, and a fingerprint of each sub-folder you own (at most 60) |

What is learned about a job is kept, so its tag is worked out once; a folder
that was not recognised is looked at again only every few minutes. The app
remembers the tags between runs. Other people's jobs show "—" in the list,
because only your own jobs' folders are looked into (see
[other people's jobs](/docs/job/other-peoples-jobs)).

> [!BUILD]
> The Python build remembers a job's code and kind only while it runs, and
> works them out again after a restart.

## What the engine reads next

Once the code is known, the job pane needs more than a fingerprint. Every
engine turns into at most three commands, all built from its spec, all
read-only and bounded:

1. **Fingerprint** — as above.
2. **Summary** — the spec's *reads*: the first or the last bytes of a file,
   the lines that contain a fixed piece of text, or a count of them. A read
   fetches at most 2 MB or 5,000 lines, and a summary holds at most 40 reads.
3. **Structure** — the files the spec names as geometry sources.

The patterns that turn that text into numbers run on your computer, on what
came back; on the cluster, the commands only list the job's folder and read
files in it. From the answer the engine makes:

- the **kind** of calculation and a one-sentence headline;
- **progress and time left**, from a step count where the output gives one —
  ionic steps of `NSW`, MD steps of `nstep` — and otherwise from the share of the
  wall-time limit used; a job the output says has finished is at 100 %;
- the **key numbers**, the **charts** and the **Calculation setup** rows;
- **warnings**, including "No output update for N min — job may be stalled."
  when a running job's output has not changed for more than 15 minutes;
- the **3-D structure**, from trajectory or geometry files or from positions
  printed in the output.

VASP and ORCA are *native*: their specs describe them like any other, but their
numbers come from hand-written readers that know what a spec cannot yet say —
NEB image folders, the two counters of a relaxed scan, continuing a run.

## A queued job, or a folder used before

A job still waiting in the queue has produced nothing, so only its input is
read: output in its folder belongs to an earlier run there. Its 3-D view shows
only a source the spec marks as the starting geometry, and files older than the
job are labelled as left by an earlier run rather than shown as its own.
[Queued jobs and reused folders](/docs/job/queued-and-reused-folders)
has the details.

## When no code matches

A folder that no engine recognises is tagged **other** in the job list. Its
pane says "Tool not recognized — showing wall-clock progress and output.": the
progress bar is the share of the wall-time limit used, and the **Output** and
**Files** tabs work as for any job. There are no charts and no 3-D view.

If a job of yours is not recognised, or recognised as the wrong code,
[A job shows no code, or “other”](/docs/help/code-not-recognised) walks through the causes.
Limiting a server to the codes you run there
([codes per server](/docs/codes/codes-per-server)) makes each check shorter and
leaves fewer codes to confuse.

## Check yourself

1. A folder holds job.inp and job.out, extensions several codes share. What decides which code it is?
   - The text at the top of the files, matched against each code's signature ← the answer
   - The extension of the newest file
   - The module loaded in the job script
   - Whichever code has the most files in the folder
   Why: A shared extension only makes a code a candidate; a signature found inside a file decides.

2. What does a job get when no code recognises its folder?
   - Nothing — it is left out of the job list
   - Wall-clock progress, its output and its files ← the answer
   - A guess at the code from the job's name
   - A warning that the job failed
   Why: The fallback shows the share of the wall-time limit used, the Output tab and the Files tab.

## Try it in the app

- Open one of your running jobs and read the code tag and the kind of calculation in the job pane's header.
- Open Connections → Settings → **Simulation codes** and find the kinds of calculation listed for a code you use.

## Related

- [The twenty supported codes](https://hiveboard.dev/docs/codes/supported-codes.md)
- [Codes per server](https://hiveboard.dev/docs/codes/codes-per-server.md)
- [Code tags and calculation kinds](https://hiveboard.dev/docs/jobs/code-and-kind.md)
- [A job shows no code, or "other"](https://hiveboard.dev/docs/help/code-not-recognised.md)
- [Engine spec reference](https://hiveboard.dev/docs/codes/engine-spec-reference.md)
