Skip to content

Commit

Permalink
Merge pull request #575 from bosilca/topic/fix_race_condition_in_cand…
Browse files Browse the repository at this point in the history
…idate_selection

Prevent race condition in accelerator copies management
  • Loading branch information
bosilca authored Oct 19, 2023
2 parents 750b3c4 + f69460c commit 7eba1f4
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 85 deletions.
6 changes: 2 additions & 4 deletions parsec/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ int parsec_data_start_transfer_ownership_to_copy(parsec_data_t* data,

copy = data->device_copies[device];
assert( NULL != copy );

PARSEC_DEBUG_VERBOSE(10, parsec_debug_output,
"DEV[%d]: start transfer ownership of data %p to copy %p in mode %d",
device, data, copy, access_mode);

switch( copy->coherency_state ) {
case PARSEC_DATA_COHERENCY_INVALID:
transfer_required = 1;
Expand Down Expand Up @@ -415,8 +415,6 @@ int parsec_data_start_transfer_ownership_to_copy(parsec_data_t* data,
}
}

assert( (!transfer_required) || (data->device_copies[valid_copy]->version >= copy->version) );

if( PARSEC_FLOW_ACCESS_READ & access_mode ) {
copy->readers++;
}
Expand Down
Loading

0 comments on commit 7eba1f4

Please sign in to comment.