#![allow(unexpected_cfgs)]
#[cfg(not(any(asan_run, miri)))]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
#[cfg(test)]
mod allocator_link_tests {
unsafe extern "C" {
fn mi_usable_size(ptr: *const std::ffi::c_void) -> usize;
}
#[cfg(not(any(asan_run, miri)))]
#[test]
fn the_shipped_allocator_is_mimalloc() {
let boxed = Box::new([0u8; 32]);
let usable = unsafe { mi_usable_size(boxed.as_ptr() as *const std::ffi::c_void) };
assert!(
usable >= 32,
"global allocator is not mimalloc (usable size {usable})"
);
}
}
pub mod array;
mod columns;
pub mod compression;
pub mod conbin;
pub mod correspondence;
#[cfg(feature = "cuda")]
pub mod cuda_array;
pub mod distrib;
#[cfg(feature = "mpi")]
pub mod distrib_read;
#[cfg(feature = "mpi")]
pub mod distrib_write;
pub mod error;
pub mod extxyz_scan;
mod fast_dec;
pub mod ffi;
pub mod frame_index;
#[cfg(feature = "grammar")]
pub mod grammar;
pub mod helpers;
pub mod hostlabel;
pub mod index_proj;
pub mod iterators;
pub mod parser;
pub mod pdb_scan;
pub mod rcso;
pub mod storage_dtype;
pub mod stream;
pub mod trajectory;
pub mod types;
pub mod units;
pub mod writer;
pub mod convert;
#[cfg(feature = "metatensor")]
pub mod metatensor_export;
pub mod chemfiles_import;
pub mod chemfiles_selection;
#[cfg(feature = "rpc")]
pub mod rpc;
#[cfg(feature = "rpc")]
pub use rpc::read_con_capnp as ReadCon_capnp;
#[cfg(feature = "python")]
pub mod python;
pub const CON_SPEC_VERSION: u32 = 3;
pub const CON_SPEC_MINOR: u32 = 1;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub use correspondence::{
CorrespondenceError, IdentityCheck, atom_id_permutation, check_atom_id_consistency,
minimum_image_delta, minimum_image_displacements, reorder_like,
};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_spec_version_is_current() {
assert_eq!(CON_SPEC_VERSION, 3);
assert_eq!(ffi::RKR_CON_SPEC_VERSION, CON_SPEC_VERSION);
}
#[test]
fn test_version_matches_source() {
let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("VERSION");
let text = std::fs::read_to_string(&path).unwrap();
assert_eq!(text, format!("{VERSION}\n"));
}
}