21simgrid.doxy 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * This file is part of the StarPU Handbook.
  3. * Copyright (C) 2009--2011 Universit@'e de Bordeaux 1
  4. * Copyright (C) 2010, 2011, 2012, 2013, 2014 Centre National de la Recherche Scientifique
  5. * Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique
  6. * See the file version.doxy for copying conditions.
  7. */
  8. /*! \page SimGridSupport SimGrid Support
  9. StarPU can use Simgrid in order to simulate execution on an arbitrary
  10. platform.
  11. \section Calibration Calibration
  12. The idea is to first compile StarPU normally, and run the application,
  13. so as to automatically benchmark the bus and the codelets.
  14. \verbatim
  15. $ ./configure && make
  16. $ STARPU_SCHED=dmda ./examples/matvecmult/matvecmult
  17. [starpu][_starpu_load_history_based_model] Warning: model matvecmult
  18. is not calibrated, forcing calibration for this run. Use the
  19. STARPU_CALIBRATE environment variable to control this.
  20. $ ...
  21. $ STARPU_SCHED=dmda ./examples/matvecmult/matvecmult
  22. TEST PASSED
  23. \endverbatim
  24. Note that we force to use the scheduler <c>dmda</c> to generate
  25. performance models for the application. The application may need to be
  26. run several times before the model is calibrated.
  27. \section Simulation Simulation
  28. Then, recompile StarPU, passing \ref enable-simgrid "--enable-simgrid"
  29. to <c>./configure</c>, and re-run the application:
  30. \verbatim
  31. $ ./configure --enable-simgrid && make
  32. $ STARPU_SCHED=dmda ./examples/matvecmult/matvecmult
  33. TEST FAILED !!!
  34. \endverbatim
  35. It is normal that the test fails: since the computation are not actually done
  36. (that is the whole point of simgrid), the result is wrong, of course.
  37. If the performance model is not calibrated enough, the following error
  38. message will be displayed
  39. \verbatim
  40. $ STARPU_SCHED=dmda ./examples/matvecmult/matvecmult
  41. [starpu][_starpu_load_history_based_model] Warning: model matvecmult
  42. is not calibrated, forcing calibration for this run. Use the
  43. STARPU_CALIBRATE environment variable to control this.
  44. [starpu][_starpu_simgrid_execute_job][assert failure] Codelet
  45. matvecmult does not have a perfmodel, or is not calibrated enough
  46. \endverbatim
  47. The number of devices can be chosen as usual with \ref STARPU_NCPU,
  48. \ref STARPU_NCUDA, and \ref STARPU_NOPENCL. For now, only the number of
  49. cpus can be arbitrarily chosen. The number of CUDA and OpenCL devices have to be
  50. lower than the real number on the current machine.
  51. The amount of simulated GPU memory is for now unbound by default, but
  52. it can be chosen by hand through the \ref STARPU_LIMIT_CUDA_MEM,
  53. \ref STARPU_LIMIT_CUDA_devid_MEM, \ref STARPU_LIMIT_OPENCL_MEM, and
  54. \ref STARPU_LIMIT_OPENCL_devid_MEM environment variables.
  55. The Simgrid default stack size is small; to increase it use the
  56. parameter <c>--cfg=contexts/stack_size</c>, for example:
  57. \verbatim
  58. $ ./example --cfg=contexts/stack_size:8192
  59. TEST FAILED !!!
  60. \endverbatim
  61. Note: of course, if the application uses <c>gettimeofday</c> to make its
  62. performance measurements, the real time will be used, which will be bogus. To
  63. get the simulated time, it has to use starpu_timing_now() which returns the
  64. virtual timestamp in ms.
  65. \section SimulationOnAnotherMachine Simulation On Another Machine
  66. The simgrid support even permits to perform simulations on another machine, your
  67. desktop, typically. To achieve this, one still needs to perform the Calibration
  68. step on the actual machine to be simulated, then copy them to your desktop
  69. machine (the <c>$STARPU_HOME/.starpu</c> directory). One can then perform the
  70. Simulation step on the desktop machine, by setting the environment
  71. variable \ref STARPU_HOSTNAME to the name of the actual machine, to
  72. make StarPU use the performance models of the simulated machine even
  73. on the desktop machine.
  74. If the desktop machine does not have CUDA or OpenCL, StarPU is still able to
  75. use simgrid to simulate execution with CUDA/OpenCL devices, but the application
  76. source code will probably disable the CUDA and OpenCL codelets in thatcd sc
  77. case. Since during simgrid execution, the functions of the codelet are actually
  78. not called, one can use dummy functions such as the following to still permit
  79. CUDA or OpenCL execution:
  80. \snippet simgrid.c To be included. You should update doxygen if you see this text.
  81. */