xiaoyeli / superlu_dist

Distributed memory, MPI based SuperLU
https://portal.nersc.gov/project/sparse/superlu/
Other
186 stars 64 forks source link

Skip cublas initialisation when GPU offloading is disabled at runtime (i.e., SUPERLU_ACC_OFFLOAD=0) #123

Closed jamtrott closed 1 year ago

jamtrott commented 1 year ago

This commit fixes a minor issue with pddrive when GPU offloading is disabled at runtime (i.e., SUPERLU_ACC_OFFLOAD=0) by skipping the initialisation of cublas. Otherwise, this could lead to an error or hang in cublasDestroy. (I observed this issue when running on CPU-only nodes of NERSC's Perlmutter with a version of SuperLU_dist that is built with GPU support enabled.)

The fix is simply to check the environment variable SUPERLU_ACC_OFFLOAD before initialising cublas.