-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge changes made for Frontier (#934)
Big merge to bring all changes made for Frontier back to the main branch. **WARNING: This merge requires Kokkos 4.0 or later!** - switch to Kokkos 4.0 - bring nxmx_writer to nanoBragg - reduce memory footprint of hopper and stage2 - optimizations for nanoBragg and diffBragg stage 2 **Changes for Kokkos 4.0** - moved mathematical functions (`exp`, `sin`, ...) and `HIPSpace` from `Kokkos::experimental` to `Kokkos` namespace - Kokkos is now build with C++17 standard - Switch from UVM to manual memory management - InitArguments is deprecated, using InitializationSettings now **Changes for nxmx_writer** - Add nxmx_writer capability to nanoBragg - Uses dxtbx's general purpose nxmx_writer - Need to set values for material and thickness for NXmx - Hook up some missing pipes for ImageSetData and FormatBraggInMemory so they can work with imageset.get_spectrum - Add example test to tst_gauss_argchk.py - Work in progress writing simulations to NeXuS **Other Changes** - change `use_cuda` to `use_gpu` - added transfer function for boolean vector to kokkos view - micro optimizations change division to multiplication with reciprocal - collect individual refinement flags into one bit-mask - collect gradients in kokkos_manager struct - port rotated axis for diffuse scattering to diffbragg_kokkos - update unit tests to check that curve fit goes through origin - change panel vectors to use kokkos_vec3 instead of double[3] - in nanoBragg_kokkos, precalculate crystal_orientation in separate function - Fix hopper_utils.py to not keep full background after ROIs are created - Always use timestamps in diffBragg/mpi_logger - adds 3-fold Flatt support to diffBragg - better timers for device code - fixes to command line, notably integrate OOM error - better management of host-dev copies - use stride when spectrum_from_imageset=True --------- Co-authored-by: Felix Wittwer <[email protected]> Co-authored-by: Aaron Brewster <[email protected]> Co-authored-by: Nicholas K Sauter <[email protected]> Co-authored-by: Vidya Ganapati <[email protected]> Co-authored-by: Billy K. Poon <[email protected]> Co-authored-by: Daniel Tchoń <[email protected]> Co-authored-by: Michael Wall <[email protected]> Co-authored-by: dermen <[email protected]>
- Loading branch information
1 parent
432483d
commit 064ef40
Showing
83 changed files
with
5,405 additions
and
2,352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1006,17 +1006,17 @@ class xia2_module(SourceModule): | |
|
||
class kokkos_module(SourceModule): | ||
module = 'kokkos' | ||
anonymous = ['git', '-b 3.7.01', | ||
anonymous = ['git', '-b 4.2.00', | ||
'[email protected]:kokkos/kokkos.git', | ||
'https://github.com/kokkos/kokkos.git', | ||
'https://github.com/kokkos/kokkos/archive/refs/tags/3.7.01.zip'] | ||
'https://github.com/kokkos/kokkos/archive/refs/tags/4.2.00.zip'] | ||
|
||
class kokkos_kernels_module(SourceModule): | ||
module = 'kokkos-kernels' | ||
anonymous = ['git', '-b 3.7.01', | ||
anonymous = ['git', '-b 4.2.00', | ||
'[email protected]:kokkos/kokkos-kernels.git', | ||
'https://github.com/kokkos/kokkos-kernels.git', | ||
'https://github.com/kokkos/kokkos-kernels/archive/refs/tags/3.7.01.zip'] | ||
'https://github.com/kokkos/kokkos-kernels/archive/refs/tags/4.2.00.zip'] | ||
|
||
# Duke repositories | ||
class probe_module(SourceModule): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from __future__ import division, print_function | ||
from argparse import ArgumentParser | ||
parser = ArgumentParser() | ||
parser.add_argument("mtzin", help="input mtz file", type=str) | ||
parser.add_argument("mtzout", help="output mtz file", type=str) | ||
args = parser.parse_args() | ||
|
||
# LIBTBX_SET_DISPATCHER_NAME diffBragg.completeF | ||
|
||
import numpy as np | ||
from iotbx.reflection_file_reader import any_reflection_file | ||
from dials.array_family import flex | ||
from scipy.interpolate import interp1d | ||
from cctbx import miller | ||
|
||
F = any_reflection_file(args.mtzin).as_miller_arrays()[0] | ||
F = F.as_amplitude_array() | ||
if not F.is_xray_amplitude_array(): | ||
F = F.set_observation_type_xray_amplitude() | ||
|
||
print("Bin-ID Res-range Completeness #ASU-indices") | ||
F.show_completeness() | ||
d_max,d_min = F.resolution_range() | ||
print("d_min, d_max (Angstrom): ", d_min, d_max) | ||
mset_full = F.build_miller_set(False, d_min=d_min) | ||
mset_full_d = {h: d for h,d in zip(mset_full.d_spacings().indices(), mset_full.d_spacings().data())} | ||
Fmap = {h:val for h,val in zip(F.indices(), F.data())} | ||
xvals = np.array(F.d_spacings().data()) | ||
yvals = np.array(F.data()) | ||
fill_vals = yvals[np.argmin(xvals)], yvals[np.argmax(xvals)] | ||
I = interp1d(xvals, yvals, fill_value=fill_vals, bounds_error=False) | ||
data = [] | ||
for h in mset_full.indices(): | ||
if h not in Fmap: | ||
d_h = mset_full_d[h] | ||
amp = I(d_h) | ||
else: | ||
amp = Fmap[h] | ||
data.append(amp) | ||
|
||
complete_amps = flex.double(data) | ||
complete_inds = mset_full.indices() | ||
ma = miller.array(mset_full, complete_amps) | ||
if not ma.is_xray_amplitude_array(): | ||
ma = ma.set_observation_type_xray_amplitude() | ||
ma = ma.as_anomalous_array() | ||
assert ma.anomalous_flag() | ||
ma.as_mtz_dataset(column_root_label="F").mtz_object().write(args.mtzout) |
Oops, something went wrong.