-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[perf] add adaptor perf show type. simplify dump code
- Loading branch information
1 parent
56339c3
commit d8f6e1f
Showing
9 changed files
with
100 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/GraphCtrl/GraphElement/GAdapter/GCoordinator/GCoordinator.inl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/*************************** | ||
@Author: Chunel | ||
@Contact: [email protected] | ||
@File: GCoordinator.inl | ||
@Time: 2023/9/8 21:12 | ||
@Desc: | ||
***************************/ | ||
|
||
#ifndef CGRAPH_GCOORDINATOR_INL | ||
#define CGRAPH_GCOORDINATOR_INL | ||
|
||
#include "GCoordinator.h" | ||
|
||
CGRAPH_NAMESPACE_BEGIN | ||
|
||
template<CInt SIZE> | ||
GCoordinator<SIZE>::GCoordinator() { | ||
element_type_ = GElementType::COORDINATOR; | ||
session_ = URandom<>::generateSession(CGRAPH_STR_COORDINATOR); | ||
} | ||
|
||
|
||
template<CInt SIZE> | ||
CStatus GCoordinator<SIZE>::run() { | ||
CGRAPH_FUNCTION_BEGIN | ||
CGRAPH_ASSERT_NOT_NULL(thread_pool_) | ||
status = (SIZE >= 0) | ||
? thread_pool_->createSecondaryThread(SIZE) | ||
: thread_pool_->releaseSecondaryThread((-1) * SIZE); | ||
|
||
CGRAPH_FUNCTION_END | ||
} | ||
|
||
|
||
template<CInt SIZE> | ||
CVoid GCoordinator<SIZE>::dumpElement(std::ostream& oss) { | ||
dumpElementHeader(oss); | ||
dumpPerfInfo(oss); | ||
oss << "\", shape=diamond]\n"; | ||
} | ||
|
||
|
||
template<CInt SIZE> | ||
CStatus GCoordinator<SIZE>::checkSuitable() { | ||
CGRAPH_FUNCTION_BEGIN | ||
CGRAPH_RETURN_ERROR_STATUS_BY_CONDITION(loop_ > 1, \ | ||
"cannot set GCoordinator loop > 1") | ||
|
||
CGRAPH_FUNCTION_END | ||
} | ||
|
||
CGRAPH_NAMESPACE_END | ||
|
||
#endif //CGRAPH_GCOORDINATOR_INL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters