message: Batched LOR: use better threading strategy for FillI and FillJAndData (cf.
diff: @@ -171,12 +171,11 @@ int BatchedLORAssembly::FillI(SparseMatrix &A) const
  auto I = A.WriteI();
  MFEM_FORALL(ii, nvdof + 1, I[ii] = 0;);
  - MFEM_FORALL(iel_ho, nel_ho,
  + MFEM_FORALL(i, ndof_per_el*nel_ho,
  {
  - for (int ii_el = 0; ii_el < ndof_per_el; ++ii_el)
  - {
  - // LDOF index of current row
  - const int sii = el_dof_lex(ii_el, iel_ho); // signed
  + const int ii_el = i%ndof_per_el;
  + const int iel_ho = i/ndof_per_el;
  + const int sii = el_dof_lex(ii_el, iel_ho);
  const int ii = (sii >= 0) ? sii : -1 -sii;
  // Get number and list of elements containing this DOF
  int i_elts[Max];
  @@ -189,7 +188,6 @@ int BatchedLORAssembly::FillI(SparseMatrix &A) const
  const int i_E = (si_E >= 0) ? si_E : -1 - si_E;
  i_elts[e_i] = i_E/ndof_per_el;
  }
  -
  for (int j = 0; j < nnz_per_row; ++j)
  {
  int jj_el = map(j, ii_el);
  @@ -202,7 +200,8 @@ int BatchedLORAssembly::FillI(SparseMatrix &A) const
  const int j_ne = j_next_offset - j_offset;
  if (i_ne == 1 || j_ne == 1) // no assembly required
  {
  - AtomicAdd(I[ii], 1);
  + // AtomicAdd(I[ii], 1);
  + I[ii] += 1;
  }
  else // assembly required
  {
  @@ -217,8 +216,8 @@ int BatchedLORAssembly::FillI(SparseMatrix &A) const
  const int min_e = GetMinElt(i_elts, i_ne, j_elts, j_ne);
  if (iel_ho == min_e) // add the nnz only once
  {
  - AtomicAdd(I[ii], 1);
  - }
  + // AtomicAdd(I[ii], 1);
  + I[ii] += 1;
  }
  }
  }
  @@ -284,10 +283,10 @@ void BatchedLORAssembly::FillJAndData(SparseMatrix &A) const
  static constexpr int Max = 16;
  - MFEM_FORALL(iel_ho, nel_ho,
  - {
  - for (int ii_el = 0; ii_el < ndof_per_el; ++ii_el)
  + MFEM_FORALL(i, ndof_per_el*nel_ho,
  {
  + const int ii_el = i%ndof_per_el;
  + const int iel_ho = i/ndof_per_el;
  // LDOF index of current row
  const int sii = el_dof_lex(ii_el, iel_ho); // signed
  const int ii = (sii >= 0) ? sii : -1 - sii;
  @@ -375,7 +374,6 @@ void BatchedLORAssembly::FillJAndData(SparseMatrix &A) const
  }
  }
  }
  - }
  });
  }
  