order issue in sychronizing MPI-2 one sided communication
问题 I am learning MPI-2 and trying to implement the first simple functionality using MPI-2 one-sided-communication: Have process 0 host one array of fixed size data_size . Each process (including 0) will generate an array and compare with the host array: If the first element of the generated array is smaller than that of the host array, replace the host array with the generated one. In code: vector<int> v1 = {rank,rank+1,rank+2}; v = get_vec(vec); if (v1[0] < v[0]) put_vec(vec,v1); The complete