Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
MPIRemoteLookupCache.h
Go to the documentation of this file.
1//===-- MPIRemoteLookupCache.h -- MPI remote-lookup cache header --===//
2//
3// Part of the Proteus Project, under the Apache License v2.0 with LLVM
4// Exceptions. See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// A fully centralized MPI storage cache where rank 0 is the single writer AND
10// reader. Other ranks make synchronous MPI requests to rank 0 for both store()
11// and lookup() operations.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef PROTEUS_MPIREMOTELOOKUP_CACHE_H
16#define PROTEUS_MPIREMOTELOOKUP_CACHE_H
17
19
20#include <vector>
21
22namespace proteus {
23
27
29 bool Found;
31 std::vector<char> Data;
32};
33
35public:
36 MPIRemoteLookupCache(const std::string &Label);
37
38 std::string getName() const override { return "MPIRemoteLookup"; }
39
40 std::unique_ptr<CompiledLibrary> lookup(const HashT &HashValue) override;
41
42protected:
43 void handleMessage(MPI_Status &Status, MPITag Tag) override;
44
45private:
46 std::unique_ptr<CompiledLibrary> lookupRemote(const HashT &HashValue);
47
48 void handleLookupRequest(MPI_Status &Status);
49
50 std::vector<char> packLookupRequest(const HashT &HashValue);
51 std::vector<char> packLookupResponse(bool Found, bool IsDynLib,
52 const std::vector<char> &Data);
53 LookupRequest unpackLookupRequest(const std::vector<char> &Buffer);
54 LookupResponse unpackLookupResponse(const std::vector<char> &Buffer);
55};
56
57} // namespace proteus
58
59#endif
Definition Hashing.h:21
Definition MPIRemoteLookupCache.h:34
std::unique_ptr< CompiledLibrary > lookup(const HashT &HashValue) override
Definition MPIRemoteLookupCache.cpp:35
void handleMessage(MPI_Status &Status, MPITag Tag) override
Definition MPIRemoteLookupCache.cpp:84
std::string getName() const override
Definition MPIRemoteLookupCache.h:38
Definition MPIStorageCache.h:31
const std::string Label
Definition MPIStorageCache.h:54
Definition MemoryCache.h:26
MPITag
Definition MPIHelpers.h:27
Definition MPIRemoteLookupCache.h:24
HashT Hash
Definition MPIRemoteLookupCache.h:25
Definition MPIRemoteLookupCache.h:28
std::vector< char > Data
Definition MPIRemoteLookupCache.h:31
bool IsDynLib
Definition MPIRemoteLookupCache.h:30
bool Found
Definition MPIRemoteLookupCache.h:29