My code tries to compute some values at each grid point

```
for i,j in ti.ndrange(nx, ny):
value = computation(i,j)
```

and I want to get the maximum of these values. My code is

```
maximum = 0.0
for i,j in ti.ndrange(nx, ny):
value = computation(i,j)
maximum = ti.max(maximum,value)
```

But it does not give me the right answer, I suspect this is because the loop is parallel.