Suggestion: Use llvm 15 instead of Apple clang to compile suite-sparse #4295
Replies: 6 comments 5 replies
-
Hi @pcostanza, thanks for the note. Is using the whole LLVM compiler suite required for this? i.e. can we just use the separately packaged |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for your response. When I tried with installing just libomp, I couldn't make it work. But I don't know if I did anything wrong. With the whole LLVM compiler suite, it worked. |
Beta Was this translation helpful? Give feedback.
-
The description for libomp says the following: 'libomp is keg-only, which means it was not symlinked into /usr/local, For compilers to find libomp you may need to set: When I do that, and then try to make SuiteSparse:GraphBLAS, the output states that it doesn't find OpenMP. I haven't investigated this further from here. With LLVM (now version 16.0.0), I have the following configuration: export LLVM_PATH="/usr/local/opt/llvm/" When I then issue make in the SuiteSparse/GraphBLAS folder, everything goes smoothly. Here is a little test program to check whether SuiteSparse is using OpenMP: #include "GraphBLAS.h" int main(int argc, char **argv) { (Use -lgraphblas.) I hope this helps. Pascal |
Beta Was this translation helpful? Give feedback.
-
There are GraphBLAS benchmarks in https://github.com/GraphBLAS/LAGraph (see https://github.com/GraphBLAS/LAGraph/tree/stable/src/benchmark). |
Beta Was this translation helpful? Give feedback.
-
Ok, I understand, and I apologise for not having provided a more complete answer. There is a paper describing the performance improvements from OpenMP from 2020. See https://people.engr.tamu.edu/davis/publications_files/CSC20_OpenMP_GraphBLAS.pdf - Table 2 in that paper shows significant speedups, depending on algorithm, with up to 30x faster with 40 threads compared to one thread for Triangle Counting. That's why the user guide for SuiteSparse:GraphBLAS (https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/dev/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf) explicitly recommends compiling with OpenMP. See Section 8.1 in the user guide (page 168), where it states the following: "Compiling GraphBLAS without OpenMP is not recommended for installation in a package manager (Linux, conda-forge, spack, brew, vcpkg, etc)." I hope this helps. |
Beta Was this translation helpful? Give feedback.
-
One way to install libomp on Mac seems to be the following:
I haven't tested this myself yet, though. |
Beta Was this translation helpful? Give feedback.
-
Output of
brew config
Output of
brew doctor
Description of issue
It seems that suite-sparse is currently compiled with Apple clang. That leads to a version of suite-sparse that doesn't have OpenMP enabled, so only runs in single-threaded mode. If you compile suite-sparse with llvm 15 (and libomp), as provided by Homebrew, then OpenMP is enabled and can use multiple threads for improved performance. (I verified this with the GraphBLAS library included in suite-sparse.) So my suggestion is to do that.
I hope this is the correct category for making such a suggestion. This is my first time posting here, so apologies if this is inappropriate.
Cheers,
Pascal
Beta Was this translation helpful? Give feedback.
All reactions