eOn client
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
PyGuard.h
Go to the documentation of this file.
1
/*
2
** This file is part of eOn.
3
**
4
** SPDX-License-Identifier: BSD-3-Clause
5
**
6
** Copyright (c) 2010--present, eOn Development Team
7
** All rights reserved.
8
**
9
** Repo:
10
** https://github.com/TheochemUI/eOn
11
*/
12
#pragma once
13
14
#include <pybind11/embed.h>
15
16
namespace
eonc
{
17
18
// Lazy, one-shot Python interpreter init. We intentionally never call
19
// Py_Finalize so that pybind11 py::object members in potentials can release
20
// their refcounts during normal destruction without racing against interpreter
21
// teardown. The OS reclaims everything on process exit.
22
inline
void
ensure_interpreter
() {
23
if
(!Py_IsInitialized()) {
24
pybind11::initialize_interpreter();
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
PyGuard.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf