* use the orte_pointer_array properly
This commit was SVN r6314.
Этот коммит содержится в:
родитель
bdd129b911
Коммит
f1c925475e
@ -68,7 +68,7 @@ extern char** environ;
|
|||||||
static struct ompi_event term_handler;
|
static struct ompi_event term_handler;
|
||||||
static struct ompi_event int_handler;
|
static struct ompi_event int_handler;
|
||||||
static orte_jobid_t jobid = ORTE_JOBID_MAX;
|
static orte_jobid_t jobid = ORTE_JOBID_MAX;
|
||||||
static orte_pointer_array_t apps_pa;
|
static orte_pointer_array_t *apps_pa;
|
||||||
static bool wait_for_job_completion = true;
|
static bool wait_for_job_completion = true;
|
||||||
static char *abort_msg = NULL;
|
static char *abort_msg = NULL;
|
||||||
static size_t abort_msg_len = -1;
|
static size_t abort_msg_len = -1;
|
||||||
@ -246,7 +246,7 @@ int main(int argc, char *argv[])
|
|||||||
/* Convert the list of apps to an array of orte_app_context_t
|
/* Convert the list of apps to an array of orte_app_context_t
|
||||||
pointers */
|
pointers */
|
||||||
|
|
||||||
num_apps = orte_pointer_array_get_size(&apps_pa);
|
num_apps = orte_pointer_array_get_size(apps_pa);
|
||||||
if (0 == num_apps) {
|
if (0 == num_apps) {
|
||||||
/* This should never happen -- this case should be caught in
|
/* This should never happen -- this case should be caught in
|
||||||
create_app(), but let's just double check... */
|
create_app(), but let's just double check... */
|
||||||
@ -262,7 +262,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
for (j = i = 0; i < num_apps; ++i) {
|
for (j = i = 0; i < num_apps; ++i) {
|
||||||
apps[i] = (orte_app_context_t *)
|
apps[i] = (orte_app_context_t *)
|
||||||
orte_pointer_array_get_item(&apps_pa, i);
|
orte_pointer_array_get_item(apps_pa, i);
|
||||||
j += apps[i]->num_procs;
|
j += apps[i]->num_procs;
|
||||||
}
|
}
|
||||||
proc_infos = malloc(sizeof(struct proc_info_t) * j);
|
proc_infos = malloc(sizeof(struct proc_info_t) * j);
|
||||||
@ -383,7 +383,7 @@ int main(int argc, char *argv[])
|
|||||||
OBJ_RELEASE(apps[i]);
|
OBJ_RELEASE(apps[i]);
|
||||||
}
|
}
|
||||||
free(apps);
|
free(apps);
|
||||||
OBJ_DESTRUCT(&apps_pa);
|
OBJ_RELEASE(apps_pa);
|
||||||
orte_finalize();
|
orte_finalize();
|
||||||
free(abort_msg);
|
free(abort_msg);
|
||||||
free(orterun_basename);
|
free(orterun_basename);
|
||||||
@ -691,7 +691,7 @@ static int parse_locals(int argc, char* argv[])
|
|||||||
temp_argc = 0;
|
temp_argc = 0;
|
||||||
temp_argv = NULL;
|
temp_argv = NULL;
|
||||||
ompi_argv_append(&temp_argc, &temp_argv, argv[0]);
|
ompi_argv_append(&temp_argc, &temp_argv, argv[0]);
|
||||||
OBJ_CONSTRUCT(&apps_pa, orte_pointer_array_t);
|
orte_pointer_array_init(&apps_pa, 1, argc + 1, 2);
|
||||||
|
|
||||||
env = NULL;
|
env = NULL;
|
||||||
for (app_num = 0, i = 1; i < argc; ++i) {
|
for (app_num = 0, i = 1; i < argc; ++i) {
|
||||||
@ -715,7 +715,7 @@ static int parse_locals(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
if (made_app) {
|
if (made_app) {
|
||||||
size_t dummy;
|
size_t dummy;
|
||||||
orte_pointer_array_add(&dummy, &apps_pa, app);
|
orte_pointer_array_add(&dummy, apps_pa, app);
|
||||||
} else {
|
} else {
|
||||||
OBJ_RELEASE(app);
|
OBJ_RELEASE(app);
|
||||||
}
|
}
|
||||||
@ -741,7 +741,7 @@ static int parse_locals(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
if (made_app) {
|
if (made_app) {
|
||||||
size_t dummy;
|
size_t dummy;
|
||||||
orte_pointer_array_add(&dummy, &apps_pa, app);
|
orte_pointer_array_add(&dummy, apps_pa, app);
|
||||||
} else {
|
} else {
|
||||||
OBJ_RELEASE(app);
|
OBJ_RELEASE(app);
|
||||||
}
|
}
|
||||||
@ -1124,7 +1124,7 @@ static int parse_appfile(char *filename, char ***env)
|
|||||||
}
|
}
|
||||||
if (made_app) {
|
if (made_app) {
|
||||||
size_t dummy;
|
size_t dummy;
|
||||||
orte_pointer_array_add(&dummy, &apps_pa, app);
|
orte_pointer_array_add(&dummy, apps_pa, app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (!feof(fp));
|
} while (!feof(fp));
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user