18mic_scc_support.doxy 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * This file is part of the StarPU Handbook.
  3. * Copyright (C) 2009--2011 Universit@'e de Bordeaux
  4. * Copyright (C) 2010, 2011, 2012, 2013 CNRS
  5. * Copyright (C) 2011, 2012 INRIA
  6. * See the file version.doxy for copying conditions.
  7. */
  8. /*! \page MICSCCSupport MIC Xeon Phi / SCC Support
  9. \section Compilation Compilation
  10. SCC support just needs the presence of the RCCE library.
  11. MIC Xeon Phi support actually needs two compilations of StarPU, one for the host and one for
  12. the device. The PATH environment variable has to include the path to the
  13. cross-compilation toolchain, for instance <c>/usr/linux-k1om-4.7/bin</c>
  14. The script <c>mic-configure</c> can then be used to achieve the two compilations: it basically
  15. calls <c>configure</c> as appropriate from two new directories: <c>build_mic</c> and
  16. <c>build_host</c>. <c>make</c> and <c>make install</c> can then be used as usual and will
  17. recurse into both directories. If different configuration options are needed
  18. for the host and for the mic, one can use <c>--with-host-param=--with-fxt</c>
  19. for instance to specify the <c>--with-fxt</c> option for the host only, or
  20. <c>--with-mic-param=--with-fxt</c> for the mic only.
  21. One can also run StarPU just natively on the Xeon Phi, i.e. it will only run
  22. directly on the Phi without any exchange with the host CPU. The binaries in
  23. <c>build_mic</c> can be run that way.
  24. In case you have troubles with the coi or scif libraries (the Intel paths are
  25. really not standard, it seems...), you can still make a build in native mode
  26. only, by using <c>mic-configure --enable-native-mic</c>
  27. \section PortingApplicationsToMICSCC Porting Applications To MIC Xeon Phi / SCC
  28. The simplest way to port an application to MIC Xeon Phi or SCC is to set the field
  29. starpu_codelet::cpu_funcs_name, to provide StarPU with the function
  30. name of the CPU implementation. StarPU will thus simply use the
  31. existing CPU implementation (cross-rebuilt in the MIC Xeon Phi case). The
  32. functions have to be globally-visible (i.e. not <c>static</c>) for
  33. StarPU to be able to look them up, and -rdynamic must be passed to gcc (or
  34. -export-dynamic to ld) so that symbols of the main program are visible.
  35. For SCC execution, the function starpu_initialize() also has to be
  36. used instead of starpu_init(), so as to pass <c>argc</c> and
  37. <c>argv</c>.
  38. \section LaunchingPrograms Launching Programs
  39. SCC programs are started through RCCE.
  40. MIC programs are started from the host. StarPU automatically
  41. starts the same program on MIC devices. It however needs to get
  42. the MIC-cross-built binary. It will look for the file given by the
  43. environment variable \ref STARPU_MIC_SINK_PROGRAM_NAME or in the
  44. directory given by the environment variable \ref
  45. STARPU_MIC_SINK_PROGRAM_PATH, or in the field
  46. starpu_conf::mic_sink_program_path. It will also look in the current
  47. directory for the same binary name plus the suffix <c>-mic</c> or
  48. <c>_mic</c>.
  49. The testsuite can be started by simply running <c>make check</c> from the
  50. top directory. It will recurse into both <c>build_host</c> to run tests with only
  51. the host, and into <c>build_mic</c> to run tests with both the host and the MIC
  52. devices. Single tests with the host and the MIC can be run by starting
  53. <c>./loader-cross.sh ./the_test</c> from <c>build_mic/tests</c>.
  54. */