fix verbose message

This commit is contained in:
quackerd 2022-06-09 23:21:55 +08:00
parent 41586f9ad0
commit f53a24e7eb

View File

@ -35,14 +35,14 @@ topo_alloc_init(struct topo_desc * desc, int verbose)
ret = cpuset_setdomain(CPU_LEVEL_WHICH, CPU_WHICH_TID, tid, sizeof(tmp_domain), &tmp_domain, DOMAINSET_POLICY_PREFER);
if (ret != 0) {
fprintf(stderr, "libnm: cpuset_setdomain failed with %d\n", errno);
fprintf(stderr, "libtopo: cpuset_setdomain failed with %d\n", errno);
return ret;
}
for (unsigned int j = 0; j < ALLOC_MEM_REGION_NUM; j++) {
if ((desc->mem_regions[i][j] = mmap(NULL, ALLOC_MEM_OBJ_NUM * ALLOC_MEM_OBJ_SIZE, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_ALIGNED_SUPER | MAP_NOCORE | MAP_PRIVATE | MAP_NOSYNC, -1, 0)) == MAP_FAILED) {
fprintf(stderr, "libnm: mmap failed with %d\n", errno);
fprintf(stderr, "libtopo: mmap failed with %d\n", errno);
return -1;
}
@ -52,7 +52,7 @@ topo_alloc_init(struct topo_desc * desc, int verbose)
}
if (verbose) {
fprintf(stdout, "libnm: reserved %u bytes (%u MB) on node %d. vaddr: 0x%p\n", ALLOC_MEM_OBJ_NUM * ALLOC_MEM_OBJ_SIZE,
fprintf(stdout, "libtopo: reserved %u bytes (%u MB) on node %d. vaddr: 0x%p\n", ALLOC_MEM_OBJ_NUM * ALLOC_MEM_OBJ_SIZE,
ALLOC_MEM_OBJ_SIZE * ALLOC_MEM_OBJ_NUM / 1024 / 1024,
i, desc->mem_regions[i][j]);
}