NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
BiometricEvaluation::MPI::CSVDistributor Class Reference

An implementation of the MPI::Distrbutor abstraction that distribute lines of a text file via work packages. More...

#include <be_mpi_csvdistributor.h>

Inherits BiometricEvaluation::MPI::Distributor.

Public Member Functions

 CSVDistributor (const std::string &propertiesFileName, const std::string &delimiter="")
 Construct a CSVDistributor using named properties. More...
 
 ~CSVDistributor ()
 
- Public Member Functions inherited from BiometricEvaluation::MPI::Distributor
 Distributor (const std::string &propertiesFileName)
 Constructor with properties file name. More...
 
virtual ~Distributor ()
 
void start ()
 Start of MPI processing for the distributor. More...
 

Static Public Attributes

static const std::string CHECKPOINTLINECOUNT
 The number of lines that were distributed, "Line Count". More...
 
static const std::string CHECKPOINTRANDOMSEED
 The seed used to randomize the input CSV file lines, "Random Seed". More...
 
- Static Public Attributes inherited from BiometricEvaluation::MPI::Distributor
static const std::string CHECKPOINTFILENAME
 The name of the checkpoint properties file, "Distributor.chk". More...
 
static const std::string CHECKPOINTREASON
 The reason string given for the checkpoint to be taken, "Reason". More...
 
static const std::string CHECKPOINTPID
 The process ID of the checkpointing Distributor process, "PID". More...
 

Protected Member Functions

void createWorkPackage (MPI::WorkPackage &workPackage)
 Create a work package for distribution. More...
 
void checkpointSave (const std::string &reason)
 Create a checkpoint state. More...
 
void checkpointRestore ()
 Restore from a checkpoint state. More...
 
- Protected Member Functions inherited from BiometricEvaluation::MPI::Distributor
virtual void createWorkPackage (MPI::WorkPackage &workPackage)=0
 Create a work package for distribution. More...
 
virtual void checkpointSave (const std::string &reason)=0
 Create a checkpoint state. More...
 
virtual void checkpointRestore ()=0
 Restore from a checkpoint state. More...
 
std::shared_ptr< IO::LogsheetgetLogsheet () const
 Get access to the Logsheet object. More...
 
std::shared_ptr< IO::PropertiesFilegetCheckpointData () const
 Get access to the checkpoint data object. More...
 

Detailed Description

An implementation of the MPI::Distrbutor abstraction that distribute lines of a text file via work packages.

This class supports checkpointing when an early exit is requested, allowing all workers to complete their current work package. If the input data lines were randomized, the random number generator seed is saved as part of the checkpoint.

On checkpoint restart, if the input data lines are randomized, the seed in the checkpoint must match the current seed; else an exception is thrown. If the checkpoint contains a seed, and the input is not currently randomized, and exception is thrown. See MPI::CSVResources.

Definition at line 42 of file be_mpi_csvdistributor.h.

Constructor & Destructor Documentation

◆ CSVDistributor()

BiometricEvaluation::MPI::CSVDistributor::CSVDistributor ( const std::string &  propertiesFileName,
const std::string &  delimiter = "" 
)

Construct a CSVDistributor using named properties.

Parameters
[in]propertiesFileNameThe file containing the properties.
[in]delimiterDelimiter used to tokenize lines read from CSV.

◆ ~CSVDistributor()

BiometricEvaluation::MPI::CSVDistributor::~CSVDistributor ( )

Member Function Documentation

◆ createWorkPackage()

void BiometricEvaluation::MPI::CSVDistributor::createWorkPackage ( MPI::WorkPackage workPackage)
protectedvirtual

Create a work package for distribution.

Implementations of this class create a work package to encapsulate the specific data type that is to be distributed.

Implements BiometricEvaluation::MPI::Distributor.

◆ checkpointSave()

void BiometricEvaluation::MPI::CSVDistributor::checkpointSave ( const std::string &  reason)
protectedvirtual

Create a checkpoint state.

Implementations of this class create a checkpoint state that captures enough information to allow the implementation to move the data sequence cursor to a point past data that has been previously distributed. The MPI Framework calls this method when a premature shutdown is requested.

Parameters
reasonA string giving the reason for the checkpoint to be saved.

Implements BiometricEvaluation::MPI::Distributor.

◆ checkpointRestore()

void BiometricEvaluation::MPI::CSVDistributor::checkpointRestore ( )
protectedvirtual

Restore from a checkpoint state.

Implementations of this class use a checkpoint state to move the data sequence cursor to a point past data that has been previously distributed. The MPI Framework calls this method prior to the start of distributing work packages.

Implements BiometricEvaluation::MPI::Distributor.

Member Data Documentation

◆ CHECKPOINTLINECOUNT

const std::string BiometricEvaluation::MPI::CSVDistributor::CHECKPOINTLINECOUNT
static

The number of lines that were distributed, "Line Count".

Definition at line 49 of file be_mpi_csvdistributor.h.

◆ CHECKPOINTRANDOMSEED

const std::string BiometricEvaluation::MPI::CSVDistributor::CHECKPOINTRANDOMSEED
static

The seed used to randomize the input CSV file lines, "Random Seed".

Definition at line 55 of file be_mpi_csvdistributor.h.


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