AUTH's THMMY "Parallel and distributed systems" course assignments.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

68 рядки
2.4 KiB

  1. /*!
  2. * \file config,h
  3. * \brief Build configuration file.
  4. *
  5. * \author
  6. * Christos Choutouridis AEM:8997
  7. * <cchoutou@ece.auth.gr>
  8. */
  9. #ifndef CONFIG_H_
  10. #define CONFIG_H_
  11. #include <iostream>
  12. #include <string>
  13. #include "matrix.hpp"
  14. // HDF5 supported types
  15. enum class HDF5_type {
  16. SCHAR, CHAR, SHORT, USHORT, INT, UINT, LONG, ULONG, LLONG, ULLONG, FLOAT, DOUBLE
  17. };
  18. /*
  19. * Defines for different version of the exercise
  20. */
  21. #define V0 0
  22. #define V1 1
  23. // Fail-safe version selection
  24. #if !defined CODE_VERSION
  25. #define CODE_VERSION V1
  26. #endif
  27. // matrix alias template dispatcher
  28. using MatrixDst = mtx::Matrix<double>;
  29. using MatrixIdx = mtx::Matrix<uint32_t>;
  30. static constexpr HDF5_type DstHDF5Type = HDF5_type::DOUBLE;
  31. static constexpr HDF5_type IdxHDF5Type = HDF5_type::INT;
  32. //! enumerator for output handling
  33. enum class StdOutputMode{ STD, FILE };
  34. /*!
  35. * Session option for each invocation of the executable
  36. */
  37. struct session_t {
  38. std::string corpusMtxFile {}; //!< corpus matrix file name in HDF5 format
  39. std::string corpusDataSet {}; //!< corpus dataset name in HDF5 matrix file
  40. std::string queryMtxFile {}; //!< optional query matrix file name in HDF5 format
  41. std::string queryDataSet {}; //!< optional query dataset name in HDF5 matrix file
  42. bool queryMtx {false}; //!< Flag to indicate that there is a separate query matrix
  43. size_t k {1}; //!< The number of nearest neighbors to find
  44. std::string outMtxFile {"out.hdf5"}; //!< output matrix file name in HDF5 format
  45. std::string outMtxIdxDataSet {"/Idx"}; //!< Index output dataset name in HDF5 matrix file
  46. std::string outMtxDstDataSet {"/Dst"}; //!< Distance output dataset name in HDF5 matrix file
  47. std::size_t max_threads {0}; //!< Maximum threads to use
  48. std::size_t slices {0}; //!< Slices/threads to use
  49. std::size_t accuracy {100}; //!< The neighbor finding accuracy
  50. bool timing {false}; //!< Enable timing prints of the program
  51. bool verbose {false}; //!< Flag to enable verbose output to stdout
  52. };
  53. extern session_t session;
  54. #endif /* CONFIG_H_ */