Apollo  6.0
Open source self driving car software
scheduler_choreography.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 
17 #ifndef CYBER_SCHEDULER_POLICY_SCHEDULER_CHOREOGRAPHY_H_
18 #define CYBER_SCHEDULER_POLICY_SCHEDULER_CHOREOGRAPHY_H_
19 
20 #include <memory>
21 #include <string>
22 #include <unordered_map>
23 #include <vector>
24 
26 #include "cyber/proto/choreography_conf.pb.h"
28 
29 namespace apollo {
30 namespace cyber {
31 namespace scheduler {
32 
34 using apollo::cyber::proto::ChoreographyTask;
35 
37  public:
38  bool RemoveCRoutine(uint64_t crid) override;
39  bool RemoveTask(const std::string& name) override;
40  bool DispatchTask(const std::shared_ptr<CRoutine>&) override;
41 
42  private:
43  friend Scheduler* Instance();
45 
46  void CreateProcessor();
47  bool NotifyProcessor(uint64_t crid) override;
48 
49  std::unordered_map<std::string, ChoreographyTask> cr_confs_;
50 
51  int32_t choreography_processor_prio_;
52  int32_t pool_processor_prio_;
53 
54  std::string choreography_affinity_;
55  std::string pool_affinity_;
56 
57  std::string choreography_processor_policy_;
58  std::string pool_processor_policy_;
59 
60  std::vector<int> choreography_cpuset_;
61  std::vector<int> pool_cpuset_;
62 };
63 
64 } // namespace scheduler
65 } // namespace cyber
66 } // namespace apollo
67 
68 #endif // CYBER_SCHEDULER_POLICY_SCHEDULER_CHOREOGRAPHY_H_
Definition: croutine.h:40
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: scheduler.h:58
bool RemoveCRoutine(uint64_t crid) override
Definition: scheduler_choreography.h:36
bool DispatchTask(const std::shared_ptr< CRoutine > &) override
bool RemoveTask(const std::string &name) override