NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
be_mpi_receiver.h
Go to the documentation of this file.
1
10#ifndef _BE_MPI_RECEIVER_H
11#define _BE_MPI_RECEIVER_H
12
13#include <string>
14#include <vector>
15#include <memory>
16
17#include <be_error_exception.h>
18#include <be_mpi.h>
19#include <be_mpi_resources.h>
20#include <be_mpi_workpackage.h>
23
24namespace BiometricEvaluation {
25 namespace MPI {
55 class Receiver {
56 public:
70 const std::string &propertiesFileName,
71 const std::shared_ptr<
73 &workPackageProcessor);
74
76
89 void start();
90
91 protected:
92
93 private:
94 MPI::TaskStatus requestWorkPackages();
95 void sendWorkPackage(MPI::WorkPackage &workPackage);
96 void startWorkers();
97 void shutdown(
98 const MPI::TaskStatus &status,
99 const std::string &reason);
100
101 Process::ForkManager _processManager;
102
103 std::shared_ptr<MPI::WorkPackageProcessor>
104 _workPackageProcessor;
105
106 std::shared_ptr<MPI::Resources> _resources;
107 std::shared_ptr<IO::Logsheet> _logsheet;
108
109 /*
110 * Declare the class that implements process worker.
111 */
112 class PackageWorker : public Process::Worker
113 {
114 public:
115 PackageWorker(
116 const std::shared_ptr<MPI::WorkPackageProcessor>
117 &workPackageProcessor,
118 const std::shared_ptr<MPI::Resources>
119 &resources);
120
121 int32_t workerMain();
122
123 ~PackageWorker();
124
125 private:
126 std::shared_ptr<
128 _workPackageProcessor;
129 std::shared_ptr<MPI::Resources> _resources;
130 std::shared_ptr<IO::Logsheet> _logsheet;
131 };
132 };
133 }
134}
135
136#endif /* _BE_MPI_RECEIVER_H */
137
A class to represent an MPI task that receives WorkPackages containers from the Distributor.
Receiver(const std::string &propertiesFileName, const std::shared_ptr< BiometricEvaluation::MPI::WorkPackageProcessor > &workPackageProcessor)
Construct a new work package receiver.
void start()
Start the receiving task.
A class to represent a piece of work to be acted upon by a processor.
Represents an object that processes the contents of a work package.
Manager implementation that starts Workers by calling fork(2).
An abstraction of an instance that performs work on given data.
TaskStatus
The status of an MPI distributor or receiver task.
Definition: be_mpi.h:121
This software was developed at the National Institute of Standards and Technology (NIST) by employees...