1
1

George identified some memory leaks and inconsistencies in the F77 API

when sizeof(int) != sizeof(MPI_Fint).  This commit should fix those
problems. 

This commit was SVN r24921.
Этот коммит содержится в:
Jeff Squyres 2011-07-22 19:49:27 +00:00
родитель 3f0d13efe2
Коммит bd96d028de
12 изменённых файлов: 31 добавлений и 10 удалений

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -72,5 +73,7 @@ void mpi_cart_coords_f(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims,
OMPI_ARRAY_NAME_CONVERT(coords)));
if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) {
OMPI_ARRAY_INT_2_FINT(coords, OMPI_FINT_2_INT(*maxdims));
} else {
OMPI_ARRAY_FINT_2_INT_CLEANUP(coords);
}
}

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -86,5 +87,4 @@ void mpi_cart_create_f(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims,
*/
OMPI_ARRAY_FINT_2_INT_CLEANUP(dims);
OMPI_ARRAY_INT_2_LOGICAL(periods, size);
OMPI_ARRAY_LOGICAL_2_INT_CLEANUP(periods);
}

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -82,5 +83,4 @@ void mpi_cart_get_f(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims,
OMPI_ARRAY_INT_2_FINT(dims, size);
OMPI_ARRAY_INT_2_LOGICAL(periods, size);
OMPI_ARRAY_INT_2_FINT(coords, size);
OMPI_ARRAY_LOGICAL_2_INT_CLEANUP(periods);
}

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -80,6 +81,5 @@ void mpi_cart_map_f(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims,
OMPI_ARRAY_FINT_2_INT_CLEANUP(dims);
OMPI_ARRAY_INT_2_LOGICAL(periods, size);
OMPI_ARRAY_LOGICAL_2_INT_CLEANUP(periods);
OMPI_SINGLE_INT_2_FINT(newrank);
}

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -90,5 +91,4 @@ void mpi_cart_sub_f(MPI_Fint *comm, ompi_fortran_logical_t *remain_dims,
}
OMPI_ARRAY_INT_2_LOGICAL(remain_dims, ndims);
OMPI_ARRAY_LOGICAL_2_INT_CLEANUP(remain_dims);
}

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -110,6 +110,8 @@ void mpi_comm_spawn_f(char *command, char *argv, MPI_Fint *maxprocs,
}
if (!OMPI_IS_FORTRAN_ERRCODES_IGNORE(array_of_errcodes)) {
OMPI_ARRAY_INT_2_FINT(array_of_errcodes, size);
} else {
OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_errcodes);
}
}

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -128,6 +128,8 @@ void mpi_comm_spawn_multiple_f(MPI_Fint *count, char *array_commands,
if (!OMPI_IS_FORTRAN_ERRCODES_IGNORE(array_errcds)) {
OMPI_ARRAY_INT_2_FINT(array_errcds, size);
} else {
OMPI_ARRAY_FINT_2_INT_CLEANUP(array_errcds);
}
OMPI_ARRAY_FINT_2_INT_CLEANUP(array_maxprocs);

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -69,5 +70,7 @@ void mpi_dims_create_f(MPI_Fint *nnodes, MPI_Fint *ndims,
OMPI_ARRAY_NAME_CONVERT(dims)));
if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) {
OMPI_ARRAY_INT_2_FINT(dims, *ndims);
} else {
OMPI_ARRAY_FINT_2_INT_CLEANUP(dims);
}
}

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -189,8 +190,8 @@
while (--converted_n >= 0) { \
in[converted_n]=OMPI_INT_2_LOGICAL(OMPI_LOGICAL_ARRAY_NAME_CONVERT(in)[converted_n]); \
} \
} while (0) \
/* free(OMPI_LOGICAL_ARRAY_NAME_CONVERT(in)) * No Need to free, here */
free(OMPI_LOGICAL_ARRAY_NAME_CONVERT(in)); \
} while (0)
# endif
#else
@ -229,8 +230,8 @@
while (--converted_n >= 0) { \
in[converted_n]=OMPI_INT_2_LOGICAL(OMPI_LOGICAL_ARRAY_NAME_CONVERT(in)[converted_n]); \
} \
} while (0) \
/* free(OMPI_LOGICAL_ARRAY_NAME_CONVERT(in)) * No Need to free, here */
free(OMPI_LOGICAL_ARRAY_NAME_CONVERT(in)); \
} while (0)
#endif /* OMPI_SIZEOF_FORTRAN_LOGICAL */

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -77,5 +78,8 @@ void mpi_graph_get_f(MPI_Fint *comm, MPI_Fint *maxindex,
if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) {
OMPI_ARRAY_INT_2_FINT(index, *maxindex);
OMPI_ARRAY_INT_2_FINT(edges, *maxedges);
} else {
OMPI_ARRAY_FINT_2_INT_CLEANUP(index);
OMPI_ARRAY_FINT_2_INT_CLEANUP(edges);
}
}

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -75,5 +76,7 @@ void mpi_graph_neighbors_f(MPI_Fint *comm, MPI_Fint *rank,
));
if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) {
OMPI_ARRAY_INT_2_FINT(neighbors, *maxneighbors);
} else {
OMPI_ARRAY_FINT_2_INT_CLEANUP(neighbors);
}
}

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -81,6 +82,8 @@ void mpi_group_translate_ranks_f(MPI_Fint *group1, MPI_Fint *n,
));
if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) {
OMPI_ARRAY_INT_2_FINT(ranks2, *n);
} else {
OMPI_ARRAY_FINT_2_INT_CLEANUP(ranks2);
}
OMPI_ARRAY_FINT_2_INT_CLEANUP(ranks1);
}