1#![allow(unexpected_cfgs)]
8#[cfg(not(any(asan_run, miri)))]
9#[global_allocator]
10static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
11
12#[cfg(test)]
13mod allocator_link_tests {
14 unsafe extern "C" {
15 fn mi_usable_size(ptr: *const std::ffi::c_void) -> usize;
16 }
17
18 #[cfg(not(any(asan_run, miri)))]
21 #[test]
22 fn the_shipped_allocator_is_mimalloc() {
23 let boxed = Box::new([0u8; 32]);
24 let usable = unsafe { mi_usable_size(boxed.as_ptr() as *const std::ffi::c_void) };
25 assert!(
26 usable >= 32,
27 "global allocator is not mimalloc (usable size {usable})"
28 );
29 }
30}
31
32pub mod array;
33mod columns;
34pub mod compression;
35pub mod conbin;
36pub mod correspondence;
37#[cfg(feature = "cuda")]
38pub mod cuda_array;
39pub mod distrib;
40#[cfg(feature = "mpi")]
41pub mod distrib_read;
42#[cfg(feature = "mpi")]
43pub mod distrib_write;
44pub mod error;
45pub mod extxyz_scan;
46mod fast_dec;
47pub mod ffi;
48pub mod frame_index;
49#[cfg(feature = "grammar")]
50pub mod grammar;
51pub mod helpers;
52pub mod hostlabel;
53pub mod index_proj;
55pub mod iterators;
56pub mod parser;
57pub mod pdb_scan;
58pub mod rcso;
60pub mod storage_dtype;
61pub mod stream;
62pub mod trajectory;
63pub mod types;
64pub mod units;
65pub mod writer;
66
67pub mod convert;
69
70#[cfg(feature = "metatensor")]
71pub mod metatensor_export;
72
73pub mod chemfiles_import;
75
76pub mod chemfiles_selection;
78
79#[cfg(feature = "rpc")]
80pub mod rpc;
81
82#[cfg(feature = "rpc")]
84pub use rpc::read_con_capnp as ReadCon_capnp;
85
86#[cfg(feature = "python")]
87pub mod python;
88
89pub const CON_SPEC_VERSION: u32 = 3;
102
103pub const CON_SPEC_MINOR: u32 = 1;
108
109pub const VERSION: &str = env!("CARGO_PKG_VERSION");
112
113pub use correspondence::{
114 CorrespondenceError, IdentityCheck, atom_id_permutation, check_atom_id_consistency,
115 minimum_image_delta, minimum_image_displacements, reorder_like,
116};
117
118#[cfg(test)]
119mod tests {
120 use super::*;
121
122 #[test]
123 fn test_spec_version_is_current() {
124 assert_eq!(CON_SPEC_VERSION, 3);
125 assert_eq!(ffi::RKR_CON_SPEC_VERSION, CON_SPEC_VERSION);
126 }
127
128 #[test]
129 fn test_version_matches_source() {
130 let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("VERSION");
131 let text = std::fs::read_to_string(&path).unwrap();
132 assert_eq!(text, format!("{VERSION}\n"));
133 }
134}