Hi, I am trying to optimize my Quick Sort by implementing concurrency/parallel. So far I can do the Recursive part in parallel (Sort the 1st and 2nd half after partition). But I am not able to implement the Partition function to use parallel.

Here is my current sequential partition method:

```
fn partition<T: PartialOrd>(v: &mut [T]) -> usize {
let pivot = v.len() - 1;
let mut i = 0;
for j in 0..pivot {
if v[j] <= v[pivot] {
v.swap(i, j);
i += 1;
}
}
v.swap(i, pivot);
i
}
```

I have researched online and many sites found that the only way is to use Prefix Sum, but I am struggling to apply here in Rust.

The best solution should do Parallel recursive calls, and Parallel partition. Could you advise?