9 #ifndef _fei_test_utils_hpp_
10 #define _fei_test_utils_hpp_
12 #include <fei_macros.hpp>
16 #include <fei_fwd.hpp>
18 #include <fei_FillableMat.hpp>
25 namespace fei_test_utils {
42 int& localProc,
int& numProcs);
53 bool bool_arg(
const char* flag,
int argc,
char** argv,
54 bool default_result=
false);
62 std::string
get_arg_value(
const char* flag,
int argc,
char** argv);
78 MPI_Comm comm,
int localProc,
79 std::vector<std::string>& stdstrings);
85 std::vector<std::string>& file_contents);
95 std::vector<std::string>& file_contents);
103 const char* testname);
116 bool check_and_cout_test_result(std::string testname,
121 std::string check_test_result(
double value,
125 int compare_with_file_benchmark(
const char* name,
127 const char* filename);
129 int whichArg(
int argc,
const char*
const* argv,
const char* findarg);
131 int dirname(
const char* name,
char*& dir);
133 void print_args(
int argc,
char** argv);
135 int compareMatrices(fei::FillableMat& mat1, fei::FillableMat& mat2,
double tol=1.e-15);
137 int readMatrix(
const char* baseName,
int np, fei::FillableMat& matrix);
139 int readMatrix(
const char* fileName, fei::FillableMat& matrix);
141 int writeMatrix(
const char* fileName, fei::FillableMat& matrix);
143 int copy_feiMatrix_to_FillableMat(
fei::Matrix& feimat, fei::FillableMat& ssmat);
std::string construct_filename(int argc, char **argv)
void read_file_lines_into_strings(const char *filename, std::vector< std::string > &file_contents)
bool bool_arg(const char *flag, int argc, char **argv, bool default_result)
double get_file_benchmark(const char *filename, const char *testname)
int get_filename_and_read_input(int argc, char **argv, MPI_Comm comm, int localProc, std::vector< std::string > &stdstrings)
int initialize_mpi(int argc, char **argv, int &localProc, int &numProcs)
void read_input_file(const char *filename, MPI_Comm comm, std::vector< std::string > &file_contents)
void broadcast_string(MPI_Comm comm, int root, std::string &strg)
bool within_percentage_margin(double value1, double value2, unsigned margin)
std::string get_arg_value(const char *flag, int argc, char **argv)