diff --git a/src/dbt/dbt_reshape_ops.F b/src/dbt/dbt_reshape_ops.F index bc267f9611..52b1bb41f5 100644 --- a/src/dbt/dbt_reshape_ops.F +++ b/src/dbt/dbt_reshape_ops.F @@ -208,11 +208,17 @@ SUBROUTINE dbt_reshape(tensor_in, tensor_out, summation, move_data) END DO !$OMP END DO END DO -!$OMP END PARALLEL +!$OMP DO DO iproc = 0, numnodes - 1 DEALLOCATE (buffer_recv(iproc)%blocks, buffer_recv(iproc)%data) END DO +!$OMP END DO +!$OMP END PARALLEL + + DEALLOCATE (nblks_recv_total, ndata_recv_total) + DEALLOCATE (nblks_send_total, ndata_send_total) + DEALLOCATE (buffer_send, buffer_recv) IF (move_prv) CALL dbt_clear(tensor_in)