fpmas 1.6
Public Member Functions | List of all members
fpmas::model::AutoBreakpoint Class Reference

#include <model.h>

Public Member Functions

 AutoBreakpoint (std::string file_format, api::io::Breakpoint< api::model::Model > &breakpoint, api::model::Model &model)
 
const api::scheduler::Jobjob () const
 

Detailed Description

An utility class that can be used to easily schedule Model breakpoints.

A job() is built to automatically dump the specified model to a file when it is executed.

Constructor & Destructor Documentation

◆ AutoBreakpoint()

fpmas::model::AutoBreakpoint::AutoBreakpoint ( std::string  file_format,
api::io::Breakpoint< api::model::Model > &  breakpoint,
api::model::Model model 
)
inline

AutoBreakpoint constructor.

The specified file_format is formatted using the fpmas::utils::format(std::string, int, fpmas::api::scheduler::TimeStep) method, so that r and t occurrences in the file_format are automatically replaced by the current process rank and the current date to generate file names.

Since breakpoints can quickly grow in size, a good practice is to use a file_format such as "breakpoint.%r.bin", that does not depend on "%t". This way, the last dump always overrides the previous, what might save a consequent amount of memory, while still allowing to recover from the most recent breakpoint in case of crash.

Parameters
file_formatFile name format
breakpointBreakpoint instance used to perform dumps
modelModel on which breakpoints are performed

Member Function Documentation

◆ job()

const api::scheduler::Job & fpmas::model::AutoBreakpoint::job ( ) const
inline

A Job that can be scheduled to automatically dump model breakpoints.

See also
fpmas::api::scheduler::Scheduler

The documentation for this class was generated from the following file: