1
1

* add --hostfile <name> option to mpirun so that you don't have to set the

silly environment variable any more :)

This commit was SVN r3576.
Этот коммит содержится в:
Brian Barrett 2004-11-16 14:09:19 +00:00
родитель 3c6a8e537a
Коммит 18a3d42bb2
2 изменённых файлов: 16 добавлений и 1 удалений

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

@ -51,6 +51,7 @@ const mca_llm_base_component_1_0_0_t mca_llm_hostfile_component = {
* component variables handles
*/
static int param_filename;
static int param_filename_deprecated;
static int param_priority;
int
@ -58,10 +59,12 @@ mca_llm_hostfile_component_open(void)
{
char *default_path = ompi_os_path(false, OMPI_SYSCONFDIR,
"openmpi-default-hostfile", NULL);
/* accept either OMPI_MCA_llm_hostfile_hostfile or
OMPI_MCA_hostfile */
param_filename = mca_base_param_register_string("llm",
"hostfile",
"hostfile",
NULL,
"hostfile",
default_path);
if (NULL != default_path) free(default_path);

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

@ -151,6 +151,18 @@ main(int argc, char *argv[])
return ret;
}
/* get our hostfile, if we have one */
if (ompi_cmd_line_is_taken(cmd_line, "hostfile")) {
/* BWB - XXX - fix me. We really should be setting this via
* an API rather than setenv. But we don't have such an API just
* yet. */
char *buf = NULL;
asprintf(&buf, "OMPI_MCA_hostfile=%s",
ompi_cmd_line_get_param(cmd_line, "hostfile", 0, 0));
/* yeah, it leaks. Can't do nothin' about that */
putenv(buf);
}
/* get our numprocs */
if (ompi_cmd_line_is_taken(cmd_line, "np")) {
num_procs = atoi(ompi_cmd_line_get_param(cmd_line, "np", 0, 0));