Skip to content

Commit

Permalink
Fix final set of warnings ready for v2.4.0 (#274)
Browse files Browse the repository at this point in the history
* Fixed missing detail in changelog and fixed warning.
* Fixed unreachable code warning.
* Tweaking changelog.
* Fixed some unused variable warnings.
* Fixed ifdef for USE_CUDAMALLOCASYNC
  • Loading branch information
mattmartineau committed Oct 25, 2023
1 parent 02234ad commit 2b4762f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ Changes:
- Fixed issue with exact_coarse_solve grid sizing
- Fixed issue with use_sum_stopping_criteria
- Fixed SIGFPE that could occur when the initial norm is 0
- Added a new API call AMGX_matrix_check_symmetry, that tests if a matrix is structurally or completely symmetric

Tested configurations:

Linux x86-64:
-- Ubuntu 20.04, Ubuntu 22.04
-- NVHPC 23.7, GCC 9.4.0, GCC 12.1
-- OpenMPI 4.0.x
-- CUDA 11.2, 11.8, 12.2
-- A100, H100

Note that while AMGX has support for building in Windows, testing on Windows is very limited.

===============================================================

Expand Down Expand Up @@ -103,4 +115,4 @@ v2.0.0 - 2017.10.17

---------------------------------------------------------------

Initial open source release
Initial open source release
4 changes: 2 additions & 2 deletions examples/amgx_mpi_capi_cla.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ int main(int argc, char **argv)
int major, minor;
char *ver, *date, *time;
//input matrix and rhs/solution
int n, nnz, block_dimx, block_dimy, block_size, num_neighbors;
int *row_ptrs = NULL, *neighbors = NULL;
int n, nnz, block_dimx, block_dimy, block_size;
int *row_ptrs = NULL;
void *col_indices = NULL;
void *values = NULL, *diag = NULL, *dh_x = NULL, *dh_b = NULL;
int *h_row_ptrs = NULL;
Expand Down
2 changes: 1 addition & 1 deletion include/global_thread_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class MemoryPool
//Mutex added to fix ICE threadsafe issue
std::mutex m_mutex2;

#ifndef USE_CUDAMALLOCASYNC
#ifdef USE_CUDAMALLOCASYNC
cudaMemPool_t m_mem_pool;
#endif

Expand Down
6 changes: 1 addition & 5 deletions src/aggregation/aggregation_amg_level.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2386,11 +2386,7 @@ void Aggregation_AMG_Level_Base<T_Config>::consolidateCoarseGridMatrix()
Matrix<TConfig> &A = this->getA();
Matrix<TConfig> &Ac = this->getNextLevel( MemorySpace( ) )->getA();

int num_parts, num_fine_neighbors, my_id;

num_parts = A.manager->getComms()->get_num_partitions();
num_fine_neighbors = A.manager->neighbors.size();
my_id = A.manager->global_id();
int my_id = A.manager->global_id();

IVector_h &destination_part = A.manager->getDestinationPartitions();
int my_destination_part = A.manager->getMyDestinationPartition();
Expand Down
8 changes: 4 additions & 4 deletions src/distributed/comms_mpi_hostbuffer_stream.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1427,25 +1427,25 @@ void CommsMPIHostBufferStream<T_Config>::recv_vector_wait_all(HZVector &a) { rec
template <class T_Config>
int CommsMPIHostBufferStream<T_Config>::get_num_partitions()
{
int total = 0;
#ifdef AMGX_WITH_MPI
int total = 0;
MPI_Comm_size( mpi_comm, &total );
return total;
#else
FatalError("MPI Comms module requires compiling with MPI", AMGX_ERR_NOT_IMPLEMENTED);
#endif
return total;
}

template <class T_Config>
int CommsMPIHostBufferStream<T_Config>::get_global_id()
{
int rank = 0;
#ifdef AMGX_WITH_MPI
int rank = 0;
MPI_Comm_rank( mpi_comm, &rank);
return rank;
#else
FatalError("MPI Comms module requires compiling with MPI", AMGX_ERR_NOT_IMPLEMENTED);
#endif
return rank;
}


Expand Down
6 changes: 3 additions & 3 deletions src/global_thread_handle.cu
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ MemoryPool::MemoryPool(size_t max_block_size, size_t page_size, size_t max_size)
{
//initializeCriticalSection(&m_mutex2);

#ifndef USE_CUDAMALLOCASYNC
#ifdef USE_CUDAMALLOCASYNC
int device;
cudaGetDevice(&device);
cudaDeviceGetMemPool(&m_mem_pool, device);
Expand Down Expand Up @@ -846,7 +846,7 @@ cudaError_t cudaFreeHost(void *ptr)

cudaError_t cudaMallocAsync(void **ptr, size_t size, cudaStream_t stream)
{
#ifndef USE_CUDAMALLOCASYNC
#ifdef USE_CUDAMALLOCASYNC

return ::cudaMallocAsync(ptr, size, stream);

Expand Down Expand Up @@ -961,7 +961,7 @@ cudaError_t cudaMallocAsync(void **ptr, size_t size, cudaStream_t stream)

cudaError_t cudaFreeAsync(void *ptr, cudaStream_t stream)
{
#ifndef USE_CUDAMALLOCASYNC
#ifdef USE_CUDAMALLOCASYNC

return ::cudaFreeAsync(ptr, stream);

Expand Down
1 change: 0 additions & 1 deletion src/matrix.cu
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ Matrix< TemplateConfig<AMGX_host, t_vecPrec, t_matPrec, t_indPrec> >::print(char
fprintf(fid, "%d %d %d\n", this->get_num_rows() * this->get_block_dimx(), this->get_num_cols() * this->get_block_dimy(), tnnz);

auto trafI = [&](auto const &I, auto const &i) { return I * this->get_block_dimy() + i + 1; };
auto trafJ = [&](auto const &J, auto const &j) { return J * this->get_block_dimx() + j + 1; };

for (i = printRowsStart; i < printRowsEnd; i++)
{
Expand Down

0 comments on commit 2b4762f

Please sign in to comment.