1
1

Plug one memory leak - still have one big one left here.

This commit was SVN r5137.
Этот коммит содержится в:
Ralph Castain 2005-04-01 19:51:47 +00:00
родитель b583c40102
Коммит d900d8f137
2 изменённых файлов: 92 добавлений и 6 удалений

Просмотреть файл

@ -241,6 +241,10 @@ static int orte_rds_hostfile_query(void)
}
cleanup:
if (NULL != mca_rds_hostfile_component.path) {
free(mca_rds_hostfile_component.path);
}
while(NULL != (item = ompi_list_remove_first(&existing))) {
OBJ_RELEASE(item);
}

Просмотреть файл

@ -17,7 +17,12 @@
#include "include/orte_constants.h"
#include "dps/dps.h"
#include "runtime/runtime.h"
#include "util/proc_info.h"
#include "util/sys_info.h"
#include "mca/gpr/base/base.h"
#include "mca/rds/base/base.h"
/* output files needed by the test */
@ -44,14 +49,83 @@ main(int argc, char **argv)
exit(1);
}
/* startup the runtime */
if (OMPI_SUCCESS == orte_init()) {
fprintf(test_out, "orte_init completed\n");
/* ENSURE THE GPR REPLICA IS ISOLATED */
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
/* Open up the output streams */
if (!ompi_output_init()) {
return OMPI_ERROR;
}
/*
* If threads are supported - assume that we are using threads - and reset otherwise.
*/
ompi_set_using_threads(OMPI_HAVE_THREAD_SUPPORT);
/* For malloc debugging */
ompi_malloc_init();
/* Ensure the system_info structure is instantiated and initialized */
if (ORTE_SUCCESS != (rc = orte_sys_info())) {
return rc;
}
/* Ensure the process info structure is instantiated and initialized */
if (ORTE_SUCCESS != (rc = orte_proc_info())) {
return rc;
}
orte_process_info.seed = true;
orte_process_info.my_name = (orte_process_name_t*)malloc(sizeof(orte_process_name_t));
orte_process_info.my_name->cellid = 0;
orte_process_info.my_name->jobid = 0;
orte_process_info.my_name->vpid = 0;
/* startup the MCA */
if (OMPI_SUCCESS == mca_base_open()) {
fprintf(test_out, "MCA started\n");
} else {
fprintf(test_out, "orte_init failed\n");
fprintf(test_out, "MCA could not start\n");
exit (1);
}
if (ORTE_SUCCESS == orte_gpr_base_open()) {
fprintf(test_out, "GPR started\n");
} else {
fprintf(test_out, "GPR could not start\n");
exit (1);
}
if (ORTE_SUCCESS == orte_gpr_base_select()) {
fprintf(test_out, "GPR replica selected\n");
} else {
fprintf(test_out, "GPR replica could not be selected\n");
exit (1);
}
if (ORTE_SUCCESS == orte_dps_open()) {
fprintf(test_out, "DPS started\n");
} else {
fprintf(test_out, "DPS could not start\n");
exit (1);
}
/* setup the RDS */
if (ORTE_SUCCESS == orte_rds_base_open()) {
fprintf(test_out, "RDS started\n");
} else {
fprintf(test_out, "RDS could not start\n");
exit (1);
}
if (ORTE_SUCCESS == orte_rds_base_select()) {
fprintf(test_out, "RDS selected\n");
} else {
fprintf(test_out, "RDS could not be selected\n");
exit (1);
}
/* run the query */
if (ORTE_SUCCESS != (rc = orte_rds_base_query())) {
fprintf(test_out, "RDS query failed with code %s\n",
@ -64,8 +138,16 @@ main(int argc, char **argv)
test_success();
}
/* finalize */
orte_finalize();
fprintf(stderr, "now finalize and see if all memory cleared\n");
orte_rds_base_close();
orte_dps_close();
orte_gpr_base_close();
orte_sys_info_finalize();
orte_proc_info_finalize();
mca_base_close();
ompi_malloc_finalize();
ompi_output_finalize();
ompi_class_finalize();
fclose( test_out );
/* result = system( cmd_str );