Skip to content

Commit

Permalink
Merge pull request #3133 from heplesser/fix-gcc12-warnings
Browse files Browse the repository at this point in the history
Fix warnings issued by gcc 12.3
  • Loading branch information
heplesser authored Mar 6, 2024
2 parents 5639572 + fc83ed7 commit f11a1fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions nestkernel/mpi_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ nest::MPIManager::communicate_Allgather( std::vector< unsigned int >& send_buffe
int disp = 0;
unsigned int max_recv_count = send_buffer_size_;
bool overflow = false;
for ( int pid = 0; pid < get_num_processes(); ++pid )
for ( size_t pid = 0; pid < get_num_processes(); ++pid )
{
unsigned int block_disp = pid * send_buffer_size_;
displacements[ pid ] = disp;
Expand Down Expand Up @@ -470,7 +470,7 @@ nest::MPIManager::communicate_Allgather( std::vector< T >& send_buffer,
int disp = 0;
unsigned int max_recv_count = send_buffer_size_;
bool overflow = false;
for ( int pid = 0; pid < get_num_processes(); ++pid )
for ( size_t pid = 0; pid < get_num_processes(); ++pid )
{
unsigned int block_disp = pid * send_buffer_size_;
displacements[ pid ] = disp;
Expand Down Expand Up @@ -560,7 +560,7 @@ nest::MPIManager::communicate_Allgather( std::vector< OffGridSpike >& send_buffe
int disp = 0;
unsigned int max_recv_count = send_buffer_size_;
bool overflow = false;
for ( int pid = 0; pid < get_num_processes(); ++pid )
for ( size_t pid = 0; pid < get_num_processes(); ++pid )
{
unsigned int block_disp = pid * send_buffer_size_;
displacements[ pid ] = disp;
Expand Down Expand Up @@ -604,7 +604,7 @@ nest::MPIManager::communicate( std::vector< double >& send_buffer,
communicate( n_nodes );
// Set up displacements vector.
displacements.resize( get_num_processes(), 0 );
for ( int i = 1; i < get_num_processes(); ++i )
for ( size_t i = 1; i < get_num_processes(); ++i )
{
displacements.at( i ) = displacements.at( i - 1 ) + n_nodes.at( i - 1 );
}
Expand Down Expand Up @@ -864,7 +864,7 @@ nest::MPIManager::time_communicatev( int num_bytes, int samples )
std::vector< int > n_nodes( get_num_processes(), packet_length );
std::vector< int > displacements( get_num_processes(), 0 );

for ( int i = 1; i < get_num_processes(); ++i )
for ( size_t i = 1; i < get_num_processes(); ++i )
{
displacements.at( i ) = displacements.at( i - 1 ) + n_nodes.at( i - 1 );
}
Expand Down Expand Up @@ -963,7 +963,7 @@ nest::MPIManager::time_communicate_alltoallv( int num_bytes, int samples )
std::vector< int > n_nodes( get_num_processes(), packet_length );
std::vector< int > displacements( get_num_processes(), 0 );

for ( int i = 1; i < get_num_processes(); ++i )
for ( size_t i = 1; i < get_num_processes(); ++i )
{
displacements.at( i ) = displacements.at( i - 1 ) + n_nodes.at( i - 1 );
}
Expand Down
3 changes: 2 additions & 1 deletion nestkernel/vp_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ inline void
nest::VPManager::assert_thread_parallel() const
{
#ifdef _OPENMP
assert( omp_get_num_threads() == n_threads_ );
// omp_get_num_threads() returns int
assert( omp_get_num_threads() == static_cast< int >( n_threads_ ) );
#endif
}

Expand Down

0 comments on commit f11a1fa

Please sign in to comment.