Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
squarefk committed Aug 2, 2022
1 parent a53aaea commit 8fdbe16
Showing 1 changed file with 1 addition and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,41 +142,7 @@ void performanceTest( std::ostream& stream, MPI_Comm comm,
positions[p], Kokkos::pair<int, int>( 0, par_num ),
Kokkos::pair<int, int>( 0, 3 ) );

// try for num_run times
for ( int t = 0; t < num_run; ++t )
{
// ensure every optimization process starts from the same status
partitioner.initializePartitionByAverage( comm,
global_num_cell );

// compute local workload
local_workload_timer.start( p );
auto pws =
Cajita::createParticleDynamicPartitionerWorkloadMeasurer<
partitioner.cell_num_per_tile_dim,
partitioner.num_space_dim, Device>(
pos_view, par_num, global_low_corner,
1.0f / num_cells_per_dim[c], comm );
partitioner.setLocalWorkload( &pws );
local_workload_timer.stop( p );

// compute prefix sum matrix
prefix_sum_timer.start( p );
partitioner.computeFullPrefixSum( comm );
prefix_sum_timer.stop( p );

// optimization
bool is_changed = false;
// full timer
total_optimize_timer.start( p );
for ( int i = 0; i < max_optimize_iteration; ++i )
{
partitioner.updatePartition( std::rand() % 3, is_changed );
if ( !is_changed )
break;
}
total_optimize_timer.stop( p );
}

}
// Output results
outputResults( stream, "insert_tile_num", problem_sizes,
Expand Down

0 comments on commit 8fdbe16

Please sign in to comment.