Makefile.am 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2009-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. # Copyright (C) 2013 Thibaut Lambert
  5. #
  6. # StarPU is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # StarPU is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. #
  17. include $(top_srcdir)/starpu.mk
  18. CC=$(MPICC)
  19. CCLD=$(MPICC)
  20. FC=$(MPIFORT)
  21. FCLD=$(MPIFORT)
  22. if STARPU_HAVE_WINDOWS
  23. LOADER_BIN =
  24. else
  25. loader_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) -I$(top_builddir)/src/
  26. if !STARPU_SIMGRID
  27. LOADER = loader
  28. LOADER_BIN = $(abs_top_builddir)/mpi/examples/$(LOADER)
  29. endif
  30. loader_SOURCES = ../../tests/loader.c
  31. endif
  32. if STARPU_SIMGRID
  33. MPI = $(abs_top_builddir)/tools/starpu_smpirun -np 4 -platform $(abs_top_srcdir)/tools/perfmodels/cluster.xml -hostfile $(abs_top_srcdir)/tools/perfmodels/hostfile
  34. else
  35. # we always test on 4 processes, the execution time is not that bigger
  36. if STARPU_QUICK_CHECK
  37. MPI = $(MPIEXEC) $(MPIEXEC_ARGS) -np 4
  38. else
  39. MPI = $(MPIEXEC) $(MPIEXEC_ARGS) -np 4
  40. endif
  41. endif
  42. if STARPU_HAVE_AM111
  43. TESTS_ENVIRONMENT = STARPU_WORKERS_NOBIND=1 STARPU_NCPU=4 top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
  44. LOG_COMPILER = $(MPI) $(LOADER_BIN)
  45. else
  46. TESTS_ENVIRONMENT = STARPU_WORKERS_NOBIND=1 STARPU_NCPU=4 top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(MPI) $(LOADER_BIN)
  47. endif
  48. if STARPU_MPI_CHECK
  49. TESTS = $(starpu_mpi_EXAMPLES)
  50. endif
  51. check_PROGRAMS = $(LOADER) $(starpu_mpi_EXAMPLES)
  52. starpu_mpi_EXAMPLES =
  53. BUILT_SOURCES =
  54. CLEANFILES = *.gcno *.gcda *.linkinfo starpu_idle_microsec.log *.mod native_fortran/fstarpu_mod.f90 native_fortran/fstarpu_mpi_mod.f90
  55. EXTRA_DIST = \
  56. mpi_lu/mpi_lu-float.h \
  57. mpi_lu/mpi_lu-double.h \
  58. mpi_lu/plu_example.c \
  59. mpi_lu/plu_implicit_example.c \
  60. mpi_lu/plu_outofcore_example.c \
  61. mpi_lu/plu_solve.c \
  62. mpi_lu/pxlu.h \
  63. mpi_lu/pxlu.c \
  64. mpi_lu/pxlu_implicit.c \
  65. mpi_lu/pxlu_kernels.h \
  66. mpi_lu/pxlu_kernels.c \
  67. matrix_decomposition/mpi_cholesky.h \
  68. matrix_decomposition/mpi_cholesky_codelets.h \
  69. matrix_decomposition/mpi_cholesky_kernels.h \
  70. matrix_decomposition/mpi_cholesky_models.h \
  71. matrix_decomposition/mpi_decomposition_params.h \
  72. matrix_decomposition/mpi_decomposition_matrix.h \
  73. user_datatype/my_interface.h \
  74. helper.h
  75. examplebindir = $(libdir)/starpu/mpi
  76. examplebin_PROGRAMS =
  77. if STARPU_USE_CUDA
  78. if STARPU_COVERITY
  79. include $(top_srcdir)/starpu-mynvcc.mk
  80. else
  81. NVCCFLAGS += --compiler-options -fno-strict-aliasing -I$(top_srcdir)/include/ -I$(top_builddir)/include/ $(HWLOC_CFLAGS)
  82. .cu.cubin:
  83. $(V_nvcc) $(NVCC) -cubin $< -o $@ $(NVCCFLAGS)
  84. .cu.o:
  85. $(V_nvcc) $(NVCC) $< -c -o $@ $(NVCCFLAGS)
  86. endif
  87. endif
  88. AM_CFLAGS = -Wall $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS) $(FXT_CFLAGS) $(MAGMA_CFLAGS) $(HWLOC_CFLAGS) $(GLOBAL_AM_CFLAGS) -Wno-unused
  89. LIBS = $(top_builddir)/src/@LIBSTARPU_LINK@ ../src/libstarpumpi-@STARPU_EFFECTIVE_VERSION@.la -lm @LIBS@ $(FXT_LIBS) $(MAGMA_LIBS)
  90. AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/examples/ -I$(top_builddir)/include -I$(top_srcdir)/mpi/include
  91. AM_LDFLAGS = $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS) $(FXT_LDFLAGS) $(STARPU_COI_LDFLAGS) $(STARPU_SCIF_LDFLAGS)
  92. ###################
  93. # Stencil example #
  94. ###################
  95. examplebin_PROGRAMS += \
  96. stencil/stencil5
  97. starpu_mpi_EXAMPLES += \
  98. stencil/stencil5
  99. if STARPU_USE_MPI_MPI
  100. examplebin_PROGRAMS += \
  101. stencil/stencil5_lb
  102. starpu_mpi_EXAMPLES += \
  103. stencil/stencil5_lb
  104. endif
  105. ##################
  106. # MPI LU example #
  107. ##################
  108. if !STARPU_NO_BLAS_LIB
  109. examplebin_PROGRAMS += \
  110. mpi_lu/plu_example_float \
  111. mpi_lu/plu_example_double \
  112. mpi_lu/plu_implicit_example_float \
  113. mpi_lu/plu_implicit_example_double \
  114. mpi_lu/plu_outofcore_example_float \
  115. mpi_lu/plu_outofcore_example_double
  116. if !STARPU_SIMGRID
  117. starpu_mpi_EXAMPLES += \
  118. mpi_lu/plu_implicit_example_float \
  119. mpi_lu/plu_implicit_example_double
  120. endif
  121. mpi_lu_plu_example_float_LDADD = \
  122. $(STARPU_LIBNUMA_LDFLAGS) \
  123. $(STARPU_BLAS_LDFLAGS) -lm
  124. mpi_lu_plu_example_float_SOURCES = \
  125. mpi_lu/plu_example_float.c \
  126. mpi_lu/plu_solve_float.c \
  127. mpi_lu/pslu_kernels.c \
  128. mpi_lu/pslu.c \
  129. ../../examples/common/blas.c
  130. mpi_lu_plu_example_double_LDADD = \
  131. $(STARPU_LIBNUMA_LDFLAGS) \
  132. $(STARPU_BLAS_LDFLAGS) -lm
  133. mpi_lu_plu_example_double_SOURCES = \
  134. mpi_lu/plu_example_double.c \
  135. mpi_lu/plu_solve_double.c \
  136. mpi_lu/pdlu_kernels.c \
  137. mpi_lu/pdlu.c \
  138. ../../examples/common/blas.c
  139. mpi_lu_plu_implicit_example_float_LDADD = \
  140. $(STARPU_LIBNUMA_LDFLAGS) \
  141. $(STARPU_BLAS_LDFLAGS) -lm
  142. mpi_lu_plu_implicit_example_float_SOURCES = \
  143. mpi_lu/plu_implicit_example_float.c \
  144. mpi_lu/plu_solve_float.c \
  145. mpi_lu/pslu_kernels.c \
  146. mpi_lu/pslu_implicit.c \
  147. ../../examples/common/blas.c
  148. mpi_lu_plu_implicit_example_double_LDADD = \
  149. $(STARPU_LIBNUMA_LDFLAGS) \
  150. $(STARPU_BLAS_LDFLAGS) -lm
  151. mpi_lu_plu_implicit_example_double_SOURCES = \
  152. mpi_lu/plu_implicit_example_double.c \
  153. mpi_lu/plu_solve_double.c \
  154. mpi_lu/pdlu_kernels.c \
  155. mpi_lu/pdlu_implicit.c \
  156. ../../examples/common/blas.c
  157. mpi_lu_plu_outofcore_example_float_LDADD = \
  158. $(STARPU_LIBNUMA_LDFLAGS) \
  159. $(STARPU_BLAS_LDFLAGS) -lm
  160. mpi_lu_plu_outofcore_example_float_SOURCES = \
  161. mpi_lu/plu_outofcore_example_float.c \
  162. mpi_lu/plu_solve_float.c \
  163. mpi_lu/pslu_kernels.c \
  164. mpi_lu/pslu_implicit.c \
  165. ../../examples/common/blas.c
  166. mpi_lu_plu_outofcore_example_double_LDADD = \
  167. $(STARPU_LIBNUMA_LDFLAGS) \
  168. $(STARPU_BLAS_LDFLAGS) -lm
  169. mpi_lu_plu_outofcore_example_double_SOURCES = \
  170. mpi_lu/plu_outofcore_example_double.c \
  171. mpi_lu/plu_solve_double.c \
  172. mpi_lu/pdlu_kernels.c \
  173. mpi_lu/pdlu_implicit.c \
  174. ../../examples/common/blas.c
  175. endif
  176. ########################
  177. # MPI Cholesky example #
  178. ########################
  179. if !STARPU_NO_BLAS_LIB
  180. examplebin_PROGRAMS += \
  181. matrix_decomposition/mpi_cholesky \
  182. matrix_decomposition/mpi_cholesky_distributed
  183. matrix_decomposition_mpi_cholesky_SOURCES = \
  184. matrix_decomposition/mpi_cholesky.c \
  185. matrix_decomposition/mpi_cholesky_models.c \
  186. matrix_decomposition/mpi_cholesky_kernels.c \
  187. matrix_decomposition/mpi_cholesky_codelets.c \
  188. matrix_decomposition/mpi_decomposition_params.c \
  189. matrix_decomposition/mpi_decomposition_matrix.c \
  190. ../../examples/common/blas.c
  191. matrix_decomposition_mpi_cholesky_LDADD = \
  192. $(STARPU_BLAS_LDFLAGS) -lm
  193. matrix_decomposition_mpi_cholesky_distributed_SOURCES = \
  194. matrix_decomposition/mpi_cholesky_distributed.c \
  195. matrix_decomposition/mpi_cholesky_models.c \
  196. matrix_decomposition/mpi_cholesky_kernels.c \
  197. matrix_decomposition/mpi_cholesky_codelets.c \
  198. matrix_decomposition/mpi_decomposition_params.c \
  199. matrix_decomposition/mpi_decomposition_matrix.c \
  200. ../../examples/common/blas.c
  201. matrix_decomposition_mpi_cholesky_distributed_LDADD = \
  202. $(STARPU_BLAS_LDFLAGS) -lm
  203. starpu_mpi_EXAMPLES += \
  204. matrix_decomposition/mpi_cholesky \
  205. matrix_decomposition/mpi_cholesky_distributed
  206. endif
  207. ########################
  208. # MPI Matrix mult example #
  209. ########################
  210. examplebin_PROGRAMS += \
  211. matrix_mult/mm
  212. matrix_mult_mm_SOURCES = \
  213. matrix_mult/mm.c
  214. matrix_mult_mm_LDADD = \
  215. -lm
  216. if !STARPU_SIMGRID
  217. starpu_mpi_EXAMPLES += \
  218. matrix_mult/mm
  219. endif
  220. ##########################################
  221. # Native Fortran MPI Matrix mult example #
  222. ##########################################
  223. if STARPU_HAVE_MPIFORT
  224. if !STARPU_SANITIZE
  225. examplebin_PROGRAMS += \
  226. native_fortran/nf_mm \
  227. native_fortran/nf_mm_task_build \
  228. native_fortran/nf_basic_ring
  229. native_fortran_nf_mm_SOURCES = \
  230. native_fortran/nf_mm_cl.f90 \
  231. native_fortran/fstarpu_mpi_mod.f90 \
  232. native_fortran/fstarpu_mod.f90 \
  233. native_fortran/nf_mm.f90
  234. native_fortran_nf_mm_LDADD = \
  235. -lm
  236. native_fortran_nf_mm_task_build_SOURCES = \
  237. native_fortran/nf_mm_cl.f90 \
  238. native_fortran/fstarpu_mpi_mod.f90 \
  239. native_fortran/fstarpu_mod.f90 \
  240. native_fortran/nf_mm_task_build.f90
  241. native_fortran_nf_mm_task_build_LDADD = \
  242. -lm
  243. native_fortran_nf_basic_ring_SOURCES = \
  244. native_fortran/fstarpu_mpi_mod.f90 \
  245. native_fortran/fstarpu_mod.f90 \
  246. native_fortran/nf_basic_ring.f90
  247. native_fortran_nf_basic_ring_LDADD = \
  248. -lm
  249. if !STARPU_SIMGRID
  250. starpu_mpi_EXAMPLES += \
  251. native_fortran/nf_mm \
  252. native_fortran/nf_mm_task_build \
  253. native_fortran/nf_basic_ring
  254. endif
  255. endif
  256. endif
  257. ###################
  258. # complex example #
  259. ###################
  260. examplebin_PROGRAMS += \
  261. complex/mpi_complex
  262. complex_mpi_complex_SOURCES = \
  263. complex/mpi_complex.c \
  264. ../../examples/interface/complex_interface.c
  265. starpu_mpi_EXAMPLES += \
  266. complex/mpi_complex
  267. #########################
  268. # user_datatype example #
  269. #########################
  270. examplebin_PROGRAMS += \
  271. user_datatype/user_datatype \
  272. user_datatype/user_datatype2
  273. user_datatype_user_datatype_SOURCES = \
  274. user_datatype/user_datatype.c \
  275. user_datatype/my_interface.c
  276. user_datatype_user_datatype2_SOURCES = \
  277. user_datatype/user_datatype2.c \
  278. user_datatype/my_interface.c
  279. if !STARPU_SIMGRID
  280. starpu_mpi_EXAMPLES += \
  281. user_datatype/user_datatype2 \
  282. user_datatype/user_datatype
  283. endif
  284. ###################
  285. # comm example #
  286. ###################
  287. examplebin_PROGRAMS += \
  288. comm/comm \
  289. comm/mix_comm
  290. if !STARPU_SIMGRID
  291. starpu_mpi_EXAMPLES += \
  292. comm/comm \
  293. comm/mix_comm
  294. endif
  295. ##################
  296. # filter example #
  297. ##################
  298. examplebin_PROGRAMS += \
  299. filters/filter
  300. if !STARPU_SIMGRID
  301. starpu_mpi_EXAMPLES += \
  302. filters/filter
  303. endif
  304. # Native Fortran example
  305. # - link over source file to build our own object
  306. native_fortran/fstarpu_mod.f90:
  307. @$(MKDIR_P) $(dir $@)
  308. $(LN_S) $(abs_top_srcdir)/include/$(notdir $@) $@
  309. native_fortran/fstarpu_mpi_mod.f90:
  310. @$(MKDIR_P) $(dir $@)
  311. $(LN_S) $(abs_top_srcdir)/mpi/include/$(notdir $@) $@
  312. if STARPU_HAVE_MPIFORT
  313. if !STARPU_SANITIZE
  314. # - express the creation of .mod along .o
  315. fstarpu_mod.mod: native_fortran/fstarpu_mod.o
  316. fstarpu_mpi_mod.mod: native_fortran/fstarpu_mpi_mod.o
  317. nf_mm_cl.mod: native_fortran/nf_mm_cl.o
  318. # - list explicit dependences to control proper module files dependencies
  319. native_fortran/fstarpu_mpi_mod.o: fstarpu_mod.mod
  320. native_fortran/nf_mm_cl.o: fstarpu_mod.mod
  321. native_fortran/nf_mm.o: nf_mm_cl.mod fstarpu_mpi_mod.mod fstarpu_mod.mod
  322. native_fortran/nf_mm_task_build.o: nf_mm_cl.mod fstarpu_mpi_mod.mod fstarpu_mod.mod
  323. native_fortran/nf_basic_ring.o: fstarpu_mpi_mod.mod fstarpu_mod.mod
  324. endif
  325. endif