File: mpi_wide_field_utilities.cc

package info (click to toggle)
purify 5.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 186,836 kB
  • sloc: cpp: 17,731; python: 510; xml: 182; makefile: 7; sh: 6
file content (25 lines) | stat: -rw-r--r-- 837 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "purify/config.h"
#include "catch2/catch_all.hpp"
#include "purify/logging.h"

#include "purify/types.h"

#include "purify/wide_field_utilities.h"

using namespace purify;

TEST_CASE("estimate_sample_density MPI") {
  const t_int imsizex = 1024;
  const t_int imsizey = 1024;
  const t_real cellx = 10;
  const t_real celly = 10;
  const t_real oversample_ratio = 2;
  const t_int M = 6;
  const Vector<t_real> u = Vector<t_real>::Random(M) * 1000;
  const Vector<t_real> v = Vector<t_real>::Random(M) * 1000;
  const sopt::mpi::Communicator comm = sopt::mpi::Communicator::World();
  const Vector<t_complex> weights = widefield::sample_density_weights(
      u, v, cellx, celly, imsizex, imsizey, oversample_ratio, 1, comm);
  REQUIRE(weights.size() == M);
  CHECK(weights.isApprox(Vector<t_complex>::Ones(weights.size())));
}