AUTH's THMMY "Parallel and distributed systems" course assignments.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

config.h 2.2 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*!
  2. * \file
  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 <cstdint>
  12. /*
  13. * Versioning:
  14. * - RC1: Model version
  15. * - RC2: Parallel full sort
  16. * - RC3: Vanila
  17. * - RC3a: Exchange optimization
  18. * - RC3b: MPI Pipeline
  19. * - RC4: Include all version
  20. */
  21. static constexpr char version[] = "0.4";
  22. /*
  23. * Defines for different version of the exercise
  24. */
  25. #define BITONIC (1)
  26. #define BUBBLETONIC (2)
  27. // Fail-safe version selection
  28. #if !defined CODE_VERSION
  29. #define CODE_VERSION BITONIC
  30. #endif
  31. // Default Data size (in case -q <N> is not present)
  32. static constexpr size_t DEFAULT_DATA_SIZE = 1 << 16;
  33. // The maximum MPI size we support (in Nodes x Processes)
  34. static constexpr size_t MAX_MPI_SIZE = 1024UL;
  35. // The maximum pipeline size we support
  36. static constexpr size_t MAX_PIPELINE_SIZE = 64UL;
  37. /*!
  38. * Value type selection
  39. *
  40. * We support the following compiler types or the <cstdint> that translate to them:
  41. * char - unsigned char
  42. * short - unsigned short
  43. * int - unsigned int
  44. * long - unsigned long
  45. * long long - unsigned long long
  46. * float
  47. * double
  48. */
  49. using distValue_t = uint32_t;
  50. /*!
  51. * Session option for each invocation of the executable.
  52. *
  53. * @note
  54. * The values of the members are set from the command line.
  55. */
  56. struct config_t {
  57. size_t arraySize{DEFAULT_DATA_SIZE}; //!< The array size of the local data to sort.
  58. bool exchangeOpt{false}; //!< Flag to request the exchange optimization
  59. size_t pipeline{1UL}; //!< Pipeline stages (1 to disable)
  60. bool validation{false}; //!< Request a full validation at the end, performed by process rank 0.
  61. bool ndebug{false}; //!< Skips debug trap on DEBUG builds.
  62. size_t perf{1}; //!< Enable performance timing measurements and prints and repeat
  63. //!< the sorting <perf> times.
  64. bool verbose{false}; //!< Flag to enable verbose output to stdout.
  65. };
  66. /*
  67. * Exported data types
  68. */
  69. extern config_t config;
  70. #endif /* CONFIG_H_ */