/** * Cleans up this topology by finalizing all pending communications. This method must be called * when the topology is not need anymore. */ public void finish() { /* Make sure all send requests have finished before exit. */ if ((pendingSendRequest != null) && !pendingSendRequest.isEmpty()) { Request[] rS = new Request[pendingSendRequest.size()]; rS = pendingSendRequest.keySet().toArray(rS); Request.Waitall(rS); pendingSendRequest.clear(); } /* Make sure all recv requests have finished before exit. The received * objects are ignored and get lost. */ if ((pendingRecvRequest != null) && !pendingRecvRequest.isEmpty()) { Request[] rR = new Request[pendingRecvRequest.size()]; rR = pendingRecvRequest.keySet().toArray(rR); Request.Waitall(rR); pendingRecvRequest.clear(); } }