@@ -649,7 +649,6 @@ EventDeliveryManager::collocate_target_data_buffers_( const thread tid,
649
649
const AssignedRanks& assigned_ranks,
650
650
SendBufferPosition& send_buffer_position )
651
651
{
652
- unsigned int num_target_data_written = 0 ;
653
652
thread source_rank;
654
653
TargetData next_target_data;
655
654
bool valid_next_target_data;
@@ -679,7 +678,7 @@ EventDeliveryManager::collocate_target_data_buffers_( const thread tid,
679
678
tid, assigned_ranks.begin , assigned_ranks.end , source_rank, next_target_data );
680
679
if ( valid_next_target_data ) // add valid entry to MPI buffer
681
680
{
682
- if ( send_buffer_position.idx ( source_rank ) == send_buffer_position. end ( source_rank ) )
681
+ if ( send_buffer_position.is_chunk_filled ( source_rank ) )
683
682
{
684
683
// entry does not fit in this part of the MPI buffer any more,
685
684
// so we need to reject it
@@ -691,8 +690,7 @@ EventDeliveryManager::collocate_target_data_buffers_( const thread tid,
691
690
// we have just rejected an entry, so source table can not be
692
691
// fully read
693
692
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
696
694
{
697
695
return is_source_table_read;
698
696
}
0 commit comments