AUTH's THMMY "Parallel and distributed systems" course assignments.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

config.h 2.2 KiB

il y a 5 jours
il y a 5 jours
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 {}; //!< Maximum threads to use
  48. bool timing {false}; //!< Enable timing prints of the program
  49. bool verbose {false}; //!< Flag to enable verbose output to stdout
  50. };
  51. extern session_t session;
  52. #endif /* CONFIG_H_ */