Guest User

Untitled

a guest
Jun 25th, 2023
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. // Copyright (c) 2023 R. Tohid (@rtohid)
  2. //
  3. // SPDX-License-Identifier: BSL-1.0
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6.  
  7. #include <iostream>
  8. #include <omp.h>
  9.  
  10. #include <hpx/hpx_start.hpp>
  11. #include <hpx/hpx_suspend.hpp>
  12. #include <hpx/future.hpp>
  13. int hello() {
  14.  
  15. std::cout << "Starting ..." << std::endl;
  16.  
  17. #pragma omp parallel
  18. {
  19. std::cout << "Hello World, from thread: " << omp_get_thread_num()
  20. << std::endl;
  21. }
  22.  
  23. return 0;
  24. }
  25.  
  26. int main(int argc, char* argv[])
  27. {
  28. hpx::start(nullptr, argc, argv);
  29. hpx::post(&hello);
  30. hpx::post([]() { hpx::disconnect(); });
  31. //return hpx::disconnect();
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment