forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 146
Closed
Labels
GPU & DCU & HPCGPU and DCU and HPC related any issuesGPU and DCU and HPC related any issues
Description
Describe the Code Quality Issue
Look! I have found yet another blas in our code, that is my_math.
When I try to import into source/module_hsolver/genelpa/elpa_new_complex.cpp
#include "module_base/global_function.h" // TO_STRING
#include "module_base/tool_quit.h" // WARNNING_QUITto pop warning and quit for failed decomposition, compilation errors popped and reminded me that
error: conflicting declaration of C function ‘void dcopy_(const long int*, const double*, const int*, double*, const int*)’
27 | void dcopy_(long const *n, const double *a, int const *incx, double *b, int const *incy);
| ^~~~~~dcopy and suchlike defined in source/module_hsolver/genelpa/my_math.hpp and source/module_base/blas_connector.h confilct with each other.
- I need to import
TO_STRINGutility to an integer return value into string, while thismodule_base/global_function.hcontaining it includesblas_connector.hto providezcopy,dcopyetc. - This genelpa folder has its own math, called
my_math(with itsblas):
➜ genelpa ✗ ls
blas.h CMakeLists.txt elpa_new_complex.cpp elpa_new.h elpa_solver.h pblas.h scalapack.h utils.h
Cblacs.h elpa_generic.hpp elpa_new.cpp elpa_new_real.cpp my_math.hpp README utils.cpp// source/module_hsolver/genelpa/my_math.hpp
{
#include "Cblacs.h"
#include "blas.h"
#include "pblas.h"
#include "scalapack.h"
}More and more blas-like headers. Local blas.
These blas confilct with each other.
For the welfare of developers, I proposed to eliminate this terrible presence from the codebase.
Additional Context
No response
Task list for Issue attackers (only for developers)
- Identify the specific code file or section with the code quality issue.
- Investigate the issue and determine the root cause.
- Research best practices and potential solutions for the identified issue.
- Refactor the code to improve code quality, following the suggested solution.
- Ensure the refactored code adheres to the project's coding standards.
- Test the refactored code to ensure it functions as expected.
- Update any relevant documentation, if necessary.
- Submit a pull request with the refactored code and a description of the changes made.
Metadata
Metadata
Assignees
Labels
GPU & DCU & HPCGPU and DCU and HPC related any issuesGPU and DCU and HPC related any issues