Skip to content

Commit

Permalink
support sigma max
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelyr committed Oct 30, 2023
1 parent 1517d94 commit c54466d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions particle_structs/src/scs/SCS_sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ namespace pumipic {
});

ReverseComparator comp;
lid_t n_sigma = num_elems/sigma;
lid_t sigmaOrMax = std::min(sigma, num_elems);
lid_t n_sigma = num_elems/sigmaOrMax;
Kokkos::parallel_for( PolicyType(n_sigma, 1), KOKKOS_LAMBDA(const TeamMem& t){
lid_t start = t.league_rank() * sigma;
lid_t end = (t.league_rank() == n_sigma-1) ? num_elems : start + sigma;
lid_t start = t.league_rank() * sigmaOrMax;
lid_t end = (t.league_rank() == n_sigma-1) ? num_elems : start + sigmaOrMax;
auto range = Kokkos::make_pair(start, end);
auto ptcl_subview = Kokkos::subview(ptcls, range);
auto index_subview = Kokkos::subview(index, range);
Expand Down
2 changes: 1 addition & 1 deletion particle_structs/test/test_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ PS* buildNextStructure(int num, lid_t num_elems, lid_t num_ptcls, kkLidView ppe,
//Build SCS with C = 32, sigma = ne, V = 1024
error_message = "SCS (C=32, sigma=ne, V=1024)";
lid_t maxC = 32;
lid_t sigma = num_elems;
lid_t sigma = INT_MAX;
lid_t V = 1024;
Kokkos::TeamPolicy<ExeSpace> policy = pumipic::TeamPolicyAuto(4, maxC);
name = "scs_C32_SMAX_V1024";
Expand Down

0 comments on commit c54466d

Please sign in to comment.