def test_cudh_small_orthorhombic_triclinic(fixture_small_triclinic): """Test if the triclinic and orthorhombic implementations give the same answer for an orthorhombic box.""" n_atoms, n_bins, coords, box, histo_ref = fixture_small_triclinic box_ort = get_orthorhombic_box() box_tri = get_orthorhombic_triclinic_box() for precision in ['single', 'double']: for check_input in [True, False]: for algo in [1, 2, 3]: histo_ort = cudh.histograms(coords, r_max, n_bins, box=box_ort, force_triclinic=False, precision=precision, check_input=check_input, algorithm=algo) histo_tri = cudh.histograms(coords, r_max, n_bins, box=box_tri, force_triclinic=True, precision=precision, check_input=check_input, algorithm=algo) util.compare(histo_ort, histo_tri)
def test_pydh_large_single(fixture_large): n_atoms, n_bins, coords, histo_ref = fixture_large histo_pydh = pydh.histograms(coords, r_max, n_bins, precision="single", n_threads=1) util.compare(histo_ref, histo_pydh)
def test_n_threads_xlarge_single(fixture_xlarge): n_atoms, n_bins, coords, histo_ref = fixture_xlarge for nt in n_threads: histo_pydh = pydh.histograms(coords, r_max, n_bins, precision="single", n_threads=nt) util.compare(histo_ref, histo_pydh)
def test_pydh_medium_manybins_single(fixture_medium_manybins): n_atoms, n_bins, coords, histo_ref = fixture_medium_manybins for check_input in [True, False]: histo_pydh = pydh.histograms(coords, r_max, n_bins, precision="single", n_threads=1, check_input=check_input) util.compare(histo_ref, histo_pydh)
def test_cudh_xlarge_single(fixture_xlarge): n_atoms, n_bins, coords, histo_ref = fixture_xlarge for gpu_id in range(cudh.get_num_devices()): for algo in [1, 2, 3]: histo_cudh = cudh.histograms(coords, r_max, n_bins, precision="single", gpu_id=gpu_id, algorithm=algo) util.compare(histo_ref, histo_cudh)
def test_n_threads_medium_double(fixture_medium): n_atoms, n_bins, coords, histo_ref = fixture_medium for check_input in [True, False]: for nt in n_threads: histo_pydh = pydh.histograms(coords, r_max, n_bins, precision="double", n_threads=nt, check_input=check_input) util.compare(histo_ref, histo_pydh)
def test_pydh_small_single(fixture_small): """Test if pydh gives the same answer as dist().""" n_atoms, n_bins, coords, histo_ref = fixture_small for check_input in [True, False]: histo_pydh = pydh.histograms(coords, r_max, n_bins, precision="single", n_threads=1, check_input=check_input) util.compare(histo_ref, histo_pydh)
def test_pydh_small_triclinic_single(fixture_small_triclinic): """Test if the triclinic implementation gives the same answer in single precision.""" n_atoms, n_bins, coords, box, histo_ref = fixture_small_triclinic for check_input in [True, False]: histo = pydh.histograms(coords, r_max, n_bins, box=box, precision="single", n_threads=1, check_input=check_input) util.compare(histo_ref, histo)
def test_pydh_small_double_blocked(fixture_small): n_atoms, n_bins, coords, histo_ref = fixture_small for check_input in [True, False]: for nt in n_threads: histo_blocked = pydh.histograms(coords, r_max, n_bins, precision="double", n_threads=nt, blocksize=200, check_input=check_input) util.compare(histo_ref, histo_blocked)
def test_cudh_medium_manybins_single(fixture_medium_manybins): n_atoms, n_bins, coords, histo_ref = fixture_medium_manybins for check_input in [True, False]: for gpu_id in range(cudh.get_num_devices()): for algo in [1, 2, 3]: histo_cudh = cudh.histograms(coords, r_max, n_bins, precision="single", gpu_id=gpu_id, check_input=check_input, algorithm=algo) util.compare(histo_ref, histo_cudh)
def test_cudh_small_triclinic(fixture_small_triclinic): """Check if pydh and cudh give the same answer with triclinic boxes.""" n_atoms, n_bins, coords, box, histo_ref = fixture_small_triclinic for precision in ['single', 'double']: for check_input in [True, False]: for algo in [1, 2, 3]: histo = cudh.histograms(coords, r_max, n_bins, box=box, precision=precision, check_input=check_input, algorithm=algo) util.compare(histo_ref, histo)