PURIFY
Next-generation radio interferometric imaging
Classes | Functions
measurement_operator_mpi.cc File Reference
#include <chrono>
#include <sstream>
#include <benchmark/benchmark.h>
#include "benchmarks/utilities.h"
#include "purify/directories.h"
#include "purify/operators.h"
#include <sopt/imaging_padmm.h>
#include <sopt/mpi/communicator.h>
#include <sopt/mpi/session.h>
#include <sopt/wavelets.h>
+ Include dependency graph for measurement_operator_mpi.cc:

Go to the source code of this file.

Classes

class  DegridOperatorCtorFixturePar
 
class  DegridOperatorFixturePar
 
class  DegridOperatorDirectFixturePar
 
class  DegridOperatorAdjointFixturePar
 
class  DegridOperatorDirectFixtureDistr
 
class  DegridOperatorDirectFixtureMPI
 
class  DegridOperatorAdjointFixtureDistr
 
class  DegridOperatorAdjointFixtureMPI
 

Functions

 BENCHMARK_DEFINE_F (DegridOperatorCtorFixturePar, Distr)(benchmark
 
 BENCHMARK_DEFINE_F (DegridOperatorCtorFixturePar, MPI)(benchmark
 
 BENCHMARK_DEFINE_F (DegridOperatorDirectFixtureDistr, Apply)(benchmark
 
 BENCHMARK_DEFINE_F (DegridOperatorAdjointFixtureDistr, Apply)(benchmark
 
 BENCHMARK_DEFINE_F (DegridOperatorDirectFixtureMPI, Apply)(benchmark
 
 BENCHMARK_DEFINE_F (DegridOperatorAdjointFixtureMPI, Apply)(benchmark
 
 Args ({1024, static_cast< t_int >(1e6), 4}) -> Args({1024, static_cast< t_int >(1e7), 4}) ->UseManualTime() ->MinTime(10.0) ->MinWarmUpTime(5.0) ->Repetitions(3) ->Unit(benchmark::kMillisecond)
 

Function Documentation

◆ Args()

Args ( {1024, static_cast< t_int >(1e6), 4}  ) -> Args({1024, static_cast< t_int >(1e7), 4}) ->UseManualTime() ->MinTime(10.0) ->MinWarmUpTime(5.0) ->Repetitions(3) ->Unit(benchmark::kMillisecond)

◆ BENCHMARK_DEFINE_F() [1/6]

BENCHMARK_DEFINE_F ( DegridOperatorAdjointFixtureDistr  ,
Apply   
)

Definition at line 201 of file measurement_operator_mpi.cc.

201  {
202  // Benchmark the application of the adjoint distributed operator
203  while (state.KeepRunning()) {
204  auto start = std::chrono::high_resolution_clock::now();
205  m_image = m_degridOperator->adjoint() * m_uv_data.vis;
206  auto end = std::chrono::high_resolution_clock::now();
207  state.SetIterationTime(b_utilities::duration(start, end, m_world));
208  }
209 
210  state.SetBytesProcessed(int64_t(state.iterations()) * (state.range(1) + m_imsizey * m_imsizex) *
211  sizeof(t_complex));
212 }
double duration(std::chrono::high_resolution_clock::time_point start, std::chrono::high_resolution_clock::time_point end)
Definition: utilities.cc:26

References b_utilities::duration().

◆ BENCHMARK_DEFINE_F() [2/6]

BENCHMARK_DEFINE_F ( DegridOperatorAdjointFixtureMPI  ,
Apply   
)

Definition at line 227 of file measurement_operator_mpi.cc.

227  {
228  // Benchmark the application of the adjoint distributed MPI operator
229  while (state.KeepRunning()) {
230  auto start = std::chrono::high_resolution_clock::now();
231  m_image = m_degridOperator->adjoint() * m_uv_data.vis;
232  auto end = std::chrono::high_resolution_clock::now();
233  state.SetIterationTime(b_utilities::duration(start, end, m_world));
234  }
235 
236  state.SetBytesProcessed(int64_t(state.iterations()) * (state.range(1) + m_imsizey * m_imsizex) *
237  sizeof(t_complex));
238 }

References b_utilities::duration().

◆ BENCHMARK_DEFINE_F() [3/6]

BENCHMARK_DEFINE_F ( DegridOperatorCtorFixturePar  ,
Distr   
)

Definition at line 48 of file measurement_operator_mpi.cc.

48  {
49  // benchmark the creation of the distributed measurement operator
50  if ((m_counter % 10) == 1) {
51  auto sky_measurements = measurementoperator::init_degrid_operator_2d<Vector<t_complex>>(
52  m_world, m_uv_data, m_imsizey, m_imsizex, m_cellsize, m_cellsize, 2, kernels::kernel::kb,
53  state.range(2), state.range(2), m_w_term);
54  }
55  while (state.KeepRunning()) {
56  auto start = std::chrono::high_resolution_clock::now();
57  auto sky_measurements = measurementoperator::init_degrid_operator_2d<Vector<t_complex>>(
58  m_world, m_uv_data, m_imsizey, m_imsizex, m_cellsize, m_cellsize, 2, kernels::kernel::kb,
59  state.range(2), state.range(2), m_w_term);
60  auto end = std::chrono::high_resolution_clock::now();
61  state.SetIterationTime(b_utilities::duration(start, end, m_world));
62  }
63 
64  state.SetBytesProcessed(int64_t(state.iterations()) * (state.range(1) + m_imsizex * m_imsizey) *
65  sizeof(t_complex));
66 }

References b_utilities::duration(), and purify::kernels::kb.

◆ BENCHMARK_DEFINE_F() [4/6]

BENCHMARK_DEFINE_F ( DegridOperatorCtorFixturePar  ,
MPI   
)

Definition at line 68 of file measurement_operator_mpi.cc.

68  {
69  // benchmark the creation of the distributed MPI measurement operator
70  if ((m_counter % 10) == 1) {
71  auto sky_measurements = measurementoperator::init_degrid_operator_2d_mpi<Vector<t_complex>>(
72  m_world, m_uv_data, m_imsizey, m_imsizex, m_cellsize, m_cellsize, 2, kernels::kernel::kb,
73  state.range(2), state.range(2), m_w_term);
74  }
75  while (state.KeepRunning()) {
76  auto start = std::chrono::high_resolution_clock::now();
77  auto sky_measurements = measurementoperator::init_degrid_operator_2d_mpi<Vector<t_complex>>(
78  m_world, m_uv_data, m_imsizey, m_imsizex, m_cellsize, m_cellsize, 2, kernels::kernel::kb,
79  state.range(2), state.range(2), m_w_term);
80  auto end = std::chrono::high_resolution_clock::now();
81  state.SetIterationTime(b_utilities::duration(start, end, m_world));
82  }
83 
84  state.SetBytesProcessed(int64_t(state.iterations()) * (state.range(1) + m_imsizex * m_imsizey) *
85  sizeof(t_complex));
86 }

References b_utilities::duration(), and purify::kernels::kb.

◆ BENCHMARK_DEFINE_F() [5/6]

BENCHMARK_DEFINE_F ( DegridOperatorDirectFixtureDistr  ,
Apply   
)

Definition at line 188 of file measurement_operator_mpi.cc.

188  {
189  // Benchmark the application of the distributed operator
190  while (state.KeepRunning()) {
191  auto start = std::chrono::high_resolution_clock::now();
192  m_uv_data.vis = (*m_degridOperator) * Image<t_complex>::Map(m_image.data(), m_image.size(), 1);
193  auto end = std::chrono::high_resolution_clock::now();
194  state.SetIterationTime(b_utilities::duration(start, end, m_world));
195  }
196 
197  state.SetBytesProcessed(int64_t(state.iterations()) * (state.range(1) + m_imsizey * m_imsizex) *
198  sizeof(t_complex));
199 }

References b_utilities::duration().

◆ BENCHMARK_DEFINE_F() [6/6]

BENCHMARK_DEFINE_F ( DegridOperatorDirectFixtureMPI  ,
Apply   
)

Definition at line 214 of file measurement_operator_mpi.cc.

214  {
215  // Benchmark the application of the distributed MPI operator
216  while (state.KeepRunning()) {
217  auto start = std::chrono::high_resolution_clock::now();
218  m_uv_data.vis = (*m_degridOperator) * Image<t_complex>::Map(m_image.data(), m_image.size(), 1);
219  auto end = std::chrono::high_resolution_clock::now();
220  state.SetIterationTime(b_utilities::duration(start, end, m_world));
221  }
222 
223  state.SetBytesProcessed(int64_t(state.iterations()) * (state.range(1) + m_imsizey * m_imsizex) *
224  sizeof(t_complex));
225 }

References b_utilities::duration().