2005-03-14 23:57:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2005-03-14 23:57:21 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** @file **/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
|
2005-03-23 20:50:12 +03:00
|
|
|
#include "include/orte_constants.h"
|
|
|
|
#include "mca/errmgr/errmgr.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-05-22 22:40:03 +04:00
|
|
|
#include "runtime/opal.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "runtime/runtime.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialze and setup a process in the ORTE.
|
|
|
|
*
|
|
|
|
* @retval ORTE_SUCCESS Upon success.
|
|
|
|
* @retval ORTE_ERROR Upon failure.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* globals used by RTE */
|
2005-03-23 20:50:12 +03:00
|
|
|
int orte_debug_flag=(int)false;
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-08-22 07:05:39 +04:00
|
|
|
static const char * orte_err2str(int errnum);
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
int orte_init(void)
|
|
|
|
{
|
2005-03-23 20:50:12 +03:00
|
|
|
int rc;
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-05-22 22:40:03 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = opal_init())) {
|
2005-03-23 20:50:12 +03:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
2005-08-22 07:05:39 +04:00
|
|
|
|
|
|
|
/* register handler for errnum -> string converstion */
|
|
|
|
opal_error_register(orte_err2str);
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-05-22 22:40:03 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_system_init())) {
|
2005-03-23 20:50:12 +03:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2005-08-22 07:05:39 +04:00
|
|
|
static const char *
|
|
|
|
orte_err2str(int errnum)
|
|
|
|
{
|
|
|
|
const char *retval;
|
|
|
|
|
|
|
|
switch (errnum) {
|
|
|
|
case ORTE_ERR_RECV_LESS_THAN_POSTED:
|
|
|
|
retval = "Receive was less than posted size";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_RECV_MORE_THAN_POSTED:
|
|
|
|
retval = "Receive was greater than posted size";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_NO_MATCH_YET:
|
|
|
|
retval = "No match for receive posted";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_BUFFER:
|
|
|
|
retval = "Buffer error";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_REQUEST:
|
|
|
|
retval = "Request error";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_NO_CONNECTION_ALLOWED:
|
|
|
|
retval = "No connection allowed";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_CONNECTION_REFUSED:
|
|
|
|
retval = "Connection refused";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_CONNECTION_FAILED:
|
|
|
|
retval = "Connection failed";
|
|
|
|
break;
|
|
|
|
case ORTE_STARTUP_DETECTED:
|
|
|
|
retval = "Startup detected";
|
|
|
|
break;
|
|
|
|
case ORTE_SHUTDOWN_DETECTED:
|
|
|
|
retval = "Shutdown detected";
|
|
|
|
break;
|
|
|
|
case ORTE_PROC_STARTING:
|
|
|
|
retval = "Proccess starting";
|
|
|
|
break;
|
|
|
|
case ORTE_PROC_STOPPED:
|
|
|
|
retval = "Proccess stopped";
|
|
|
|
break;
|
|
|
|
case ORTE_PROC_TERMINATING:
|
|
|
|
retval = "Proccess terminating";
|
|
|
|
break;
|
|
|
|
case ORTE_PROC_ALIVE:
|
|
|
|
retval = "Proccess alive";
|
|
|
|
break;
|
|
|
|
case ORTE_PROC_RUNNING:
|
|
|
|
retval = "Process running";
|
|
|
|
break;
|
|
|
|
case ORTE_PROC_KILLED:
|
|
|
|
retval = "Process killed";
|
|
|
|
break;
|
|
|
|
case ORTE_PROC_EXITED:
|
|
|
|
retval = "Process exited";
|
|
|
|
break;
|
|
|
|
case ORTE_NODE_UP:
|
|
|
|
retval = "Node is up";
|
|
|
|
break;
|
|
|
|
case ORTE_NODE_DOWN:
|
|
|
|
retval = "Node is down";
|
|
|
|
break;
|
|
|
|
case ORTE_NODE_BOOTING:
|
|
|
|
retval = "Node is booting";
|
|
|
|
break;
|
|
|
|
case ORTE_NODE_ERROR:
|
|
|
|
retval = "Node is in error condition";
|
|
|
|
break;
|
|
|
|
case ORTE_PACK_MISMATCH:
|
|
|
|
retval = "Pack data mismatch";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_PACK_FAILURE:
|
|
|
|
retval = "Data pack failed";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_UNPACK_FAILURE:
|
|
|
|
retval = "Data unpack failed";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_COMM_FAILURE:
|
|
|
|
retval = "Communication failure";
|
|
|
|
break;
|
|
|
|
case ORTE_UNPACK_INADEQUATE_SPACE:
|
|
|
|
retval = "Data unpack had inadequate space";
|
|
|
|
break;
|
|
|
|
case ORTE_UNPACK_READ_PAST_END_OF_BUFFER:
|
|
|
|
retval = "Data unpack would read past end of buffer";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_GPR_DATA_CORRUPT:
|
|
|
|
retval = "GPR data corruption";
|
|
|
|
break;
|
|
|
|
case ORTE_ERR_TYPE_MISMATCH:
|
|
|
|
retval = "Type mismatch";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
retval = NULL;
|
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-08-22 07:05:39 +04:00
|
|
|
return retval;
|
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
|