|
| 1 | +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ |
1 | 2 | /* |
2 | 3 | * Copyright (c) 2011-2015 The University of Tennessee and The University |
3 | 4 | * of Tennessee Research Foundation. All rights |
|
7 | 8 | * Copyright (c) 2015 Intel, Inc. All rights reserved |
8 | 9 | * Copyright (c) 2015 Research Organization for Information Science |
9 | 10 | * and Technology (RIST). All rights reserved. |
| 11 | + * Copyright (c) 2016 Los Alamos National Security, LLC. All rights |
| 12 | + * reserved. |
10 | 13 | * $COPYRIGHT$ |
11 | 14 | * |
12 | 15 | * Additional copyrights may follow |
|
31 | 34 | #include "opal/mca/pmix/pmix.h" |
32 | 35 |
|
33 | 36 | #define ERR_EXIT(ERR) \ |
34 | | - do { free(local_pattern); \ |
| 37 | + do { \ |
| 38 | + free (nodes_roots); \ |
| 39 | + free (local_procs); \ |
| 40 | + free (tracker); \ |
| 41 | + free (colors); \ |
| 42 | + free(local_pattern); \ |
35 | 43 | return (ERR); } \ |
36 | 44 | while(0); |
37 | 45 |
|
@@ -70,12 +78,20 @@ static int check_oversubscribing(int rank, |
70 | 78 | oversub[0] = local_oversub; |
71 | 79 | for(i = 1; i < num_nodes; i++) |
72 | 80 | if (OMPI_SUCCESS != ( err = MCA_PML_CALL(irecv(&oversub[i], 1, MPI_INT, |
73 | | - nodes_roots[i], 111, comm_old, &reqs[i-1])))) |
| 81 | + nodes_roots[i], 111, comm_old, &reqs[i-1])))) { |
| 82 | + /* NTH: more needs to be done to correctly clean up here */ |
| 83 | + free (reqs); |
| 84 | + free (oversub); |
74 | 85 | return err; |
| 86 | + } |
75 | 87 |
|
76 | 88 | if (OMPI_SUCCESS != ( err = ompi_request_wait_all(num_nodes-1, |
77 | | - reqs, MPI_STATUSES_IGNORE))) |
| 89 | + reqs, MPI_STATUSES_IGNORE))) { |
| 90 | + /* NTH: more needs to be done to correctly clean up here */ |
| 91 | + free (reqs); |
| 92 | + free (oversub); |
78 | 93 | return err; |
| 94 | + } |
79 | 95 |
|
80 | 96 | for(i = 0; i < num_nodes; i++) |
81 | 97 | oversubscribed += oversub[i]; |
|
0 commit comments