tests.cpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /**
  2. * @file tests/mpi/tests.cpp
  3. * @author The PARADEVS Development Team
  4. * See the AUTHORS or Authors.txt file
  5. */
  6. /*
  7. * PARADEVS - the multimodeling and simulation environment
  8. * This file is a part of the PARADEVS environment
  9. *
  10. * Copyright (C) 2013-2015 ULCO http://www.univ-litoral.fr
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation, either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. #include <tests/mpi/graph_manager.hpp>
  26. #include <tests/pdevs/graph_manager.hpp>
  27. #include <paradevs/common/RootCoordinator.hpp>
  28. #include <chrono>
  29. #define CATCH_CONFIG_MAIN
  30. #include <tests/catch.hpp>
  31. using namespace paradevs::tests::pdevs;
  32. using namespace paradevs::tests::mpi;
  33. using namespace paradevs::common;
  34. using namespace std::chrono;
  35. TEST_CASE("pdevs/mpi/hierachical", "run")
  36. {
  37. steady_clock::time_point t1 = steady_clock::now();
  38. paradevs::common::RootCoordinator <
  39. DoubleTime,
  40. paradevs::pdevs::mpi::Coordinator <
  41. DoubleTime,
  42. paradevs::tests::mpi::RootGraphManager
  43. >
  44. > rc(0, 100, "root");
  45. rc.run();
  46. steady_clock::time_point t2 = steady_clock::now();
  47. duration < double > time_span = duration_cast <
  48. duration < double > >(t2 - t1);
  49. std::cout << "mpi/dependant -> " << time_span.count()
  50. << std::endl;
  51. }
  52. // TEST_CASE("pdevs/classic/hierachical", "run")
  53. // {
  54. // steady_clock::time_point t1 = steady_clock::now();
  55. // paradevs::common::RootCoordinator <
  56. // DoubleTime, paradevs::pdevs::Coordinator <
  57. // DoubleTime, paradevs::tests::pdevs::RootGraphManager >
  58. // > rc(0, 100, "root", paradevs::common::NoParameters(),
  59. // paradevs::common::NoParameters());
  60. // rc.run();
  61. // steady_clock::time_point t2 = steady_clock::now();
  62. // duration < double > time_span = duration_cast <
  63. // duration < double > >(t2 - t1);
  64. // std::cout << "classic/dependant -> " << time_span.count() << std::endl;
  65. // }
  66. // TEST_CASE("pdevs/mpi/independant", "run")
  67. // {
  68. // steady_clock::time_point t1 = steady_clock::now();
  69. // paradevs::common::RootCoordinator <
  70. // DoubleTime, paradevs::pdevs::mpi::Coordinator <
  71. // DoubleTime, paradevs::tests::mpi::Root2GraphManager >
  72. // > rc(0, 100, "root", paradevs::common::NoParameters(),
  73. // paradevs::common::NoParameters());
  74. // rc.run();
  75. // steady_clock::time_point t2 = steady_clock::now();
  76. // duration < double > time_span = duration_cast <
  77. // duration < double > >(t2 - t1);
  78. // std::cout << "mpi/independant -> " << time_span.count()
  79. // << std::endl;
  80. // }
  81. // TEST_CASE("pdevs/classic/independant", "run")
  82. // {
  83. // steady_clock::time_point t1 = steady_clock::now();
  84. // paradevs::common::RootCoordinator <
  85. // DoubleTime, paradevs::pdevs::Coordinator <
  86. // DoubleTime, paradevs::tests::mpi::Root3GraphManager >
  87. // > rc(0, 100, "root", paradevs::common::NoParameters(),
  88. // paradevs::common::NoParameters());
  89. // rc.run();
  90. // steady_clock::time_point t2 = steady_clock::now();
  91. // duration < double > time_span = duration_cast <
  92. // duration < double > >(t2 - t1);
  93. // std::cout << "classic/independant -> " << time_span.count() << std::endl;
  94. // }