nf_mm.f90 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ! StarPU --- Runtime system for heterogeneous multicore architectures.
  2. !
  3. ! Copyright (C) 2016 Inria
  4. !
  5. ! StarPU is free software; you can redistribute it and/or modify
  6. ! it under the terms of the GNU Lesser General Public License as published by
  7. ! the Free Software Foundation; either version 2.1 of the License, or (at
  8. ! your option) any later version.
  9. !
  10. ! StarPU is distributed in the hope that it will be useful, but
  11. ! WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. !
  14. ! See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. program nf_mm
  16. use iso_c_binding ! C interfacing module
  17. use fstarpu_mod ! StarPU interfacing module
  18. use fstarpu_mpi_mod ! StarPU-MPI interfacing module
  19. use nf_mm_cl
  20. implicit none
  21. integer(c_int) :: ncpu
  22. integer(c_int) :: ret
  23. ret = fstarpu_mpi_init(1)
  24. print *,"fstarpu_mpi_init status:", ret
  25. if (ret /= 0) then
  26. stop 1
  27. end if
  28. ret = fstarpu_init(C_NULL_PTR)
  29. if (ret == -19) then
  30. stop 77
  31. else if (ret /= 0) then
  32. stop 1
  33. end if
  34. ! stop there if no CPU worker available
  35. ncpu = fstarpu_cpu_worker_get_count()
  36. if (ncpu == 0) then
  37. call fstarpu_shutdown()
  38. stop 77
  39. end if
  40. call fstarpu_shutdown()
  41. ret = fstarpu_mpi_shutdown()
  42. print *,"fstarpu_mpi_shutdown status:", ret
  43. if (ret /= 0) then
  44. stop 1
  45. end if
  46. end program nf_mm