starpu_mpi_ft.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2013-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #ifndef FT_STARPU_STARPU_MPI_FT_H
  17. #define FT_STARPU_STARPU_MPI_FT_H
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. struct _starpu_mpi_checkpoint_template;
  23. typedef struct _starpu_mpi_checkpoint_template* starpu_mpi_checkpoint_template_t;
  24. /**
  25. * Registers a checkpoint template \p cp_template with the given arguments.
  26. * It is then ready to use with ::starpu_mpi_submit_checkpoint_template during the program execution.
  27. * A unique checkpoint id \p cp_id is requested from the user in order to
  28. * match with a corresponding ::starpu_mpi_init_from_checkpoint.
  29. *
  30. * The arguments following the cp_template and the checkpoint_id can be of the following types:
  31. * <ul>
  32. * <li> ::STARPU_R followed by a data handle and the backup rank;
  33. * <li> ::STARPU_DATA_ARRAY followed by an array of data handles,
  34. * its number of elements and a backup rank;
  35. * <li> ::STARPU_VALUE followed by a pointer to the unregistered value,
  36. * its size in bytes, a unique tag (as the ones given for data handle registering)
  37. * and the function giving the back up rank of the rank argument : int(backup_of)(int) .
  38. * <li> The argument list must be ended by the value 0.
  39. * </ul>
  40. */
  41. #ifdef STARPU_USE_MPI_FT
  42. int starpu_mpi_checkpoint_template_register(starpu_mpi_checkpoint_template_t* cp_template, int cp_id, int cp_domain, ...);
  43. int starpu_mpi_checkpoint_template_create(starpu_mpi_checkpoint_template_t* cp_template, int cp_id, int cp_domain);
  44. int starpu_mpi_checkpoint_template_add_entry(starpu_mpi_checkpoint_template_t* cp_template, ...);
  45. int starpu_mpi_checkpoint_template_freeze(starpu_mpi_checkpoint_template_t* cp_template);
  46. int starpu_mpi_submit_checkpoint_template(starpu_mpi_checkpoint_template_t cp_template, int prio);
  47. int starpu_mpi_ft_turn_on(void);
  48. int starpu_mpi_ft_turn_off(void);
  49. int _starpu_mpi_checkpoint_template_print(starpu_mpi_checkpoint_template_t cp_template);
  50. #else //STARPU_USE_MPI_FT
  51. static int starpu_mpi_checkpoint_template_register(starpu_mpi_checkpoint_template_t* cp_template, int cp_id, int cp_domain, ...) {return 0;}
  52. static int starpu_mpi_checkpoint_template_create(starpu_mpi_checkpoint_template_t* cp_template, int cp_id, int cp_domain) {return 0;}
  53. static int starpu_mpi_checkpoint_template_add_entry(starpu_mpi_checkpoint_template_t* cp_template, ...) {return 0;}
  54. static int starpu_mpi_checkpoint_template_freeze(starpu_mpi_checkpoint_template_t* cp_template) {return 0;}
  55. static int starpu_mpi_submit_checkpoint_template(starpu_mpi_checkpoint_template_t cp_template) {return 0;}
  56. static int starpu_mpi_ft_turn_on(void) {return 0;}
  57. static int starpu_mpi_ft_turn_off(void) {return 0;}
  58. static int _starpu_mpi_checkpoint_template_print(starpu_mpi_checkpoint_template_t cp_template) {return 0;}
  59. #endif //STARPU_USE_MPI_FT
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif //FT_STARPU_STARPU_MPI_FT_H