attr.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2017 Inria
  4. * Copyright (C) 2017,2018,2019 CNRS
  5. * Copyright (C) 2017,2018 Université de Bordeaux
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. #include <starpu_mpi.h>
  19. #include "helper.h"
  20. #include <inttypes.h>
  21. int main(int argc STARPU_ATTRIBUTE_UNUSED, char *argv[] STARPU_ATTRIBUTE_UNUSED)
  22. {
  23. int flag;
  24. int64_t *value;
  25. int64_t rvalue;
  26. starpu_mpi_comm_get_attr(MPI_COMM_WORLD, 42, NULL, &flag);
  27. STARPU_ASSERT_MSG(flag == 0, "starpu_mpi_comm_get_attr was called with invalid argument\n");
  28. starpu_mpi_comm_get_attr(MPI_COMM_WORLD, STARPU_MPI_TAG_UB, &value, &flag);
  29. STARPU_ASSERT_MSG(flag == 1, "starpu_mpi_comm_get_attr was called with valid argument\n");
  30. rvalue = *value;
  31. FPRINTF(stderr, "Value: %"PRIi64"\n", *value);
  32. FPRINTF(stderr, "Value: %"PRIi64"\n", rvalue);
  33. return 0;
  34. }