2004-11-20 22:12:43 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 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.
|
2005-09-09 22:27:17 +04:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
* 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.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
2005-09-09 22:27:17 +04:00
|
|
|
*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Additional copyrights may follow
|
2005-09-09 22:27:17 +04:00
|
|
|
*
|
2004-11-20 22:12:43 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/** @file:
|
|
|
|
*
|
|
|
|
* The Open MPI general purpose registry - implementation.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* includes
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "orte_config.h"
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/orte_constants.h"
|
|
|
|
#include "orte/orte_types.h"
|
2005-09-09 22:27:17 +04:00
|
|
|
#include "opal/util/trace.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/dss/dss_types.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
#include "orte/mca/ns/ns_types.h"
|
|
|
|
#include "orte/mca/oob/oob_types.h"
|
|
|
|
#include "orte/mca/rml/rml.h"
|
2004-11-20 22:12:43 +03:00
|
|
|
|
|
|
|
#include "gpr_proxy.h"
|
|
|
|
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
int orte_gpr_proxy_cleanup_job(orte_jobid_t jobid)
|
2004-11-20 22:12:43 +03:00
|
|
|
{
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_buffer_t *cmd, *answer;
|
|
|
|
int rc, ret;
|
|
|
|
|
2005-09-09 22:27:17 +04:00
|
|
|
OPAL_TRACE(1);
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
if (orte_gpr_proxy_globals.compound_cmd_mode) {
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_pack_cleanup_job(orte_gpr_proxy_globals.compound_cmd, jobid))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
|
|
|
return rc;
|
2004-11-20 22:12:43 +03:00
|
|
|
}
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
cmd = OBJ_NEW(orte_buffer_t);
|
|
|
|
if (NULL == cmd) { /* got a problem */
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
2005-09-09 22:27:17 +04:00
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
2004-11-20 22:12:43 +03:00
|
|
|
}
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_pack_cleanup_job(cmd, jobid))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_RELEASE(cmd);
|
2005-09-09 22:27:17 +04:00
|
|
|
return rc;
|
2004-11-20 22:12:43 +03:00
|
|
|
}
|
|
|
|
|
2005-03-18 06:43:59 +03:00
|
|
|
if (0 > orte_rml.send_buffer(orte_process_info.gpr_replica, cmd, ORTE_RML_TAG_GPR, 0)) {
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
|
|
|
|
OBJ_RELEASE(cmd);
|
|
|
|
return ORTE_ERR_COMM_FAILURE;
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(cmd);
|
2005-09-09 22:27:17 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
answer = OBJ_NEW(orte_buffer_t);
|
|
|
|
if (NULL == answer) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2005-09-09 22:27:17 +04:00
|
|
|
|
2005-03-18 06:43:59 +03:00
|
|
|
if (0 > orte_rml.recv_buffer(orte_process_info.gpr_replica, answer, ORTE_RML_TAG_GPR)) {
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
|
|
|
|
OBJ_RELEASE(answer);
|
|
|
|
return ORTE_ERR_COMM_FAILURE;
|
|
|
|
}
|
2005-09-09 22:27:17 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_unpack_cleanup_job(answer, &ret))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_RELEASE(answer);
|
|
|
|
return rc;
|
|
|
|
}
|
2005-09-09 22:27:17 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
OBJ_RELEASE(answer);
|
2005-09-09 22:27:17 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
return ret;
|
2004-11-20 22:12:43 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
int orte_gpr_proxy_cleanup_proc(orte_process_name_t *proc)
|
2004-11-20 22:12:43 +03:00
|
|
|
{
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_buffer_t *cmd, *answer;
|
|
|
|
int rc, ret;
|
2005-09-09 22:27:17 +04:00
|
|
|
|
|
|
|
OPAL_TRACE(1);
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
if (orte_gpr_proxy_globals.compound_cmd_mode) {
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_pack_cleanup_proc(orte_gpr_proxy_globals.compound_cmd, proc))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
|
|
|
return rc;
|
2004-11-20 22:12:43 +03:00
|
|
|
}
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
cmd = OBJ_NEW(orte_buffer_t);
|
|
|
|
if (NULL == cmd) { /* got a problem */
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
2004-12-12 20:07:20 +03:00
|
|
|
}
|
2004-11-20 22:12:43 +03:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_pack_cleanup_proc(cmd, proc))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_RELEASE(cmd);
|
|
|
|
return rc;
|
2004-11-20 22:12:43 +03:00
|
|
|
}
|
|
|
|
|
2005-03-18 06:43:59 +03:00
|
|
|
if (0 > orte_rml.send_buffer(orte_process_info.gpr_replica, cmd, ORTE_RML_TAG_GPR, 0)) {
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
|
|
|
|
OBJ_RELEASE(cmd);
|
|
|
|
return ORTE_ERR_COMM_FAILURE;
|
2004-11-20 22:12:43 +03:00
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
OBJ_RELEASE(cmd);
|
2005-09-09 22:27:17 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
answer = OBJ_NEW(orte_buffer_t);
|
|
|
|
if (NULL == answer) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2005-09-09 22:27:17 +04:00
|
|
|
|
2005-03-18 06:43:59 +03:00
|
|
|
if (0 > orte_rml.recv_buffer(orte_process_info.gpr_replica, answer, ORTE_RML_TAG_GPR)) {
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
|
|
|
|
OBJ_RELEASE(answer);
|
|
|
|
return ORTE_ERR_COMM_FAILURE;
|
|
|
|
}
|
2005-09-09 22:27:17 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_unpack_cleanup_proc(answer, &ret))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_RELEASE(answer);
|
|
|
|
return rc;
|
|
|
|
}
|
2005-09-09 22:27:17 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
OBJ_RELEASE(answer);
|
2005-09-09 22:27:17 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
return ret;
|
2004-11-20 22:12:43 +03:00
|
|
|
}
|