Skip to content

Commit d093957

Browse files
authored
Merge pull request #1416 from jakobj/fix/impossible-condition-in-collocate
Fix misuse of outdated variable that led to an impossible condition
2 parents 1c231da + 9049dbf commit d093957

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

nestkernel/event_delivery_manager.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ EventDeliveryManager::collocate_target_data_buffers_( const thread tid,
649649
const AssignedRanks& assigned_ranks,
650650
SendBufferPosition& send_buffer_position )
651651
{
652-
unsigned int num_target_data_written = 0;
653652
thread source_rank;
654653
TargetData next_target_data;
655654
bool valid_next_target_data;
@@ -679,7 +678,7 @@ EventDeliveryManager::collocate_target_data_buffers_( const thread tid,
679678
tid, assigned_ranks.begin, assigned_ranks.end, source_rank, next_target_data );
680679
if ( valid_next_target_data ) // add valid entry to MPI buffer
681680
{
682-
if ( send_buffer_position.idx( source_rank ) == send_buffer_position.end( source_rank ) )
681+
if ( send_buffer_position.is_chunk_filled( source_rank ) )
683682
{
684683
// entry does not fit in this part of the MPI buffer any more,
685684
// so we need to reject it
@@ -691,8 +690,7 @@ EventDeliveryManager::collocate_target_data_buffers_( const thread tid,
691690
// we have just rejected an entry, so source table can not be
692691
// fully read
693692
is_source_table_read = false;
694-
if ( num_target_data_written
695-
== ( send_buffer_position.send_recv_count_per_rank * assigned_ranks.size ) ) // buffer is full
693+
if ( send_buffer_position.are_all_chunks_filled() ) // buffer is full
696694
{
697695
return is_source_table_read;
698696
}

0 commit comments

Comments
 (0)