Generated Cap’n’Proto Struct Documentation
This section contains the documentation for the Cap’n’Proto generated classes. These classes are automatically generated from the Cap’n’Proto schema definitions and provide type-safe data structures and RPC interfaces.
Note
These are generated Cap’n’Proto struct and interface classes. For notes on how to deal with such classes, please consult the Cap’n’Proto C++ examples or the Cap’n’Proto documentation.
For more information about the Cap’n’Proto schemas used in FusionSC, see the Cap’n’Proto Schema Documentation section.
API Documentation
The generated classes are organized by schema module. Each schema file produces:
Structs: Data structures with typed fields
Interfaces: RPC service definitions with methods and parameters
Clients/Servers: C++ implementations for calling/implementation of services
For the complete list of generated classes, see the Cap’n’Proto documentation index.
-
namespace fsc
The FSC library.
Simple interface module for ZLib
Typedefs
-
template<typename T>
using References = typename internal::References_<T>::Type Use this to figure out what datatype a DataRef points to.
-
using Tensor3Ref = Eigen::TensorMap<Eigen::Tensor<double, 3>>
-
using Tensor2Ref = Eigen::TensorMap<Eigen::Tensor<double, 2>>
-
template<typename T>
using DeviceMappingType = decltype(mapToDevice(std::declval<T>(), std::declval<DeviceBase&>(), true))
-
template<typename T>
using DeviceType = decltype(std::declval<DeviceMappingType<T>>()->get())
-
using LocalVatNetworkBase = capnp::VatNetwork<lvn::VatId, lvn::ProvisionId, lvn::RecipientId, lvn::ThirdPartyCapId, lvn::JoinResult>
-
using Library = Own<const LibraryHandle>
-
using LibraryThread = Own<ThreadContext>
Enums
-
enum class KernelArgType
Specifies copy behavior for arguments around kernel invocation.
Values:
-
enumerator NOCOPY
Don’t copy data between host and device for this invocation.
-
enumerator IN
Only copy data to the device before kernel invocation.
-
enumerator OUT
Copy data to host after kernel invocation.
-
enumerator INOUT
Equivalent to IN and OUT.
-
enumerator ALIAS_IN
-
enumerator ALIAS_OUT
-
enumerator ALIAS_INOUT
-
enumerator NOCOPY
Functions
-
inline Array<const byte> wordsToBytes(Array<const capnp::word> words)
Casts capnp word (8 bytes) array to byte array.
-
inline Array<const capnp::word> bytesToWords(Array<const byte> bytes)
Casts byte array to capnp word (8 bytes) array. Undefined if not aligned.
-
inline ArrayPtr<const capnp::word> bytesToWords(ArrayPtr<const byte> bytes)
Casts byte array to capnp word (8 bytes) array. Undefined if not aligned.
-
template<typename T, typename Cap, typename ...Attachments>
Cap::Client attach(T src, Attachments&&... attachments)
-
template<typename F>
kj::PromiseForResult<F, void> withBackoff(kj::Duration min, kj::Duration max, uint64_t growth, F func)
-
Own<kj::HttpService> createDataViewer(OneOf<DataRef<>::Client, Warehouse::Folder::Client, Warehouse::File<>::Client> root, capnp::SchemaLoader &loader)
Creates an HTTP service that can be used to take a closer look at objects.
-
Promise<bool> isDataRef(capnp::Capability::Client)
Checks if the object in question represents a DataRef object.
-
bool hasMaximumOrdinal(capnp::DynamicStruct::Reader in, unsigned int maxOrdinal)
-
Promise<void> removeDatarefsInStruct(capnp::AnyStruct::Reader in, capnp::AnyStruct::Builder out)
-
Promise<void> removeCapability(capnp::Capability::Client client, capnp::AnyPointer::Builder out)
-
Promise<void> removeDatarefs(capnp::AnyPointer::Reader in, capnp::AnyPointer::Builder out)
-
Promise<void> removeDatarefs(capnp::AnyStruct::Reader in, capnp::AnyStruct::Builder out)
-
size_t linearIndex(const capnp::List<uint64_t>::Reader &shape, const ArrayPtr<size_t> index)
Helper function for calculating linear index based on shape info.
-
DataRef<capnp::AnyPointer>::Client overrideRefs(DataRef<capnp::AnyPointer>::Client, kj::Array<capnp::Capability::Client>)
Provides an overlay over the input data ref that changes the references.
-
template<typename T>
constexpr bool isTemporary()
-
template<typename T, typename Cap = capnp::FromClient<T>, typename ...Attachments>
Cap::Client attachToClient(T src, Attachments&&... attachments)
-
template<typename T, typename = kj::EnableIf<capnp::kind<capnp::FromReader<T>>() == capnp::Kind::STRUCT>>
bool hasMaximumOrdinal(T in, unsigned int maxOrdinal) Struct version checker.
When passing structured data between functions, Cap’n’proto will silently hide all fields which are not understood by the current version of the protocol. Likewise, if new fields are added, methods that do not yet understand them will likely not check for their presence. In many cases, this is useful behavior.
However, for scientific codes, when data are requested, it is extremely important that a given request is understood completely. This method aims to enable protocol evolution with this contraint, by checking whether a function, that can only interpret fields up to the given ordinal number in the given struct, will be able to fully understand the passed data. It does so by not only inspecting the ordinal numbers of set fields, but also by inspecting the wire representation of the struct, to ensure that there are no unknown fields set by a potentially newer version of the protocol.
- Parameters:
in – The data to be checked for consistency.
maxOrdinal – An upper bound on the ordinal number of fields. Any field with an ordinal number exceeding this parameter (or unknown to this client) may only be set to its default value, otherwise this method will return false.
- Returns:
true if the given struct meets the max ordinal requirements, otherwise false.
- TEST_CASE ("parse-geqdsk")
-
void parseGeqdsk(AxisymmetricEquilibrium::Builder out, kj::StringPtr geqdsk)
Reads a geqdsk equilibrium file into an AxisymmetricEquilibrium object.
-
FSC_DECLARE_KERNEL(invertRflmKernel, Tensor3Ref, Tensor3Ref, Tensor3Ref, Tensor3Ref, double, double, double, double)
- inline EIGEN_DEVICE_FUNC void mapInSectionKernel (unsigned int idx, uint64_t section, Tensor2Ref in, cu::RFLMKernelData::Builder out, cu::ReversibleFieldlineMapping::Reader mapping)
- inline EIGEN_DEVICE_FUNC void fromFieldAlignedKernel (unsigned int idx, double phi0, double r0, cu::ReversibleFieldlineMapping::Reader mapping, Tensor2Ref inOut)
- inline EIGEN_DEVICE_FUNC void toFieldAlignedKernel (unsigned int idx, double phi0, double r0, cu::ReversibleFieldlineMapping::Reader mapping, Tensor2Ref inOut)
-
FSC_DECLARE_KERNEL(fltKernel, cu::FLTKernelData::Builder, Eigen::TensorMap<Eigen::Tensor<double, 4>>, cu::FLTKernelRequest::Builder, cu::MergedGeometry::Reader, cu::IndexedGeometry::Reader, cu::IndexedGeometry::IndexData::Reader, cu::ReversibleFieldlineMapping::Reader, cu::GeometryMapping::MappingData::Reader)
-
Own<FLT::Server> newFLT(Own<DeviceBase> device, FLTConfig::Reader config)
-
void importRaw(kj::ArrayPtr<std::array<const double, 3>> vertices, kj::ArrayPtr<kj::Array<const size_t>> faces, MergedGeometry::Builder out)
-
kj::Tuple<kj::Array<std::array<double, 3>>, kj::Array<kj::Array<size_t>>> exportRaw(MergedGeometry::Reader merged, bool triangulate)
-
FSC_DECLARE_KERNEL(rayCastKernel, Eigen::TensorMap<Eigen::Tensor<double, 2>>, Eigen::TensorMap<Eigen::Tensor<double, 2>>, cu::MergedGeometry::Reader, cu::IndexedGeometry::Reader, cu::IndexedGeometry::IndexData::Reader, ArrayPtr<IntersectResult>)
- EIGEN_DEVICE_FUNC void rayCastKernel (unsigned int idx, Eigen::TensorMap< Eigen::Tensor< double, 2 > > pStart, Eigen::TensorMap< Eigen::Tensor< double, 2 > > pEnd, cu::MergedGeometry::Reader geo, cu::IndexedGeometry::Reader index, cu::IndexedGeometry::IndexData::Reader indexData, ArrayPtr< IntersectResult > out)
- TEST_CASE ("intersect")
- TEST_CASE ("transform-cube")
- TEST_CASE ("quad")
- TEST_CASE ("index-cube")
-
double angle(Angle::Reader in)
-
Mat4d rotationAxisAngle(Vec3d center, Vec3d axis, double angle)
Calculates a rotation matrix around an axis and angle
-
void unrollMesh(double phi1, double phi2, Mesh::Reader meshIn, Mesh::Builder meshOut)
-
void triangulateMesh(Mesh::Reader in, Mesh::Builder out, double maxEdgeLength)
- inline EIGEN_DEVICE_FUNC Vec3u locationInGrid (Vec3d point, Vec3d min, Vec3d max, Vec3u size)
-
H5::DataSet createDataSet(H5::H5Location &parent, kj::StringPtr name, const H5::DataType &dType, kj::ArrayPtr<const H5Dim> dimensions)
-
H5::DataSet createDimension(H5::H5Location &parent, kj::StringPtr name, const H5::DataType &dType, const H5Dim &dim, bool hideFromNetcdf)
-
size_t totalSize(const H5::DataSpace &space)
-
template<typename T>
const H5::PredType &h5Type()
-
template<typename T>
H5::DataSet createDataSet(H5::H5Location&, kj::StringPtr, kj::ArrayPtr<const H5Dim> = nullptr)
-
template<typename T>
H5::DataSet createDimension(H5::H5Location&, kj::StringPtr, const H5Dim&, bool hideFromNetcdf = false)
-
template<typename Builder, typename T = capnp::FromBuilder<Builder>>
void readTensor(const H5::DataSet&, Builder)
-
template<typename Reader, typename T = capnp::FromAny<Reader>>
void writeTensor(const H5::DataSet&, Reader)
-
FSC_DECLARE_KERNEL(estimateDensityKernel, unsigned int, cu::KDTree::Reader, Eigen::TensorMap<Eigen::Tensor<double, 1>>, Eigen::TensorMap<Eigen::Tensor<double, 2>>, cu::DensityKernel::Reader, double, uint32_t, double, ArrayPtr<double>)
- EIGEN_DEVICE_FUNC void estimateDensityKernel (unsigned int idx, cu::KDTree::Reader tree, Eigen::TensorMap< Eigen::Tensor< double, 1 > > weights, Eigen::TensorMap< Eigen::Tensor< double, 2 > > evalPoints, cu::DensityKernel::Reader kernel, double kernelDiam, uint32_t kernelDim, double tol, ArrayPtr< double > out)
-
Own<HFCamProvider::Server> newHFCamProvider(Own<DeviceBase> device)
- TEST_CASE ("http")
-
capnp::Capability::Client connectInProcess(const LocalVatHub &hub, uint64_t address)
-
Own<const InProcessServer> newInProcessServer(kj::Function<capnp::Capability::Client()> serviceFactory, Library lib)
- TEST_CASE ("indexBuild")
-
Own<KDTreeService::Server> newKDTreeService()
-
Tensor<double, 2> sample(KDTree::Reader index, double scale)
- TEST_CASE ("c1cubic")
- TEST_CASE ("c1interp")
-
template<typename Strategy, typename Vec, size_t... indices>
std::array<typename Strategy::Coeffs, sizeof...(indices)> calculateCoeffsND(Strategy &strategy, const Vec &lx, std::index_sequence<indices...> indexSequence)
- inline EIGEN_DEVICE_FUNC Vec3u locationInGrid (Vec3d point, const cu::CartesianGrid::Reader &grid)
- inline EIGEN_DEVICE_FUNC double vecdet (const Vec3d v0, const Vec3d v1, const Vec3d v2)
- inline EIGEN_DEVICE_FUNC double intersectBox (const Vec3d &start, const Vec3d &end, const Vec3d &p1, const Vec3d &p2)
- inline EIGEN_DEVICE_FUNC double intersectGridElement (const Vec3d &p1, const Vec3d &p2, const cu::CartesianGrid::Reader grid, size_t iX, size_t iY, size_t iZ)
- inline EIGEN_DEVICE_FUNC double rayCastTriangle (const Vec3d point, const Vec3d direction, const Vec3d triangle[3])
- inline EIGEN_DEVICE_FUNC uint32_t intersectGeometryAllEvents (const Vec3d p1, const Vec3d p2, cu::MergedGeometry::Reader geometry, cu::CartesianGrid::Reader grid, cu::IndexedGeometry::IndexData::Reader indexData, double lMax, cupnp::List< cu::FLTKernelEvent >::Builder eventBuffer, uint32_t eventCount)
- Returns:
The new number of events in the event buffer, or eventBuffer.size() to indicate that we ran out of space.
- inline EIGEN_DEVICE_FUNC IntersectResult intersectGeometryFirstHit (const Vec3d &p1, const Vec3d &p2, cu::MergedGeometry::Reader geometry, cu::IndexedGeometry::Reader index, cu::IndexedGeometry::IndexData::Reader indexData)
-
kj::Own<JobLauncher> newMpiScheduler(Own<JobLauncher> backend)
-
Own<JobLauncher> newSlurmScheduler(Own<JobLauncher> backend)
- TEST_CASE ("slurm-parser")
- TEST_CASE ("job-echo")
- TEST_CASE ("job-failure")
-
Own<JobLauncher> newProcessScheduler(kj::StringPtr jobDir)
-
Job::Client runJob(JobLauncher &sched, kj::StringPtr cmd, kj::ArrayPtr<kj::StringPtr> args, kj::PathPtr wd)
- TEST_CASE ("field-schema")
-
void loadJson(capnp::DynamicStruct::Builder, kj::BufferedInputStream&, const JsonOptions& = JsonOptions())
-
void loadJson(capnp::ListSchema, kj::Function<capnp::DynamicList::Builder(size_t)>, kj::BufferedInputStream&, const JsonOptions& = JsonOptions())
-
capnp::DynamicValue::Reader loadJsonPrimitive(capnp::Type, kj::BufferedInputStream&, const JsonOptions& = JsonOptions())
-
void writeJson(capnp::DynamicValue::Reader, kj::BufferedOutputStream&, const JsonOptions& = JsonOptions())
-
Own<Eigen::GpuDevice> newGpuDevice()
-
void synchronizeGpuDevice(Eigen::GpuDevice &device, const Operation &op)
Schedules a promise to be fulfilled when all previous calls on the GPU device’s command stream are finished.
-
template<typename T>
constexpr bool isTriviallyCopyable()
-
template<typename T>
Own<DeviceMapping<T>> cloneMapping(Own<DeviceMapping<T>> &base)
-
template<typename T>
Own<DeviceMapping<T>> mapToDevice(T t, DeviceBase &device, bool allowAlias)
-
template<typename T>
Own<DeviceMapping<T>> mapToDevice(Own<DeviceMapping<T>> &&mapping, DeviceBase &device, bool allowAlias)
-
template<typename T>
Own<DeviceMapping<T>> mapToDevice(Own<DeviceMapping<T>> &mapping, DeviceBase &device, bool allowAlias)
-
template<typename T>
KernelArg<T> kArg(T in, bool copyToHost, bool copyToDevice, bool allowAlias) Allows to override the copy behavior on a specified argument.
-
template<typename T>
KernelArg<T> kArg(T in, KernelArgType type) Allows to override the copy behavior on a specified argument.
-
template<typename T>
KernelArg<Own<DeviceMapping<T>>> kArg(Own<DeviceMapping<T>> &ref, KernelArgType type) Allows creation of a kernel arg form reference.
-
inline unsigned int numThreads()
-
template<typename HostType, typename CupnpType>
CuTypedMessageBuilder<HostType, CupnpType> cuBuilder(Own<capnp::MessageBuilder> builder)
-
template<typename HostType, typename CupnpType>
CuTypedMessageBuilder<HostType, CupnpType> cuBuilder(Temporary<HostType> &&tmp)
-
template<typename HostType, typename CupnpType>
CuTypedMessageBuilder<HostType, CupnpType> cuBuilder(MapNewMessage)
-
template<typename HostType, typename CupnpType>
CuTypedMessageReader<HostType, CupnpType> cuReader(Own<capnp::MessageReader> reader)
-
template<typename HostType, typename CupnpType>
CuTypedMessageReader<HostType, CupnpType> cuReader(LocalDataRef<HostType> ldr)
-
template<typename HostType, typename CupnpType>
CuTypedMessageReader<HostType, CupnpType> cuReader(std::nullptr_t)
-
template<typename HostType, typename CupnpType, typename T>
CuTypedMessageReader<HostType, CupnpType> cuReader(Maybe<T> maybe)
-
Own<LoadBalancer> newLoadBalancer(NetworkInterface::Client clt, LoadBalancerConfig::Reader config)
-
KJ_DECLARE_NON_POLYMORPHIC(LoadLimiter::Impl)
-
inline Library newLibrary(StartupParameters params = StartupParameters())
-
inline ThreadContext &getActiveThread()
-
inline bool hasActiveThread()
-
Own<FieldCache> lruFieldCache(unsigned int size)
-
FieldResolver::Client newCache(MagneticField::Reader field, ComputedField::Reader computed)
Creates a field resolver that will insert a cache instruction when detecting the passed field
- TEST_CASE ("sphere_field")
- TEST_CASE ("build-field-cancel")
- TEST_CASE ("build-field")
- TEST_CASE ("build-field-interp")
- TEST_CASE ("build-field-gpu")
-
bool isBuiltin(MagneticField::Reader field)
-
bool isBuiltin(Filament::Reader filament)
-
ToroidalGridStruct readGrid(ToroidalGrid::Reader in, unsigned int maxOrdinal)
-
void writeGrid(const ToroidalGridStruct &in, ToroidalGrid::Builder out)
-
Own<FieldCalculator::Server> newFieldCalculator(Own<DeviceBase> dev)
Creates a new field calculator.
-
void simpleTokamak(MagneticField::Builder output, double rMajor, double rMinor, unsigned int nCoils, double Ip)
For testing
- TEST_CASE ("matcher")
-
Own<Matcher::Server> newMatcher()
-
NetworkInterface::OpenPort::Client listenViaHttp(Own<kj::ConnectionReceiver> receiver, NetworkInterface::Listener::Client target, Own<kj::HttpService> fallback)
-
NetworkInterface::OpenPort::Client listenViaHttp(Own<kj::ConnectionReceiver> receiver, capnp::Capability::Client target, Own<kj::HttpService> fallback)
-
Warehouse::Client openWarehouse(db::Connection &conn, bool readOnly, kj::StringPtr tablePrefix)
-
void updateOfflineData(OfflineData::Builder dst, OfflineData::Reader updates)
-
Tensor<uint32_t, 2> triangulate(Tensor<double, 2> vertices)
-
Own<RootService::Server> createRoot(LocalConfig::Reader config)
-
Own<LocalResources::Server> createLocalResources(LocalConfig::Reader config)
-
kj::ArrayPtr<uint64_t> protectedInterfaces()
List of interface IDs that may not be called via network callss.
-
Own<db::Connection> connectSqlite(kj::StringPtr url, bool readOnly)
-
Promise<Own<SSHSession>> createSSHSession(Own<kj::AsyncIoStream> stream)
-
Own<StreamConverter> newStreamConverter()
-
Own<kj::AsyncInputStream> buffer(Own<kj::AsyncInputStream> &&is, uint64_t limit)
Buffers the input stream
Creates an eagerly consuming buffer (based on linked list of blocks) that consumes data from the given input stream. The internal buffer blocks are released once the data is no longer required. The input stream features an optimized tee implementation that shared the buffer and only forks the buffer’s cursor position.
-
Own<MultiplexedOutputStream> multiplex(Own<kj::AsyncOutputStream> &&os)
Multiplexes the output stream
This returns an object that can safely allow multiple simultaneous writes to the given output stream by multiplexing write calls in turn with a FIFO.
-
Own<std::istream> asStdStream(kj::BufferedInputStream &is)
Wraps a buffered input stream into an std::istream
-
Own<std::ostream> asStdStream(kj::BufferedOutputStream &is)
Wraps a buffered output stream into an std::ostream.
-
template<typename T, int rank, int options, typename Index, typename T2>
void readTensor(T2 reader, Tensor<T, rank, options, Index> &out)
-
template<typename T, int rank, int options, typename Index, typename T2>
kj::Array<size_t> readVardimTensor(T2 reader, size_t variableDim, Tensor<T, rank, options, Index> &out)
-
template<typename TensorType, typename T2>
void writeTensor(const TensorType &in, T2 builder)
-
template<typename TensorType, typename T2>
void writeVardimTensor(const TensorType &in, size_t variableDim, kj::ArrayPtr<size_t> vardimShape, T2 builder)
-
template<typename T>
void validateTensor(T t, kj::ArrayPtr<const Maybe<uint64_t>> shapeConstraints = nullptr)
-
void extractBrand(capnp::Schema in, capnp::schema::Brand::Builder out)
-
void extractType(capnp::Type in, capnp::schema::Type::Builder out)
- template<typename T> Vec3< T > EIGEN_DEVICE_FUNC cross (const Vec3< T > &t1, const Vec3< T > &t2)
-
FSC_DECLARE_KERNEL(computeSurfaceKernel, cu::VmecKernelComm::Builder)
-
FSC_DECLARE_KERNEL(invertSurfaceKernel, cu::VmecKernelComm::Builder)
- inline EIGEN_DEVICE_FUNC void computeSurfaceKernel (unsigned int idx, cu::VmecKernelComm::Builder comm)
- inline EIGEN_DEVICE_FUNC void invertSurfaceKernel (unsigned int idx, cu::VmecKernelComm::Builder comm)
-
kj::String generateVmecInput(VmecRequest::Reader request, kj::PathPtr mgridFile)
Generates the input file for a VMEC request.
VMEC input file generator.
Generates the Fortran NAMELIST to be passed into VMEC.
- Parameters:
request – The VMEC run request.
mgridPath – Path to the MGRID file required for free boundary runs.
-
void interpretOutputFile(kj::PathPtr path, VmecResult::Builder out)
VMEC result reader
Reads a wout.nc from VMEC and converts the contents into a response.
Warning
This function can only read NetCDF4/HDF5 files. VMEC writes NetCDF-classic format. Pre-process the output file with nccopy to convert it into NetCDF4.
-
Promise<void> writeMGridFile(kj::PathPtr path, ComputedField::Reader cField)
MGRID file generator
Writes a simple MGRID file from the computed field to the given destination path.
-
Own<VmecDriver::Server> createVmecDriver(Own<DeviceBase> &&dev, Own<JobLauncher> &&scheduler, VmecConfig::Reader config)
Create a VMEC service driver.
- Parameters:
dev – Compute device for the surface inversion calculations.
launcher – Job launcher to use for the VMEC code (post-processing is done using the system launcher).
config – Configuration for the VMEC driver.
Variables
-
kj::StringPtr commitHash
Git commit hash extracted by the build system. May include a trailing “+” if modified.
-
constexpr double pi = 3.14159265358979323846
-
constexpr capnp::ReaderOptions READ_UNLIMITED = {std::numeric_limits<uint64_t>::max(), std::numeric_limits<int>::max()}
-
template<typename T>
struct _IsTemporary Public Static Attributes
-
static constexpr bool val = false
-
static constexpr bool val = false
-
template<typename T>
struct _IsTemporary<fsc::Temporary<T>> Public Static Attributes
-
static constexpr bool val = true
-
static constexpr bool val = true
-
struct ArchiveWriter
Public Functions
-
inline ~ArchiveWriter()
-
inline void write(capnp::word *dst, uint64_t value)
-
inline void writePrefix()
-
inline DataRecord &allocData(uint64_t nBytes)
Allocates data from the data section and creats a data record.
-
inline InfoRecord &allocInfo()
Allocates a new info record.
-
inline void writeInfo(Temporary<ArchiveInfo> infoSection)
Serializes the info section and finalizes the header.
-
inline void finalize(uint64_t rootObject)
Finalizes the file by writing root object and storing the file.
Public Members
-
capnp::WordCount dataSize = 0 * WORDS
Current size of data section.
-
kj::TreeMap<ID, Promise<void>> downloadQueue
Promise that resolves when all DataRefs known to advertise (don’t trust this) a given hash have finished or failed downloading.
-
kj::List<DataRecord, &DataRecord::link> dataRecords
List of all data records.
-
kj::List<InfoRecord, &InfoRecord::link> infoRecords
List of all object info records.
-
internal::DownloadTask<uint64_t>::Context downloadContext
Download context to use for de-duplication.
Public Static Attributes
-
static kj::StringPtr DESCRIPTION = "This is an FSC / fusionsc archive file. To read it, please use the fusionsc toolkit to inspect its contents or refer it for details on the format"_kj
-
static capnp::WordCount MAGIC_TAG_SIZE = 1 * WORDS
-
static capnp::WordCount HEADER_SIZE_SIZE = 1 * WORDS
-
static capnp::WordCount HEADER_SIZE = 3 * WORDS
-
static capnp::WordCount DESCRIPTION_SIZE = (DESCRIPTION.size() + 7) / 8 * WORDS
-
static capnp::WordCount TOTAL_PREFIX_SIZE = MAGIC_TAG_SIZE + HEADER_SIZE_SIZE + HEADER_SIZE + DESCRIPTION_SIZE
-
struct DataRecord
-
struct InfoRecord
-
struct TransmissionProcess : public fsc::internal::DownloadTask<uint64_t>
Public Functions
-
inline TransmissionProcess(ArchiveWriter &parent, DataRef<capnp::AnyPointer>::Client src)
-
inline Promise<Maybe<uint64_t>> useCached() override
-
inline Promise<void> beginDownload() override
-
inline Promise<void> finishDownload() override
-
inline Promise<uint64_t> buildResult() override
-
inline Promise<uint64_t> finalize(uint64_t blockID)
-
inline TransmissionProcess(ArchiveWriter &parent, DataRef<capnp::AnyPointer>::Client src)
-
inline ~ArchiveWriter()
Public Types
Public Functions
-
struct BalancedIntervalSplit
-
struct BaseDirProvider : public fsc::JobDirProvider
-
struct Blob
Blob object.
Public Functions
-
virtual Own<Blob> addRef() = 0
-
virtual void incRef() = 0
Increases the in-database refcount.
-
virtual void decRef() = 0
Decreases the in-database refcount and deletes the blob if it hits 0.
-
virtual int64_t getRefcount() = 0
Reads the current in-database refcount.
-
virtual kj::Array<const byte> getHash() = 0
Reads the hash of the blob (or nullptr if the blob is under construction or deleted)
-
virtual int64_t getId() = 0
Returns the ID of the blob.
-
inline bool isFinished()
Checks whether incRef may be called on this blob.
-
virtual Own<BlobReader> open() = 0
Opens the blob for reading.
-
virtual Own<Blob> addRef() = 0
-
struct BlobBuilder : public kj::OutputStream
Construction helper for new Blobs. Inherits from kj::OutputStream.
This interface is responsible for managing the construction of a new Blob for the store. It can only be obtained through BlobStore::create(). Upon creation, a blob under construction is created with an implicit reference count of 1. The reference count may not be increased until the blob’s construction is finished.
The blob may be filled with data through the OutputStream interface. Once all data have been transferred, call the finish() method.
finish() will check for hash duplication.If the new blob’s hash is unique, that blob will be returned (and from now on its refcount can be increased). In case of a hash conflict, the new Blob will be deleted, the originally present blob with same hash will have its refcount increased by 1, and that blob will be returned.
This allows for interactions where the lifetime of the under-construction blob is attached to an external object during the construction phase, and the Blob can be deleted implicitly if that object gets deleted.
Public Functions
-
virtual bool tryConsume(kj::ArrayPtr<const byte> input) = 0
Alternative write API. This does not call the underlying database and only manipulates the compressor and the buffer. It can be called from other thread as long as no simul taneous other calls to the blob builder are made.
Returns true if the buffer was completely consumed. If it returns false, flush() must be called before calling tryConsume again. In this case, the next call to tryConsume MUST hold the same data as the previous call.
-
virtual void flush() = 0
Flushes buffer to database. UNLIKE tryConsume CAN NOT BE USED CROSS-THREAD.
-
virtual Own<Blob> finish() = 0
After write completion and hash key assignment, returns the finished blob (not neccessarily the same as the blob returned by getBlobUnderConstruction()
-
virtual Own<Blob> getBlobUnderConstruction() = 0
-
virtual bool tryConsume(kj::ArrayPtr<const byte> input) = 0
-
struct BlobReader : public kj::InputStream
Extended input stream interface that can outsource the compression to an external thread. Inherits from kj::InputStream.
Public Functions
-
virtual Promise<size_t> tryReadAsync(void *buf, size_t min, size_t max, const kj::Executor &decompressionThread) = 0
-
virtual Promise<size_t> tryReadAsync(void *buf, size_t min, size_t max, const kj::Executor &decompressionThread) = 0
-
struct BlobStore
Blob storage interface.
Public Functions
-
virtual Own<BlobStore> addRef() = 0
-
virtual Maybe<Own<Blob>> find(kj::ArrayPtr<const byte> hash) = 0
Looks for a blob object in the database based on the given has key.
-
virtual Own<BlobBuilder> create(size_t chunkSize) = 0
Allocates a new blob without hash key in the database to be written to.
-
virtual Own<BlobStore> addRef() = 0
-
struct BreakHandler
Helper to abort computations with CTRL + C.
Usage of this is slightly complicated. A single BreakHandler object should be created on stack before the FusionSC library itself is used (implementation constraint). However, its methods may only be used after library startup.
-
template<typename Scalar>
struct C1CubicDeriv Public Functions
-
template<typename Num>
struct C1CubicInterpolation Continuously differentiable interpolation based on 3rd order Hermite splines. Interpolates exact up to 2nd order. Values on interval endpoints are exact. Derivatives equal their central finite difference.
Public Functions
- inline constexpr EIGEN_DEVICE_FUNC size_t nPoints ()
- inline constexpr EIGEN_DEVICE_FUNC std::array< Scalar, 4 > coefficients (Num x)
- inline constexpr EIGEN_DEVICE_FUNC std::array< int, 4 > offsets ()
-
template<typename TensorType>
struct ConstTensorMapping : public fsc::DeviceMapping<kj::Array<const TensorType::Scalar>> Subclassed by fsc::DeviceMapping< Own< TensorMap< const T > > >, fsc::DeviceMapping< Own< TensorMap< const TensorFixedSize< TVal, Dims, options, Index > > > >
Public Types
-
using Scalar = typename TensorType::Scalar
-
using Scalar = typename TensorType::Scalar
-
struct CPUDevice : public fsc::CPUDeviceBase, public kj::Refcounted
Public Functions
-
~CPUDevice()
-
Own<DeviceBase> addRef() override
-
Eigen::ThreadPoolDevice &eigenDevice()
Public Static Functions
-
static unsigned int estimateNumThreads()
Public Static Attributes
-
static int BRAND = 0
-
~CPUDevice()
-
struct CPUDeviceBase : public fsc::DeviceBase
Subclassed by fsc::CPUDevice, fsc::LoopDevice
-
class CSPRNG
A cryptographically secure (pseudo-)random number generator. Currently implemented as a Botan-provided auto-seeding RNG, but might change without notice.
-
template<typename HostType, typename CupnpType>
struct CuTypedMessageBuilder Public Members
-
Own<capnp::MessageBuilder> builder
-
Own<capnp::MessageBuilder> builder
-
template<typename HostType, typename CupnpType>
struct CuTypedMessageReader Public Members
-
Own<capnp::MessageReader> reader
-
Own<capnp::MessageReader> reader
-
template<typename T = ::capnp::AnyPointer>
struct DataRef Cap’n’proto interface for data objects.
The DataRef template is a special capability recognized all throughout the FSC library. It represents a link to a data storage location (local or remote), associated with a unique ID, which can be downloaded to local storage and accessed there. Locally downloaded data are represented by the LocalDataRef class, which subclasses DataRef::Client.
The stored data is expected to be in one of the two following formats:
If T is any type except capnp::Data, it must correspond to a Cap’n’proto struct type. In this case, the DataRef holds a message with the corresponding root type, and a capability table that tracks any remote objects in use by this message (including other DataRef instances).
If T is DataRef::Data, then the corresponding message can either be a raw binary or a Cap’n’proto message with a capnp::Data object as its root (note that the library will default to raw storage because of the laxer size constraints)
Once obtained, DataRefs can be freely passed around as part of RPC calls or data published in other DataRef::Client instances. The fsc runtime will do all it possibly can to protect the integrity of a DataRef. In the absence of hardware failure, data referenced via DataRef objects can only go out of use once all referencing DataRef objects do so as well.
DataRefs only represent a link to locally or remotely stored data. To access the underlying data, they must be converted into LocalDataRef instances using LocalDataService::download() methods.
Note
This is a generated Capnproto interface class. For notes on how to deal with such a class, please consult the Capnproto C++ examples (https://capnproto.org) or the generated API documentation
interface DataRef (T) { interface Receiver { begin @0 (numBytes : UInt64) -> (); receive @1 (data : Data) -> stream; done @2 () -> (); } metaAndCapTable @0 () -> (metadata : DataRefMetadata, table : List(Capability)); rawBytes @1 (start : UInt64, end : UInt64) -> (data : Data); transmit @2 (start : UInt64, end : UInt64, receiver : Receiver); }
- Template Parameters:
T – Type of the root message stored in the data ref.
-
struct Client : public virtual capnp::Capability::Client
Actual interface object class.
Subclassed by fsc::LocalDataRef< T >
-
struct DataService
Remote interface to data service.
This interface serves as an access point to remotely download
Note
This is a generated Capnproto interface class. For notes on how to deal with such a class, please consult the Capnproto C++ examples (https://capnproto.org) or the generated API documentation
interface DataService @0xc6d48902ddb7e122 { store @0 [T] (id : Data, data : T, schema : AnyPointer) -> (ref : DataRef(T)); # Upload a message to the remote data service and have it publish it clone @1 [T] (source : DataRef(T)) -> (ref : DataRef(T)); # Have the remote data service download a DataRef and re-publish it hash @2 [T] (source : DataRef(T)) -> (hash : Data); # Have the remote service inspect the linked tree of refs and their content tables and # compute a hash based on the received information. cloneAllIntoMemory @3 [T] (source : DataRef(T)) -> (ref : DataRef(T)); # Have the remote data service download a complete copy }
-
struct DataStore
Public Functions
-
DataStore(fusionsc_DataStore *store)
-
~DataStore()
-
DataStore() = delete
-
DataStore(const DataStore&)
-
DataStore(DataStore&&)
-
fusionsc_DataStore *incRef()
-
fusionsc_DataStore *release()
-
StoreEntry publish(ArrayPtr<const byte> key, Array<const byte> data)
-
Maybe<StoreEntry> query(ArrayPtr<const byte> key)
-
void gc()
-
DataStore(fusionsc_DataStore *store)
-
struct DBCache
Database cache object.
-
struct DeviceBase
Compute device that can execute C++ kernels Manages a compute device (either a thread-pool or a GPU compute stream) with its own memory space.
Subclassed by fsc::CPUDeviceBase
Public Functions
-
DeviceBase(void *brand)
-
virtual ~DeviceBase()
-
template<typename ...T>
inline void addToBarrier(T&&... args) Accepts arguments to be attached to the next barrier() promise.
-
Promise<void> barrier()
Returns a promise that resolves when all actions submitted to the device queue have finished.
-
virtual void updateDevice(kj::byte *devicePtr, const kj::byte *hostPtr, size_t size) = 0
Enqueues a host -> device copy operation.
Warning
Callers should ensure that hostPtr and devicePtr are valid until the next barrier promise is resolved, e.g. by passing appropriate keepalive objects via addToBarrier.
-
virtual void updateHost(kj::byte *hostPtr, const kj::byte *devicePtr, size_t size) = 0
Enqueues a device -> host copy operation.
Warning
Callers should ensure that hostPtr and devicePtr are valid until the next barrier promise is resolved, e.g. by passing appropriate keepalive objects via addToBarrier.
-
virtual kj::byte *map(const kj::byte *hostPtr, size_t size, bool allowAlias) = 0
Map a view of the obtained buffer to the device. Creates a view of the specified buffer in device memory space.
Note
It is rarely neccessary to call this method directly, instead an Own<DeviceMapping<kj::ArrayPtr>> can be obtained by calling mapToDevice(ArrayPtr).
- Parameters:
allowAlias – Whether modifications in device memory are allowed to begin directly visible in host memory space (or other mappings). Note that this doesn’t force alias semantics, updateHost() must still be called to ensure the host data is correct, but it might become a noop.
- Returns:
A pointer to the device buffer or nullptr, in which case the device buffer should be obtained via translateToDevice(hostPtr) (but the nullptr should still be passed to unmap).
-
virtual void unmap(const kj::byte *hostPtr, kj::byte *devicePtr) = 0
Unmap a host/device buffer pair.
-
virtual kj::byte *translateToDevice(kj::byte *hostPtr) = 0
If map() returned nullptr, call this method to obtain the device buffer pointer.
-
virtual Own<DeviceBase> addRef() = 0
Public Members
-
const void *brand
-
DeviceBase(void *brand)
-
template<typename T>
struct DeviceMapping : public fsc::DeviceMappingBase Subclassed by fsc::ConstTensorMapping< T >, fsc::ConstTensorMapping< TensorFixedSize< TVal, Dims, options, Index > >, fsc::TensorMapping< T >, fsc::TensorMapping< Tensor< TVal, tRank, tOpts, Index > >, fsc::TensorMapping< TensorFixedSize< TVal, Dims, options, Index > >, fsc::ConstTensorMapping< TensorType >, fsc::DeviceMapping< CuTypedMessageBuilder< HostType, CupnpType > >, fsc::DeviceMapping< CuTypedMessageReader< HostType, CupnpType > >, fsc::TensorMapping< TensorType >
Public Functions
-
inline DeviceMapping(T newTarget, DeviceBase &device, bool allowAlias)
-
inline void doUpdateDevice() override
-
inline void doUpdateHost() override
-
inline DeviceMapping(T newTarget, DeviceBase &device, bool allowAlias)
-
template<typename HostType, typename CupnpType>
struct DeviceMapping<CuTypedMessageBuilder<HostType, CupnpType>> : public fsc::DeviceMapping<Own<capnp::MessageBuilder>> Public Types
-
using Parent = DeviceMapping<Own<capnp::MessageBuilder>>
Public Functions
-
inline DeviceMapping(CuTypedMessageBuilder<HostType, CupnpType> &&typedBuilder, DeviceBase &device, bool allowAlias)
-
inline cupnp::Location getUntyped()
-
inline capnp::MessageBuilder &getHostUntyped()
-
inline Own<DeviceMapping<CuTypedMessageBuilder<HostType, CupnpType>>> addRef()
-
using Parent = DeviceMapping<Own<capnp::MessageBuilder>>
-
template<typename HostType, typename CupnpType>
struct DeviceMapping<CuTypedMessageReader<HostType, CupnpType>> : public fsc::DeviceMapping<Own<capnp::MessageReader>> Public Types
-
using Parent = DeviceMapping<Own<capnp::MessageReader>>
Public Functions
-
inline DeviceMapping(CuTypedMessageReader<HostType, CupnpType> &&typedReader, DeviceBase &device, bool allowAlias)
-
inline cupnp::Location getUntyped()
-
inline capnp::MessageReader &getHostUntyped()
-
inline Own<DeviceMapping<CuTypedMessageReader<HostType, CupnpType>>> addRef()
-
using Parent = DeviceMapping<Own<capnp::MessageReader>>
-
template<typename T>
struct DeviceMapping<KernelArg<T>> : public fsc::DeviceMappingBase
-
template<typename T>
struct DeviceMapping<kj::Array<const T>> : public fsc::DeviceMappingBase
-
template<typename T>
struct DeviceMapping<kj::Array<T>> : public fsc::DeviceMappingBase
-
template<>
struct DeviceMapping<Own<capnp::MessageBuilder>> : public fsc::MessageMappingBase Public Functions
-
DeviceMapping(Own<capnp::MessageBuilder> builder, DeviceBase &device, bool allowAlias)
-
~DeviceMapping()
-
void doUpdateHost() override
-
void doUpdateDevice() override
-
cupnp::Location get()
-
capnp::MessageBuilder &getHost()
-
inline Own<DeviceMapping<Own<capnp::MessageBuilder>>> addRef()
-
DeviceMapping(Own<capnp::MessageBuilder> builder, DeviceBase &device, bool allowAlias)
-
template<>
struct DeviceMapping<Own<capnp::MessageReader>> : public fsc::MessageMappingBase Public Functions
-
DeviceMapping(Own<capnp::MessageReader> reader, DeviceBase &device, bool allowAlias)
-
~DeviceMapping()
-
void doUpdateHost() override
-
void doUpdateDevice() override
-
cupnp::Location get()
-
capnp::MessageReader &getHost()
-
inline Own<DeviceMapping<Own<capnp::MessageReader>>> addRef()
-
DeviceMapping(Own<capnp::MessageReader> reader, DeviceBase &device, bool allowAlias)
-
template<>
struct DeviceMapping<Own<kernels::MagKernelContext>> : public fsc::DeviceMappingBase Public Functions
-
inline DeviceMapping(Own<kernels::MagKernelContext> &&p, DeviceBase &device, bool allowAlias)
-
inline void doUpdateDevice() override
-
inline void doUpdateHost() override
-
inline kernels::MagKernelContext get()
Public Members
-
Own<kernels::MagKernelContext> pCtx
-
inline DeviceMapping(Own<kernels::MagKernelContext> &&p, DeviceBase &device, bool allowAlias)
-
template<typename T>
struct DeviceMapping<Own<TensorMap<const T>>> : public fsc::ConstTensorMapping<T> Public Functions
-
inline DeviceMapping(Own<TensorMap<const T>> t, DeviceBase &device, bool allowAlias)
-
inline DeviceMapping(Own<TensorMap<const T>> t, DeviceBase &device, bool allowAlias)
-
template<typename TVal, typename Dims, int options, typename Index>
struct DeviceMapping<Own<TensorMap<const TensorFixedSize<TVal, Dims, options, Index>>>> : public fsc::ConstTensorMapping<TensorFixedSize<TVal, Dims, options, Index>>
-
template<typename T>
struct DeviceMapping<Own<TensorMap<T>>> : public fsc::TensorMapping<T> Public Functions
-
inline DeviceMapping(Own<TensorMap<T>> t, DeviceBase &device, bool allowAlias)
-
inline DeviceMapping(Own<TensorMap<T>> t, DeviceBase &device, bool allowAlias)
-
template<typename TVal, int tRank, int tOpts, typename Index>
struct DeviceMapping<Tensor<TVal, tRank, tOpts, Index>> : public fsc::TensorMapping<Tensor<TVal, tRank, tOpts, Index>>
-
template<typename TVal, typename Dims, int options, typename Index>
struct DeviceMapping<TensorFixedSize<TVal, Dims, options, Index>> : public fsc::TensorMapping<TensorFixedSize<TVal, Dims, options, Index>>
-
struct DeviceMappingBase : public kj::Refcounted
Base class for DeviceMapping implementations that handles barriers.
Subclassed by fsc::DeviceMapping< kj::Array< const TensorType::Scalar > >, fsc::DeviceMapping< Own< capnp::MessageBuilder > >, fsc::DeviceMapping< Own< capnp::MessageReader > >, fsc::DeviceMapping< kj::Array< TensorType::Scalar > >, fsc::DeviceMapping< T >, fsc::DeviceMapping< KernelArg< T > >, fsc::DeviceMapping< Own< kernels::MagKernelContext > >, fsc::DeviceMapping< kj::Array< T > >, fsc::DeviceMapping< kj::Array< const T > >, fsc::MessageMappingBase
Public Functions
-
DeviceMappingBase(DeviceBase &device)
-
virtual ~DeviceMappingBase()
-
void updateHost()
-
void updateDevice()
-
Own<DeviceMappingBase> addRef()
-
DeviceMappingBase(DeviceBase &device)
-
struct FieldCache
Public Functions
-
virtual Maybe<Promise<LocalDataRef<Float64Tensor>>> check(kj::ArrayPtr<const byte> pointsHash, kj::ArrayPtr<const byte> fieldKey) = 0
-
virtual void put(kj::ArrayPtr<const byte> pointsHash, kj::ArrayPtr<const byte> fieldKey, Promise<LocalDataRef<Float64Tensor>>) = 0
-
virtual Maybe<Promise<LocalDataRef<Float64Tensor>>> check(kj::ArrayPtr<const byte> pointsHash, kj::ArrayPtr<const byte> fieldKey) = 0
-
class FieldResolverBase : public FieldResolver::Server
Public Functions
-
Promise<void> resolveField(ResolveFieldContext context) override
-
Promise<void> resolveFilament(ResolveFilamentContext context) override
-
virtual Promise<void> processField(MagneticField::Reader input, MagneticField::Builder output, ResolveFieldContext context)
-
virtual Promise<void> processFilament(Filament::Reader input, Filament::Builder output, ResolveFieldContext context)
-
Promise<void> resolveField(ResolveFieldContext context) override
-
struct GeometryLibImpl : public GeometryLib::Server
Public Functions
-
inline GeometryLibImpl(Own<DeviceBase> device)
-
Promise<void> merge(MergeContext) override
-
Promise<void> index(IndexContext) override
-
Promise<void> planarCut(PlanarCutContext) override
-
Promise<void> reduce(ReduceContext) override
-
Promise<void> weightedSample(WeightedSampleContext) override
-
Promise<void> intersect(IntersectContext) override
-
Promise<void> unroll(UnrollContext) override
-
Promise<void> planarClip(PlanarClipContext) override
-
Promise<void> triangulate(TriangulateContext) override
Public Members
-
Own<DeviceBase> device
-
inline GeometryLibImpl(Own<DeviceBase> device)
-
struct GeometryResolverBase : public GeometryResolver::Server
Public Functions
-
Promise<void> resolveGeometry(ResolveGeometryContext context) override
-
virtual Promise<void> processGeometry(Geometry::Reader input, Geometry::Builder output, ResolveGeometryContext context)
-
Promise<void> processTransform(Transformed<Geometry>::Reader input, Transformed<Geometry>::Builder output, ResolveGeometryContext context)
-
Promise<void> resolveGeometry(ResolveGeometryContext context) override
-
struct H5Dim
Public Functions
-
H5Dim(const H5::DataSet&)
Dimension scale constructor
Extracts the information from the target dimension scale object. Requires the target dataset to begin a 1D dataset (NetCDF style)
-
inline H5Dim(const H5::DataSet &ds, hsize_t len, hsize_t maxLen)
-
inline H5Dim(hsize_t len, hsize_t maxLen)
-
inline H5Dim(hsize_t len)
-
H5Dim(const H5::DataSet&)
-
struct HDF5Lib
-
struct ID
Identifier class wrapping a byte array.
Public Static Functions
-
template<typename T>
static ID fromReader(T t) Construct ID by from Reader. Requires data.h.
Creates ID from canonical representation of reader.
This method constructs an ID out of the canonical representation of the passed capnproto reader.
If the reader holds any capabilities (such as DataRef), the canonicalization will fail. Use fromReaderWithRefs() instead.
Note
Requires data.h
-
template<typename T>
static Promise<ID> fromReaderWithRefs(T t) Construct ID from reader with datarefs. Requires data.h.
Creates ID from canonical representation of reader, replaces contained DataRef::Client s with their IDs.
In addition to fromReader(), this method also replaces all linked DataRef objects with their IDs. Since this might require remote calls, it can only return a Promise to an ID.
Note
Requires data.h
-
template<typename T>
-
struct InProcessServer
Public Functions
-
virtual LocalVatHub getHub() const = 0
-
virtual Own<const InProcessServer> addRef() const = 0
-
template<typename T>
inline T::Client connect() const
-
inline capnp::Capability::Client connectBase() const
-
virtual LocalVatHub getHub() const = 0
-
struct IntersectResult
-
struct JobDir
-
struct JobDirProvider
Subclassed by fsc::BaseDirProvider, fsc::JobLauncher
-
struct JobLauncher : public fsc::JobDirProvider
Public Functions
-
virtual Job::Client launch(JobRequest req) = 0
-
virtual Own<JobLauncher> addRef() = 0
-
inline virtual ~JobLauncher()
-
virtual Job::Client launch(JobRequest req) = 0
-
struct JobRequest
-
struct JobServerBase : public Job::Server
Public Functions
-
Promise<void> eval(EvalContext) override
-
Promise<void> eval(EvalContext) override
-
template<int dims>
struct KDTreeIndex : public fsc::KDTreeIndexBase Public Functions
- inline CUPNP_FUNCTION FindResult findNearest (const Vec< double, dims > &x)
- inline CUPNP_FUNCTION void findNearest (const Vec< double, dims > &x, FindResult ¤tClosest, cu::KDTree::Node::Reader node)
-
struct KDTreeIndexBase
Subclassed by fsc::KDTreeIndex< dims >
Public Functions
-
inline CUPNP_FUNCTION KDTreeIndexBase(cu::KDTree::Reader tree)
- inline CUPNP_FUNCTION NodeInfo getNode (uint64_t id)
-
struct FindResult
-
struct NodeInfo
Public Functions
- inline CUPNP_FUNCTION double diameter ()
- inline CUPNP_FUNCTION double diameterSqr ()
-
inline CUPNP_FUNCTION KDTreeIndexBase(cu::KDTree::Reader tree)
-
template<typename T>
struct KernelArg Helper type that describes kernel arguments and their in/out semantics.
Note
For use with FSC_KARG(…)
-
template<typename Device>
struct KernelLauncher Helper to launch an int-based kernel on a specific device. Currently supports thread-pool- and GPU devices.
Public Static Functions
-
template<typename Kernel, Kernel f, typename ...Params>
static inline Promise<void> launch(Device &device, size_t n, Eigen::TensorOpCost &cost, Promise<void> onCancel, Params... params) Launches f on the computing capabilities owned by device. The cost parameter should contain an approximation of the computing expense for the kernel. On the thread-pool backend, if the expense is sufficiently small, the kernel will be computed in-line or with fewer threads.
The kernel will run asynchronously. It is guaranteed that it will not start before this function has returned.
-
template<typename Kernel, Kernel f, typename ...Params>
-
template<>
struct KernelLauncher<DeviceBase> Public Static Functions
-
template<typename Kernel, Kernel func, typename ...Params>
static inline Promise<void> launch(DeviceBase &device, size_t n, const Eigen::TensorOpCost &cost, Promise<void> onCancel, Params... params)
-
template<typename Kernel, Kernel func, typename ...Params>
-
template<>
struct KernelLauncher<LoopDevice> Public Static Functions
-
template<typename Kernel, Kernel f, typename ...Params>
static inline Promise<void> launch(LoopDevice &device, size_t n, const Eigen::TensorOpCost &cost, Promise<void> onCancel, Params... params)
-
template<typename Kernel, Kernel f, typename ...Params>
-
struct LibraryHandle : public kj::AtomicRefcounted
“Global” libary handle. This class serves as the dependency injection context for objects that should be shared across all threads. Currently, this is only the local data store table and a shared daemon runner.
Public Functions
-
LibraryHandle(StartupParameters params = StartupParameters())
-
~LibraryHandle()
-
inline kj::Own<const LibraryHandle> addRef() const
-
inline DataStore &store() const
-
const kj::Executor &worker() const
-
inline LibraryThread newThread(Maybe<kj::EventPort&> eventPort = nullptr) const
-
std::unique_ptr<Botan::HashFunction> defaultHash() const
-
LibraryHandle(StartupParameters params = StartupParameters())
-
template<typename Num>
struct LinearInterpolation Simple fast linear interpolation strategy
Public Functions
- inline constexpr EIGEN_DEVICE_FUNC size_t nPoints ()
- inline constexpr EIGEN_DEVICE_FUNC std::array< Scalar, 2 > coefficients (Num x)
- inline constexpr EIGEN_DEVICE_FUNC std::array< int, 2 > offsets ()
-
struct LoadBalancer
Public Functions
-
virtual Own<LoadBalancer> addRef() = 0
-
virtual StatusInfo status() = 0
-
virtual capnp::Capability::Client loadBalanced() = 0
-
inline virtual ~LoadBalancer() noexcept(false)
-
virtual Own<LoadBalancer> addRef() = 0
-
struct LoadLimiter
Public Functions
-
LoadLimiter(size_t capacity = 1)
-
size_t getCapacity()
-
void setCapacity(size_t newCapacity)
-
size_t getActive()
-
size_t getQueued()
-
struct Token
Subclassed by fsc::LoadLimiter::Impl::TokenImpl
Public Functions
-
inline virtual ~Token() noexcept(false)
-
inline virtual ~Token() noexcept(false)
-
LoadLimiter(size_t capacity = 1)
-
template<typename T = capnp::AnyPointer>
class LocalDataRef : public fsc::DataRef<T>::Client Local version of DataRef::Client.
Data reference backed by local storage. In addition to the remote access functionality provided by the interface in capnp::DataRef, this class provides direct access to locally stored data. This class uses non-atomic reference counting for performance, so it can not be shared across threads. To share this to other threads, pass the DataRef::Client capability it inherits from via RPC and use that thread’s DataService to download it into a local reference. If this ref and the other DataServce share the same data store, the underlying data will not be copied, but shared between the references.
Public Functions
-
ArrayPtr<const byte> getRaw()
Provides direct access to the raw underlying byte array associated with this data reference.
-
Array<const byte> forkRaw()
Same as getRaw(), but provides an owning reference (that can be passed across threads)
-
T::Reader get(const capnp::ReaderOptions &options = READ_UNLIMITED)
Provides a structured view of the underlying data. If T is capnp::Data, the returned reader will be identical to getRaw(). Otherwise, this will interpret the backing array as a CapNProto message with the given type at its root. Note that if T is not capnp::Data, and the backing array can not be interpreted as a CapNProto message, this method will fail.
-
template<typename T2 = capnp::AnyPointer>
class LocalDataRef<T2> as() Provides a new data reference sharing the underling buffer and capabilities, but having a different interpretation data type.
-
ArrayPtr<const byte> getID()
-
ArrayPtr<capnp::Capability::Client> getCapTable()
-
DataRefMetadata::Format::Reader getFormat()
-
DataRefMetadata::Reader getMetadata()
-
LocalDataRef(LocalDataRef<T> &other)
-
LocalDataRef(LocalDataRef<T> &&other)
-
LocalDataRef<T> &operator=(LocalDataRef<T> &other)
-
LocalDataRef<T> &operator=(LocalDataRef<T> &&other)
-
LocalDataRef<T> deepFork()
Creates a copy of this DataRef (sharing the data) that can be safely passed to other threads.
-
LocalDataRef() = delete
-
LocalDataRef(DataRef<capnp::AnyPointer>::Client capView, Own<internal::LocalDataRefImplV2> backend)
-
template<typename T2>
LocalDataRef(LocalDataRef<T2> &other)
-
template<typename T2>
LocalDataRef<T2> as()
Public Members
-
Own<internal::LocalDataRefImplV2> backend
Friends
- friend class LocalDataRef
-
ArrayPtr<const byte> getRaw()
-
class LocalDataService
Publishes and downloads data into LocalDataRef instances.
Main entry point for handling local and remote data references. Can be used to both create remotely-downloadable data references with its ‘publish’ methods and download (as in, create local copies of) remote references with its ‘download’ methods.
Download methods
-
template<typename Reference, typename T = References<Reference>>
Promise<LocalDataRef<T>> download(Reference src, bool recursive = false) Downloads remote DataRef::Client into LocalDataRef.
Downloads the data contained in the remote reference into the local backing store and links the remote capabilities into a local capability table.
- Parameters:
src – The DataRef<T>::Client to download from (can also be a LocalDataRef<T>)
recursive – Whether to recursively download all referenced DataRef instances into the local data store as well. If true, all contained DataRef objects will point into local storage after the returned promise resolved, and are therefore guaranteed to instantly resolve in future download attempts.
- Returns:
Promise to a local data ref instance which extends the interface by DataRef with direct access to the stored data.
-
template<typename Reference, typename T = References<Reference>>
Promise<Maybe<LocalDataRef<T>>> downloadIfNotNull(Reference src, bool recursive = false) Downloads remote DataRef::Client into LocalDataRef if it is not null.
Downloads the data contained in the remote reference into the local backing store and links the remote capabilities into a local capability table.
- Parameters:
src – The DataRef<T>::Client to download from (can also be a LocalDataRef<T>)
recursive – Whether to recursively download all referenced DataRef instances into the local data store as well. If true, all contained DataRef objects will point into local storage after the returned promise resolved, and are therefore guaranteed to instantly resolve in future download attempts.
- Returns:
Promise to a local data ref instance which extends the interface by DataRef with direct access to the stored data. The contained Maybe will evaluate to nullptr if the given DataRef is unset.
Publication methods
-
template<typename T = capnp::Data>
LocalDataRef<T> publish(typename DataRefMetadata::Reader metaData, Array<const byte> backingArray, ArrayPtr<capnp::Capability::Client> capTable = nullptr) Publishes binary data and capability table.
Creates a local data reference directly from a backing array and a capability table.
The interpretation of the backing array depends on the seleced data type. If the data type is capnp::Data, the array is interpreted as the raw data intended to be referenced. This is e.g. intended to be used for raw memory-mapped files. Currently, any other type leads to the backing array being interpreted as containing a CapNProto message (including its segment table) with a root of the specified data type (can also be capnp::AnyPointer, capnp::AnyList or capnp::AnyStruct or similar).
- Parameters:
id – The global ID to publish this data ref under.
backingArray – The contents of the binary buffer. The LocalDataRef object will take ownership of this buffer.
capTable – A list of capabilities (usually the capability table of the passed Cap’n’Proto message) to be stored alongside the binary data.
- Returns:
A LocalDataRef object which can be passed into all targets expecting abort DataRef::Client.
-
template<typename Reader, typename T = capnp::FromAny<Reader>>
LocalDataRef<T> publish(Reader reader) Publishes Cap’n’proto message.
Creates a local data reference by copying the contents of a capnproto reader. If the reader is of type capnp::Data, the byte array it points to will be copied verbatim into the backing buffer. Currently, for any other type this method will create a message containing a deepcopy copy of the data referenced by this reader and store it into the backing array (including the message’s segment table). Capabilities contained in the reader’s message will be added into the capability table hosted by the DataRef.
-
LocalDataRef<capnp::Data> publish(kj::ArrayPtr<const byte> bytes)
Publish the contents of an array (copies and hashes the array)
-
LocalDataRef<capnp::Data> publish(kj::Array<const byte> bytes, kj::ArrayPtr<const kj::byte> hash = nullptr)
Take ownership of array and publish it, potentially with precomputed hash.
Archiving methods
- template<typename Ref, typename T = References<Ref>> Promise< void > writeArchive (Ref reference, const kj::File &out) KJ_WARN_UNUSED_RESULT
Write DataRef to an archive file.
Downloads the target data and all its transitive dependencies and writes them into an archive file. This file can then be shared with other customers to provide them a deep copy of the stored data.
-
template<typename T>
LocalDataRef<T> publishArchive(const kj::ReadableFile &in, const capnp::ReaderOptions readerOpts = READ_UNLIMITED) Publish contents of archive file as LocalDataRef.
Reads an archive file and publishes all data contained within. Returns a LocalDataRef to the root used when writing the archive.
-
template<typename T>
LocalDataRef<T> publishArchive(kj::Array<const byte> in, const capnp::ReaderOptions readerOpts = READ_UNLIMITED)
-
template<typename T>
LocalDataRef<T> publishConstant(kj::ArrayPtr<const byte> in)
-
LocalDataRef<capnp::Data> publishFile(const kj::ReadableFile &in, kj::ArrayPtr<const kj::byte> fileHash = nullptr, bool copy = false)
Publish the raw contents of a file as a data ref via mmap or copy.
-
LocalDataRef<capnp::Data> publishFile(const kj::ReadableFile &in, bool copy = false)
Shorthand for publishing without hash.
Flat representation
-
template<typename T>
Promise<kj::Array<kj::Array<const byte>>> downloadFlat(LocalDataRef<T> src)
-
template<typename T>
LocalDataRef<T> publishFlat(kj::Array<kj::Array<const byte>> data)
Raw data files
Limit configuration
-
void setLimits(Limits limits)
Public Functions
-
void setChunkDebugMode()
Reduces chunk size to 1kB and throws error if chunks can’t be mapped.
-
operator DataService::Client()
-
LocalDataService(const LibraryHandle &hdl)
Constructs a new data service instance using the shared backing store.
-
LocalDataService(LocalDataService &other)
-
LocalDataService(LocalDataService &&other) = default
-
LocalDataService &operator=(LocalDataService &other)
-
LocalDataService &operator=(LocalDataService &&other) = default
-
LocalDataService() = delete
-
struct Limits
Public Members
-
uint64_t maxRAMObjectSize = 500000000
-
Maybe<uint64_t> ramRemaining = nullptr
-
uint64_t maxRAMObjectSize = 500000000
-
template<typename Reference, typename T = References<Reference>>
-
struct LocalNetworkInterface : public fsc::NetworkInterfaceBase
Network implementation based on the local network interface.
Public Functions
-
LocalNetworkInterface(Own<kj::Network> network)
Construct a network interface given a kj::Network (which can e.g. be used to restrict the address space)
-
LocalNetworkInterface()
Construct network interface using the process-wide network.
-
~LocalNetworkInterface()
-
virtual Promise<Own<kj::AsyncIoStream>> makeConnection(kj::StringPtr host, unsigned int port) override
-
LocalNetworkInterface(Own<kj::Network> network)
-
struct LocalVatHub
Exchange hub for local vat networks.
Whereas the LocalVatNetwork class represents the endpoints in the local network, the hub represents the network itself. Its join() method can be used to obtain new endpoints in the network with unique addresses. joins will be performed sequentially, and the first join() call is always guaranteed to have an ID of 0. Subsequent join() calls give no promises about the used IDs. After a network is deallocated, its ID will be reclaimed and might be used again. This inclused the initial 0 ID.
This class actually wraps a C interface struct which can be passed to other fusionsc instances without ABI incompatibility considerations.
Public Functions
-
LocalVatHub(fusionsc_LvnHub* = nullptr)
-
LocalVatHub(const LocalVatHub&)
-
LocalVatHub(LocalVatHub&&)
-
~LocalVatHub()
-
LocalVatHub &operator=(const LocalVatHub&)
-
LocalVatHub &operator=(LocalVatHub&&)
-
Own<LocalVatNetwork> join() const
-
fusionsc_LvnHub *incRef()
-
fusionsc_LvnHub *release()
-
LocalVatHub(fusionsc_LvnHub* = nullptr)
-
struct LocalVatNetwork : public LocalVatNetworkBase
Local Vat network implementation
Local multi-point implementation of Cap’n’proto’s vat network protocol. All LocalVatNetwork instances connected to the same LocalVatHub instance can form connections with each other.
Note
An instance of LocalVatNetwork may not be simultaneously used from multiple threads. However, multiple threads can connect through the same LocalVatHub, and may form connections with each other. Additionally, it is also allowed to create a LocalVatNetwork instance in one thread but use it in another, as long as no method except getVatId() is called beforehand.
Public Functions
-
virtual lvn::VatId::Reader getVatId() const = 0
-
virtual Maybe<Own<LocalVatNetworkBase::Connection>> connect(lvn::VatId::Reader hostId) override = 0
-
virtual Promise<kj::Own<LocalVatNetworkBase::Connection>> accept() override = 0
Public Static Attributes
-
static lvn::VatId::Reader INITIAL_VAT_ID = lvn::INITIAL_VAT_ID.get()
-
virtual lvn::VatId::Reader getVatId() const = 0
-
struct LoopDevice : public fsc::CPUDeviceBase, public kj::Refcounted
-
Public Static Functions
-
static Own<LoopDevice> create()
Public Static Attributes
-
static int BRAND = 0
-
static Own<LoopDevice> create()
-
struct MapNewMessage
-
struct MessageMappingBase : public fsc::DeviceMappingBase
Subclassed by fsc::DeviceMapping< Own< capnp::MessageBuilder > >, fsc::DeviceMapping< Own< capnp::MessageReader > >
Public Functions
-
MessageMappingBase(DeviceBase &device, bool allowAlias)
-
void updateStructureOnDevice()
Public Members
-
const bool allowAlias
-
MessageMappingBase(DeviceBase &device, bool allowAlias)
-
struct MT19937
Implements the popular 32 bit Mersenne twister 19937 pseudo-random number generator.
Public Functions
-
inline CUPNP_FUNCTION MT19937(cu::MT19937State::Reader input)
- inline CUPNP_FUNCTION void save (cu::MT19937State::Builder output)
- inline CUPNP_FUNCTION void update ()
- inline CUPNP_FUNCTION uint32_t operator() ()
- inline CUPNP_FUNCTION double uniform ()
- inline CUPNP_FUNCTION double exponential ()
- inline CUPNP_FUNCTION void normalPair (double &n1, double &n2)
Public Static Functions
-
static inline void seed(uint32_t seed, MT19937State::Builder state)
-
inline CUPNP_FUNCTION MT19937(cu::MT19937State::Reader input)
-
struct MultiplexedOutputStream : public kj::AsyncOutputStream
A variant of kj::OutputStream where multiple write calls may be simultaneously active.
Public Functions
-
virtual Own<MultiplexedOutputStream> addRef() = 0
-
virtual Own<MultiplexedOutputStream> addRef() = 0
-
template<int nDims, typename Strategy, int iDim>
struct NDInterpEvaluator -
Public Static Functions
- template<typename F, typename... Indices> static inline EIGEN_DEVICE_FUNC Scalar evaluate (Strategy &strategy, const F &f, const Vec< int, nDims > &base, const std::array< typename Strategy::Coeffs, nDims > &coeffs, Indices... indices)
- template<typename F, typename... Indices> static inline EIGEN_DEVICE_FUNC Scalar evaluateCheckNan (Strategy &strategy, const F &f, const Vec< int, nDims > &base, const std::array< typename Strategy::Coeffs, nDims > &coeffs, Indices... indices)
-
template<int nDims, typename Strategy>
struct NDInterpEvaluator<nDims, Strategy, nDims> -
Public Static Functions
- template<typename F, typename... Indices> static inline EIGEN_DEVICE_FUNC Scalar evaluate (Strategy &strategy, const F &f, const Vec< int, nDims > &base, const std::array< typename Strategy::Coeffs, nDims > &coeffs, Indices... indices)
- template<typename F, typename... Indices> static inline EIGEN_DEVICE_FUNC Scalar evaluateCheckNan (Strategy &strategy, const F &f, const Vec< int, nDims > &base, const std::array< typename Strategy::Coeffs, nDims > &coeffs, Indices... indices)
-
template<int nDims, typename Strategy>
struct NDInterpolator Multi-dimensional interpolator that runs based on a given 1-dimensional interpolation strategy
Public Functions
-
inline EIGEN_DEVICE_FUNC NDInterpolator(const Strategy &strategy, std::initializer_list<Axis> axes)
- template<typename F> inline EIGEN_DEVICE_FUNC Scalar operator() (const F &f, const Vec< Scalar, nDims > &x)
-
struct Axis
-
inline EIGEN_DEVICE_FUNC NDInterpolator(const Strategy &strategy, std::initializer_list<Axis> axes)
-
struct NetworkInterfaceBase : public virtual NetworkInterface::Server
This class provides the high-level networking services (SSH, RPC etc.) based on primitives for forming simple network connections.
Subclassed by fsc::LocalNetworkInterface
Public Functions
-
virtual Promise<Own<kj::ConnectionReceiver>> listen(kj::StringPtr host, Maybe<unsigned int> portHint = nullptr) = 0
-
Promise<void> sshConnect(SshConnectContext ctx) override
-
Promise<void> listen(ListenContext ctx) override
-
Promise<void> serve(ServeContext ctx) override
-
Promise<void> connect(ConnectContext ctx) override
-
virtual Promise<Own<kj::ConnectionReceiver>> listen(kj::StringPtr host, Maybe<unsigned int> portHint = nullptr) = 0
-
struct NullErrorHandler : public kj::TaskSet::ErrorHandler
Public Functions
-
void taskFailed(kj::Exception &&e) override
Public Static Attributes
-
static NullErrorHandler instance
-
void taskFailed(kj::Exception &&e) override
-
struct OrdinalChecker
Public Types
-
using DynamicValue = capnp::DynamicValue
-
using DynamicStruct = capnp::DynamicStruct
-
using StructSchema = capnp::StructSchema
-
using AnyStruct = capnp::AnyStruct
-
using SType = capnp::schema::Type
Public Functions
-
inline OrdinalChecker(DynamicStruct::Reader in, unsigned int maxOrdinal)
-
inline void allowPointer(unsigned int offset)
-
inline void allowBool(unsigned int offset)
-
inline void allowBytes(unsigned int size, unsigned int offsetInSizes)
-
inline bool checkField(DynamicStruct::Reader group, StructSchema::Field field, bool forbidden)
-
inline bool checkStruct(capnp::DynamicStruct::Reader in, bool forbidden)
-
inline bool checkRoot()
-
inline bool checkMask()
-
inline bool check()
-
using DynamicValue = capnp::DynamicValue
-
struct RFLM
Public Functions
- inline EIGEN_DEVICE_FUNC Vec3d unmap (double phi)
Computes the real-space coordinates of the last-mapped position projected to the given phi plane.
- inline EIGEN_DEVICE_FUNC Vec3d unmap (double phi, double u, double v)
Computes the real-space coordinates of a phi-u-v coordinate in the current section.
- inline EIGEN_DEVICE_FUNC double map (const Vec3d &x, bool goingCcw)
Captures a position for mapping using the closest mapping filament.
- inline EIGEN_DEVICE_FUNC double mapInSection (uint64_t section, double phi, double z, double r)
Maps using a pre-selected section.
- inline EIGEN_DEVICE_FUNC Vec3d advance (double newPhi, cupnp::List< cu::FLTKernelEvent >::Builder eventBuffer, uint32_t eventCount, uint32_t &newEventCount, uint32_t collisionLimit)
Advances to a new phi position, remapping if neccessary. Returns new real-space position.
- inline EIGEN_DEVICE_FUNC Vec3d advance (double newPhi)
- inline EIGEN_DEVICE_FUNC double getFieldlinePosition (double phi)
- inline EIGEN_DEVICE_FUNC void setFieldlinePosition (double newValue)
-
inline EIGEN_DEVICE_FUNC RFLM(cu::ReversibleFieldlineMapping::Reader mapping)
-
inline EIGEN_DEVICE_FUNC RFLM(cu::ReversibleFieldlineMapping::Reader mapping, cu::GeometryMapping::MappingData::Reader)
-
inline EIGEN_DEVICE_FUNC RFLM(const RFLM &other) = default
- inline EIGEN_DEVICE_FUNC void save (cu::ReversibleFieldlineMapping::State::Builder)
- inline EIGEN_DEVICE_FUNC void load (cu::ReversibleFieldlineMapping::State::Reader)
-
inline void save(ReversibleFieldlineMapping::State::Builder)
-
inline void load(ReversibleFieldlineMapping::State::Reader)
-
inline void activateSection(uint64_t iSection)
-
inline cu::ReversibleFieldlineMapping::Section::Reader activeSection()
-
inline cu::GeometryMapping::SectionData::Reader activeGeoSection()
Public Members
-
cu::ReversibleFieldlineMapping::Reader mapping
-
cu::GeometryMapping::MappingData::Reader geoMapping
-
Vec2d uv
-
uint64_t currentSection
-
uint64_t currentSectionRaw
-
double phi
-
double lenOffset
-
uint32_t nPad
-
uint64_t nPhi
-
uint64_t nZ
-
uint64_t nR
-
double phi1
-
double phi2
Public Static Attributes
-
static constexpr double SECTION_TOL = 0.001
-
struct TensorField
Public Functions
-
inline TensorField(cu::Float64Tensor::Reader reader, RFLM &parent)
-
inline double operator()(int iPhi, int iZ, int iR) const
-
inline TensorField(cu::Float64Tensor::Reader reader, RFLM &parent)
Public Types
Public Functions
-
template<typename Strategy>
struct SlabFieldInterpolator Public Types
-
using Axis = typename NDInterpolator<3, Strategy>::Axis
Public Functions
-
inline EIGEN_DEVICE_FUNC SlabFieldInterpolator(const Strategy &strategy, cu::ToroidalGrid::Reader grid)
-
inline EIGEN_DEVICE_FUNC SlabFieldInterpolator(const Strategy &strategy, const ToroidalGridStruct &grid)
- inline EIGEN_DEVICE_FUNC Vec< Scalar, 3 > operator() (const TensorMap< const Tensor< Scalar, 4 > > &fieldData, const Vec< Scalar, 3 > &xyz)
- inline EIGEN_DEVICE_FUNC Vec< Scalar, 3 > inSlabOrientation (const TensorMap< const Tensor< Scalar, 4 > > &fieldData, const Vec< Scalar, 3 > &xyz)
- inline EIGEN_DEVICE_FUNC Vec< Scalar, 3 > operator() (const TensorMap< Tensor< Scalar, 4 > > &fieldData, const Vec< Scalar, 3 > &xyz)
- inline EIGEN_DEVICE_FUNC Vec< Scalar, 3 > inSlabOrientation (const TensorMap< Tensor< Scalar, 4 > > &fieldData, const Vec< Scalar, 3 > &xyz)
Public Members
-
NDInterpolator<3, Strategy> interpolator
-
using Axis = typename NDInterpolator<3, Strategy>::Axis
-
struct SSHChannel
-
struct SSHChannelListener
Public Functions
-
virtual ~SSHChannelListener()
-
virtual Promise<Own<SSHChannel>> accept() = 0
-
virtual int getPort() = 0
-
virtual Own<SSHChannelListener> addRef() = 0
-
virtual void close() = 0
-
virtual bool isOpen() = 0
-
virtual ~SSHChannelListener()
-
struct SSHSession
Public Functions
-
virtual ~SSHSession()
-
virtual Own<SSHSession> addRef() = 0
-
virtual Promise<Own<SSHChannel>> connectRemote(kj::StringPtr remoteHost, size_t remotePort) = 0
-
virtual Promise<Own<SSHChannel>> connectRemote(kj::StringPtr remoteHost, size_t remotePort, kj::StringPtr srcHost, size_t srcPort) = 0
-
virtual Promise<Own<SSHChannelListener>> listen(kj::StringPtr host = "0.0.0.0"_kj, Maybe<int> port = nullptr) = 0
-
virtual Promise<bool> authenticatePubkeyFile(kj::StringPtr user, kj::StringPtr pubkeyFile, kj::StringPtr privkeyFile, kj::StringPtr passPhrase = nullptr) = 0
-
virtual Promise<bool> authenticatePubkeyData(kj::StringPtr user, kj::StringPtr pubkeyData, kj::StringPtr privkeyData, kj::StringPtr passPhrase) = 0
-
virtual bool isAuthenticated() = 0
-
virtual void close() = 0
-
virtual bool isOpen() = 0
-
virtual Promise<void> drain() = 0
-
virtual ~SSHSession()
-
struct StartupParameters
-
struct StoreEntry
Public Functions
-
StoreEntry(fusionsc_DataStoreEntry*)
-
~StoreEntry()
-
StoreEntry(const StoreEntry&)
-
StoreEntry(StoreEntry&&)
-
StoreEntry &operator=(const StoreEntry&)
-
StoreEntry &operator=(StoreEntry&&)
-
fusionsc_DataStoreEntry *incRef()
-
fusionsc_DataStoreEntry *release()
-
StoreEntry(fusionsc_DataStoreEntry*)
-
template<typename T>
struct Temporary : public T::Builder Combined MessageBuilder and Struct::Builder.
This class holds a locally owned MessageBuilder and specifies the type of the message’s root. It directly derives from T::Builder, so the root struct / list can be directly accessed.
- Template Parameters:
T – Data type of the contained message.
Public Types
-
using Builds = T
Public Functions
-
template<typename ...Params>
inline Temporary(Params... params)
-
inline Temporary(typename T::Reader reader)
-
inline Temporary(typename T::Builder builder)
-
inline Temporary(Own<capnp::MessageBuilder> holder)
-
inline T::Builder asBuilder()
-
inline operator capnp::MessageBuilder&()
Public Members
-
Own<capnp::MessageBuilder> holder
-
template<typename TensorType>
struct TensorMapping : public fsc::DeviceMapping<kj::Array<TensorType::Scalar>> Subclassed by fsc::DeviceMapping< Own< TensorMap< T > > >, fsc::DeviceMapping< Tensor< TVal, tRank, tOpts, Index > >, fsc::DeviceMapping< TensorFixedSize< TVal, Dims, options, Index > >
Public Types
-
using Scalar = typename TensorType::Scalar
-
using Scalar = typename TensorType::Scalar
-
struct ThreadContext
Subclassed by fsc::WorkerContext
Public Functions
-
~ThreadContext()
-
inline const kj::Executor &executor() const
Access to executor from outside threads.
-
inline const Library &library() const
-
inline LocalDataService &dataService()
-
inline kj::AsyncIoContext &ioContext()
-
inline kj::WaitScope &waitScope()
-
inline kj::Timer &timer()
-
inline CSPRNG &rng()
-
inline kj::Network &network()
-
inline StreamConverter &streamConverter()
-
inline kj::Filesystem &filesystem()
-
inline DataStore &store() const
-
inline const kj::Executor &worker() const
-
Promise<void> uncancelable(Promise<void> p)
-
void detach(Promise<void> p)
-
Promise<void> drain()
-
kj::Canceler &lifetimeScope()
-
~ThreadContext()
-
struct ToroidalGridStruct
Public Functions
-
inline bool isValid() const
- inline EIGEN_DEVICE_FUNC double phi (int i_phi) const
- inline EIGEN_DEVICE_FUNC double r (int i_r) const
- inline EIGEN_DEVICE_FUNC double z (int i_z) const
- inline EIGEN_DEVICE_FUNC Vec3d xyz (int i_phi, int i_z, int i_r) const
- inline EIGEN_DEVICE_FUNC Vec3d phizr (int i_phi, int i_z, int i_r) const
-
inline bool isValid() const
-
struct UnbalancedIntervalSplit
-
template<typename T>
struct ValueExtractor Helper that extracts the scalar value of an AutoDiff scalar
-
struct WorkerContext : public fsc::ThreadContext
Thread context that cancels all long-running tasks.
-
template<typename T>
struct XThreadQueue Cross-thread communication queue.
A queue that can asynchronously poll messages while allowing cross- thread synchronous pushes. Supports connection-like close semantics
Public Functions
-
bool push(T &&t) const
Push an item into the queue. Returns true if the queue is open, and false if it closed.
-
Promise<T> pop()
Retrieve item from queue.
Returns a promise that resolves once an entry is available in the queue. Only one such promise may be active at any time. Waiting promises will get cancelled if another wait is queued with pop().
-
void clear()
Removes all items currently in the queue.
-
void close(const kj::Exception &e = KJ_EXCEPTION(DISCONNECTED, "Queue closed"))
Close the queue
After closing the queue, no new messages can be pushed into the queue. Objects that are pushed after closing will be silently discarded. Objects pushed into the queue before calling close() will remain in the queue and can be read with pop(). Once the queue is cleared, the promise returned by pop() will contain the exception argument to close()
-
~XThreadQueue()
-
bool push(T &&t) const
-
struct ZLib
Helper class for implementing ZLib-based compression and decompression.
Subclassed by fsc::Compressor, fsc::Decompressor
Public Types
-
namespace capi
-
namespace db
Enums
-
enum class TransactionType : uint8_t
Values:
-
enumerator UNKNOWN
-
enumerator READ_WRITE
-
enumerator READ_ONLY
-
enumerator READ_ONLY_DEFER
-
enumerator UNKNOWN
Functions
-
KJ_DECLARE_NON_POLYMORPHIC(Connection::BaseTransactionHook)
-
struct Connection
Public Functions
-
virtual Own<Connection> addRef() = 0
-
virtual Own<Connection> fork(bool readOnly) = 0
-
virtual Own<PreparedStatementHook> prepareHook(kj::StringPtr sql) = 0
-
virtual bool inTransaction() = 0
-
inline PreparedStatement prepare(kj::StringPtr sql)
-
inline int64_t exec(kj::StringPtr sql)
-
virtual Own<TransactionHook> beginTransaction(TransactionType) = 0
-
inline bool isSqliteLike()
Checks whether connection behaves like an SQLite connection.
If true, the connection has the following traits:
Serialization failure happens latest at the first write statement of a transaction.
It is strongly advisable to batch small write transactions into larger ones.
If these traits are true, clients can and should merge multiple write statements into super-transactions that will be released before the event loop goes to idle. If serialization failure can occur in a delayed fasion, this is not safe to perform as earlier successful writes can be invalidated by the later failure.
-
struct BaseTransactionHook : public fsc::db::Connection::TransactionHook, public kj::Refcounted
Public Functions
-
inline BaseTransactionHook(Connection &c)
-
inline ~BaseTransactionHook() noexcept
-
inline Own<Connection::BaseTransactionHook> addRef()
-
inline void deactivate() noexcept
-
inline bool active() noexcept override
-
inline void commit() override
-
inline void rollback() noexcept override
-
inline Own<SavepointTransactionHook> newSavepoint()
-
inline BaseTransactionHook(Connection &c)
-
struct TransactionHook
Subclassed by fsc::db::Connection::BaseTransactionHook
Public Functions
-
virtual ~TransactionHook()
-
virtual void commit() = 0
-
virtual bool active() noexcept = 0
-
virtual void rollback() noexcept = 0
-
virtual ~TransactionHook()
-
virtual Own<Connection> addRef() = 0
-
struct PreparedStatement
Prepared statement object.
Public Functions
-
PreparedStatement() = default
-
PreparedStatement(Own<PreparedStatementHook> &&hook)
-
~PreparedStatement()
-
PreparedStatement(PreparedStatement&&) = default
-
PreparedStatement &operator=(PreparedStatement&&) = default
-
template<typename P>
void setParameter(size_t, P) Set a statement parameter.
-
inline void reset()
Reset the statement.
-
template<typename ...Params>
inline size_t operator()(Params... params) Execute the statement directly (bind + step + reset). Returns no. of rows modified.
-
template<typename ...Params>
inline int64_t insert(Params... params) Execute the statement directly (bind + step + reset). Returns last inserted rowid.
-
struct Column
Column of a statement row.
Public Functions
-
inline Column(PreparedStatement &parent, size_t idx)
-
inline double asDouble()
-
inline int64_t asInt64()
-
inline kj::StringPtr asText()
-
inline bool isNull()
-
inline operator kj::StringPtr()
-
inline operator double()
-
inline operator int64_t()
-
inline kj::String name()
-
inline bool operator==(const Column &other)
-
inline bool operator!=(const Column &other)
-
inline Column &operator++()
-
inline Column *operator->()
-
inline Column &operator*()
-
inline Column(PreparedStatement &parent, size_t idx)
-
struct Query
Query object returned by bind() that can step through result rows and access columns.
Public Functions
-
inline Query(PreparedStatement &p)
-
inline ~Query()
-
inline Column operator[](size_t idx)
-
bool step()
Public Members
-
PreparedStatement &parent
-
inline Query(PreparedStatement &p)
-
PreparedStatement() = default
-
struct PreparedStatementHook
Backend implementation class for prepared statements.
Public Functions
-
virtual void reset() = 0
-
virtual bool step() = 0
-
virtual int64_t lastInsertedRowid() = 0
-
virtual size_t nRowsModified() = 0
-
virtual void setParameter(size_t, double) = 0
-
virtual void setParameter(size_t, int64_t) = 0
-
virtual void setParameter(size_t, kj::StringPtr) = 0
-
virtual void setParameter(size_t, decltype(nullptr)) = 0
-
virtual double getDouble(size_t) = 0
-
virtual int64_t getInt64(size_t) = 0
-
virtual kj::StringPtr getText(size_t) = 0
-
virtual bool isNull(size_t) = 0
-
virtual kj::String getColumnName(size_t) = 0
-
virtual size_t size() = 0
-
virtual void reset() = 0
-
struct Transaction
Public Functions
-
Transaction(Connection &parent, TransactionType type = TransactionType::UNKNOWN)
-
~Transaction() noexcept(false)
-
inline void commit()
-
inline void rollback() noexcept
-
inline bool active() noexcept
-
Transaction(Connection &parent, TransactionType type = TransactionType::UNKNOWN)
-
enum class TransactionType : uint8_t
-
namespace devices
-
namespace jtext
-
namespace w7x
Functions
- TEST_CASE ("coilsdb")
This test cases sets up a dummy coilsDB and then queries the internal proxy for some coils from it. The test cases are defined in w7x-test.capnp
- TEST_CASE ("compdb")
-
CoilsDB::Client newCoilsDBFromWebservice(kj::StringPtr address)
Constructs a new client for the W7-X coils DB that connects to the webservice on the given address.
-
Provider::Client newProvider()
-
FieldResolver::Client newW7xFieldResolver()
-
GeometryResolver::Client newW7xGeometryResolver()
-
FieldResolver::Client newCoilsDBResolver(CoilsDB::Client coilsDB)
-
FieldResolver::Client newConfigDBResolver(CoilsDB::Client coilsDB)
-
GeometryResolver::Client newComponentsDBResolver(ComponentsDB::Client componentsDB)
-
void buildCoilFields(W7XCoilSet::Reader in, W7XCoilSet::Fields::Builder output)
Variables
-
struct CoilsDBWebservice : public CoilsDB::Server
-
struct ComponentsDBWebservice : public ComponentsDB::Server
-
struct ProviderImpl : public Provider::Server
-
namespace jtext
-
namespace kernels
Typedefs
-
using Field = Eigen::Tensor<double, 4>
-
using FieldValues = Eigen::Tensor<double, 2>
-
using FieldValuesRef = Eigen::TensorMap<FieldValues>
-
using MFilament = Eigen::Tensor<double, 2>
-
using MagTransform = Eigen::Matrix<double, 3, 4>
Functions
-
FSC_DECLARE_KERNEL(addFieldInterpKernel, MagKernelContext, FieldRef, ToroidalGridStruct)
-
FSC_DECLARE_KERNEL(biotSavartKernel, MagKernelContext, FilamentRef, double, double)
-
FSC_DECLARE_KERNEL(dipoleFieldKernel, MagKernelContext, FieldValuesRef, FieldValuesRef, kj::ArrayPtr<double>, size_t, size_t)
-
FSC_DECLARE_KERNEL(eqFieldKernel, MagKernelContext, cu::AxisymmetricEquilibrium::Reader)
- inline EIGEN_DEVICE_FUNC void dipoleFieldKernel (unsigned int idx, MagKernelContext ctx, FieldValuesRef dipolePoints, FieldValuesRef dipoleMoments, kj::ArrayPtr< double > radii, size_t start, size_t end)
-
struct MagKernelContext
Public Functions
-
inline MagKernelContext(FieldValuesRef pointsIn, FieldValuesRef fieldOut)
-
inline MagKernelContext(const MagKernelContext&) = default
-
inline MagKernelContext(MagKernelContext&&) = default
- inline EIGEN_DEVICE_FUNC Vec3d getPosition (unsigned int idx) const
- inline EIGEN_DEVICE_FUNC void addField (unsigned int idx, Vec3d fieldContrib) const
- inline EIGEN_DEVICE_FUNC MagKernelContext scaleBy (double scale) const
Public Members
-
FieldValuesRef field
-
FieldValuesRef points
-
double scale = 1
-
Eigen::Matrix<double, 3, 4> transform = Eigen::Matrix<double, 3, 4>::Zero()
-
bool transformed = false
-
inline MagKernelContext(FieldValuesRef pointsIn, FieldValuesRef fieldOut)
-
using Field = Eigen::Tensor<double, 4>
-
namespace kmath
Functions
- template<typename Num> EIGEN_DEVICE_FUNC Num wrap (Num x)
- template<typename Num> EIGEN_DEVICE_FUNC bool crossedPhi (Num phi1, Num phi2, Num phi0)
- template<typename Num, int dim, typename F> EIGEN_DEVICE_FUNC void runge_kutta_4_step (Eigen::Vector< Num, dim > &x, Num t, Num h, const F &f)
- template<typename Num, int dim, typename F> EIGEN_DEVICE_FUNC double runge_kutta_fehlberg_step (Eigen::Vector< Num, dim > &x, Num t, Num h, const F &f)
- inline EIGEN_DEVICE_FUNC unsigned int modPlus (int i, int n)
-
namespace nudft
Functions
-
template<unsigned int xdim, unsigned int ydim>
void calculateModes(kj::ArrayPtr<const FourierPoint<xdim, ydim>>, kj::ArrayPtr<FourierMode<xdim, ydim>>)
-
template<unsigned int xdim, unsigned int ydim>
struct FourierMode
-
template<unsigned int xdim, unsigned int ydim>
struct FourierPoint
-
template<unsigned int xdim, unsigned int ydim>
-
namespace structio
-
Functions
-
void save(Node&&, Visitor&)
Streams loaded data into the target visitor, but deallocates no-longer-needed data.
-
Own<Visitor> createVisitor(capnp::ListSchema schema, ListInitializer initializer)
-
Own<Visitor> createVisitor(kj::BufferedOutputStream &os, const Dialect &dialect, const SaveOptions &opts)
-
void save(DynamicValue::Reader reader, Visitor &v, const SaveOptions &opts, Maybe<kj::WaitScope&> ws)
-
void save(DynamicValue::Reader reader, kj::BufferedOutputStream &os, const Dialect &dialect, const SaveOptions &opts, Maybe<kj::WaitScope&> ws)
-
Array<kj::byte> saveToArray(DynamicValue::Reader reader, const Dialect &dialect, const SaveOptions &opts, Maybe<kj::WaitScope&> ws)
-
kj::String saveToString(DynamicValue::Reader reader, const Dialect &dialect, const SaveOptions &opts, Maybe<kj::WaitScope&> ws)
-
void save(capnp::DynamicValue::Reader, Visitor&, const SaveOptions& = SaveOptions(), Maybe<kj::WaitScope&> = nullptr)
-
void save(capnp::DynamicValue::Reader, kj::BufferedOutputStream&, const Dialect&, const SaveOptions& = SaveOptions(), Maybe<kj::WaitScope&> = nullptr)
-
kj::Array<kj::byte> saveToArray(capnp::DynamicValue::Reader, const Dialect&, const SaveOptions& = SaveOptions(), Maybe<kj::WaitScope&> = nullptr)
-
kj::String saveToString(capnp::DynamicValue::Reader, const Dialect&, const SaveOptions& = SaveOptions(), Maybe<kj::WaitScope&> = nullptr)
-
struct Dialect
Public Types
-
struct Node
Public Types
-
using Payload = OneOf<MapPayload, ListPayload, kj::String, kj::Array<kj::byte>, double, uint64_t, int64_t, bool, NullValue>
-
struct NullValue
-
using Payload = OneOf<MapPayload, ListPayload, kj::String, kj::Array<kj::byte>, double, uint64_t, int64_t, bool, NullValue>
-
struct SaveOptions
Public Members
-
bool compact = false
Enable compact representation
Compact representation allows hiding default valued fields and substituting structures of the form { “onlyField” : defaultValue } with the field key (“onlyField” or the field ID).
-
bool integerKeys = false
Enable integer field keys
Some formats (YAML / CBOR) permit arbitrary objects to be used as keys. In such a case, we can save space and improve protcol migration by preferentially using the numeric IDs instead of names for a lot of objects (field keys, enumerants).
Since this eliminates the value of the saved data as self-describing structures, it is disabled by default.
-
CapabilityStrategy *capabilityStrategy = CapabilityStrategy::DEFAULT
Allows the override of capability storage
Custom viewers / editors might want to override how a capability is shown, e.g. by replacing them with a clickable link that opens the target in a GUI.
-
struct CapabilityStrategy
Public Functions
-
virtual void saveCapability(capnp::DynamicCapability::Client, Visitor&, const SaveOptions&, Maybe<kj::WaitScope&>) const = 0
Public Static Attributes
-
static CapabilityStrategy *const DEFAULT = &DEFAULT_CAP_INSTANCE
-
virtual void saveCapability(capnp::DynamicCapability::Client, Visitor&, const SaveOptions&, Maybe<kj::WaitScope&>) const = 0
-
bool compact = false
-
struct Visitor
Public Functions
-
inline virtual ~Visitor() noexcept(false)
-
virtual void beginObject(Maybe<size_t>) = 0
-
virtual void endObject() = 0
-
virtual void beginArray(Maybe<size_t>) = 0
-
virtual void endArray() = 0
-
virtual void acceptNull() = 0
-
virtual void acceptDouble(double) = 0
-
virtual void acceptInt(int64_t) = 0
-
virtual void acceptUInt(uint64_t) = 0
-
virtual void acceptBool(bool) = 0
-
virtual bool done() = 0
Public Members
-
bool supportsIntegerKeys = false
Whether this visitor allows integer map keys.
-
inline virtual ~Visitor() noexcept(false)
-
void save(Node&&, Visitor&)
-
template<typename T>