poet/src/util/Parser.h
2021-01-12 14:48:25 +01:00

42 lines
932 B
C++

#ifndef PARSER_H
#define PARSER_H
#include <string>
#include "../argh.h"
#include "RRuntime.h"
#include "SimParams.h"
#define PARSER_OK 0
#define PARSER_ERROR 1
#define PARSER_HELP 2
#define DHT_SIZE_PER_PROCESS 1073741824
#define WORK_PACKAGE_SIZE_DEFAULT 5
namespace poet {
class Parser {
public:
Parser(char *argv[], int world_rank, int world_size);
int parseCmdl();
void parseR(RRuntime &R);
t_simparams getParams();
private:
std::list<std::string> checkOptions(argh::parser cmdl);
std::set<std::string> flaglist{"ignore-result", "dht", "dht-nolog"};
std::set<std::string> paramlist{"work-package-size", "dht-signif",
"dht-strategy", "dht-size",
"dht-snaps", "dht-file"};
argh::parser cmdl;
t_simparams simparams;
int world_rank;
int world_size;
int dht_significant_digits;
};
} // namespace poet
#endif // PARSER_H