pub fn check_replace_conflicts<S: State>(
superstep_result: &SuperstepResult<S>,
replace_fields: &[usize],
) -> Result<(), JunctureError>Expand description
Check for replace conflicts in superstep results
For fields using ReplaceReducer, only one node is allowed to write
to that field in a single superstep. This function detects violations
of that constraint.
§Arguments
superstep_result- Results from the completed superstepreplace_fields- Field indices that useReplaceReducer
§Returns
Ok(())if no conflictsErr(JunctureError::Execution)if conflicts exist
§Errors
Returns an error if multiple nodes wrote to the same replace field.
§Examples
ⓘ
use juncture_core::pregel::scheduler::check_replace_conflicts;
let replace_fields = vec![0, 2]; // fields 0 and 2 use ReplaceReducer
check_replace_conflicts(&superstep_result, &replace_fields)?;