11#ifndef BE_MPI_CSVRESOURCES_H_
12#define BE_MPI_CSVRESOURCES_H_
44 static std::vector<std::string>
47 static std::vector<std::string>
51 const std::string &propertiesFileName);
119 std::pair<uint64_t, std::string>
146 std::mt19937_64::result_type
167 std::pair<uint64_t, std::string>
176 uint64_t _remainingLines;
179 std::string _csvPath;
181 std::shared_ptr<std::ifstream> _csvStream;
184 bool _trimWhitespace;
190 bool _randomizeLines;
192 std::vector<std::pair<uint64_t, std::string>>
195 std::mt19937_64 _rng;
197 std::mt19937_64::result_type _rngSeed;
202 std::string _delimiter;
static const std::string INPUTCSVPROPERTY
Text file to read.
bool useBuffer() const
Obtain whether or not the entire CSV was read into memory at construction.
std::pair< uint64_t, std::string > readLine()
Obtain the next line from a buffer of file stream.
CSVResources(const std::string &propertiesFileName)
static const std::string TRIMPROPERTY
Trim whitespace from lines read.
static const std::string CHUNKSIZEPROPERTY
Number of lines sent in succession.
bool randomizeLines() const
If using buffer, whether or not to randomize how lines from the buffer are iterated.
uint64_t getNumLines() const
Obtain number of lines of input.
static const std::string USEBUFFERPROPERTY
Read file into buffer first, or read from file.
static const std::string RANDOMIZEPROPERTY
Randomly iterate buffer.
uint32_t getChunkSize() const
std::mt19937_64::result_type getRandomSeed() const
Obtain the seed used to shuffle lines.
std::string getDelimiter() const
static const std::string RANDOMSEEDPROPERTY
Seed for randomization.
static const std::string DELIMITERPROPERTY
Delimiter to tokenize sent lines.
static std::vector< std::string > getOptionalProperties()
uint64_t getNumRemainingLines() const
Obtain the number of lines that have not yet been read from readLine() by a Distributor.
static std::vector< std::string > getRequiredProperties()
A class to represent a set of resources needed by an MPI program.
This software was developed at the National Institute of Standards and Technology (NIST) by employees...