eOn client
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
NbGuard.h
Go to the documentation of this file.
1
/*
2
** Interpreter init without pybind11.
3
**
4
** Polarity:
5
** * Preferred: Python owns the process (eon-server + pyeonclient).
6
*Interpreter
7
** already exists; ensure_interpreter() is a no-op.
8
** * Fallback: standalone eonclient needs a pot that calls into Python (ASE).
9
** Use Py_InitializeEx — do NOT depend on pybind11::embed.
10
**
11
** Object/array marshalling for pots should use nanobind (nb::object,
12
*nb::ndarray)
13
** once the interpreter is up, matching pyeonclient.
14
*/
15
#pragma once
16
17
#include <Python.h>
18
19
namespace
eonc
{
20
21
inline
void
ensure_interpreter
() {
22
if
(!Py_IsInitialized()) {
23
// 0 = skip signal handlers (same idea as pybind11 embed defaults)
24
Py_InitializeEx(0);
25
}
26
}
27
28
}
// namespace eonc
eonc
RAII resource manager for the ARTn C library with global synchronization.
Definition
ARTnSaddleSearch.cpp:19
eonc::ensure_interpreter
void ensure_interpreter()
Definition
NbGuard.h:21
include
eon
NbGuard.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf