You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that HPX assumes that tcmalloc is available, and then complains when running cmake that it is not available. Instead, HPX should check whether tcmalloc is available, and simply not use it if it is not available.
These lines in CMakeLists.txt confirm my suspicion:
{{{
if(NOT HPX_MALLOC)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(HPX_MALLOC "TCMalloc")
else()
set(HPX_MALLOC "system")
endif()
endif()
}}}
My current work-around is to manually specify "system" as allocator. This should not be necessary.
On a side note: Although there is a "tcmalloc" package, this package only provides shared libraries and not the header files, i.e. it cannot be used to build programs. There is no other Ubuntu package that provides tcmalloc.h.
The text was updated successfully, but these errors were encountered:
It is, impossibly to know as a mortal without apt-file or packages.ubuntu.com that the package happens to be libgoogle-perftools-dev on Ubuntu and gperftools-devel on Fedora. Other distros may have it in other places, so I don't know if mentioning it in the error would help or not. I would prefer some sort of human-readable diagnostic as to that using a non-system malloc is strongly recommended, and possibly a mention of the packages for Ubuntu/Fedora, or at the very least that it's typically bundled with Google perftools.
I first configured without specifying any allocator. The error message ("tcmalloc selected, but tcmalloc cannot be used" or similar) made it seems as if HPX had examined my system, found tcmalloc and thus selected it, and later found it to be unusable. I thus suspected a badly installed package on my system, and began to debug this.
Later, I found that HPX first selects tcmalloc, and then checks whether it is actually present. This seemed like a bug in HPX to me, thus this ticket. I set "-DHPX_MALLOC=system" as a work-around for a bug in HPX, and the performance implications were not clear to me at all.
Even later I find that this is all done on purpose. I recommend a few things:
(1) Add a comment to the code where tcmalloc is (unconditionally) selected for Linux, such as:
"On Linux, the system allocator has a bad performance for multi-threaded applications. We thus use tcmalloc by default. If tcmalloc is not present, this will fail. It is intentional that overriding this default requires an explicit "-DHPX_ALLOC=system" when configuring, so that the user knows about these performance implications.
(2) Be more clear in the error message. Unfortunately, you don't know at this point whether the user selected tcmalloc, or whether HPX selected tcmalloc. You want different error messages in both cases. If the user selected tcmalloc, then the current error message is fine. If HPX chose tcmalloc as default, then you want to output a message that (a) explains this choice of default, (b) explains the performance implications, and (c) describes the work-around if tcmalloc and friends are not available (-DHPX_ALLOC=system).
I am using HPX on Ubuntu 12.10.
It seems that HPX assumes that tcmalloc is available, and then complains when running cmake that it is not available. Instead, HPX should check whether tcmalloc is available, and simply not use it if it is not available.
These lines in CMakeLists.txt confirm my suspicion:
{{{
if(NOT HPX_MALLOC)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(HPX_MALLOC "TCMalloc")
else()
set(HPX_MALLOC "system")
endif()
endif()
}}}
My current work-around is to manually specify "system" as allocator. This should not be necessary.
On a side note: Although there is a "tcmalloc" package, this package only provides shared libraries and not the header files, i.e. it cannot be used to build programs. There is no other Ubuntu package that provides tcmalloc.h.
The text was updated successfully, but these errors were encountered: