mic-scc-support.texi 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. @c -*-texinfo-*-
  2. @c This file is part of the StarPU Handbook.
  3. @c Copyright (C) 2013 Universit@'e de Bordeaux 1
  4. @c See the file starpu.texi for copying conditions.
  5. @section Compilation
  6. SCC support just needs the presence of the RCCE library.
  7. MIC support actually needs two compilations of StarPU, one for the host and one for
  8. the device. The @code{mic-configure} script can be used to achieve this: it basically
  9. calls @code{configure} as appropriate from two new directories: @code{build_mic} and
  10. @code{build_host}. @code{make} and @code{make install} can then be used as usual and will
  11. recurse into both directories.
  12. @c TODO: move to configuration section ?
  13. It can be parameterized with the following environment variables:
  14. @table @asis
  15. @item @code{MIC_HOST}
  16. Defines the value of the @code{--host} parameter passed to @code{configure} for the
  17. cross-compilation. The current default is @code{x86_64-k1om-linux}.
  18. @item @code{MIC_CC_PATH}
  19. Defines the path to the MIC cross-compiler. The current default is @code{/usr/linux-k1om-4.7/bin/}.
  20. @item @code{COI_DIR}
  21. Defines the path to the COI library. The current default is @code{/opt/intel/mic/coi}
  22. @end table
  23. @section Porting applications to MIC/SCC
  24. The simplest way to port an application to MIC/SCC is to add the
  25. @code{cpu_funcs_name} field in the codelet, to provide StarPU with the function
  26. name of the CPU implementation. StarPU will thus simply use the existing CPU
  27. implementation (cross-rebuilt in the MIC case). The functions have to be
  28. globally-visible (i.e. not @code{static}) for StarPU to be able to look them up.
  29. For SCC execution, @code{starpu_initialize} also has to be used instead of @code{starpu_init}, so
  30. as to pass @code{argc} and @code{argv}.
  31. @section Launching programs
  32. SCC programs are started through RCCE
  33. MIC programs are started from the host. StarPU automatically
  34. starts the same program on MIC devices. It however needs to get
  35. the MIC-cross-built binary. It will look for the file given by the
  36. @code{STARPU_MIC_SINK_PROGRAM_NAME} environment variable or in the directory
  37. given by the @code{STARPU_MIC_SINK_PROGRAM_PATH} environment variable, or in
  38. the @code{mic_sink_program_path} field of the @code{starpu_config} structure.
  39. It will also look in the current directory for the same binary name plus a
  40. @code{-mic} or @code{_mic} suffix.