-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a thread name to all DALI threads #3912
Conversation
77ce73c
to
ef02b63
Compare
!build |
CI MESSAGE: [4876435]: BUILD STARTED |
CI MESSAGE: [4876435]: BUILD PASSED |
!build |
CI MESSAGE: [4879091]: BUILD STARTED |
CI MESSAGE: [4879091]: BUILD PASSED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be good to add pthread_getname_np
to tests to make sure that it works and keeps working in the future?
Regardless, cool feature.
@awolant - done |
!build |
CI MESSAGE: [4893041]: BUILD STARTED |
CI MESSAGE: [4893041]: BUILD PASSED |
@@ -100,6 +100,8 @@ struct DomainTimeRange : RangeBase { | |||
#endif | |||
}; | |||
|
|||
void SetThreadName(const char *name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some docs comment that only first 15 characters of the name will be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see it's only for the pthread name. So maybe it's not that important to note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
dali/core/nvtx.cc
Outdated
|
||
#else | ||
|
||
void SetThreadName(const char *name) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The impl without NVTX enabled still could set the pthread name, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
!build |
CI MESSAGE: [4910165]: BUILD STARTED |
CI MESSAGE: [4910165]: BUILD FAILED |
CI MESSAGE: [4910272]: BUILD STARTED |
CI MESSAGE: [4910272]: BUILD FAILED |
CI MESSAGE: [4910311]: BUILD STARTED |
CI MESSAGE: [4910314]: BUILD STARTED |
CI MESSAGE: [4910311]: BUILD FAILED |
dali/pipeline/util/worker_thread.h
Outdated
@@ -66,15 +67,15 @@ class WorkerThread { | |||
public: | |||
typedef std::function<void(void)> Work; | |||
|
|||
inline WorkerThread(int device_id, bool set_affinity) : | |||
inline WorkerThread(int device_id, bool set_affinity, const std::string name) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline WorkerThread(int device_id, bool set_affinity, const std::string name) : | |
inline WorkerThread(int device_id, bool set_affinity, const std::string &name) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
dali/pipeline/util/thread_pool.cc
Outdated
|
||
namespace dali { | ||
|
||
ThreadPool::ThreadPool(int num_thread, int device_id, bool set_affinity) | ||
ThreadPool::ThreadPool(int num_thread, int device_id, bool set_affinity, const std::string name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ThreadPool::ThreadPool(int num_thread, int device_id, bool set_affinity, const std::string name) | |
ThreadPool::ThreadPool(int num_thread, int device_id, bool set_affinity, const std::string &name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
dali/pipeline/util/thread_pool.h
Outdated
DLL_PUBLIC ThreadPool(int num_thread, int device_id, bool set_affinity, | ||
const std::string name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DLL_PUBLIC ThreadPool(int num_thread, int device_id, bool set_affinity, | |
const std::string name); | |
DLL_PUBLIC ThreadPool(int num_thread, int device_id, bool set_affinity, | |
const std::string &name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than a few missing &
, OK.
CI MESSAGE: [4910314]: BUILD FAILED |
e4b6c19
to
eecd062
Compare
CI MESSAGE: [4912612]: BUILD STARTED |
CI MESSAGE: [4912612]: BUILD FAILED |
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
CI MESSAGE: [4912820]: BUILD STARTED |
CI MESSAGE: [4912820]: BUILD FAILED |
CI MESSAGE: [4913316]: BUILD STARTED |
CI MESSAGE: [4913316]: BUILD PASSED |
- adds an ability to name thread poll and the worker thread threads so they are easier to identify on the nsight traces - use NVTX API to set full names visible in nsight traces and pthread_setname_np to set truncated names visible in the GDB debugger Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
threads so they are easier to identified on the nsight traces
Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com
Category:
Other (e.g. Documentation, Tests, Configuration)
Description:
threads so they are easier to identified on the nsight traces
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Checklist
Tests
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A