15out_of_core.doxy 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * This file is part of the StarPU Handbook.
  3. * Copyright (C) 2013 Corentin Salingue
  4. * See the file version.doxy for copying conditions.
  5. */
  6. /*! \page OutOfCore Out Of Core
  7. \section Introduction Introduction
  8. When using StarPU, one may need to store more data than what the main memory
  9. (RAM) can store. This part describes the method to add a new memory node on a
  10. disk and to use it.
  11. \section UseANewDiskMemory Use a new disk memory
  12. To use a disk memory node, you have to register it with this function:
  13. \code{.c}
  14. int new_dd = starpu_disk_register(&starpu_disk_stdio_ops, (void *) "/tmp/", 1024*1024*200);
  15. \endcode
  16. Here, we use the stdio library to realize the read/write operations, i.e.
  17. fread/fwrite. This structure must have a path where to store files, as well as
  18. the maximum size the software can afford storing on the disk.
  19. Don't forget to check if the result is correct!
  20. When the register function is called, StarPU will benchmark the disk. This can
  21. take some time.
  22. <strong>Warning: the size thus has to be at least 1 MB!</strong>
  23. StarPU will automatically try to evict unused data to this new disk. One can
  24. also use the standard StarPU node API, see the \ref API_Standard_Memory_Library
  25. and the \ref API_Data_Interfaces .
  26. The disk is unregistered during the starpu_shutdown().
  27. \section DiskFunctions Disk functions
  28. There are various ways to operate a disk memory node, described by the structure
  29. starpu_disk_ops. For instance, the variable #starpu_disk_stdio_ops
  30. uses fread/fwrite functions.
  31. All structures are in \ref API_Out_Of_Core .
  32. \section ExampleDiskCopy Examples: disk_copy
  33. \snippet disk_copy.c To be included. You should update doxygen if you see this text.
  34. \section ExampleDiskCompute Examples: disk_compute
  35. \snippet disk_compute.c To be included. You should update doxygen if you see this text.
  36. */