kokkos icon indicating copy to clipboard operation
kokkos copied to clipboard

Possible infinite loop with MDRangePolicy when upper bound is smaller than lower bound

Open pkestene opened this issue 2 years ago • 0 comments

Describe the bug

Currently, when using this (e.g. with Kokkos::Serial backend):

    Kokkos::parallel_for(
      "test_mdrange",
      Kokkos::MDRangePolicy<Kokkos::Rank<2>>({ 100, 100 }, { 95, 105 }),
      KOKKOS_LAMBDA(const int i, const int j)
      {
          printf("i,j=%d,%d\n", i, j);
      });

it leads to an infinite loop. Probably that MDRangePolicy::init_helper should do a Kokkos::Abort if there is a rank i such that m_upper[i] < m_lower[i]

Please include the following for a minimal reproducer

  1. Compilers (with versions)
  2. Kokkos release or commit used (i.e., the sha1 number)
  3. Platform, architecture and backend
  4. CMake configure command
  5. Output from CMake configure command
  6. Minimum, complete code needed to reproduce the bug
  7. Command line needed to reproduce the bug
  8. KokkosCore_config.h header file (generated during the build)
  9. Please provide any additional relevant error logs

pkestene avatar Nov 21 '23 21:11 pkestene