Added some user friendly output to the hostfile RDS component.
This is more of a usability feature, but a very useful one. So I suggest that it go into the release branches. This commit was SVN r10153.
Этот коммит содержится в:
родитель
8a22272ffb
Коммит
bb95df9bf2
@ -19,6 +19,7 @@
|
|||||||
# Use the top-level Makefile.options
|
# Use the top-level Makefile.options
|
||||||
|
|
||||||
|
|
||||||
|
dist_pkgdata_DATA = help-rds-hostfile.txt
|
||||||
|
|
||||||
# Make the output library in this directory, and name it either
|
# Make the output library in this directory, and name it either
|
||||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||||
|
54
orte/mca/rds/hostfile/help-rds-hostfile.txt
Обычный файл
54
orte/mca/rds/hostfile/help-rds-hostfile.txt
Обычный файл
@ -0,0 +1,54 @@
|
|||||||
|
# -*- text -*-
|
||||||
|
#
|
||||||
|
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||||
|
# University Research and Technology
|
||||||
|
# Corporation. All rights reserved.
|
||||||
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||||
|
# of Tennessee Research Foundation. All rights
|
||||||
|
# reserved.
|
||||||
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||||
|
# University of Stuttgart. All rights reserved.
|
||||||
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
|
# All rights reserved.
|
||||||
|
# $COPYRIGHT$
|
||||||
|
#
|
||||||
|
# Additional copyrights may follow
|
||||||
|
#
|
||||||
|
# $HEADER$
|
||||||
|
#
|
||||||
|
# This is the US/English general help file for Open RTE's RDS component.
|
||||||
|
#
|
||||||
|
[rds:no-hostfile]
|
||||||
|
Open RTE was unable to open the hostfile:
|
||||||
|
%s
|
||||||
|
Check to make sure the path and filename are correct.
|
||||||
|
[rds:slots]
|
||||||
|
Open RTE detected a bad parameter in the hostfile:
|
||||||
|
%s
|
||||||
|
The slots parameter is less than 0:
|
||||||
|
slots=%d
|
||||||
|
[rds:max_slots]
|
||||||
|
Open RTE detected a bad parameter in the hostfile:
|
||||||
|
%s
|
||||||
|
The max_slots parameter is less than 0:
|
||||||
|
max_slots=%d
|
||||||
|
[rds:max_slots_lt]
|
||||||
|
Open RTE detected a bad parameter in the hostfile:
|
||||||
|
%s
|
||||||
|
The max_slots parameter is less than the slots parameter:
|
||||||
|
slots=%d
|
||||||
|
max_slots=%d
|
||||||
|
[rds:parse_error_string]
|
||||||
|
Open RTE detected a parse error in the hostfile:
|
||||||
|
%s
|
||||||
|
It occured on line number %d on token %d:
|
||||||
|
%s
|
||||||
|
[rds:parse_error_int]
|
||||||
|
Open RTE detected a parse error in the hostfile:
|
||||||
|
%s
|
||||||
|
It occured on line number %d on token %d:
|
||||||
|
%d
|
||||||
|
[rds:parse_error]
|
||||||
|
Open RTE detected a parse error in the hostfile:
|
||||||
|
%s
|
||||||
|
It occured on line number %d on token %d.
|
@ -27,6 +27,8 @@
|
|||||||
#include "opal/util/argv.h"
|
#include "opal/util/argv.h"
|
||||||
#include "opal/mca/mca.h"
|
#include "opal/mca/mca.h"
|
||||||
#include "opal/mca/base/base.h"
|
#include "opal/mca/base/base.h"
|
||||||
|
#include "opal/util/show_help.h"
|
||||||
|
|
||||||
#include "orte/orte_constants.h"
|
#include "orte/orte_constants.h"
|
||||||
#include "orte/util/sys_info.h"
|
#include "orte/util/sys_info.h"
|
||||||
#include "orte/mca/ns/ns.h"
|
#include "orte/mca/ns/ns.h"
|
||||||
@ -42,22 +44,34 @@
|
|||||||
|
|
||||||
static orte_cellid_t local_cellid;
|
static orte_cellid_t local_cellid;
|
||||||
static bool need_cellid = true;
|
static bool need_cellid = true;
|
||||||
|
static char *cur_hostfile_name = NULL;
|
||||||
|
|
||||||
static void orte_rds_hostfile_parse_error(int token)
|
static void orte_rds_hostfile_parse_error(int token)
|
||||||
{
|
{
|
||||||
switch (token) {
|
switch (token) {
|
||||||
case ORTE_RDS_HOSTFILE_STRING:
|
case ORTE_RDS_HOSTFILE_STRING:
|
||||||
opal_output(0, "Error reading hostfile at line %d: token:%d %s\n",
|
opal_show_help("help-rds-hostfile.txt", "rds:parse_error_string",
|
||||||
orte_rds_hostfile_line, token, orte_rds_hostfile_value.sval);
|
true,
|
||||||
|
cur_hostfile_name,
|
||||||
|
orte_rds_hostfile_line,
|
||||||
|
token,
|
||||||
|
orte_rds_hostfile_value.sval);
|
||||||
break;
|
break;
|
||||||
case ORTE_RDS_HOSTFILE_IPV4:
|
case ORTE_RDS_HOSTFILE_IPV4:
|
||||||
case ORTE_RDS_HOSTFILE_INT:
|
case ORTE_RDS_HOSTFILE_INT:
|
||||||
opal_output(0, "Error reading hostfile at line %d: token:%d %d\n",
|
opal_show_help("help-rds-hostfile.txt", "rds:parse_error_int",
|
||||||
orte_rds_hostfile_line, token, orte_rds_hostfile_value.ival);
|
true,
|
||||||
|
cur_hostfile_name,
|
||||||
|
orte_rds_hostfile_line,
|
||||||
|
token,
|
||||||
|
orte_rds_hostfile_value.ival);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
opal_output(0, "Error reading hostfile at line %d token:%d\n",
|
opal_show_help("help-rds-hostfile.txt", "rds:parse_error",
|
||||||
orte_rds_hostfile_line, token);
|
true,
|
||||||
|
cur_hostfile_name,
|
||||||
|
orte_rds_hostfile_line,
|
||||||
|
token );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -220,6 +234,9 @@ static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_l
|
|||||||
case ORTE_RDS_HOSTFILE_SLOTS:
|
case ORTE_RDS_HOSTFILE_SLOTS:
|
||||||
rc = orte_rds_hostfile_parse_int();
|
rc = orte_rds_hostfile_parse_int();
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
opal_show_help("help-rds-hostfile.txt", "rds:slots",
|
||||||
|
true,
|
||||||
|
cur_hostfile_name, rc);
|
||||||
OBJ_RELEASE(node);
|
OBJ_RELEASE(node);
|
||||||
return ORTE_ERROR;
|
return ORTE_ERROR;
|
||||||
}
|
}
|
||||||
@ -236,6 +253,9 @@ static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_l
|
|||||||
case ORTE_RDS_HOSTFILE_SLOTS_MAX:
|
case ORTE_RDS_HOSTFILE_SLOTS_MAX:
|
||||||
rc = orte_rds_hostfile_parse_int();
|
rc = orte_rds_hostfile_parse_int();
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
opal_show_help("help-rds-hostfile.txt", "rds:max_slots",
|
||||||
|
true,
|
||||||
|
cur_hostfile_name, ((size_t) rc));
|
||||||
OBJ_RELEASE(node);
|
OBJ_RELEASE(node);
|
||||||
return ORTE_ERROR;
|
return ORTE_ERROR;
|
||||||
}
|
}
|
||||||
@ -246,6 +266,9 @@ static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_l
|
|||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
opal_show_help("help-rds-hostfile.txt", "rds:max_slots_lt",
|
||||||
|
true,
|
||||||
|
cur_hostfile_name, node->node_slots, rc);
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||||
OBJ_RELEASE(node);
|
OBJ_RELEASE(node);
|
||||||
return ORTE_ERROR;
|
return ORTE_ERROR;
|
||||||
@ -282,10 +305,15 @@ static int orte_rds_hostfile_parse(const char *hostfile, opal_list_t* existing,
|
|||||||
int rc = ORTE_SUCCESS;
|
int rc = ORTE_SUCCESS;
|
||||||
|
|
||||||
OPAL_LOCK(&mca_rds_hostfile_component.lock);
|
OPAL_LOCK(&mca_rds_hostfile_component.lock);
|
||||||
|
|
||||||
|
cur_hostfile_name = strdup(hostfile);
|
||||||
|
|
||||||
orte_rds_hostfile_done = false;
|
orte_rds_hostfile_done = false;
|
||||||
orte_rds_hostfile_in = fopen(hostfile, "r");
|
orte_rds_hostfile_in = fopen(hostfile, "r");
|
||||||
if (NULL == orte_rds_hostfile_in) {
|
if (NULL == orte_rds_hostfile_in) {
|
||||||
|
opal_show_help("help-rds-hostfile.txt", "rds:no-hostfile",
|
||||||
|
true,
|
||||||
|
cur_hostfile_name);
|
||||||
rc = ORTE_ERR_NOT_FOUND;
|
rc = ORTE_ERR_NOT_FOUND;
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
@ -326,6 +354,11 @@ static int orte_rds_hostfile_parse(const char *hostfile, opal_list_t* existing,
|
|||||||
orte_rds_hostfile_in = NULL;
|
orte_rds_hostfile_in = NULL;
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
|
if(NULL != cur_hostfile_name) {
|
||||||
|
free(cur_hostfile_name);
|
||||||
|
cur_hostfile_name = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
OPAL_UNLOCK(&mca_rds_hostfile_component.lock);
|
OPAL_UNLOCK(&mca_rds_hostfile_component.lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user