Skip to content

Commit 2a2a5ac

Browse files
committed
Add DEBUG prints
1 parent 1b363c4 commit 2a2a5ac

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

.github/workflows/reusable_gpu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ on:
1212
os:
1313
description: A list of OSes
1414
type: string
15-
default: "['Ubuntu', 'Windows']"
15+
default: "['Ubuntu']"
1616
build_type:
1717
description: A list of build types
1818
type: string
19-
default: "['Debug', 'Release']"
19+
default: "['Debug']"
2020
shared_lib:
2121
description: A list of options for building shared library
2222
type: string
@@ -110,7 +110,7 @@ jobs:
110110

111111
- name: Run benchmarks DEBUG
112112
working-directory: ${{env.BUILD_DIR}}
113-
run: UMF_LOG="level:debug;flush:debug;output:stderr;pid:yes" ./benchmark/umf-bench-ubench
113+
run: UMF_LOG="level:info;flush:info;output:stderr;pid:yes" ./benchmark/umf-bench-ubench
114114

115115
- name: Run benchmarks
116116
working-directory: ${{env.BUILD_DIR}}

benchmark/ubench.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ UBENCH_EX(simple, proxy_pool_with_os_memory_provider) {
239239
proxy_pool);
240240
}
241241

242+
fprintf(stderr, ">>> DEBUG 1-A umfPoolDestroy(proxy_pool)\n");
242243
umfPoolDestroy(proxy_pool);
244+
fprintf(stderr, ">>> DEBUG 1-B umfPoolDestroy(proxy_pool)\n");
243245
umfMemoryProviderDestroy(os_memory_provider);
244246
free(array);
245247
}
@@ -322,7 +324,9 @@ UBENCH_EX(simple, disjoint_pool_with_os_memory_provider) {
322324
disjoint_pool);
323325
}
324326

327+
fprintf(stderr, ">>> DEBUG 2-A umfPoolDestroy(disjoint_pool)\n");
325328
umfPoolDestroy(disjoint_pool);
329+
fprintf(stderr, ">>> DEBUG 2-B umfPoolDestroy(disjoint_pool)\n");
326330
umfDisjointPoolParamsDestroy(disjoint_memory_pool_params);
327331
umfMemoryProviderDestroy(os_memory_provider);
328332
free(array);
@@ -369,7 +373,9 @@ UBENCH_EX(simple, jemalloc_pool_with_os_memory_provider) {
369373
jemalloc_pool);
370374
}
371375

376+
fprintf(stderr, ">>> DEBUG 3-A umfPoolDestroy(jemalloc_pool)\n");
372377
umfPoolDestroy(jemalloc_pool);
378+
fprintf(stderr, ">>> DEBUG 3-B umfPoolDestroy(jemalloc_pool)\n");
373379
umfMemoryProviderDestroy(os_memory_provider);
374380
free(array);
375381
}
@@ -415,9 +421,16 @@ UBENCH_EX(simple, scalable_pool_with_os_memory_provider) {
415421
scalable_pool);
416422
}
417423

424+
fprintf(stderr, ">>> DEBUG 4-A umfPoolDestroy(scalable_pool)\n");
418425
umfPoolDestroy(scalable_pool);
426+
fprintf(stderr, ">>> DEBUG 4-B umfPoolDestroy(scalable_pool)\n");
427+
fprintf(stderr,
428+
">>> DEBUG 4-C umfMemoryProviderDestroy(os_memory_provider)\n");
419429
umfMemoryProviderDestroy(os_memory_provider);
430+
fprintf(stderr,
431+
">>> DEBUG 4-D umfMemoryProviderDestroy(os_memory_provider)\n");
420432
free(array);
433+
fprintf(stderr, ">>> DEBUG 4-E free()\n");
421434
}
422435
#endif /* (defined UMF_POOL_SCALABLE_ENABLED) */
423436

@@ -450,31 +463,41 @@ int create_level_zero_params(ze_context_handle_t *context,
450463
uint32_t driver_idx = 0;
451464
ze_driver_handle_t driver = NULL;
452465

466+
fprintf(stderr, ">>> DEBUG L0 %i\n", __LINE__);
453467
int ret = init_level_zero();
468+
fprintf(stderr, ">>> DEBUG L0 %i\n", __LINE__);
454469
if (ret != 0) {
455470
fprintf(stderr, "Failed to init Level 0!\n");
456471
return ret;
457472
}
458473

474+
fprintf(stderr, ">>> DEBUG L0 %i\n", __LINE__);
459475
ret = find_driver_with_gpu(&driver_idx, &driver);
476+
fprintf(stderr, ">>> DEBUG L0 %i\n", __LINE__);
460477
if (ret || driver == NULL) {
461478
fprintf(stderr, "Cannot find L0 driver with GPU device!\n");
462479
return ret;
463480
}
464481

482+
fprintf(stderr, ">>> DEBUG L0 %i\n", __LINE__);
465483
ret = create_context(driver, context);
484+
fprintf(stderr, ">>> DEBUG L0 %i\n", __LINE__);
466485
if (ret != 0) {
467486
fprintf(stderr, "Failed to create L0 context!\n");
468487
return ret;
469488
}
470489

490+
fprintf(stderr, ">>> DEBUG L0 %i\n", __LINE__);
471491
ret = find_gpu_device(driver, device);
492+
fprintf(stderr, ">>> DEBUG L0 %i\n", __LINE__);
472493
if (ret) {
473494
fprintf(stderr, "Cannot find GPU device!\n");
474495
destroy_context(*context);
475496
return ret;
476497
}
477498

499+
fprintf(stderr, ">>> DEBUG L0 %i\n", __LINE__);
500+
478501
return ret;
479502
}
480503

@@ -610,7 +633,9 @@ UBENCH_EX(ipc, disjoint_pool_with_level_zero_provider) {
610633
umfPoolFree(pool, allocs[i].ptr);
611634
}
612635

636+
fprintf(stderr, ">>> DEBUG 5-A umfPoolDestroy(pool)\n");
613637
umfPoolDestroy(pool);
638+
fprintf(stderr, ">>> DEBUG 5-B umfPoolDestroy(pool)\n");
614639

615640
err_params_destroy:
616641
umfDisjointPoolParamsDestroy(disjoint_params);

src/provider/provider_os_memory.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,21 +668,28 @@ static void os_finalize(void *provider) {
668668
os_memory_provider_t *os_provider = provider;
669669

670670
if (os_provider->fd > 0) {
671+
fprintf(stderr, ">>> DEBUG 44-A %i\n", __LINE__);
671672
utils_mutex_destroy_not_free(&os_provider->lock_fd);
672673
}
673674

675+
fprintf(stderr, ">>> DEBUG 44-B %i\n", __LINE__);
674676
critnib_delete(os_provider->fd_offset_map);
675677

678+
fprintf(stderr, ">>> DEBUG 44-C %i\n", __LINE__);
676679
free_bitmaps(os_provider);
677680

678681
if (os_provider->partitions) {
682+
fprintf(stderr, ">>> DEBUG 44-D %i\n", __LINE__);
679683
umf_ba_global_free(os_provider->partitions);
680684
}
681685

682686
if (os_provider->nodeset_str_buf) {
687+
fprintf(stderr, ">>> DEBUG 44-E %i\n", __LINE__);
683688
umf_ba_global_free(os_provider->nodeset_str_buf);
684689
}
690+
fprintf(stderr, ">>> DEBUG 44-F %i\n", __LINE__);
685691
hwloc_topology_destroy(os_provider->topo);
692+
fprintf(stderr, ">>> DEBUG 44-G %i\n", __LINE__);
686693
umf_ba_global_free(os_provider);
687694
}
688695

0 commit comments

Comments
 (0)