src/main.rs

changeset 3
c3a4f4bb87f7
parent 1
a4137aedcb3a
--- a/src/main.rs	Thu Feb 26 09:32:12 2026 -0500
+++ b/src/main.rs	Wed Apr 22 22:32:00 2026 -0500
@@ -1,7 +1,5 @@
-/*!
-TODO: include README here.
-*/
-
+// The main documentation is in README.md
+#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]
 #![feature(maybe_uninit_array_assume_init)]
 #![feature(iterator_try_collect)]
 #![feature(once_cell_try)]
@@ -27,6 +25,7 @@
 use experiments::Experiments;
 use python_access::pymod_pointsource_pde;
 
+/// Helper for construct the list Python modules that we include as strings from `.py` files.
 macro_rules! pymods {
     [$($modname:expr),*] => {&[$(
         (c_str!(concat!("pointsource_pde.", $modname)),
@@ -35,6 +34,7 @@
     )*]};
 }
 
+/// List of Python modules that we include as strings from `.py` files.
 const PY_MODULES: &[(&CStr, &CStr, &CStr)] = pymods![
     "dolfinx_extras",
     "compose",
@@ -47,6 +47,11 @@
 
 /// The entry point for the program.
 pub fn main() -> DynResult<()> {
+    unsafe {
+        // "#(/€"#€/("#€(/ OpenMPI and Fenics junk, don't do your obsolete “single-program multiple-data, with no controller at all” threading.
+        std::env::set_var("OMP_NUM_THREADS", "1");
+    }
+
     // Initialise logging
     colog::init();
 
@@ -74,8 +79,8 @@
 import mpi4py
 
 mpi4py.rc.initialize = False  # do not initialize MPI automatically
-mpi4py.rc.thread_level = "multiple"
-mpi4py.rc.threads = True
+mpi4py.rc.thread_level = "serialized"
+mpi4py.rc.threads = False
 
 from mpi4py import MPI
 

mercurial