checkpoint#

Checkpoint files: naming, retention and pre-flight checks.

The adapter writes and reads the product’s checkpoint files (for example a case and data file). This module decides where they go, keeps the newest keep_last of them, and – when the server shares the client’s file system – validates paths before and after each write so that a bad target fails fast instead of leaving a synchronous server command waiting.

Classes:

CheckpointStore(adapter, config, *, run_id)

Write, restore and prune the checkpoints of one resilient session.

Functions:

preflight_read(file_path)

Check that the checkpoint file at file_path can be read.

preflight_write(file_path)

Check that a checkpoint can be written to file_path.

sanitize(name)

Make a checkpoint name safe to use in a file name.

class ansys.fluent.core.resilient.engine.checkpoint.CheckpointStore(adapter, config, *, run_id)#

Bases: object

Write, restore and prune the checkpoints of one resilient session.

Methods:

__init__(adapter, config, *, run_id)

discard_after(checkpoint)

Forget every checkpoint newer than checkpoint.

find([name])

Return the newest checkpoint, or the newest one called name.

newest()

Return the newest retained checkpoint, if any.

restore(session, checkpoint)

Restore session from checkpoint.

write(session, name, *[, reason, journal_seq])

Write a checkpoint of session.

Attributes:

checkpoints

Return the retained checkpoints (oldest first).

__init__(adapter, config, *, run_id)#
property checkpoints: list[Checkpoint]#

Return the retained checkpoints (oldest first).

discard_after(checkpoint)#

Forget every checkpoint newer than checkpoint.

find(name=None)#

Return the newest checkpoint, or the newest one called name.

Raises:
CheckpointError

If no matching checkpoint is retained.

newest()#

Return the newest retained checkpoint, if any.

restore(session, checkpoint)#

Restore session from checkpoint.

Raises:
CheckpointError

If the checkpoint files are missing or the product fails to read them.

write(session, name, *, reason=None, journal_seq=0)#

Write a checkpoint of session.

Raises:
CheckpointError

If the checkpoint cannot be written or verified.

ansys.fluent.core.resilient.engine.checkpoint.preflight_read(file_path)#

Check that the checkpoint file at file_path can be read.

Raises:
CheckpointError

If the file is missing, unreadable, or empty.

ansys.fluent.core.resilient.engine.checkpoint.preflight_write(file_path)#

Check that a checkpoint can be written to file_path.

Raises:
CheckpointError

If the file name is invalid, the directory is missing or not writable, or the path is too long.

ansys.fluent.core.resilient.engine.checkpoint.sanitize(name)#

Make a checkpoint name safe to use in a file name.