LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
ltfb/execution_context.hpp
Go to the documentation of this file.
1 // Copyright (c) 2014-2023, Lawrence Livermore National Security, LLC.
3 // Produced at the Lawrence Livermore National Laboratory.
4 // Written by the LBANN Research Team (B. Van Essen, et al.) listed in
5 // the CONTRIBUTORS file. <lbann-dev@llnl.gov>
6 //
7 // LLNL-CODE-697807.
8 // All rights reserved.
9 //
10 // This file is part of LBANN: Livermore Big Artificial Neural Network
11 // Toolkit. For details, see http://software.llnl.gov/LBANN or
12 // https://github.com/LLNL/LBANN.
13 //
14 // Licensed under the Apache License, Version 2.0 (the "Licensee"); you
15 // may not use this file except in compliance with the License. You may
16 // obtain a copy of the License at:
17 //
18 // http://www.apache.org/licenses/LICENSE-2.0
19 //
20 // Unless required by applicable law or agreed to in writing, software
21 // distributed under the License is distributed on an "AS IS" BASIS,
22 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
23 // implied. See the License for the specific language governing
24 // permissions and limitations under the license.
26 #ifndef LBANN_EXECUTION_ALGORITHMS_LTFB_EXECUTION_CONTEXT_HPP_INCLUDED
27 #define LBANN_EXECUTION_ALGORITHMS_LTFB_EXECUTION_CONTEXT_HPP_INCLUDED
28 
31 
32 #include <memory>
33 #include <string>
34 
35 namespace lbann {
36 namespace ltfb {
37 
48 {
49 public:
50  LTFBExecutionContext() = default;
51  ~LTFBExecutionContext() = default;
52 
54  std::unique_ptr<lbann::ExecutionContext> get_new() const override
55  {
56  return std::make_unique<LTFBExecutionContext>();
57  }
58 
63  std::string get_type() const override { return "ltfb"; }
64 
66  std::string get_state_string() const noexcept override
67  {
68  return build_string(this->get_type(), ".step.", this->get_step());
69  }
70 
72 
75  template <class Archive>
76  void serialize(Archive& ar);
77 
80  {
81  LBANN_ERROR("TODO: Not yet implemented.");
82  }
85  {
86  LBANN_ERROR("TODO: Not yet implemented.");
87  }
90  {
91  LBANN_ERROR("TODO: Not yet implemented.");
92  }
95  {
96  LBANN_ERROR("TODO: Not yet implemented.");
97  }
99 
100 }; // class ExecutionContext
101 
102 } // namespace ltfb
103 } // namespace lbann
104 #endif // LBANN_EXECUTION_ALGORITHMS_LTFB_EXECUTION_CONTEXT_HPP_INCLUDED
void save_to_checkpoint_distributed(persist &p) override
Checkpoint exection_context to a distributed checkpoint.
#define LBANN_ERROR(...)
Definition: exception.hpp:37
std::string build_string(Args &&... args)
Build a string from the arguments.
Definition: exception.hpp:157
void load_from_checkpoint_distributed(persist &p) override
Restore execution_context from a distributed checkpoint.
void load_from_checkpoint_shared(persist &p) override
Restore execution_context from a shared checkpoint.
void save_to_checkpoint_shared(persist &p) override
Checkpoint exection_context to a shared checkpoint.
std::string get_type() const override
Get a string identifying the type of execution context.
std::unique_ptr< lbann::ExecutionContext > get_new() const override
std::string get_state_string() const noexcept override
Return the state of the execution context as a string.
size_t get_step() const noexcept
Current step in the training algorithm.