unrecieved Isend in balance function
there is a bug in the balance function where if it is used before another function which uses isend and recv then the recv in the second function will fail. the solution to this is to move the line with `send_amt = if else...`  outside of the if loop
diff --git a/heat/core/dndarray.py b/heat/core/dndarray.py
index 20af23cf..8ba52f29 100644
--- a/heat/core/dndarray.py
+++ b/heat/core/dndarray.py
@@ -553,8 +553,8 @@ class DNDarray:
                 if self.comm.rank == spr:
                     for pr in range(spr):
                         send_amt = abs((chunk_map[pr, self.split] - lshape_map[pr, self.split]).item())
+                        send_amt = send_amt if send_amt < self.lshape[self.split] else self.lshape[self.split]
                         if send_amt:
-                            send_amt = send_amt if send_amt < self.lshape[self.split] else self.lshape[self.split]
                             send_slice[self.split] = slice(0, send_amt)
                             keep_slice[self.split] = slice(send_amt, self.lshape[self.split])
 
@@ -592,8 +592,8 @@ class DNDarray:
             if self.comm.rank == spr:
                 for pr in range(self.comm.size - 1, spr, -1):
                     send_amt = abs((chunk_map[pr, self.split] - lshape_map[pr, self.split]).item())
+                    send_amt = send_amt if send_amt < self.lshape[self.split] else self.lshape[self.split]
                     if send_amt:
-                        send_amt = send_amt if send_amt < self.lshape[self.split] else self.lshape[self.split]
                         send_slice[self.split] = slice(self.lshape[self.split] - send_amt, self.lshape[self.split])
                         keep_slice[self.split] = slice(0, self.lshape[self.split] - send_amt)
 
['heat/core/dndarray.py']