Skip to content

Commit 2b4762f

Browse files
Fix final set of warnings ready for v2.4.0 (#274)
* Fixed missing detail in changelog and fixed warning. * Fixed unreachable code warning. * Tweaking changelog. * Fixed some unused variable warnings. * Fixed ifdef for USE_CUDAMALLOCASYNC
1 parent 02234ad commit 2b4762f

File tree

7 files changed

+24
-17
lines changed

7 files changed

+24
-17
lines changed

CHANGELOG

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ Changes:
3131
- Fixed issue with exact_coarse_solve grid sizing
3232
- Fixed issue with use_sum_stopping_criteria
3333
- Fixed SIGFPE that could occur when the initial norm is 0
34+
- Added a new API call AMGX_matrix_check_symmetry, that tests if a matrix is structurally or completely symmetric
35+
36+
Tested configurations:
37+
38+
Linux x86-64:
39+
-- Ubuntu 20.04, Ubuntu 22.04
40+
-- NVHPC 23.7, GCC 9.4.0, GCC 12.1
41+
-- OpenMPI 4.0.x
42+
-- CUDA 11.2, 11.8, 12.2
43+
-- A100, H100
44+
45+
Note that while AMGX has support for building in Windows, testing on Windows is very limited.
3446

3547
===============================================================
3648

@@ -103,4 +115,4 @@ v2.0.0 - 2017.10.17
103115

104116
---------------------------------------------------------------
105117

106-
Initial open source release
118+
Initial open source release

examples/amgx_mpi_capi_cla.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ int main(int argc, char **argv)
166166
int major, minor;
167167
char *ver, *date, *time;
168168
//input matrix and rhs/solution
169-
int n, nnz, block_dimx, block_dimy, block_size, num_neighbors;
170-
int *row_ptrs = NULL, *neighbors = NULL;
169+
int n, nnz, block_dimx, block_dimy, block_size;
170+
int *row_ptrs = NULL;
171171
void *col_indices = NULL;
172172
void *values = NULL, *diag = NULL, *dh_x = NULL, *dh_b = NULL;
173173
int *h_row_ptrs = NULL;

include/global_thread_handle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class MemoryPool
141141
//Mutex added to fix ICE threadsafe issue
142142
std::mutex m_mutex2;
143143

144-
#ifndef USE_CUDAMALLOCASYNC
144+
#ifdef USE_CUDAMALLOCASYNC
145145
cudaMemPool_t m_mem_pool;
146146
#endif
147147

src/aggregation/aggregation_amg_level.cu

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,11 +2386,7 @@ void Aggregation_AMG_Level_Base<T_Config>::consolidateCoarseGridMatrix()
23862386
Matrix<TConfig> &A = this->getA();
23872387
Matrix<TConfig> &Ac = this->getNextLevel( MemorySpace( ) )->getA();
23882388

2389-
int num_parts, num_fine_neighbors, my_id;
2390-
2391-
num_parts = A.manager->getComms()->get_num_partitions();
2392-
num_fine_neighbors = A.manager->neighbors.size();
2393-
my_id = A.manager->global_id();
2389+
int my_id = A.manager->global_id();
23942390

23952391
IVector_h &destination_part = A.manager->getDestinationPartitions();
23962392
int my_destination_part = A.manager->getMyDestinationPartition();

src/distributed/comms_mpi_hostbuffer_stream.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,25 +1427,25 @@ void CommsMPIHostBufferStream<T_Config>::recv_vector_wait_all(HZVector &a) { rec
14271427
template <class T_Config>
14281428
int CommsMPIHostBufferStream<T_Config>::get_num_partitions()
14291429
{
1430-
int total = 0;
14311430
#ifdef AMGX_WITH_MPI
1431+
int total = 0;
14321432
MPI_Comm_size( mpi_comm, &total );
1433+
return total;
14331434
#else
14341435
FatalError("MPI Comms module requires compiling with MPI", AMGX_ERR_NOT_IMPLEMENTED);
14351436
#endif
1436-
return total;
14371437
}
14381438

14391439
template <class T_Config>
14401440
int CommsMPIHostBufferStream<T_Config>::get_global_id()
14411441
{
1442-
int rank = 0;
14431442
#ifdef AMGX_WITH_MPI
1443+
int rank = 0;
14441444
MPI_Comm_rank( mpi_comm, &rank);
1445+
return rank;
14451446
#else
14461447
FatalError("MPI Comms module requires compiling with MPI", AMGX_ERR_NOT_IMPLEMENTED);
14471448
#endif
1448-
return rank;
14491449
}
14501450

14511451

src/global_thread_handle.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ MemoryPool::MemoryPool(size_t max_block_size, size_t page_size, size_t max_size)
8383
{
8484
//initializeCriticalSection(&m_mutex2);
8585

86-
#ifndef USE_CUDAMALLOCASYNC
86+
#ifdef USE_CUDAMALLOCASYNC
8787
int device;
8888
cudaGetDevice(&device);
8989
cudaDeviceGetMemPool(&m_mem_pool, device);
@@ -846,7 +846,7 @@ cudaError_t cudaFreeHost(void *ptr)
846846

847847
cudaError_t cudaMallocAsync(void **ptr, size_t size, cudaStream_t stream)
848848
{
849-
#ifndef USE_CUDAMALLOCASYNC
849+
#ifdef USE_CUDAMALLOCASYNC
850850

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

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

962962
cudaError_t cudaFreeAsync(void *ptr, cudaStream_t stream)
963963
{
964-
#ifndef USE_CUDAMALLOCASYNC
964+
#ifdef USE_CUDAMALLOCASYNC
965965

966966
return ::cudaFreeAsync(ptr, stream);
967967

src/matrix.cu

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ Matrix< TemplateConfig<AMGX_host, t_vecPrec, t_matPrec, t_indPrec> >::print(char
415415
fprintf(fid, "%d %d %d\n", this->get_num_rows() * this->get_block_dimx(), this->get_num_cols() * this->get_block_dimy(), tnnz);
416416

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

420419
for (i = printRowsStart; i < printRowsEnd; i++)
421420
{

0 commit comments

Comments
 (0)