Detailed logs (#124)

* Use a single printf per line (reduce chances of lines being cut in logs)

* team_comm can be an int or a pointer depending on MPI impl.
Received is confusing (since we are on the origin), use submitted
instead

* Print arguments to calls when using DEBUG

---------

Signed-off-by: Aurelien Bouteiller <abouteil@amd.com>

[ROCm/rocshmem commit: 3600291558]
This commit is contained in:
Aurelien Bouteiller
2025-05-15 10:37:12 -04:00
committed by GitHub
parent 17cde51fb7
commit 03a9fac960
3 changed files with 194 additions and 127 deletions
+6 -7
View File
@@ -62,9 +62,9 @@ namespace rocshmem {
#endif
#ifdef DEBUG
#define GPU_DPRINTF(...) \
do { \
gpu_dprintf(__VA_ARGS__); \
#define GPU_DPRINTF(...) \
do { \
gpu_dprintf("WG (%u, %u, %u) TH (%u, %u, %u) " __VA_ARGS__); \
} while (0);
#else
#define GPU_DPRINTF(...) \
@@ -159,10 +159,9 @@ __device__ void gpu_dprintf(const char* fmt, const Args&... args) {
while (atomicCAS(print_lock, 0, 1) == 1) {
}
printf("WG (%u, %u, %u) TH (%u, %u, %u) ", hipBlockIdx_x,
hipBlockIdx_y, hipBlockIdx_z, hipThreadIdx_x, hipThreadIdx_y,
hipThreadIdx_z);
printf(fmt, args...);
printf(fmt, hipBlockIdx_x, hipBlockIdx_y, hipBlockIdx_z,
hipThreadIdx_x, hipThreadIdx_y, hipThreadIdx_z,
args...);
*print_lock = 0;
}