I think you can do this, just a modification to the sequence. You don't need to store any thing but the variable you are sorting withnYou do not need to know the range of variables ... X position is enough . Store this in F_UDMI 0nin F_UDMI 1, store integers from 0 to N-1nCall the sorting function by HOST or by NODE 0 only .. You need to sort F_UDMI 1 only according to F_UDMI 0 ... i.e, the lower x in F_UDMI 0 should correspond to 0 in F_UDMI 1 ... the largest x, should have N-1 in F_UDMI 1nNow you are ready to move the nodes, But instead of looping over faces, F_UDMI 1 is the index. Loop over 0 to N-1 and recall each face. You can read the y-position if you need it in the calculation, and enter the new position of the face.nDon't forget to declare 2 F_UDMI before compiling. nSearch GitHub for C++ sorting functions, you might find something ready. n