Loading...
Searching...
No Matches
ServeRpcServer.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 <cstdint>
15#include <functional>
16#include <memory>
17#include <string>
18#include <vector>
19
20namespace eonc {
21
36using ForceCallback = std::function<void(long nAtoms, const double *positions,
37 const int *atomicNrs, double *forces,
38 double *energy, const double *box)>;
39
50void startRpcServer(ForceCallback callback, const std::string &host,
51 uint16_t port);
52
61void startPooledRpcServer(std::vector<ForceCallback> pool,
62 const std::string &host, uint16_t port);
63
64} // namespace eonc
65
RAII resource manager for the ARTn C library with global synchronization.
std::function< void(long nAtoms, const double *positions, const int *atomicNrs, double *forces, double *energy, const double *box)> ForceCallback
Callback type for potential energy/force evaluation.
void startPooledRpcServer(std::vector< ForceCallback > pool, const std::string &host, uint16_t port)
Start a blocking Cap'n Proto RPC server backed by a pool of force callbacks dispatched round-robin.
void startRpcServer(ForceCallback callback, const std::string &host, uint16_t port)
Start a blocking Cap'n Proto RPC server using a force callback.