burst.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 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. /*
  17. * This test sends simultaneously many communications, with various configurations.
  18. *
  19. * Global purpose is to run with trace recording, to watch the behaviour of communications.
  20. */
  21. #include <starpu_mpi.h>
  22. #include "helper.h"
  23. #include "burst_helper.h"
  24. void parse_args(int argc, char **argv)
  25. {
  26. int i;
  27. for (i = 1; i < argc; i++)
  28. {
  29. if (strcmp(argv[i], "-nreqs") == 0)
  30. {
  31. burst_nb_requests = atoi(argv[++i]);
  32. }
  33. else if (strcmp(argv[i], "-help") == 0 || strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0)
  34. {
  35. fprintf(stderr,"Usage: %s [-nreqs nreqs]\n", argv[0]);
  36. fprintf(stderr,"Currently selected: %d requests in each burst\n", burst_nb_requests);
  37. exit(EXIT_SUCCESS);
  38. }
  39. else
  40. {
  41. fprintf(stderr,"Unrecognized option %s\n", argv[i]);
  42. exit(EXIT_FAILURE);
  43. }
  44. }
  45. }
  46. int main(int argc, char **argv)
  47. {
  48. int ret, rank, other_rank;
  49. parse_args(argc, argv);
  50. ret = starpu_mpi_init_conf(&argc, &argv, 1, MPI_COMM_WORLD, NULL);
  51. STARPU_CHECK_RETURN_VALUE(ret, "starpu_mpi_init_conf");
  52. starpu_mpi_comm_rank(MPI_COMM_WORLD, &rank);
  53. burst_init_data(rank);
  54. burst_all(rank);
  55. /* Clear up */
  56. burst_free_data(rank);
  57. starpu_mpi_shutdown();
  58. return 0;
  59. }