Makefile.am 11 KB

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