Bring the resource discovery system's resource file component online so I can find the node I need to launch upon. I removed all reference to the xml library that was causing trouble, and wrote my own limited xml parser instead, so this will now compile just fine anywhere.
Need to do some refining of the component, but it meets basic requirements right now. Nobody else should notice any change - system basically ignores it unless you tell it to do something. This commit was SVN r5723.
Этот коммит содержится в:
родитель
2c4209f4cb
Коммит
89b6a97f0f
@ -8,8 +8,11 @@
|
|||||||
<front-end>
|
<front-end>
|
||||||
<name>pfe1.lanl.gov</name>
|
<name>pfe1.lanl.gov</name>
|
||||||
<tmp-dir>/net/scratch1</tmp-dir>
|
<tmp-dir>/net/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
|
</front-end>
|
||||||
|
<front-end>
|
||||||
|
<name>pfe2.lanl.gov</name>
|
||||||
</front-end>
|
</front-end>
|
||||||
<front-end>pfe2.lanl.gov</front-end>
|
|
||||||
<compute-domains>
|
<compute-domains>
|
||||||
<num-domains>1</num-domains>
|
<num-domains>1</num-domains>
|
||||||
<nodes-per-domain>1024</nodes-per-domain>
|
<nodes-per-domain>1024</nodes-per-domain>
|
||||||
@ -34,7 +37,7 @@
|
|||||||
</filesystem>
|
</filesystem>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>bproc</launcher>
|
<launcher>bproc</launcher>
|
||||||
<node-arch>
|
<arch>
|
||||||
<cpus-per-node>2</cpus-per-node>
|
<cpus-per-node>2</cpus-per-node>
|
||||||
<cpu-type>xeon</cpu-type>
|
<cpu-type>xeon</cpu-type>
|
||||||
<cpu-vendor>intel</cpu-vendor>
|
<cpu-vendor>intel</cpu-vendor>
|
||||||
@ -43,7 +46,7 @@
|
|||||||
<type>myrinet</type>
|
<type>myrinet</type>
|
||||||
</interconnect>
|
</interconnect>
|
||||||
<memory-per-node>1.0</memory-per-node> <!--given in gigabytes-->
|
<memory-per-node>1.0</memory-per-node> <!--given in gigabytes-->
|
||||||
</node-arch>
|
</arch>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource>
|
<resource>
|
||||||
@ -52,26 +55,32 @@
|
|||||||
<front-end>
|
<front-end>
|
||||||
<name>ll-1.lanl.gov</name>
|
<name>ll-1.lanl.gov</name>
|
||||||
<tmp-dir>/net/scratch1</tmp-dir>
|
<tmp-dir>/net/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<front-end>
|
<front-end>
|
||||||
<name>ll-2.lanl.gov</name>
|
<name>ll-2.lanl.gov</name>
|
||||||
<tmp-dir>/net/scratch1</tmp-dir>
|
<tmp-dir>/net/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<front-end>
|
<front-end>
|
||||||
<name>ll-3.lanl.gov</name>
|
<name>ll-3.lanl.gov</name>
|
||||||
<tmp-dir>/net/scratch1</tmp-dir>
|
<tmp-dir>/net/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<front-end>
|
<front-end>
|
||||||
<name>ll-4.lanl.gov</name>
|
<name>ll-4.lanl.gov</name>
|
||||||
<tmp-dir>/net/scratch1</tmp-dir>
|
<tmp-dir>/net/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<front-end>
|
<front-end>
|
||||||
<name>ll-5.lanl.gov</name>
|
<name>ll-5.lanl.gov</name>
|
||||||
<tmp-dir>/net/scratch1</tmp-dir>
|
<tmp-dir>/net/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<front-end>
|
<front-end>
|
||||||
<name>ll-6.lanl.gov</name>
|
<name>ll-6.lanl.gov</name>
|
||||||
<tmp-dir>/net/scratch1</tmp-dir>
|
<tmp-dir>/net/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<os>
|
<os>
|
||||||
<type>linux</type>
|
<type>linux</type>
|
||||||
@ -97,7 +106,7 @@
|
|||||||
</filesystem>
|
</filesystem>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>bproc</launcher>
|
<launcher>bproc</launcher>
|
||||||
<node-arch>
|
<arch>
|
||||||
<cpus-per-node>2</cpus-per-node>>
|
<cpus-per-node>2</cpus-per-node>>
|
||||||
<cpu-type>opteron</cpu-type>
|
<cpu-type>opteron</cpu-type>
|
||||||
<cpu-vendor>amd</cpu-vendor>
|
<cpu-vendor>amd</cpu-vendor>
|
||||||
@ -106,7 +115,7 @@
|
|||||||
<type>myrinet</type>
|
<type>myrinet</type>
|
||||||
</interconnect>
|
</interconnect>
|
||||||
<memory-per-node>2.0</memory-per-node> <!--given in gigabytes-->
|
<memory-per-node>2.0</memory-per-node> <!--given in gigabytes-->
|
||||||
</node-arch>
|
</arch>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
<resource>
|
<resource>
|
||||||
@ -115,8 +124,10 @@
|
|||||||
<front-end>
|
<front-end>
|
||||||
<name>ffe1.lanl.gov</name>
|
<name>ffe1.lanl.gov</name>
|
||||||
<tmp-dir>/net/scratch1</tmp-dir>
|
<tmp-dir>/net/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<front-end><name>ffe2.lanl.gov</name>
|
<front-end>
|
||||||
|
<name>ffe2.lanl.gov</name>
|
||||||
<tmp-dir>/net/scratch1</tmp-dir>
|
<tmp-dir>/net/scratch1</tmp-dir>
|
||||||
</front-end>
|
</front-end>
|
||||||
<os>
|
<os>
|
||||||
@ -160,6 +171,7 @@
|
|||||||
<type>cluster</type>
|
<type>cluster</type>
|
||||||
<front-end>
|
<front-end>
|
||||||
<name>qafe.lanl.gov</name>
|
<name>qafe.lanl.gov</name>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>rms</launcher>
|
<launcher>rms</launcher>
|
||||||
@ -200,6 +212,7 @@
|
|||||||
<type>cluster</type>
|
<type>cluster</type>
|
||||||
<front-end>
|
<front-end>
|
||||||
<name>qbfe.lanl.gov</name>
|
<name>qbfe.lanl.gov</name>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>rms</launcher>
|
<launcher>rms</launcher>
|
||||||
@ -241,6 +254,7 @@
|
|||||||
<front-end>
|
<front-end>
|
||||||
<name>cfe1.lanl.gov</name>
|
<name>cfe1.lanl.gov</name>
|
||||||
<tmp-dir>/scratch1</tmp-dir>
|
<tmp-dir>/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>lsf</launcher>
|
<launcher>lsf</launcher>
|
||||||
@ -279,6 +293,7 @@
|
|||||||
<front-end>
|
<front-end>
|
||||||
<name>cfe1.lanl.gov</name>
|
<name>cfe1.lanl.gov</name>
|
||||||
<tmp-dir>/scratch1</tmp-dir>
|
<tmp-dir>/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>lsf</launcher>
|
<launcher>lsf</launcher>
|
||||||
@ -317,6 +332,7 @@
|
|||||||
<front-end>
|
<front-end>
|
||||||
<name>cfe1.lanl.gov</name>
|
<name>cfe1.lanl.gov</name>
|
||||||
<tmp-dir>/scratch1</tmp-dir>
|
<tmp-dir>/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>lsf</launcher>
|
<launcher>lsf</launcher>
|
||||||
@ -355,6 +371,7 @@
|
|||||||
<front-end>
|
<front-end>
|
||||||
<name>lambda.lanl.gov</name>
|
<name>lambda.lanl.gov</name>
|
||||||
<tmp-dir>/scratch</tmp-dir>
|
<tmp-dir>/scratch</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>bproc</launcher>
|
<launcher>bproc</launcher>
|
||||||
@ -388,6 +405,7 @@
|
|||||||
<type>cluster</type>
|
<type>cluster</type>
|
||||||
<front-end>
|
<front-end>
|
||||||
<name>qscfe1.lanl.gov</name>
|
<name>qscfe1.lanl.gov</name>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>lsf</launcher>
|
<launcher>lsf</launcher>
|
||||||
@ -425,6 +443,7 @@
|
|||||||
<front-end>
|
<front-end>
|
||||||
<name>cxfe.lanl.gov</name>
|
<name>cxfe.lanl.gov</name>
|
||||||
<tmp-dir>/scratch1</tmp-dir>
|
<tmp-dir>/scratch1</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>lsf</launcher>
|
<launcher>lsf</launcher>
|
||||||
@ -432,14 +451,14 @@
|
|||||||
<num-nodes>32</num-nodes>
|
<num-nodes>32</num-nodes>
|
||||||
<cpus-per-node>4</cpus-per-node>
|
<cpus-per-node>4</cpus-per-node>
|
||||||
<memory-per-node>4.0</memory-per-node>
|
<memory-per-node>4.0</memory-per-node>
|
||||||
<node-arch>
|
<arch>
|
||||||
<name>cx0</name>
|
<name>cx0</name>
|
||||||
<memory-per-node>16.0</memory-per-node>
|
<memory-per-node>16.0</memory-per-node>
|
||||||
</node-arch>
|
</arch>
|
||||||
<node-arch>
|
<arch>
|
||||||
<name>cx1</name>
|
<name>cx1</name>
|
||||||
<memory-per-node>16.0</memory-per-node>
|
<memory-per-node>16.0</memory-per-node>
|
||||||
</node-arch>
|
</arch>
|
||||||
<interconnect>
|
<interconnect>
|
||||||
<type>quadrics</type>
|
<type>quadrics</type>
|
||||||
<num-rails>1</num-rails>
|
<num-rails>1</num-rails>
|
||||||
@ -470,6 +489,7 @@
|
|||||||
<front-end>
|
<front-end>
|
||||||
<name>mauve.lanl.gov</name>
|
<name>mauve.lanl.gov</name>
|
||||||
<tmp-dir>/scratch</tmp-dir>
|
<tmp-dir>/scratch</tmp-dir>
|
||||||
|
<ssh>true</ssh>
|
||||||
</front-end>
|
</front-end>
|
||||||
<allocator>lsf</allocator>
|
<allocator>lsf</allocator>
|
||||||
<launcher>lsf</launcher>
|
<launcher>lsf</launcher>
|
||||||
|
@ -71,7 +71,9 @@ enum {
|
|||||||
ORTE_ERR_GPR_DATA_CORRUPT = -44,
|
ORTE_ERR_GPR_DATA_CORRUPT = -44,
|
||||||
ORTE_ERR_PERM = -45, /* no permission */
|
ORTE_ERR_PERM = -45, /* no permission */
|
||||||
ORTE_ERR_TYPE_MISMATCH = -46,
|
ORTE_ERR_TYPE_MISMATCH = -46,
|
||||||
ORTE_ERR_VALUE_OUT_OF_BOUNDS = -47
|
ORTE_ERR_VALUE_OUT_OF_BOUNDS = -47,
|
||||||
|
ORTE_ERR_FILE_READ_FAILURE = -48,
|
||||||
|
ORTE_ERR_FILE_WRITE_FAILURE = -49
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ORTE_CONSTANTS_H */
|
#endif /* ORTE_CONSTANTS_H */
|
||||||
|
@ -33,7 +33,8 @@ libmca_gpr_base_la_SOURCES = \
|
|||||||
$(headers) \
|
$(headers) \
|
||||||
gpr_base_open.c \
|
gpr_base_open.c \
|
||||||
gpr_base_close.c \
|
gpr_base_close.c \
|
||||||
gpr_base_select.c
|
gpr_base_select.c \
|
||||||
|
gpr_base_xfer_payload.c
|
||||||
|
|
||||||
# Conditionally install the header files
|
# Conditionally install the header files
|
||||||
|
|
||||||
|
@ -212,6 +212,11 @@ int orte_gpr_base_unpack_subscription(orte_buffer_t *buffer, void *dest,
|
|||||||
int orte_gpr_base_unpack_notify_data(orte_buffer_t *buffer, void *dest,
|
int orte_gpr_base_unpack_notify_data(orte_buffer_t *buffer, void *dest,
|
||||||
size_t *num_vals, orte_data_type_t type);
|
size_t *num_vals, orte_data_type_t type);
|
||||||
|
|
||||||
|
/* general utilities */
|
||||||
|
int orte_gpr_base_xfer_payload(orte_gpr_value_union_t *dest,
|
||||||
|
orte_gpr_value_union_t *src,
|
||||||
|
orte_data_type_t type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* globals that might be needed inside the gpr
|
* globals that might be needed inside the gpr
|
||||||
*/
|
*/
|
||||||
|
177
src/mca/gpr/base/gpr_base_xfer_payload.c
Обычный файл
177
src/mca/gpr/base/gpr_base_xfer_payload.c
Обычный файл
@ -0,0 +1,177 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
|
* All rights reserved.
|
||||||
|
* $COPYRIGHT$
|
||||||
|
*
|
||||||
|
* Additional copyrights may follow
|
||||||
|
*
|
||||||
|
* $HEADER$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "orte_config.h"
|
||||||
|
#include "include/orte_constants.h"
|
||||||
|
#include "include/constants.h"
|
||||||
|
|
||||||
|
#include "util/argv.h"
|
||||||
|
#include "util/output.h"
|
||||||
|
|
||||||
|
#include "mca/errmgr/errmgr.h"
|
||||||
|
|
||||||
|
#include "mca/gpr/base/base.h"
|
||||||
|
|
||||||
|
|
||||||
|
int orte_gpr_base_xfer_payload(orte_gpr_value_union_t *dest,
|
||||||
|
orte_gpr_value_union_t *src,
|
||||||
|
orte_data_type_t type)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
switch(type) {
|
||||||
|
|
||||||
|
case ORTE_BOOL:
|
||||||
|
dest->tf_flag = src->tf_flag;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_SIZE:
|
||||||
|
dest->size = src->size;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_PID:
|
||||||
|
dest->pid = src->pid;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_STRING:
|
||||||
|
dest->strptr = strdup(src->strptr);
|
||||||
|
if (NULL == dest->strptr) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_UINT8:
|
||||||
|
dest->ui8 = src->ui8;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_UINT16:
|
||||||
|
dest->ui16 = src->ui16;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_UINT32:
|
||||||
|
dest->ui32 = src->ui32;
|
||||||
|
break;
|
||||||
|
|
||||||
|
#ifdef HAVE_INT64_T
|
||||||
|
case ORTE_UINT64:
|
||||||
|
dest->ui64 = src->ui64;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
case ORTE_INT8:
|
||||||
|
dest->i8 = src->i8;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_INT16:
|
||||||
|
dest->i16 = src->i16;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_INT32:
|
||||||
|
dest->i32 = src->i32;
|
||||||
|
break;
|
||||||
|
|
||||||
|
#ifdef HAVE_INT64_T
|
||||||
|
case ORTE_INT64:
|
||||||
|
dest->i64 = src->i64;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
case ORTE_NAME:
|
||||||
|
dest->proc = src->proc;;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_JOBID:
|
||||||
|
dest->jobid = src->jobid;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_CELLID:
|
||||||
|
dest->cellid = src->cellid;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_VPID:
|
||||||
|
dest->vpid = src->vpid;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_NODE_STATE:
|
||||||
|
dest->node_state = src->node_state;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_PROC_STATE:
|
||||||
|
dest->proc_state = src->proc_state;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_EXIT_CODE:
|
||||||
|
dest->exit_code = src->exit_code;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_BYTE_OBJECT:
|
||||||
|
(dest->byteobject).size = (src->byteobject).size;
|
||||||
|
(dest->byteobject).bytes = (uint8_t*)malloc((dest->byteobject).size);
|
||||||
|
if (NULL == (dest->byteobject).bytes) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
memcpy((dest->byteobject).bytes, (src->byteobject).bytes, (dest->byteobject).size);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_APP_CONTEXT:
|
||||||
|
if(NULL == src->app_context) {
|
||||||
|
dest->app_context = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
dest->app_context = OBJ_NEW(orte_app_context_t);
|
||||||
|
dest->app_context->idx = src->app_context->idx;
|
||||||
|
if(NULL != src->app_context->app) {
|
||||||
|
dest->app_context->app = strdup(src->app_context->app);
|
||||||
|
} else {
|
||||||
|
dest->app_context->app = NULL;
|
||||||
|
}
|
||||||
|
dest->app_context->num_procs = src->app_context->num_procs;
|
||||||
|
dest->app_context->argc = src->app_context->argc;
|
||||||
|
dest->app_context->argv = ompi_argv_copy(src->app_context->argv);
|
||||||
|
dest->app_context->num_env = src->app_context->num_env;
|
||||||
|
dest->app_context->env = ompi_argv_copy(src->app_context->env);
|
||||||
|
if(NULL != src->app_context->cwd) {
|
||||||
|
dest->app_context->cwd = strdup(src->app_context->cwd);
|
||||||
|
} else {
|
||||||
|
dest->app_context->cwd = NULL;
|
||||||
|
}
|
||||||
|
dest->app_context->num_map = src->app_context->num_map;
|
||||||
|
if (NULL != src->app_context->map_data) {
|
||||||
|
dest->app_context->map_data = (orte_app_context_map_t **) malloc(sizeof(orte_app_context_map_t *) * src->app_context->num_map);
|
||||||
|
for (i = 0; i < src->app_context->num_map; ++i) {
|
||||||
|
dest->app_context->map_data[i] =
|
||||||
|
OBJ_NEW(orte_app_context_map_t);
|
||||||
|
dest->app_context->map_data[i]->map_type =
|
||||||
|
src->app_context->map_data[i]->map_type;
|
||||||
|
dest->app_context->map_data[i]->map_data =
|
||||||
|
strdup(src->app_context->map_data[i]->map_data);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dest->app_context->map_data = NULL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ORTE_NULL:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return ORTE_ERR_BAD_PARAM;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
@ -512,6 +512,21 @@ typedef int (*orte_gpr_base_module_increment_value_fn_t)(orte_gpr_value_t *value
|
|||||||
typedef int (*orte_gpr_base_module_decrement_value_fn_t)(orte_gpr_value_t *value);
|
typedef int (*orte_gpr_base_module_decrement_value_fn_t)(orte_gpr_value_t *value);
|
||||||
|
|
||||||
|
|
||||||
|
/* Transfer a payload between keyval values
|
||||||
|
* Because the data type of the value dictates how it must be transferred, it can be
|
||||||
|
* a burden to transfer the payload. This function centralizes that action so it only
|
||||||
|
* need be defined once.
|
||||||
|
*
|
||||||
|
* @param dest The address of the value union where the data is to be placed.
|
||||||
|
* @param src The address of the value union currently holding the data.
|
||||||
|
* @param type The type of the data
|
||||||
|
*
|
||||||
|
* @retval ORTE_SUCCESS Operation successfully completed.
|
||||||
|
* @retval ORTE_ERROR(s) Operation failed, returning the provided error code.
|
||||||
|
*/
|
||||||
|
typedef int (*orte_gpr_base_module_xfer_payload_fn_t)(orte_gpr_value_union_t *dest,
|
||||||
|
orte_gpr_value_union_t *src, orte_data_type_t type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ver 1.0.0
|
* Ver 1.0.0
|
||||||
*/
|
*/
|
||||||
@ -532,6 +547,7 @@ struct orte_gpr_base_module_1_0_0_t {
|
|||||||
orte_gpr_base_module_index_nb_fn_t index_nb;
|
orte_gpr_base_module_index_nb_fn_t index_nb;
|
||||||
/* GENERAL OPERATIONS */
|
/* GENERAL OPERATIONS */
|
||||||
orte_gpr_base_module_preallocate_segment_fn_t preallocate_segment;
|
orte_gpr_base_module_preallocate_segment_fn_t preallocate_segment;
|
||||||
|
orte_gpr_base_module_xfer_payload_fn_t xfer_payload;
|
||||||
/* ARITHMETIC OPERATIONS */
|
/* ARITHMETIC OPERATIONS */
|
||||||
orte_gpr_base_module_increment_value_fn_t increment_value;
|
orte_gpr_base_module_increment_value_fn_t increment_value;
|
||||||
orte_gpr_base_module_decrement_value_fn_t decrement_value;
|
orte_gpr_base_module_decrement_value_fn_t decrement_value;
|
||||||
|
@ -134,6 +134,7 @@ typedef uint16_t orte_gpr_addr_mode_t;
|
|||||||
typedef union { /* shared storage for the value */
|
typedef union { /* shared storage for the value */
|
||||||
char *strptr;
|
char *strptr;
|
||||||
size_t size;
|
size_t size;
|
||||||
|
bool tf_flag;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
uint8_t ui8;
|
uint8_t ui8;
|
||||||
uint16_t ui16;
|
uint16_t ui16;
|
||||||
|
@ -81,6 +81,7 @@ static orte_gpr_base_module_t orte_gpr_proxy = {
|
|||||||
orte_gpr_proxy_index_nb,
|
orte_gpr_proxy_index_nb,
|
||||||
/* GENERAL OPERATIONS */
|
/* GENERAL OPERATIONS */
|
||||||
orte_gpr_proxy_preallocate_segment,
|
orte_gpr_proxy_preallocate_segment,
|
||||||
|
orte_gpr_base_xfer_payload,
|
||||||
/* ARITHMETIC OPERATIONS */
|
/* ARITHMETIC OPERATIONS */
|
||||||
orte_gpr_proxy_increment_value,
|
orte_gpr_proxy_increment_value,
|
||||||
orte_gpr_proxy_decrement_value,
|
orte_gpr_proxy_decrement_value,
|
||||||
|
@ -42,7 +42,7 @@ bool orte_gpr_replica_check_itag_list(orte_gpr_replica_addr_mode_t addr_mode,
|
|||||||
size_t i, j;
|
size_t i, j;
|
||||||
|
|
||||||
/* check for trivial case */
|
/* check for trivial case */
|
||||||
if (NULL == itags || 0 >= num_itags_search) { /* wildcard case - automatically true */
|
if (NULL == itags || 0 == num_itags_search) { /* wildcard case - automatically true */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ void orte_gpr_replica_dump_itagval_value(orte_buffer_t *buffer,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ORTE_BOOL:
|
case ORTE_BOOL:
|
||||||
sprintf(tmp, "\t\tData type: ORTE_BOOL");
|
sprintf(tmp, "\t\tData type: ORTE_BOOL\tValue: %s", iptr->value.tf_flag ? "TRUE" : "FALSE");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ORTE_STRING:
|
case ORTE_STRING:
|
||||||
|
@ -200,10 +200,6 @@ typedef int (*orte_gpr_replica_update_keyval_fn_t)
|
|||||||
orte_gpr_replica_container_t *cptr,
|
orte_gpr_replica_container_t *cptr,
|
||||||
orte_gpr_keyval_t *kptr);
|
orte_gpr_keyval_t *kptr);
|
||||||
|
|
||||||
int orte_gpr_replica_xfer_payload(orte_gpr_value_union_t *dest,
|
|
||||||
orte_gpr_value_union_t *src,
|
|
||||||
orte_data_type_t type);
|
|
||||||
|
|
||||||
int orte_gpr_replica_compare_values(int *cmp, orte_gpr_replica_itagval_t *ival1,
|
int orte_gpr_replica_compare_values(int *cmp, orte_gpr_replica_itagval_t *ival1,
|
||||||
orte_gpr_replica_itagval_t *ival2);
|
orte_gpr_replica_itagval_t *ival2);
|
||||||
|
|
||||||
|
@ -459,7 +459,7 @@ MOVEON:
|
|||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
kptr[n]->type = (values[i]->keyvals[n])->type;
|
kptr[n]->type = (values[i]->keyvals[n])->type;
|
||||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_xfer_payload(
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_xfer_payload(
|
||||||
&(kptr[n]->value), &((values[i]->keyvals[n])->value),
|
&(kptr[n]->value), &((values[i]->keyvals[n])->value),
|
||||||
(values[i]->keyvals[n])->type))) {
|
(values[i]->keyvals[n])->type))) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
|
@ -335,7 +335,7 @@ int orte_gpr_replica_get_fn(orte_gpr_addr_mode_t addr_mode,
|
|||||||
ival_list = OBJ_NEW(orte_gpr_replica_ival_list_t);
|
ival_list = OBJ_NEW(orte_gpr_replica_ival_list_t);
|
||||||
ival_list->itag = iptr[j]->itag;
|
ival_list->itag = iptr[j]->itag;
|
||||||
ival_list->type = iptr[j]->type;
|
ival_list->type = iptr[j]->type;
|
||||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_xfer_payload(
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_xfer_payload(
|
||||||
&(ival_list->value), &(iptr[j]->value), iptr[j]->type))) {
|
&(ival_list->value), &(iptr[j]->value), iptr[j]->type))) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
OBJ_RELEASE(ival_list);
|
OBJ_RELEASE(ival_list);
|
||||||
@ -411,7 +411,7 @@ int orte_gpr_replica_get_fn(orte_gpr_addr_mode_t addr_mode,
|
|||||||
goto CLEANUP;
|
goto CLEANUP;
|
||||||
}
|
}
|
||||||
kptr[j]->type = ival_list->type;
|
kptr[j]->type = ival_list->type;
|
||||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_xfer_payload(
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_xfer_payload(
|
||||||
&(kptr[j]->value), &(ival_list->value), ival_list->type))) {
|
&(kptr[j]->value), &(ival_list->value), ival_list->type))) {
|
||||||
goto CLEANUP;
|
goto CLEANUP;
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ int orte_gpr_replica_add_keyval(orte_gpr_replica_itagval_t **ivalptr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
iptr->type = kptr->type;
|
iptr->type = kptr->type;
|
||||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_xfer_payload(&(iptr->value),
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_xfer_payload(&(iptr->value),
|
||||||
&(kptr->value), kptr->type))) {
|
&(kptr->value), kptr->type))) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
OBJ_RELEASE(iptr);
|
OBJ_RELEASE(iptr);
|
||||||
@ -369,152 +369,6 @@ int orte_gpr_replica_get_value(void *value, orte_gpr_replica_itagval_t *ival)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int orte_gpr_replica_xfer_payload(orte_gpr_value_union_t *dest,
|
|
||||||
orte_gpr_value_union_t *src,
|
|
||||||
orte_data_type_t type)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
switch(type) {
|
|
||||||
|
|
||||||
case ORTE_SIZE:
|
|
||||||
dest->size = src->size;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_PID:
|
|
||||||
dest->pid = src->pid;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_STRING:
|
|
||||||
dest->strptr = strdup(src->strptr);
|
|
||||||
if (NULL == dest->strptr) {
|
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_UINT8:
|
|
||||||
dest->ui8 = src->ui8;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_UINT16:
|
|
||||||
dest->ui16 = src->ui16;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_UINT32:
|
|
||||||
dest->ui32 = src->ui32;
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef HAVE_INT64_T
|
|
||||||
case ORTE_UINT64:
|
|
||||||
dest->ui64 = src->ui64;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case ORTE_INT8:
|
|
||||||
dest->i8 = src->i8;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_INT16:
|
|
||||||
dest->i16 = src->i16;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_INT32:
|
|
||||||
dest->i32 = src->i32;
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef HAVE_INT64_T
|
|
||||||
case ORTE_INT64:
|
|
||||||
dest->i64 = src->i64;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case ORTE_NAME:
|
|
||||||
dest->proc = src->proc;;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_JOBID:
|
|
||||||
dest->jobid = src->jobid;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_CELLID:
|
|
||||||
dest->cellid = src->cellid;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_VPID:
|
|
||||||
dest->vpid = src->vpid;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_NODE_STATE:
|
|
||||||
dest->node_state = src->node_state;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_PROC_STATE:
|
|
||||||
dest->proc_state = src->proc_state;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_EXIT_CODE:
|
|
||||||
dest->exit_code = src->exit_code;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_BYTE_OBJECT:
|
|
||||||
(dest->byteobject).size = (src->byteobject).size;
|
|
||||||
(dest->byteobject).bytes = (uint8_t*)malloc((dest->byteobject).size);
|
|
||||||
if (NULL == (dest->byteobject).bytes) {
|
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
||||||
}
|
|
||||||
memcpy((dest->byteobject).bytes, (src->byteobject).bytes, (dest->byteobject).size);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_APP_CONTEXT:
|
|
||||||
if(NULL == src->app_context) {
|
|
||||||
dest->app_context = NULL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
dest->app_context = OBJ_NEW(orte_app_context_t);
|
|
||||||
dest->app_context->idx = src->app_context->idx;
|
|
||||||
if(NULL != src->app_context->app) {
|
|
||||||
dest->app_context->app = strdup(src->app_context->app);
|
|
||||||
} else {
|
|
||||||
dest->app_context->app = NULL;
|
|
||||||
}
|
|
||||||
dest->app_context->num_procs = src->app_context->num_procs;
|
|
||||||
dest->app_context->argc = src->app_context->argc;
|
|
||||||
dest->app_context->argv = ompi_argv_copy(src->app_context->argv);
|
|
||||||
dest->app_context->num_env = src->app_context->num_env;
|
|
||||||
dest->app_context->env = ompi_argv_copy(src->app_context->env);
|
|
||||||
if(NULL != src->app_context->cwd) {
|
|
||||||
dest->app_context->cwd = strdup(src->app_context->cwd);
|
|
||||||
} else {
|
|
||||||
dest->app_context->cwd = NULL;
|
|
||||||
}
|
|
||||||
dest->app_context->num_map = src->app_context->num_map;
|
|
||||||
if (NULL != src->app_context->map_data) {
|
|
||||||
dest->app_context->map_data = (orte_app_context_map_t **) malloc(sizeof(orte_app_context_map_t *) * src->app_context->num_map);
|
|
||||||
for (i = 0; i < src->app_context->num_map; ++i) {
|
|
||||||
dest->app_context->map_data[i] =
|
|
||||||
OBJ_NEW(orte_app_context_map_t);
|
|
||||||
dest->app_context->map_data[i]->map_type =
|
|
||||||
src->app_context->map_data[i]->map_type;
|
|
||||||
dest->app_context->map_data[i]->map_data =
|
|
||||||
strdup(src->app_context->map_data[i]->map_data);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dest->app_context->map_data = NULL;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ORTE_NULL:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return ORTE_ERR_BAD_PARAM;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return ORTE_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
int orte_gpr_replica_compare_values(int *cmp, orte_gpr_replica_itagval_t *ival1,
|
int orte_gpr_replica_compare_values(int *cmp, orte_gpr_replica_itagval_t *ival1,
|
||||||
orte_gpr_replica_itagval_t *ival2)
|
orte_gpr_replica_itagval_t *ival2)
|
||||||
{
|
{
|
||||||
|
@ -220,7 +220,7 @@ int orte_gpr_replica_subscribe_fn(orte_gpr_notify_action_t action, size_t num_su
|
|||||||
cntr->cptr = cptr2;
|
cntr->cptr = cptr2;
|
||||||
cntr->iptr = iptr;
|
cntr->iptr = iptr;
|
||||||
cntr->trigger_level.type = (trigs[j]->keyvals[i])->type;
|
cntr->trigger_level.type = (trigs[j]->keyvals[i])->type;
|
||||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_xfer_payload(&(cntr->trigger_level.value),
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_xfer_payload(&(cntr->trigger_level.value),
|
||||||
&((trigs[j]->keyvals[i])->value), (trigs[j]->keyvals[i])->type))) {
|
&((trigs[j]->keyvals[i])->value), (trigs[j]->keyvals[i])->type))) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
goto CLEANUP;
|
goto CLEANUP;
|
||||||
@ -265,7 +265,7 @@ int orte_gpr_replica_subscribe_fn(orte_gpr_notify_action_t action, size_t num_su
|
|||||||
cntr->cptr = cptr[k];
|
cntr->cptr = cptr[k];
|
||||||
cntr->iptr = iptr;
|
cntr->iptr = iptr;
|
||||||
cntr->trigger_level.type = (trigs[j]->keyvals[i])->type;
|
cntr->trigger_level.type = (trigs[j]->keyvals[i])->type;
|
||||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_xfer_payload(&(cntr->trigger_level.value),
|
if (ORTE_SUCCESS != (rc = orte_gpr_base_xfer_payload(&(cntr->trigger_level.value),
|
||||||
&((trigs[j]->keyvals[i])->value), (trigs[j]->keyvals[i])->type))) {
|
&((trigs[j]->keyvals[i])->value), (trigs[j]->keyvals[i])->type))) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
goto CLEANUP;
|
goto CLEANUP;
|
||||||
|
@ -78,6 +78,7 @@ static orte_gpr_base_module_t orte_gpr_replica_module = {
|
|||||||
orte_gpr_replica_index_nb,
|
orte_gpr_replica_index_nb,
|
||||||
/* GENERAL OPERATIONS */
|
/* GENERAL OPERATIONS */
|
||||||
orte_gpr_replica_preallocate_segment,
|
orte_gpr_replica_preallocate_segment,
|
||||||
|
orte_gpr_base_xfer_payload,
|
||||||
/* ARITHMETIC OPERATIONS */
|
/* ARITHMETIC OPERATIONS */
|
||||||
orte_gpr_replica_increment_value,
|
orte_gpr_replica_increment_value,
|
||||||
orte_gpr_replica_decrement_value,
|
orte_gpr_replica_decrement_value,
|
||||||
|
@ -128,9 +128,14 @@ OMPI_DECLSPEC int orte_ns_base_compare(orte_ns_cmp_bitmask_t fields,
|
|||||||
|
|
||||||
OMPI_DECLSPEC int orte_ns_base_free_name(orte_process_name_t **name);
|
OMPI_DECLSPEC int orte_ns_base_free_name(orte_process_name_t **name);
|
||||||
|
|
||||||
|
/* not available functions */
|
||||||
OMPI_DECLSPEC int orte_ns_base_module_init_not_available(void);
|
OMPI_DECLSPEC int orte_ns_base_module_init_not_available(void);
|
||||||
|
|
||||||
OMPI_DECLSPEC int orte_ns_base_create_cellid_not_available(orte_cellid_t *cellid);
|
OMPI_DECLSPEC int orte_ns_base_create_cellid_not_available(orte_cellid_t *cellid,
|
||||||
|
char *site, char *resource);
|
||||||
|
|
||||||
|
OMPI_DECLSPEC int orte_ns_base_get_cell_info_not_available(orte_cellid_t cellid,
|
||||||
|
char **site, char **resource);
|
||||||
|
|
||||||
OMPI_DECLSPEC int orte_ns_base_create_jobid_not_available(orte_jobid_t *jobid);
|
OMPI_DECLSPEC int orte_ns_base_create_jobid_not_available(orte_jobid_t *jobid);
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "util/output.h"
|
||||||
|
|
||||||
#include "mca/errmgr/errmgr.h"
|
#include "mca/errmgr/errmgr.h"
|
||||||
#include "dps/dps_internal.h"
|
#include "dps/dps_internal.h"
|
||||||
|
|
||||||
|
@ -51,13 +51,23 @@ orte_ns_base_module_init_not_available(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
orte_ns_base_create_cellid_not_available(orte_cellid_t *cellid)
|
orte_ns_base_create_cellid_not_available(orte_cellid_t *cellid, char *site, char *resource)
|
||||||
{
|
{
|
||||||
*cellid = ORTE_CELLID_MAX;
|
*cellid = ORTE_CELLID_MAX;
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_UNREACH);
|
ORTE_ERROR_LOG(ORTE_ERR_UNREACH);
|
||||||
return ORTE_ERR_UNREACH;
|
return ORTE_ERR_UNREACH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
orte_ns_base_get_cell_info_not_available(orte_cellid_t cellid,
|
||||||
|
char **site, char **resource)
|
||||||
|
{
|
||||||
|
*site = NULL;
|
||||||
|
*resource = NULL;
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_UNREACH);
|
||||||
|
return ORTE_ERR_UNREACH;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
orte_ns_base_create_jobid_not_available(orte_jobid_t *jobid)
|
orte_ns_base_create_jobid_not_available(orte_jobid_t *jobid)
|
||||||
{
|
{
|
||||||
|
@ -50,6 +50,7 @@ int mca_ns_base_output = -1;
|
|||||||
OMPI_DECLSPEC mca_ns_base_module_t orte_ns = {
|
OMPI_DECLSPEC mca_ns_base_module_t orte_ns = {
|
||||||
orte_ns_base_module_init_not_available,
|
orte_ns_base_module_init_not_available,
|
||||||
orte_ns_base_create_cellid_not_available,
|
orte_ns_base_create_cellid_not_available,
|
||||||
|
orte_ns_base_get_cell_info_not_available,
|
||||||
orte_ns_base_assign_cellid_to_process,
|
orte_ns_base_assign_cellid_to_process,
|
||||||
orte_ns_base_create_jobid_not_available,
|
orte_ns_base_create_jobid_not_available,
|
||||||
orte_ns_base_create_process_name,
|
orte_ns_base_create_process_name,
|
||||||
|
@ -62,18 +62,37 @@ typedef int (*orte_ns_base_module_init_fn_t)(void);
|
|||||||
* 1 to MCA_NS_BASE_CELLID_MAX-1 (zero is reserved for the seed name and cannot therefore be
|
* 1 to MCA_NS_BASE_CELLID_MAX-1 (zero is reserved for the seed name and cannot therefore be
|
||||||
* allocated).
|
* allocated).
|
||||||
*
|
*
|
||||||
* @param None
|
* @param site The name of the site where the cell is located.
|
||||||
* @retval cellid The numerical value of the allocated cell id. A value of
|
* @param resource The name of the resource associated with this cell (e.g., the name
|
||||||
|
* of the cluster).
|
||||||
|
* @param cellid The numerical value of the allocated cell id. A value of
|
||||||
* MCA_NS_BASE_CELLID_MAX indicates
|
* MCA_NS_BASE_CELLID_MAX indicates
|
||||||
* that an error occurred - this represents a very unlikely
|
* that an error occurred - this represents a very unlikely
|
||||||
* event meaning that the system ran out of cell id's. This probably indicates
|
* event meaning that the system ran out of cell id's. This probably indicates
|
||||||
* an error in the calling program as the number of available cell id's is extremely large.
|
* an error in the calling program as the number of available cell id's is extremely large.
|
||||||
*
|
*
|
||||||
|
* @retval ORTE_SUCCESS A cellid was created and returned.
|
||||||
|
* @retval ORTE_ERROR_VALUE An error code indicative of the problem.
|
||||||
|
*
|
||||||
* @code
|
* @code
|
||||||
* new_cellid = ompi_name_server.create_cellid()
|
* new_cellid = ompi_name_server.create_cellid()
|
||||||
* @endcode
|
* @endcode
|
||||||
*/
|
*/
|
||||||
typedef int (*orte_ns_base_module_create_cellid_fn_t)(orte_cellid_t *cellid);
|
typedef int (*orte_ns_base_module_create_cellid_fn_t)(orte_cellid_t *cellid,
|
||||||
|
char *site, char *resource);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get cell info
|
||||||
|
* Retrieve the site and resource info on a cell.
|
||||||
|
*
|
||||||
|
* @param cellid The id of the cell who's info is being requested.
|
||||||
|
* @param site Returns a pointer to a strdup'd string containing the site name.
|
||||||
|
* @param resource Returns a pointer to a strdup'd string containg the resource name.
|
||||||
|
* @retval ORTE_SUCCESS A cellid was created and returned.
|
||||||
|
* @retval ORTE_ERROR_VALUE An error code indicative of the problem.
|
||||||
|
*/
|
||||||
|
typedef int (*orte_ns_base_module_get_cell_info_fn_t)(orte_cellid_t cellid,
|
||||||
|
char **site, char **resource);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the cell id for a process.
|
* Get the cell id for a process.
|
||||||
@ -571,6 +590,7 @@ typedef int (*orte_ns_base_module_get_peers_fn_t)(orte_process_name_t **procs,
|
|||||||
struct mca_ns_base_module_1_0_0_t {
|
struct mca_ns_base_module_1_0_0_t {
|
||||||
orte_ns_base_module_init_fn_t init;
|
orte_ns_base_module_init_fn_t init;
|
||||||
orte_ns_base_module_create_cellid_fn_t create_cellid;
|
orte_ns_base_module_create_cellid_fn_t create_cellid;
|
||||||
|
orte_ns_base_module_get_cell_info_fn_t get_cell_info;
|
||||||
orte_ns_base_module_assign_cellid_to_process_fn_t assign_cellid_to_process;
|
orte_ns_base_module_assign_cellid_to_process_fn_t assign_cellid_to_process;
|
||||||
orte_ns_base_module_create_jobid_fn_t create_jobid;
|
orte_ns_base_module_create_jobid_fn_t create_jobid;
|
||||||
orte_ns_base_module_create_proc_name_fn_t create_process_name;
|
orte_ns_base_module_create_proc_name_fn_t create_process_name;
|
||||||
|
@ -38,17 +38,24 @@
|
|||||||
* functions
|
* functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int orte_ns_proxy_create_cellid(orte_cellid_t *cellid)
|
int orte_ns_proxy_create_cellid(orte_cellid_t *cellid, char *site, char *resource)
|
||||||
{
|
{
|
||||||
orte_buffer_t* cmd;
|
orte_buffer_t* cmd;
|
||||||
orte_buffer_t* answer;
|
orte_buffer_t* answer;
|
||||||
orte_ns_cmd_flag_t command;
|
orte_ns_cmd_flag_t command;
|
||||||
size_t count;
|
size_t count;
|
||||||
int rc;
|
int rc;
|
||||||
|
orte_ns_proxy_cell_info_t *cptr;
|
||||||
|
|
||||||
/* set the default value of error */
|
/* set the default value of error */
|
||||||
*cellid = ORTE_CELLID_MAX;
|
*cellid = ORTE_CELLID_MAX;
|
||||||
|
|
||||||
|
/* check for errors */
|
||||||
|
if (NULL == site || NULL == resource) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||||
|
return ORTE_ERR_BAD_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
command = ORTE_NS_CREATE_CELLID_CMD;
|
command = ORTE_NS_CREATE_CELLID_CMD;
|
||||||
|
|
||||||
cmd = OBJ_NEW(orte_buffer_t);
|
cmd = OBJ_NEW(orte_buffer_t);
|
||||||
@ -57,7 +64,19 @@ int orte_ns_proxy_create_cellid(orte_cellid_t *cellid)
|
|||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, (void*)&command, 1, ORTE_NS_CMD))) {
|
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_NS_CMD))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(cmd);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &site, 1, ORTE_STRING))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
OBJ_RELEASE(cmd);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &resource, 1, ORTE_STRING))) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
OBJ_RELEASE(cmd);
|
OBJ_RELEASE(cmd);
|
||||||
return rc;
|
return rc;
|
||||||
@ -102,10 +121,45 @@ int orte_ns_proxy_create_cellid(orte_cellid_t *cellid)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
OBJ_RELEASE(answer);
|
OBJ_RELEASE(answer);
|
||||||
|
|
||||||
|
/* store the info locally for later retrieval */
|
||||||
|
cptr = OBJ_NEW(orte_ns_proxy_cell_info_t);
|
||||||
|
if (NULL == cptr) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
cptr->cellid = *cellid;
|
||||||
|
cptr->site = strdup(site);
|
||||||
|
cptr->resource = strdup(resource);
|
||||||
|
ompi_list_append(&orte_ns_proxy_cell_info_list, &cptr->item);
|
||||||
|
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int orte_ns_proxy_get_cell_info(orte_cellid_t cellid,
|
||||||
|
char **site, char **resource)
|
||||||
|
{
|
||||||
|
ompi_list_item_t *item;
|
||||||
|
orte_ns_proxy_cell_info_t *cell;
|
||||||
|
|
||||||
|
*site = NULL;
|
||||||
|
*resource = NULL;
|
||||||
|
|
||||||
|
for (item = ompi_list_get_first(&orte_ns_proxy_cell_info_list);
|
||||||
|
item != ompi_list_get_end(&orte_ns_proxy_cell_info_list);
|
||||||
|
item = ompi_list_get_next(item)) {
|
||||||
|
cell = (orte_ns_proxy_cell_info_t*)item;
|
||||||
|
if (cellid == cell->cellid) {
|
||||||
|
*site = strdup(cell->site);
|
||||||
|
*resource = strdup(cell->resource);
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ORTE_ERR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
int orte_ns_proxy_create_jobid(orte_jobid_t *job)
|
int orte_ns_proxy_create_jobid(orte_jobid_t *job)
|
||||||
{
|
{
|
||||||
orte_buffer_t* cmd;
|
orte_buffer_t* cmd;
|
||||||
|
@ -31,6 +31,16 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct orte_ns_proxy_cell_info_t {
|
||||||
|
ompi_list_item_t item; /**< Allows this item to be placed on a list */
|
||||||
|
orte_cellid_t cellid;
|
||||||
|
char *site;
|
||||||
|
char *resource;
|
||||||
|
};
|
||||||
|
typedef struct orte_ns_proxy_cell_info_t orte_ns_proxy_cell_info_t;
|
||||||
|
|
||||||
|
OBJ_CLASS_DECLARATION(orte_ns_proxy_cell_info_t);
|
||||||
|
|
||||||
struct orte_ns_proxy_tagitem_t {
|
struct orte_ns_proxy_tagitem_t {
|
||||||
ompi_list_item_t item; /**< Allows this item to be placed on a list */
|
ompi_list_item_t item; /**< Allows this item to be placed on a list */
|
||||||
orte_rml_tag_t tag; /**< OOB tag */
|
orte_rml_tag_t tag; /**< OOB tag */
|
||||||
@ -70,6 +80,7 @@ int orte_ns_proxy_finalize(void);
|
|||||||
|
|
||||||
extern orte_process_name_t *orte_ns_my_replica;
|
extern orte_process_name_t *orte_ns_my_replica;
|
||||||
extern int orte_ns_proxy_debug;
|
extern int orte_ns_proxy_debug;
|
||||||
|
extern ompi_list_t orte_ns_proxy_cell_info_list;
|
||||||
extern ompi_list_t orte_ns_proxy_taglist;
|
extern ompi_list_t orte_ns_proxy_taglist;
|
||||||
extern ompi_list_t orte_ns_proxy_dtlist;
|
extern ompi_list_t orte_ns_proxy_dtlist;
|
||||||
extern ompi_mutex_t orte_ns_proxy_mutex;
|
extern ompi_mutex_t orte_ns_proxy_mutex;
|
||||||
@ -77,7 +88,9 @@ extern ompi_mutex_t orte_ns_proxy_mutex;
|
|||||||
/*
|
/*
|
||||||
* proxy function prototypes
|
* proxy function prototypes
|
||||||
*/
|
*/
|
||||||
int orte_ns_proxy_create_cellid(orte_cellid_t *cellid);
|
int orte_ns_proxy_create_cellid(orte_cellid_t *cellid, char *site, char *resource);
|
||||||
|
|
||||||
|
int orte_ns_proxy_get_cell_info(orte_cellid_t cellid, char **site, char **resource);
|
||||||
|
|
||||||
int orte_ns_proxy_create_jobid(orte_jobid_t *jobid);
|
int orte_ns_proxy_create_jobid(orte_jobid_t *jobid);
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ OMPI_COMP_EXPORT mca_ns_base_component_t mca_ns_proxy_component = {
|
|||||||
static mca_ns_base_module_t orte_ns_proxy = {
|
static mca_ns_base_module_t orte_ns_proxy = {
|
||||||
orte_ns_proxy_module_init,
|
orte_ns_proxy_module_init,
|
||||||
orte_ns_proxy_create_cellid,
|
orte_ns_proxy_create_cellid,
|
||||||
|
orte_ns_proxy_get_cell_info,
|
||||||
orte_ns_base_assign_cellid_to_process,
|
orte_ns_base_assign_cellid_to_process,
|
||||||
orte_ns_proxy_create_jobid,
|
orte_ns_proxy_create_jobid,
|
||||||
orte_ns_base_create_process_name,
|
orte_ns_base_create_process_name,
|
||||||
@ -100,6 +101,31 @@ static mca_ns_base_module_t orte_ns_proxy = {
|
|||||||
*/
|
*/
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
|
|
||||||
|
/* constructor - used to initialize state of cell info list instance */
|
||||||
|
static void orte_ns_proxy_cell_info_construct(orte_ns_proxy_cell_info_t* ptr)
|
||||||
|
{
|
||||||
|
ptr->resource = NULL;
|
||||||
|
ptr->site = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* destructor - used to free any resources held by instance */
|
||||||
|
static void orte_ns_proxy_cell_info_destructor(orte_ns_proxy_cell_info_t* ptr)
|
||||||
|
{
|
||||||
|
if (NULL != ptr->resource) {
|
||||||
|
free(ptr->resource);
|
||||||
|
}
|
||||||
|
if (NULL != ptr->site) {
|
||||||
|
free(ptr->site);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* define instance of ompi_class_t */
|
||||||
|
OBJ_CLASS_INSTANCE(
|
||||||
|
orte_ns_proxy_cell_info_t, /* type name */
|
||||||
|
ompi_list_item_t, /* parent "class" name */
|
||||||
|
orte_ns_proxy_cell_info_construct, /* constructor */
|
||||||
|
orte_ns_proxy_cell_info_destructor); /* destructor */
|
||||||
|
|
||||||
/* constructor - used to initialize state of taglist instance */
|
/* constructor - used to initialize state of taglist instance */
|
||||||
static void orte_ns_proxy_tagitem_construct(orte_ns_proxy_tagitem_t* tagitem)
|
static void orte_ns_proxy_tagitem_construct(orte_ns_proxy_tagitem_t* tagitem)
|
||||||
{
|
{
|
||||||
@ -150,6 +176,7 @@ OBJ_CLASS_INSTANCE(
|
|||||||
|
|
||||||
orte_process_name_t* orte_ns_my_replica=NULL;
|
orte_process_name_t* orte_ns_my_replica=NULL;
|
||||||
int orte_ns_proxy_debug=0;
|
int orte_ns_proxy_debug=0;
|
||||||
|
ompi_list_t orte_ns_proxy_cell_info_list;
|
||||||
ompi_list_t orte_ns_proxy_taglist;
|
ompi_list_t orte_ns_proxy_taglist;
|
||||||
ompi_list_t orte_ns_proxy_dtlist;
|
ompi_list_t orte_ns_proxy_dtlist;
|
||||||
ompi_mutex_t orte_ns_proxy_mutex;
|
ompi_mutex_t orte_ns_proxy_mutex;
|
||||||
@ -206,6 +233,9 @@ mca_ns_base_module_t* orte_ns_proxy_init(int *priority)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* initialize the cell info list */
|
||||||
|
OBJ_CONSTRUCT(&orte_ns_proxy_cell_info_list, ompi_list_t);
|
||||||
|
|
||||||
/* initialize the taglist */
|
/* initialize the taglist */
|
||||||
OBJ_CONSTRUCT(&orte_ns_proxy_taglist, ompi_list_t);
|
OBJ_CONSTRUCT(&orte_ns_proxy_taglist, ompi_list_t);
|
||||||
|
|
||||||
@ -238,14 +268,19 @@ int orte_ns_proxy_module_init(void)
|
|||||||
int orte_ns_proxy_finalize(void)
|
int orte_ns_proxy_finalize(void)
|
||||||
{
|
{
|
||||||
orte_ns_proxy_tagitem_t *tagitem;
|
orte_ns_proxy_tagitem_t *tagitem;
|
||||||
|
orte_ns_proxy_cell_info_t *cptr;
|
||||||
|
|
||||||
if (orte_ns_proxy_debug) {
|
if (orte_ns_proxy_debug) {
|
||||||
ompi_output(0, "finalizing ns proxy");
|
ompi_output(0, "finalizing ns proxy");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free the taglist storage, but only if this component was initialized */
|
/* free the storage, but only if this component was initialized */
|
||||||
|
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
|
while (NULL != (cptr = (orte_ns_proxy_cell_info_t*)ompi_list_remove_first(&orte_ns_proxy_cell_info_list))) {
|
||||||
|
OBJ_RELEASE(cptr);
|
||||||
|
}
|
||||||
|
OBJ_DESTRUCT(&orte_ns_proxy_cell_info_list);
|
||||||
while (NULL != (tagitem = (orte_ns_proxy_tagitem_t*)ompi_list_remove_first(&orte_ns_proxy_taglist))) {
|
while (NULL != (tagitem = (orte_ns_proxy_tagitem_t*)ompi_list_remove_first(&orte_ns_proxy_taglist))) {
|
||||||
OBJ_RELEASE(tagitem);
|
OBJ_RELEASE(tagitem);
|
||||||
}
|
}
|
||||||
|
@ -37,13 +37,26 @@
|
|||||||
* functions
|
* functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int orte_ns_replica_create_cellid(orte_cellid_t *cellid)
|
int orte_ns_replica_create_cellid(orte_cellid_t *cellid, char *site, char *resource)
|
||||||
{
|
{
|
||||||
|
orte_ns_replica_cell_tracker_t *new_cell;
|
||||||
|
|
||||||
OMPI_THREAD_LOCK(&orte_ns_replica_mutex);
|
OMPI_THREAD_LOCK(&orte_ns_replica_mutex);
|
||||||
|
|
||||||
if (ORTE_CELLID_MAX > orte_ns_replica_next_cellid) {
|
if (ORTE_CELLID_MAX > orte_ns_replica_next_cellid) {
|
||||||
*cellid = orte_ns_replica_next_cellid;
|
*cellid = orte_ns_replica_next_cellid;
|
||||||
orte_ns_replica_next_cellid++;
|
orte_ns_replica_next_cellid++;
|
||||||
|
new_cell = OBJ_NEW(orte_ns_replica_cell_tracker_t);
|
||||||
|
if (NULL == new_cell) {
|
||||||
|
*cellid = ORTE_CELLID_MAX;
|
||||||
|
OMPI_THREAD_UNLOCK(&orte_ns_replica_mutex);
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
new_cell->cell = *cellid;
|
||||||
|
new_cell->site = strdup(site);
|
||||||
|
new_cell->resource = strdup(resource);
|
||||||
|
ompi_list_append(&orte_ns_replica_cell_tracker, &new_cell->item);
|
||||||
OMPI_THREAD_UNLOCK(&orte_ns_replica_mutex);
|
OMPI_THREAD_UNLOCK(&orte_ns_replica_mutex);
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -54,6 +67,26 @@ int orte_ns_replica_create_cellid(orte_cellid_t *cellid)
|
|||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int orte_ns_replica_get_cell_info(orte_cellid_t cellid,
|
||||||
|
char **site, char **resource)
|
||||||
|
{
|
||||||
|
ompi_list_item_t *item;
|
||||||
|
orte_ns_replica_cell_tracker_t *cell;
|
||||||
|
|
||||||
|
for (item = ompi_list_get_first(&orte_ns_replica_cell_tracker);
|
||||||
|
item != ompi_list_get_end(&orte_ns_replica_cell_tracker);
|
||||||
|
item = ompi_list_get_next(item)) {
|
||||||
|
cell = (orte_ns_replica_cell_tracker_t*)item;
|
||||||
|
if (cellid == cell->cell) {
|
||||||
|
*site = strdup(cell->site);
|
||||||
|
*resource = strdup(cell->resource);
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ORTE_ERR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int orte_ns_replica_create_jobid(orte_jobid_t *jobid)
|
int orte_ns_replica_create_jobid(orte_jobid_t *jobid)
|
||||||
{
|
{
|
||||||
orte_ns_replica_name_tracker_t *new_nt;
|
orte_ns_replica_name_tracker_t *new_nt;
|
||||||
|
@ -30,6 +30,20 @@
|
|||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* list class for tracking cellid's
|
||||||
|
*/
|
||||||
|
struct orte_ns_replica_cell_tracker_t {
|
||||||
|
ompi_list_item_t item;
|
||||||
|
orte_cellid_t cell;
|
||||||
|
char *site;
|
||||||
|
char *resource;
|
||||||
|
};
|
||||||
|
typedef struct orte_ns_replica_cell_tracker_t orte_ns_replica_cell_tracker_t;
|
||||||
|
|
||||||
|
OBJ_CLASS_DECLARATION(orte_ns_replica_cell_tracker_t);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* list class for tracking vpids/jobid
|
* list class for tracking vpids/jobid
|
||||||
* This structure is used to create a linked list of jobid-max vpid pairs. Basically, we
|
* This structure is used to create a linked list of jobid-max vpid pairs. Basically, we
|
||||||
@ -67,6 +81,7 @@ OBJ_CLASS_DECLARATION(orte_ns_replica_dti_t);
|
|||||||
*/
|
*/
|
||||||
extern orte_cellid_t orte_ns_replica_next_cellid;
|
extern orte_cellid_t orte_ns_replica_next_cellid;
|
||||||
extern orte_jobid_t orte_ns_replica_next_jobid;
|
extern orte_jobid_t orte_ns_replica_next_jobid;
|
||||||
|
extern ompi_list_t orte_ns_replica_cell_tracker;
|
||||||
extern ompi_list_t orte_ns_replica_name_tracker;
|
extern ompi_list_t orte_ns_replica_name_tracker;
|
||||||
extern orte_rml_tag_t orte_ns_replica_next_rml_tag;
|
extern orte_rml_tag_t orte_ns_replica_next_rml_tag;
|
||||||
extern orte_data_type_t orte_ns_replica_next_dti;
|
extern orte_data_type_t orte_ns_replica_next_dti;
|
||||||
@ -99,7 +114,13 @@ void orte_ns_replica_recv(int status, orte_process_name_t* sender,
|
|||||||
/*
|
/*
|
||||||
* Implementation of create_cellid().
|
* Implementation of create_cellid().
|
||||||
*/
|
*/
|
||||||
int orte_ns_replica_create_cellid(orte_cellid_t *cellid);
|
int orte_ns_replica_create_cellid(orte_cellid_t *cellid, char *site, char *resource);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Implementation of get_cell_info()
|
||||||
|
*/
|
||||||
|
int orte_ns_replica_get_cell_info(orte_cellid_t cellid,
|
||||||
|
char **site, char **resource);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Implementation of create_jobid().
|
* Implementation of create_jobid().
|
||||||
|
@ -70,6 +70,7 @@ OMPI_COMP_EXPORT mca_ns_base_component_t mca_ns_replica_component = {
|
|||||||
static mca_ns_base_module_t orte_ns_replica = {
|
static mca_ns_base_module_t orte_ns_replica = {
|
||||||
orte_ns_replica_module_init,
|
orte_ns_replica_module_init,
|
||||||
orte_ns_replica_create_cellid,
|
orte_ns_replica_create_cellid,
|
||||||
|
orte_ns_replica_get_cell_info,
|
||||||
orte_ns_base_assign_cellid_to_process,
|
orte_ns_base_assign_cellid_to_process,
|
||||||
orte_ns_replica_create_jobid,
|
orte_ns_replica_create_jobid,
|
||||||
orte_ns_base_create_process_name,
|
orte_ns_base_create_process_name,
|
||||||
@ -104,6 +105,29 @@ static mca_ns_base_module_t orte_ns_replica = {
|
|||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
|
|
||||||
|
|
||||||
|
/* constructor - used to initialize state of cell_tracker instance */
|
||||||
|
static void orte_ns_replica_cell_tracker_construct(orte_ns_replica_cell_tracker_t* cell_tracker)
|
||||||
|
{
|
||||||
|
cell_tracker->cell = 0;
|
||||||
|
cell_tracker->site = NULL;
|
||||||
|
cell_tracker->resource = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* destructor - used to free any resources held by instance */
|
||||||
|
static void orte_ns_replica_cell_tracker_destructor(orte_ns_replica_cell_tracker_t* cell_tracker)
|
||||||
|
{
|
||||||
|
if (NULL != cell_tracker->site) free(cell_tracker->site);
|
||||||
|
if (NULL != cell_tracker->resource) free(cell_tracker->resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* define instance of ompi_class_t */
|
||||||
|
OBJ_CLASS_INSTANCE(
|
||||||
|
orte_ns_replica_cell_tracker_t, /* type name */
|
||||||
|
ompi_list_item_t, /* parent "class" name */
|
||||||
|
orte_ns_replica_cell_tracker_construct, /* constructor */
|
||||||
|
orte_ns_replica_cell_tracker_destructor); /* destructor */
|
||||||
|
|
||||||
|
|
||||||
/* constructor - used to initialize state of name_tracker instance */
|
/* constructor - used to initialize state of name_tracker instance */
|
||||||
static void orte_ns_replica_tracker_construct(orte_ns_replica_name_tracker_t* name_tracker)
|
static void orte_ns_replica_tracker_construct(orte_ns_replica_name_tracker_t* name_tracker)
|
||||||
{
|
{
|
||||||
@ -123,6 +147,7 @@ OBJ_CLASS_INSTANCE(
|
|||||||
orte_ns_replica_tracker_construct, /* constructor */
|
orte_ns_replica_tracker_construct, /* constructor */
|
||||||
orte_ns_replica_tracker_destructor); /* destructor */
|
orte_ns_replica_tracker_destructor); /* destructor */
|
||||||
|
|
||||||
|
|
||||||
/* constructor - used to initialize state of taglist instance */
|
/* constructor - used to initialize state of taglist instance */
|
||||||
static void orte_ns_replica_tagitem_construct(orte_ns_replica_tagitem_t* tagitem)
|
static void orte_ns_replica_tagitem_construct(orte_ns_replica_tagitem_t* tagitem)
|
||||||
{
|
{
|
||||||
@ -145,6 +170,7 @@ OBJ_CLASS_INSTANCE(
|
|||||||
orte_ns_replica_tagitem_construct, /* constructor */
|
orte_ns_replica_tagitem_construct, /* constructor */
|
||||||
orte_ns_replica_tagitem_destructor); /* destructor */
|
orte_ns_replica_tagitem_destructor); /* destructor */
|
||||||
|
|
||||||
|
|
||||||
/* constructor - used to initialize state of dtilist instance */
|
/* constructor - used to initialize state of dtilist instance */
|
||||||
static void orte_ns_replica_dti_construct(orte_ns_replica_dti_t* dti)
|
static void orte_ns_replica_dti_construct(orte_ns_replica_dti_t* dti)
|
||||||
{
|
{
|
||||||
@ -172,6 +198,7 @@ OBJ_CLASS_INSTANCE(
|
|||||||
*/
|
*/
|
||||||
orte_cellid_t orte_ns_replica_next_cellid;
|
orte_cellid_t orte_ns_replica_next_cellid;
|
||||||
orte_jobid_t orte_ns_replica_next_jobid;
|
orte_jobid_t orte_ns_replica_next_jobid;
|
||||||
|
ompi_list_t orte_ns_replica_cell_tracker;
|
||||||
ompi_list_t orte_ns_replica_name_tracker;
|
ompi_list_t orte_ns_replica_name_tracker;
|
||||||
orte_rml_tag_t orte_ns_replica_next_rml_tag;
|
orte_rml_tag_t orte_ns_replica_next_rml_tag;
|
||||||
orte_data_type_t orte_ns_replica_next_dti;
|
orte_data_type_t orte_ns_replica_next_dti;
|
||||||
@ -225,6 +252,11 @@ mca_ns_base_module_t* orte_ns_replica_init(int *priority)
|
|||||||
|
|
||||||
*priority = 50;
|
*priority = 50;
|
||||||
|
|
||||||
|
/* initialize the cell tracker */
|
||||||
|
|
||||||
|
OBJ_CONSTRUCT(&orte_ns_replica_cell_tracker, ompi_list_t);
|
||||||
|
orte_ns_replica_next_cellid = 0;
|
||||||
|
|
||||||
/* initialize the name tracker */
|
/* initialize the name tracker */
|
||||||
|
|
||||||
OBJ_CONSTRUCT(&orte_ns_replica_name_tracker, ompi_list_t);
|
OBJ_CONSTRUCT(&orte_ns_replica_name_tracker, ompi_list_t);
|
||||||
@ -331,14 +363,14 @@ void orte_ns_replica_recv(int status, orte_process_name_t* sender,
|
|||||||
orte_cellid_t cell;
|
orte_cellid_t cell;
|
||||||
orte_jobid_t job;
|
orte_jobid_t job;
|
||||||
orte_vpid_t startvpid, range;
|
orte_vpid_t startvpid, range;
|
||||||
char *tagname;
|
char *tagname, *site, *resource;
|
||||||
orte_rml_tag_t oob_tag;
|
orte_rml_tag_t oob_tag;
|
||||||
orte_data_type_t type;
|
orte_data_type_t type;
|
||||||
size_t count;
|
size_t count;
|
||||||
int rc=ORTE_SUCCESS, ret;
|
int rc=ORTE_SUCCESS, ret;
|
||||||
|
|
||||||
count = 1;
|
count = 1;
|
||||||
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, (void*)&command, &count, ORTE_NS_CMD))) {
|
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &command, &count, ORTE_NS_CMD))) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
rc = ORTE_ERR_BAD_PARAM;
|
rc = ORTE_ERR_BAD_PARAM;
|
||||||
goto RETURN_ERROR;
|
goto RETURN_ERROR;
|
||||||
@ -348,14 +380,28 @@ void orte_ns_replica_recv(int status, orte_process_name_t* sender,
|
|||||||
|
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case ORTE_NS_CREATE_CELLID_CMD:
|
case ORTE_NS_CREATE_CELLID_CMD:
|
||||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(&answer, (void*)&command, 1, ORTE_NS_CMD))) {
|
if (ORTE_SUCCESS != (rc = orte_dps.pack(&answer, &command, 1, ORTE_NS_CMD))) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
goto RETURN_ERROR;
|
goto RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = orte_ns_replica_create_cellid(&cell);
|
count = 1;
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &site, &count, ORTE_STRING))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
rc = ORTE_ERR_BAD_PARAM;
|
||||||
|
goto RETURN_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (ORTE_SUCCESS != (ret = orte_dps.pack(&answer, (void*)&cell, 1, ORTE_CELLID))) {
|
count = 1;
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &resource, &count, ORTE_STRING))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
rc = ORTE_ERR_BAD_PARAM;
|
||||||
|
goto RETURN_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = orte_ns_replica_create_cellid(&cell, site, resource);
|
||||||
|
|
||||||
|
if (ORTE_SUCCESS != (ret = orte_dps.pack(&answer, &cell, 1, ORTE_CELLID))) {
|
||||||
ORTE_ERROR_LOG(ret);
|
ORTE_ERROR_LOG(ret);
|
||||||
goto RETURN_ERROR;
|
goto RETURN_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,8 @@ libmca_rds_base_la_SOURCES = \
|
|||||||
rds_base_close.c \
|
rds_base_close.c \
|
||||||
rds_base_select.c \
|
rds_base_select.c \
|
||||||
rds_base_open.c \
|
rds_base_open.c \
|
||||||
rds_base_query.c
|
rds_base_query.c \
|
||||||
|
rds_base_registry_fns.c
|
||||||
|
|
||||||
|
|
||||||
# Conditionally install the header files
|
# Conditionally install the header files
|
||||||
|
@ -50,7 +50,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(orte_rds_base_selected_t);
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* function definitions
|
* API function definitions
|
||||||
*/
|
*/
|
||||||
OMPI_DECLSPEC int orte_rds_base_open(void);
|
OMPI_DECLSPEC int orte_rds_base_open(void);
|
||||||
OMPI_DECLSPEC int orte_rds_base_select(void);
|
OMPI_DECLSPEC int orte_rds_base_select(void);
|
||||||
@ -74,6 +74,11 @@ OMPI_DECLSPEC extern orte_rds_base_t orte_rds_base;
|
|||||||
* external API functions will be documented in the mca/ns/ns.h file
|
* external API functions will be documented in the mca/ns/ns.h file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* utility functions for use within the RDS
|
||||||
|
*/
|
||||||
|
int orte_rds_base_store_resource(ompi_list_t *resource_list);
|
||||||
|
|
||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "mca/mca.h"
|
#include "mca/mca.h"
|
||||||
#include "mca/base/base.h"
|
#include "mca/base/base.h"
|
||||||
#include "mca/base/mca_base_param.h"
|
#include "mca/base/mca_base_param.h"
|
||||||
|
#include "mca/gpr/gpr_types.h"
|
||||||
#include "util/output.h"
|
#include "util/output.h"
|
||||||
|
|
||||||
#include "mca/rds/base/base.h"
|
#include "mca/rds/base/base.h"
|
||||||
@ -34,10 +35,52 @@
|
|||||||
|
|
||||||
#include "mca/rds/base/static-components.h"
|
#include "mca/rds/base/static-components.h"
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* globals
|
* Local functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static void orte_rds_base_cell_desc_constructor(orte_rds_cell_desc_t *cell)
|
||||||
|
{
|
||||||
|
cell->site = NULL;
|
||||||
|
cell->name = NULL;
|
||||||
|
cell->type = NULL;
|
||||||
|
|
||||||
|
OBJ_CONSTRUCT(&cell->attributes, ompi_list_t);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void orte_rds_base_cell_desc_destructor(orte_rds_cell_desc_t *cell)
|
||||||
|
{
|
||||||
|
if (NULL != cell->site) free(cell->site);
|
||||||
|
if (NULL != cell->name) free(cell->name);
|
||||||
|
if (NULL != cell->type) free(cell->type);
|
||||||
|
|
||||||
|
OBJ_DESTRUCT(&cell->attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
OBJ_CLASS_INSTANCE(
|
||||||
|
orte_rds_cell_desc_t,
|
||||||
|
ompi_list_item_t,
|
||||||
|
orte_rds_base_cell_desc_constructor,
|
||||||
|
orte_rds_base_cell_desc_destructor);
|
||||||
|
|
||||||
|
|
||||||
|
static void orte_rds_base_cell_attr_constructor(orte_rds_cell_attr_t *cell)
|
||||||
|
{
|
||||||
|
OBJ_CONSTRUCT(&cell->keyval, orte_gpr_keyval_t);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void orte_rds_base_cell_attr_destructor(orte_rds_cell_attr_t *cell)
|
||||||
|
{
|
||||||
|
OBJ_DESTRUCT(&cell->keyval);
|
||||||
|
}
|
||||||
|
|
||||||
|
OBJ_CLASS_INSTANCE(
|
||||||
|
orte_rds_cell_attr_t,
|
||||||
|
ompi_list_item_t,
|
||||||
|
orte_rds_base_cell_attr_constructor,
|
||||||
|
orte_rds_base_cell_attr_destructor);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
|
118
src/mca/rds/base/rds_base_registry_fns.c
Обычный файл
118
src/mca/rds/base/rds_base_registry_fns.c
Обычный файл
@ -0,0 +1,118 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
|
* All rights reserved.
|
||||||
|
* $COPYRIGHT$
|
||||||
|
*
|
||||||
|
* Additional copyrights may follow
|
||||||
|
*
|
||||||
|
* $HEADER$
|
||||||
|
*/
|
||||||
|
/** @file:
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* includes
|
||||||
|
*/
|
||||||
|
#include "orte_config.h"
|
||||||
|
#include "include/orte_constants.h"
|
||||||
|
|
||||||
|
#include "class/ompi_list.h"
|
||||||
|
#include "util/output.h"
|
||||||
|
#include "mca/errmgr/errmgr.h"
|
||||||
|
#include "mca/gpr/gpr.h"
|
||||||
|
#include "mca/schema/schema.h"
|
||||||
|
|
||||||
|
#include "mca/rds/base/base.h"
|
||||||
|
|
||||||
|
int orte_rds_base_store_resource(ompi_list_t *resources)
|
||||||
|
{
|
||||||
|
orte_rds_cell_desc_t *cell;
|
||||||
|
ompi_list_item_t *item;
|
||||||
|
orte_gpr_value_t **values;
|
||||||
|
orte_rds_cell_attr_t *attr;
|
||||||
|
size_t i, j, num_vals;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
if (NULL == resources) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||||
|
return ORTE_ERR_BAD_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
num_vals = ompi_list_get_size(resources);
|
||||||
|
if (0 == num_vals) { /* nothing to do */
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
values = (orte_gpr_value_t**)malloc(num_vals * sizeof(orte_gpr_value_t*));
|
||||||
|
if (NULL == values) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i=0; i < num_vals && NULL != (cell = (orte_rds_cell_desc_t*)ompi_list_remove_first(resources)); i++) {
|
||||||
|
values[i] = OBJ_NEW(orte_gpr_value_t);
|
||||||
|
if (NULL == values[i]) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
rc = ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
goto CLEANUP;
|
||||||
|
}
|
||||||
|
|
||||||
|
values[i]->addr_mode = ORTE_GPR_TOKENS_XAND | ORTE_GPR_KEYS_OR;
|
||||||
|
values[i]->segment = strdup(ORTE_RESOURCE_SEGMENT);
|
||||||
|
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_schema.get_cell_tokens(&(values[i]->tokens),
|
||||||
|
&(values[i]->num_tokens), cell->cellid))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
goto CLEANUP;
|
||||||
|
}
|
||||||
|
|
||||||
|
values[i]->cnt = ompi_list_get_size(&cell->attributes);
|
||||||
|
values[i]->keyvals = (orte_gpr_keyval_t**)malloc(values[i]->cnt * sizeof(orte_gpr_keyval_t*));
|
||||||
|
if (NULL == values[i]->keyvals) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
rc = ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
goto CLEANUP;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j=0, item = ompi_list_get_first(&cell->attributes);
|
||||||
|
j < values[i]->cnt && item != ompi_list_get_end(&cell->attributes);
|
||||||
|
j++, item = ompi_list_get_next(item)) {
|
||||||
|
attr = (orte_rds_cell_attr_t*)item;
|
||||||
|
|
||||||
|
values[i]->keyvals[j] = OBJ_NEW(orte_gpr_keyval_t);
|
||||||
|
if (NULL == values[i]->keyvals[j]) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
rc = ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
goto CLEANUP;
|
||||||
|
}
|
||||||
|
|
||||||
|
values[i]->keyvals[j]->key = strdup(attr->keyval.key);
|
||||||
|
values[i]->keyvals[j]->type = attr->keyval.type;
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_gpr.xfer_payload(
|
||||||
|
&(values[i]->keyvals[j]->value),
|
||||||
|
&(attr->keyval.value),
|
||||||
|
values[i]->keyvals[j]->type))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
goto CLEANUP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OBJ_RELEASE(cell);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_gpr.put(num_vals, values))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
CLEANUP:
|
||||||
|
for (i=0; i < num_vals; i++) {
|
||||||
|
if (NULL != values[i]) OBJ_RELEASE(values[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
@ -37,10 +37,11 @@
|
|||||||
* access to at some foreign site).
|
* access to at some foreign site).
|
||||||
*
|
*
|
||||||
* 2. A hostfile (e.g., etc/openmpi-default-hostfile) describes a set of hosts to
|
* 2. A hostfile (e.g., etc/openmpi-default-hostfile) describes a set of hosts to
|
||||||
* which a specific user has access and/or wishes to use to run an application. The
|
* which a specific user has access and may wish to use to run applications. The
|
||||||
* information in the hostfile is much less detailed than in a resource file - it
|
* information in the hostfile is much less detailed than in a resource file - it
|
||||||
* is primarily intended to allow a user to specify which hosts are to be used for
|
* is primarily intended to allow a user to specify which hosts are available for
|
||||||
* an application, and potentially how the application's processes can/are to be
|
* use in an unmanaged environment (e.g, one spawned by rsh/ssh as opposed
|
||||||
|
* to a BProc system), and potentially how the application's processes can/are to be
|
||||||
* distributed across them. Thus, one would not expect to find info on memory/node
|
* distributed across them. Thus, one would not expect to find info on memory/node
|
||||||
* in a hostfile, but would expect to find info on user id for a given host and the
|
* in a hostfile, but would expect to find info on user id for a given host and the
|
||||||
* maximum number of processes the user wants put on a given host.
|
* maximum number of processes the user wants put on a given host.
|
||||||
@ -113,7 +114,7 @@
|
|||||||
#include "mca/mca.h"
|
#include "mca/mca.h"
|
||||||
#include "mca/ns/ns_types.h"
|
#include "mca/ns/ns_types.h"
|
||||||
|
|
||||||
#include "rds_types.h"
|
#include "mca/rds/rds_types.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -14,9 +14,47 @@
|
|||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "orte_config.h"
|
||||||
|
|
||||||
|
#include "class/ompi_list.h"
|
||||||
|
#include "mca/gpr/gpr_types.h"
|
||||||
|
#include "mca/ns/ns_types.h"
|
||||||
|
|
||||||
#ifndef ORTE_MCA_RDS_TYPES_H
|
#ifndef ORTE_MCA_RDS_TYPES_H
|
||||||
#define ORTE_MCA_RDS_TYPES_H
|
#define ORTE_MCA_RDS_TYPES_H
|
||||||
|
|
||||||
|
/* resource descriptor object */
|
||||||
|
typedef struct {
|
||||||
|
/** Base object */
|
||||||
|
ompi_list_item_t super;
|
||||||
|
/** id of cell in which this resource resides */
|
||||||
|
orte_cellid_t cellid;
|
||||||
|
/** string name of the site */
|
||||||
|
char *site;
|
||||||
|
/** string name of the resource */
|
||||||
|
char *name;
|
||||||
|
/** string type of the resource */
|
||||||
|
char *type;
|
||||||
|
/** list of attributes */
|
||||||
|
ompi_list_t attributes;
|
||||||
|
} orte_rds_cell_desc_t;
|
||||||
|
|
||||||
|
OBJ_CLASS_DECLARATION(orte_rds_cell_desc_t);
|
||||||
|
|
||||||
|
/* resource attribute object */
|
||||||
|
typedef struct {
|
||||||
|
/** Base object */
|
||||||
|
ompi_list_item_t super;
|
||||||
|
/** key-value pair describing attribute */
|
||||||
|
orte_gpr_keyval_t keyval;
|
||||||
|
} orte_rds_cell_attr_t;
|
||||||
|
|
||||||
|
OBJ_CLASS_DECLARATION(orte_rds_cell_attr_t);
|
||||||
|
|
||||||
|
|
||||||
|
/* name of resource */
|
||||||
|
#define ORTE_RDS_NAME "orte-rds-name"
|
||||||
|
|
||||||
/* type of resource (e.g., "cluster") */
|
/* type of resource (e.g., "cluster") */
|
||||||
#define ORTE_RDS_TYPE "orte-rds-type"
|
#define ORTE_RDS_TYPE "orte-rds-type"
|
||||||
|
|
||||||
@ -25,6 +63,8 @@
|
|||||||
/* location of the temporary directory on the frontend - required because
|
/* location of the temporary directory on the frontend - required because
|
||||||
* some machines do not allow the frontend to access scratch filesystem space */
|
* some machines do not allow the frontend to access scratch filesystem space */
|
||||||
#define ORTE_RDS_FE_TMP "orte-rds-fe-tmpdir"
|
#define ORTE_RDS_FE_TMP "orte-rds-fe-tmpdir"
|
||||||
|
/* whether or not ssh to the frontend is allowed */
|
||||||
|
#define ORTE_RDS_FE_SSH "orte-rds-fe-ssh"
|
||||||
|
|
||||||
/* node architecture info */
|
/* node architecture info */
|
||||||
#define ORTE_RDS_NUM_NODES "orte-rds-arch-num-nodes"
|
#define ORTE_RDS_NUM_NODES "orte-rds-arch-num-nodes"
|
||||||
@ -52,12 +92,16 @@
|
|||||||
#define ORTE_RDS_OS_VENDOR "orte-rds-os-vendor"
|
#define ORTE_RDS_OS_VENDOR "orte-rds-os-vendor"
|
||||||
#define ORTE_RDS_OS_VERSION "orte-rds-os-version"
|
#define ORTE_RDS_OS_VERSION "orte-rds-os-version"
|
||||||
|
|
||||||
|
/* compute domains */
|
||||||
|
#define ORTE_RDS_COMP_NUM_DOMAINS "orte-rds-comp-domains"
|
||||||
|
#define ORTE_RDS_COMP_NODES_DOMAIN "orte-rds-comp-nodes-domain"
|
||||||
|
|
||||||
/* filesystem type (e.g., "panasys") */
|
/* filesystem type (e.g., "panasys") */
|
||||||
#define ORTE_RDS_FS_TYPE "orte-rds-fs-type"
|
#define ORTE_RDS_FS_TYPE "orte-rds-fs-type"
|
||||||
/* home directory for users */
|
/* home directory for users */
|
||||||
#define ORTE_RDS_FS_HOME "orte-rds-fs-home"
|
#define ORTE_RDS_FS_HOME "orte-rds-fs-home"
|
||||||
/* scratch directory */
|
/* scratch directory */
|
||||||
#define ORTE_RDS_FS_SCRATCH "orte-rds-fs-scratch-dir"
|
#define ORTE_RDS_FS_SCRATCH_ROOT "orte-rds-fs-scratch-dir"
|
||||||
/* size of the scratch filesystem */
|
/* size of the scratch filesystem */
|
||||||
#define ORTE_RDS_FS_SCRATCH_SIZE "orte-rds-fs-scratch-size"
|
#define ORTE_RDS_FS_SCRATCH_SIZE "orte-rds-fs-scratch-size"
|
||||||
/* number of domains in the filesystem */
|
/* number of domains in the filesystem */
|
||||||
@ -70,8 +114,16 @@
|
|||||||
#define ORTE_RDS_FS_GIVE "orte-rds-fs-give-dir"
|
#define ORTE_RDS_FS_GIVE "orte-rds-fs-give-dir"
|
||||||
|
|
||||||
/* allocator and launcher info */
|
/* allocator and launcher info */
|
||||||
|
/* the allocator used to get resources allocated to me on this resource
|
||||||
|
* (e.g., LSF)
|
||||||
|
*/
|
||||||
#define ORTE_RDS_ALLOCATOR "orte-rds-allocator"
|
#define ORTE_RDS_ALLOCATOR "orte-rds-allocator"
|
||||||
|
/* the type of launch environment on this resource (e.g., BProc, rsh/ssh) */
|
||||||
#define ORTE_RDS_LAUNCHER "orte-rds-launcher"
|
#define ORTE_RDS_LAUNCHER "orte-rds-launcher"
|
||||||
|
/* where in the order this resource should be allocated when looking for resources
|
||||||
|
* with the given type of launcher
|
||||||
|
*/
|
||||||
|
#define ORTE_RDS_ALLOCATION_SEQUENCE "orte-rds-allocate-sequence"
|
||||||
|
|
||||||
/* operational limits */
|
/* operational limits */
|
||||||
#define ORTE_RDS_MAX_PROCS_CPU "orte-rds-max-procs-per-cpu"
|
#define ORTE_RDS_MAX_PROCS_CPU "orte-rds-max-procs-per-cpu"
|
||||||
|
@ -1 +0,0 @@
|
|||||||
rhc
|
|
@ -32,6 +32,7 @@ endif
|
|||||||
|
|
||||||
proxy_SOURCES = \
|
proxy_SOURCES = \
|
||||||
rds_resfile.c \
|
rds_resfile.c \
|
||||||
|
rds_resfile_parse_attributes.c \
|
||||||
rds_resfile.h \
|
rds_resfile.h \
|
||||||
rds_resfile_component.c
|
rds_resfile_component.c
|
||||||
|
|
||||||
|
@ -18,5 +18,4 @@
|
|||||||
# Specific to this module
|
# Specific to this module
|
||||||
|
|
||||||
PARAM_INIT_FILE=rds_resfile.c
|
PARAM_INIT_FILE=rds_resfile.c
|
||||||
PARAM_CONFIG_HEADER_FILE="rds_resfile_config.h"
|
|
||||||
PARAM_CONFIG_FILES="Makefile"
|
PARAM_CONFIG_FILES="Makefile"
|
||||||
|
@ -1,114 +0,0 @@
|
|||||||
# -*- shell-script -*-
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# Main function. This will be invoked in the middle of the templated
|
|
||||||
# configure script.
|
|
||||||
#
|
|
||||||
AC_DEFUN([MCA_CONFIGURE_STUB],[
|
|
||||||
|
|
||||||
# Additional --with flags that can be specified
|
|
||||||
|
|
||||||
AC_ARG_WITH(rds-resfile-xml2-config,
|
|
||||||
AC_HELP_STRING([--with-rds-resfile-xml2-config=EXEC],
|
|
||||||
[Specify the location of xml2-config executable]))
|
|
||||||
|
|
||||||
# Did the user specify where xml2-config is?
|
|
||||||
|
|
||||||
xml2_config=
|
|
||||||
if test -n "$with_rds_resfile_xml2_config"; then
|
|
||||||
if test -x "$with_rds_resfile_xml2_config"; then
|
|
||||||
xml2_config="$with_rds_resfile_xml2_config"
|
|
||||||
elif test -x "$with_rds_resfile_xml2_config/xml2-config"; then
|
|
||||||
xml2_config="$with_rds_resfile_xml2_config/xml2-config"
|
|
||||||
elif test -x "$with_rds_resfile_xml2_config/bin/xml2-config"; then
|
|
||||||
xml2_config="$with_rds_resfile_xml2_config/bin/xml2-config"
|
|
||||||
else
|
|
||||||
AC_MSG_WARN([$with_rds_resfile_xml2_config does not appear to point to anything close to an xml2-config file])
|
|
||||||
AC_MSG_WARN([Going to try to find libxml2 without it...])
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
AC_PATH_PROG(xml2_config, [xml2-config])
|
|
||||||
if test -z "$xml2_config"; then
|
|
||||||
AC_MSG_WARN([Could not find xml2-config helper script])
|
|
||||||
AC_MSG_WARN([Going to try to find libxml2 without it...])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add to CPPFLAGS, but only if necessary (note that xml2-config
|
|
||||||
# will output -I/path even if /path is already in the default
|
|
||||||
# search path of the compiler)
|
|
||||||
|
|
||||||
EXTRA_CPPFLAGS=
|
|
||||||
AC_CHECK_HEADER(libxml/parser.h, HAPPY=1, HAPPY=0)
|
|
||||||
if test "$HAPPY" = "0"; then
|
|
||||||
if test -x "$xml2_config"; then
|
|
||||||
AC_MSG_CHECKING([for CPPFLAGS with xml2-config])
|
|
||||||
EXTRA_CPPFLAGS="`$xml2_config --cflags`"
|
|
||||||
CPPFLAGS="$CPPFLAGS $EXTRA_CPPFLAGS"
|
|
||||||
AC_MSG_RESULT([$EXTRA_CPPFLAGS])
|
|
||||||
AC_CHECK_HEADER(libxml/tree.h, HAPPY=1, HAPPY=0)
|
|
||||||
else
|
|
||||||
HAPPY=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$HAPPY" = "0"; then
|
|
||||||
AC_MSG_ERROR([Cannot find libxml2 header files])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Similar to above, add to LDFLAGS only if necessary.
|
|
||||||
|
|
||||||
EXTRA_LDFLAGS=
|
|
||||||
AC_CHECK_LIB([xml2], [xmlReadFile], HAPPY=1, HAPPY=0)
|
|
||||||
if test "$HAPPY" = "0"; then
|
|
||||||
if test -x "$xml2_config"; then
|
|
||||||
AC_MSG_CHECKING([for CPPFLAGS with xml2-config])
|
|
||||||
EXTRA_LDFLAGS="`$xml2_config --libs`"
|
|
||||||
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
|
|
||||||
AC_MSG_RESULT([$EXTRA_LDFLAGS])
|
|
||||||
AC_CHECK_LIB([xml2], [xmlFreeDoc], HAPPY=1, HAPPY=0)
|
|
||||||
else
|
|
||||||
HAPPY=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$HAPPY" = "0"; then
|
|
||||||
AC_MSG_ERROR([Cannot find libxml2 library])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
LIBS="$LIBS -lxml2"
|
|
||||||
|
|
||||||
# Save extra compiler/linker flags so that they can be added in
|
|
||||||
# the wrapper compilers, if necessary. Separate out the LIBS from
|
|
||||||
# the LDFLAGS (because xml2-config [incorrectly] lumps them all
|
|
||||||
# together into one string.
|
|
||||||
|
|
||||||
WRAPPER_EXTRA_LIBS="$LIBS"
|
|
||||||
WRAPPER_EXTRA_LDFLAGS=
|
|
||||||
for flag in $EXTRA_LDFLAGS; do
|
|
||||||
case $flag in
|
|
||||||
-l*)
|
|
||||||
WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $flag"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $flag"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
LIBMPI_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS"
|
|
||||||
LIBMPI_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS"
|
|
||||||
])dnl
|
|
@ -16,106 +16,238 @@
|
|||||||
#include "orte_config.h"
|
#include "orte_config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <libxml/parser.h>
|
|
||||||
#include <libxml/tree.h>
|
|
||||||
|
|
||||||
#include "include/orte_constants.h"
|
#include "include/orte_constants.h"
|
||||||
#include "mca/base/mca_base_param.h"
|
#include "mca/base/mca_base_param.h"
|
||||||
|
#include "mca/errmgr/errmgr.h"
|
||||||
|
#include "mca/ns/ns.h"
|
||||||
|
|
||||||
#include "rds_resfile.h"
|
#include "rds_resfile.h"
|
||||||
|
|
||||||
static void
|
#define ORTE_RDS_RESFILE_MAX_LINE_LENGTH 512
|
||||||
process_resource(xmlChar *site, xmlDoc *doc, xmlNode *a_node)
|
|
||||||
|
static ompi_list_t orte_rds_resfile_resource_list;
|
||||||
|
|
||||||
|
static int orte_rds_resfile_parse_site(char *site, FILE *fp);
|
||||||
|
|
||||||
|
static int orte_rds_resfile_parse_resource(orte_rds_cell_desc_t *cell, FILE *fp);
|
||||||
|
|
||||||
|
|
||||||
|
static int orte_rds_resfile_parse_resource(orte_rds_cell_desc_t *cell, FILE *fp)
|
||||||
{
|
{
|
||||||
xmlNode *cur_node = NULL;
|
char *line;
|
||||||
xmlChar *resource;
|
bool name_given = false;
|
||||||
char *tokens[3];
|
int rc;
|
||||||
|
orte_rds_cell_attr_t *na;
|
||||||
|
|
||||||
tokens[0] = strdup((char*)site);
|
while (NULL != (line = orte_rds_resfile_getline(fp))) {
|
||||||
tokens[2] = NULL;
|
/* check for end of resource description */
|
||||||
|
if (0 == strncmp(line, "</resource", strlen("</resource"))) {
|
||||||
cur_node = a_node->children;
|
return ORTE_SUCCESS;
|
||||||
while (NULL != cur_node) {
|
|
||||||
if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"name"))) {
|
|
||||||
resource = xmlNodeListGetString(doc, cur_node->children, 1);
|
|
||||||
printf("site[resource]: %s[%s]\n", site, resource);
|
|
||||||
tokens[1] = strdup((char*)resource);
|
|
||||||
xmlFree(resource);
|
|
||||||
}
|
}
|
||||||
cur_node = cur_node->next;
|
/* check for attribute and redirect to proper parser */
|
||||||
|
if (0 == strncmp(line, "<name", strlen("<name"))) {
|
||||||
|
/* check to ensure only ONE name is given */
|
||||||
|
if (name_given) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||||
|
return ORTE_ERR_BAD_PARAM;
|
||||||
|
}
|
||||||
|
name_given = true;
|
||||||
|
if (NULL == (cell->name = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
/* get new cellid for this site/resource */
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_ns.create_cellid(&(cell->cellid), cell->site, cell->name))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
na = OBJ_NEW(orte_rds_cell_attr_t);
|
||||||
|
if (NULL == na) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_NAME);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
na->keyval.value.strptr = strdup(cell->name);
|
||||||
|
ompi_list_append(&(cell->attributes), &na->super);
|
||||||
|
na = OBJ_NEW(orte_rds_cell_attr_t);
|
||||||
|
if (NULL == na) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
na->keyval.key = strdup(ORTE_CELLID_KEY);
|
||||||
|
na->keyval.type = ORTE_CELLID;
|
||||||
|
na->keyval.value.cellid = cell->cellid;
|
||||||
|
ompi_list_append(&(cell->attributes), &na->super);
|
||||||
|
} else if (0 == strncmp(line, "<type", strlen("<type"))) {
|
||||||
|
if (NULL == (cell->type = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
na = OBJ_NEW(orte_rds_cell_attr_t);
|
||||||
|
if (NULL == na) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_TYPE);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
na->keyval.value.strptr = strdup(cell->type);
|
||||||
|
ompi_list_append(&(cell->attributes), &na->super);
|
||||||
|
} else if (0 == strncmp(line, "<front-end", strlen("<front-end"))) {
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_rds_resfile_parse_fe(cell, fp))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<compute-domains", strlen("<compute-domains"))) {
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_rds_resfile_parse_cd(cell, fp))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<os", strlen("<os"))) {
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_rds_resfile_parse_os(cell, fp))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<filesystem", strlen("<filesystem"))) {
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_rds_resfile_parse_fs(cell, fp))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<allocator", strlen("<allocator"))) {
|
||||||
|
na = OBJ_NEW(orte_rds_cell_attr_t);
|
||||||
|
if (NULL == na) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_ALLOCATOR);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
if (NULL == (na->keyval.value.strptr = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
ompi_list_append(&(cell->attributes), &na->super);
|
||||||
|
} else if (0 == strncmp(line, "<launcher", strlen("<launcher"))) {
|
||||||
|
na = OBJ_NEW(orte_rds_cell_attr_t);
|
||||||
|
if (NULL == na) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_LAUNCHER);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
if (NULL == (na->keyval.value.strptr = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
ompi_list_append(&(cell->attributes), &na->super);
|
||||||
|
} else if (0 == strncmp(line, "<sequence", strlen("<sequence"))) {
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_rds_resfile_parse_se(cell, fp))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<arch", strlen("<arch"))) {
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_rds_resfile_parse_na(cell, fp))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
process_site(xmlChar *site, xmlDoc *doc, xmlNode *a_node)
|
static int orte_rds_resfile_parse_site(char *site, FILE *fp)
|
||||||
{
|
{
|
||||||
xmlNode *cur_node = NULL;
|
char *line;
|
||||||
|
orte_rds_cell_desc_t *cell;
|
||||||
|
int rc;
|
||||||
|
|
||||||
cur_node = a_node->children;
|
while (NULL != (line = orte_rds_resfile_getline(fp))) {
|
||||||
while (NULL != cur_node) {
|
if (0 == strncmp(line, "<resource", strlen("<resource"))) {
|
||||||
if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"resource"))) {
|
cell = OBJ_NEW(orte_rds_cell_desc_t);
|
||||||
process_resource(site, doc, cur_node);
|
if (NULL == cell) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
cur_node = cur_node->next;
|
cell->site = strdup(site);
|
||||||
|
/* parse the resource description */
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_rds_resfile_parse_resource(cell, fp))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ompi_list_append(&orte_rds_resfile_resource_list, &cell->super);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int orte_rds_resfile_query(void)
|
int orte_rds_resfile_query(void)
|
||||||
{
|
{
|
||||||
#if 0
|
int fileid, rc;
|
||||||
xmlDoc *doc = NULL;
|
FILE *fp;
|
||||||
xmlNode *root_element = NULL;
|
char *input_line, *resfile, *site;
|
||||||
xmlNode *cur = NULL;
|
|
||||||
xmlChar *site;
|
|
||||||
int fileid;
|
|
||||||
char *resfile;
|
|
||||||
|
|
||||||
/*
|
OMPI_LOCK(&mca_rds_resfile_component.lock);
|
||||||
* this initializes the library and checks potential ABI mismatches
|
|
||||||
* between the version it was compiled for and the actual shared
|
|
||||||
* library used.
|
|
||||||
*/
|
|
||||||
LIBXML_TEST_VERSION
|
|
||||||
|
|
||||||
/* get the resource filename */
|
/* get the resource filename */
|
||||||
fileid = mca_base_param_register_string("rds", "resfile", "name", "RESOURCE_FILE", NULL);
|
fileid = mca_base_param_register_string("rds", "resfile", "name", NULL, NULL);
|
||||||
mca_base_param_lookup_string(fileid, &resfile);
|
mca_base_param_lookup_string(fileid, &resfile);
|
||||||
if (NULL == resfile) { /* no resource file provided */
|
if (NULL == resfile) { /* no resource file provided */
|
||||||
|
/* DO NOT ORTE_ERROR_LOG OR RETURN AN ERROR - THIS IS NOT AN ERROR CONDITION */
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* open the resource file */
|
||||||
|
fp = fopen(resfile, "r");
|
||||||
|
if (NULL == fp) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
||||||
return ORTE_ERR_NOT_FOUND;
|
return ORTE_ERR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*parse the file and get the DOM */
|
/* setup the resource list */
|
||||||
doc = xmlReadFile(resfile, NULL, 0);
|
OBJ_CONSTRUCT(&orte_rds_resfile_resource_list, ompi_list_t);
|
||||||
|
|
||||||
if (doc == NULL) {
|
/* dump the initial line containing the DOM */
|
||||||
printf("error: could not parse file %s\n", resfile);
|
input_line = orte_rds_resfile_getline(fp);
|
||||||
|
if (NULL == input_line || 0 != strncmp(input_line, "<?xml", 5)) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
rc = ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
goto CLEANUP;
|
||||||
|
}
|
||||||
|
free(input_line);
|
||||||
|
|
||||||
|
/* parse file */
|
||||||
|
while (NULL != (input_line = orte_rds_resfile_getline(fp))) {
|
||||||
|
if (0 == strncmp(input_line, "<site-name>", strlen("<site-name>"))) {
|
||||||
|
/* extract the site name from input_line */
|
||||||
|
if (NULL == (site = orte_rds_resfile_parse_field(input_line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(input_line);
|
||||||
|
rc = ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
goto CLEANUP;
|
||||||
|
}
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_rds_resfile_parse_site(site, fp))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
free(input_line);
|
||||||
|
goto CLEANUP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(input_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Get the root element node */
|
/* place resource list on registry */
|
||||||
root_element = xmlDocGetRootElement(doc);
|
if (ORTE_SUCCESS != (rc = orte_rds_base_store_resource(&orte_rds_resfile_resource_list))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
/* walk the document tree looking for sites and save their info to the registry */
|
return rc;
|
||||||
cur = root_element->children;
|
|
||||||
while (NULL != cur) {
|
|
||||||
if ((!xmlStrcmp(cur->name, (const xmlChar *)"site-name"))) {
|
|
||||||
site = xmlNodeListGetString(doc, cur->children, 1);
|
|
||||||
printf("site: %s\n", site);
|
|
||||||
process_site(site, doc, cur);
|
|
||||||
xmlFree(site);
|
|
||||||
}
|
|
||||||
cur = cur->next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*free the document */
|
CLEANUP:
|
||||||
xmlFreeDoc(doc);
|
fclose(fp);
|
||||||
|
OBJ_DESTRUCT(&orte_rds_resfile_resource_list);
|
||||||
|
|
||||||
/*
|
OMPI_UNLOCK(&mca_rds_resfile_component.lock);
|
||||||
*Free the global variables that may
|
|
||||||
*have been allocated by the parser.
|
|
||||||
*/
|
|
||||||
xmlCleanupParser();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -125,3 +257,53 @@ int orte_rds_resfile_finalize(void)
|
|||||||
{
|
{
|
||||||
return ORTE_SUCCESS;
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *orte_rds_resfile_getline(FILE *fp)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char *ret, *buff, *start;
|
||||||
|
char input[ORTE_RDS_RESFILE_MAX_LINE_LENGTH];
|
||||||
|
|
||||||
|
/* find the next non-blank line, stop at end-of-file */
|
||||||
|
ret = fgets(input, ORTE_RDS_RESFILE_MAX_LINE_LENGTH, fp);
|
||||||
|
while (NULL != ret) {
|
||||||
|
input[strlen(input)-1] = '\0'; /* remove newline */
|
||||||
|
/* strip leading whitespace */
|
||||||
|
for (i=0; i < (int)strlen(input) && (input[i] == ' ' || input[i] == '\t'); i++);
|
||||||
|
if (i < (int)strlen(input)) {
|
||||||
|
start = &input[i];
|
||||||
|
buff = strdup(start);
|
||||||
|
return buff;
|
||||||
|
}
|
||||||
|
ret = fgets(input, ORTE_RDS_RESFILE_MAX_LINE_LENGTH, fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *orte_rds_resfile_parse_field(char *input)
|
||||||
|
{
|
||||||
|
char *start, *stop, *ans;
|
||||||
|
|
||||||
|
start = strchr(input, '>');
|
||||||
|
if (NULL == start) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
start++;
|
||||||
|
stop = strchr(start, '<');
|
||||||
|
if (NULL == stop) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
*stop = '\0'; /* terminate the string */
|
||||||
|
|
||||||
|
if (start == stop) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ans = strdup(start);
|
||||||
|
return ans;
|
||||||
|
}
|
||||||
|
@ -21,11 +21,19 @@
|
|||||||
#ifndef ORTE_RDS_RESFILE_H
|
#ifndef ORTE_RDS_RESFILE_H
|
||||||
#define ORTE_RDS_RESFILE_H
|
#define ORTE_RDS_RESFILE_H
|
||||||
|
|
||||||
#include "mca/rds/rds.h"
|
#include "orte_config.h"
|
||||||
|
|
||||||
|
#include "threads/mutex.h"
|
||||||
|
|
||||||
|
#include "mca/rds/base/base.h"
|
||||||
|
|
||||||
#if defined(c_plusplus) || defined(__cplusplus)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* resfile internal globals */
|
||||||
|
extern ompi_list_t resource_list;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RDS Resource file functions
|
* RDS Resource file functions
|
||||||
*/
|
*/
|
||||||
@ -33,6 +41,23 @@ int orte_rds_resfile_query(void);
|
|||||||
|
|
||||||
int orte_rds_resfile_finalize(void);
|
int orte_rds_resfile_finalize(void);
|
||||||
|
|
||||||
|
/* RDS resource file internal functions */
|
||||||
|
char *orte_rds_resfile_getline(FILE *fp);
|
||||||
|
|
||||||
|
char *orte_rds_resfile_parse_field(char *input);
|
||||||
|
|
||||||
|
/* RDS resource file attribute parsers */
|
||||||
|
int orte_rds_resfile_parse_fe(orte_rds_cell_desc_t *cell, FILE *fp);
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_cd(orte_rds_cell_desc_t *cell, FILE *fp);
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_os(orte_rds_cell_desc_t *cell, FILE *fp);
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_fs(orte_rds_cell_desc_t *cell, FILE *fp);
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_se(orte_rds_cell_desc_t *cell, FILE *fp);
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_na(orte_rds_cell_desc_t *cell, FILE *fp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RDS Resource file Component
|
* RDS Resource file Component
|
||||||
@ -41,6 +66,7 @@ struct orte_rds_resfile_component_t {
|
|||||||
orte_rds_base_component_t super;
|
orte_rds_base_component_t super;
|
||||||
int debug;
|
int debug;
|
||||||
char *filename;
|
char *filename;
|
||||||
|
ompi_mutex_t lock;
|
||||||
};
|
};
|
||||||
typedef struct orte_rds_resfile_component_t orte_rds_resfile_component_t;
|
typedef struct orte_rds_resfile_component_t orte_rds_resfile_component_t;
|
||||||
|
|
||||||
|
@ -96,6 +96,7 @@ static char* orte_rds_resfile_param_register_string(
|
|||||||
*/
|
*/
|
||||||
static int orte_rds_resfile_open(void)
|
static int orte_rds_resfile_open(void)
|
||||||
{
|
{
|
||||||
|
OBJ_CONSTRUCT(&mca_rds_resfile_component.lock, ompi_mutex_t);
|
||||||
mca_rds_resfile_component.debug = orte_rds_resfile_param_register_int("debug",1);
|
mca_rds_resfile_component.debug = orte_rds_resfile_param_register_int("debug",1);
|
||||||
mca_rds_resfile_component.filename = orte_rds_resfile_param_register_string("file", NULL);
|
mca_rds_resfile_component.filename = orte_rds_resfile_param_register_string("file", NULL);
|
||||||
|
|
||||||
@ -105,6 +106,7 @@ static int orte_rds_resfile_open(void)
|
|||||||
|
|
||||||
static orte_rds_base_module_t *orte_rds_resfile_init(void)
|
static orte_rds_base_module_t *orte_rds_resfile_init(void)
|
||||||
{
|
{
|
||||||
|
OBJ_DESTRUCT(&mca_rds_resfile_component.lock);
|
||||||
return &orte_rds_resfile_module;
|
return &orte_rds_resfile_module;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
293
src/mca/rds/resfile/rds_resfile_parse_attributes.c
Обычный файл
293
src/mca/rds/resfile/rds_resfile_parse_attributes.c
Обычный файл
@ -0,0 +1,293 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
|
* All rights reserved.
|
||||||
|
* $COPYRIGHT$
|
||||||
|
*
|
||||||
|
* Additional copyrights may follow
|
||||||
|
*
|
||||||
|
* $HEADER$
|
||||||
|
*/
|
||||||
|
#include "orte_config.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include "include/orte_constants.h"
|
||||||
|
#include "util/output.h"
|
||||||
|
#include "mca/errmgr/errmgr.h"
|
||||||
|
|
||||||
|
#include "rds_resfile.h"
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_fe(orte_rds_cell_desc_t *cell, FILE *fp)
|
||||||
|
{
|
||||||
|
char *line, *ssh;
|
||||||
|
orte_rds_cell_attr_t *na;
|
||||||
|
|
||||||
|
while (NULL != (line = orte_rds_resfile_getline(fp))) {
|
||||||
|
if (0 == strncmp(line, "</front-end", strlen("</front-end"))) {
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
na = OBJ_NEW(orte_rds_cell_attr_t);
|
||||||
|
if (NULL == na) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
if (0 == strncmp(line, "<name", strlen("<name"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_FE_NAME);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
if (NULL == (na->keyval.value.strptr = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<tmp-dir", strlen("<tmp-dir"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_FE_TMP);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
if (NULL == (na->keyval.value.strptr = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<ssh", strlen("<ssh"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_FE_SSH);
|
||||||
|
na->keyval.type = ORTE_BOOL;
|
||||||
|
if (NULL == (ssh = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
if (0 == strncmp(ssh, "true", 4)) {
|
||||||
|
na->keyval.value.tf_flag = true;
|
||||||
|
} else {
|
||||||
|
na->keyval.value.tf_flag = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||||
|
return ORTE_ERR_BAD_PARAM;
|
||||||
|
}
|
||||||
|
ompi_list_append(&(cell->attributes), &na->super);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_cd(orte_rds_cell_desc_t *cell, FILE *fp)
|
||||||
|
{
|
||||||
|
char *line, *tmp;
|
||||||
|
orte_rds_cell_attr_t *na;
|
||||||
|
|
||||||
|
while (NULL != (line = orte_rds_resfile_getline(fp))) {
|
||||||
|
if (0 == strncmp(line, "</compute-domains", strlen("</compute-domains"))) {
|
||||||
|
free(line);
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
na = OBJ_NEW(orte_rds_cell_attr_t);
|
||||||
|
if (NULL == na) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
if (0 == strncmp(line, "<num-domains", strlen("<num-domains"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_COMP_NUM_DOMAINS);
|
||||||
|
na->keyval.type = ORTE_INT16;
|
||||||
|
if (NULL == (tmp = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
na->keyval.value.i16 = 13; /* strtoi(tmp); */
|
||||||
|
} else if (0 == strncmp(line, "<nodes-per-domain", strlen("<nodes-per-domain"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_COMP_NODES_DOMAIN);
|
||||||
|
na->keyval.type = ORTE_INT16;
|
||||||
|
if (NULL == (tmp = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
na->keyval.value.i16 = 13; /*strtoi(tmp); */
|
||||||
|
} else {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_BAD_PARAM;
|
||||||
|
}
|
||||||
|
ompi_list_append(&(cell->attributes), &na->super);
|
||||||
|
free(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_os(orte_rds_cell_desc_t *cell, FILE *fp)
|
||||||
|
{
|
||||||
|
char *line;
|
||||||
|
orte_rds_cell_attr_t *na;
|
||||||
|
|
||||||
|
while (NULL != (line = orte_rds_resfile_getline(fp))) {
|
||||||
|
if (0 == strncmp(line, "</os", strlen("</os"))) {
|
||||||
|
free(line);
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
na = OBJ_NEW(orte_rds_cell_attr_t);
|
||||||
|
if (NULL == na) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
if (0 == strncmp(line, "<type", strlen("<type"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_OS_TYPE);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
if (NULL == (na->keyval.value.strptr = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<vendor", strlen("<vendor"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_OS_VENDOR);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
if (NULL == (na->keyval.value.strptr = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<version", strlen("<version"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_OS_VERSION);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
if (NULL == (na->keyval.value.strptr = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_BAD_PARAM;
|
||||||
|
}
|
||||||
|
ompi_list_append(&(cell->attributes), &na->super);
|
||||||
|
free(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_fs(orte_rds_cell_desc_t *cell, FILE *fp)
|
||||||
|
{
|
||||||
|
char *line;
|
||||||
|
/* orte_rds_cell_attr_t *na; */
|
||||||
|
|
||||||
|
while (NULL != (line = orte_rds_resfile_getline(fp))) {
|
||||||
|
if (0 == strncmp(line, "</filesystem", strlen("</filesystem"))) {
|
||||||
|
free(line);
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
#if 0
|
||||||
|
na = OBJ_NEW(orte_rds_cell_attr_t);
|
||||||
|
if (NULL == na) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
if (0 == strncmp(line, "<type", strlen("<type"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_FS_TYPE);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
if (NULL == (na->keyval.value.strptr = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<home-root", strlen("<home-root"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_FS_HOME);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
if (NULL == (na->keyval.value.strptr = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
} else if (0 == strncmp(line, "<scratch", strlen("<scratch"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_FS_SCRATCH);
|
||||||
|
na->keyval.type = ORTE_STRING;
|
||||||
|
if (NULL == (na->keyval.value.strptr = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
} else if (0 == strncmp(line, "<num-domains", strlen("<num-domains"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_FS_DOMAINS);
|
||||||
|
na->keyval.type = ORTE_INT16;
|
||||||
|
if (NULL == (tmp = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
na->keyval.value.i16 = 13; /* strtoi(tmp); */
|
||||||
|
} else if (0 == strncmp(line, "<nodes-per-domain", strlen("<nodes-per-domain"))) {
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_FS_NODES_DOMAIN);
|
||||||
|
na->keyval.type = ORTE_INT16;
|
||||||
|
if (NULL == (tmp = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
na->keyval.value.i16 = 13; /*strtoi(tmp); */
|
||||||
|
} else {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_BAD_PARAM;
|
||||||
|
}
|
||||||
|
ompi_list_append(&(cell->attributes), &na->super);
|
||||||
|
#endif
|
||||||
|
free(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_se(orte_rds_cell_desc_t *cell, FILE *fp)
|
||||||
|
{
|
||||||
|
char *line;
|
||||||
|
orte_rds_cell_attr_t *na;
|
||||||
|
char *tmp;
|
||||||
|
|
||||||
|
while (NULL != (line = orte_rds_resfile_getline(fp))) {
|
||||||
|
if (0 == strncmp(line, "</sequence", strlen("</sequence"))) {
|
||||||
|
free(line);
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
na = OBJ_NEW(orte_rds_cell_attr_t);
|
||||||
|
if (NULL == na) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
na->keyval.key = strdup(ORTE_RDS_ALLOCATION_SEQUENCE);
|
||||||
|
na->keyval.type = ORTE_INT16;
|
||||||
|
if (NULL == (tmp = orte_rds_resfile_parse_field(line))) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_READ_FAILURE);
|
||||||
|
free(line);
|
||||||
|
return ORTE_ERR_FILE_READ_FAILURE;
|
||||||
|
}
|
||||||
|
na->keyval.value.i16 = 13; /*strtoi(tmp); */
|
||||||
|
free(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
int orte_rds_resfile_parse_na(orte_rds_cell_desc_t *cell, FILE *fp)
|
||||||
|
{
|
||||||
|
char *line;
|
||||||
|
/* orte_rds_cell_attr_t *na; */
|
||||||
|
|
||||||
|
while (NULL != (line = orte_rds_resfile_getline(fp))) {
|
||||||
|
if (0 == strncmp(line, "</arch", strlen("</arch"))) {
|
||||||
|
free(line);
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
free(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ORTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
@ -82,6 +82,7 @@ int orte_schema_base_get_node_tokens(char ***node_tokens, size_t* num_tokens, or
|
|||||||
int rc;
|
int rc;
|
||||||
char** tokens;
|
char** tokens;
|
||||||
char* cellid_string;
|
char* cellid_string;
|
||||||
|
|
||||||
tokens = (char**)malloc(3 * sizeof(char*));
|
tokens = (char**)malloc(3 * sizeof(char*));
|
||||||
if (NULL == tokens) {
|
if (NULL == tokens) {
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
@ -112,9 +113,34 @@ CLEANUP:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int orte_schema_base_get_cell_tokens(char ***tokens, size_t* num_tokens, orte_cellid_t cellid)
|
int orte_schema_base_get_cell_tokens(char ***cell_tokens, size_t* num_tokens, orte_cellid_t cellid)
|
||||||
{
|
{
|
||||||
return ORTE_ERR_NOT_IMPLEMENTED;
|
int rc;
|
||||||
|
char **tokens;
|
||||||
|
|
||||||
|
*num_tokens = 0;
|
||||||
|
|
||||||
|
tokens = (char**)malloc(3 * sizeof(char*));
|
||||||
|
if (NULL == tokens) {
|
||||||
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_ns.get_cell_info(cellid, &tokens[1], &tokens[2]))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
free(*tokens);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
if (ORTE_SUCCESS != (rc = orte_ns.convert_cellid_to_string(&tokens[0], cellid))) {
|
||||||
|
ORTE_ERROR_LOG(rc);
|
||||||
|
free(*tokens);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
*num_tokens = 3;
|
||||||
|
*cell_tokens = tokens;
|
||||||
|
|
||||||
|
return ORTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int orte_schema_base_get_job_segment_name(char **name, orte_jobid_t jobid)
|
int orte_schema_base_get_job_segment_name(char **name, orte_jobid_t jobid)
|
||||||
|
@ -108,6 +108,8 @@ char *orte_error_strings[] = {
|
|||||||
"ORTE_ERR_GPR_DATA_CORRUPT",
|
"ORTE_ERR_GPR_DATA_CORRUPT",
|
||||||
"ORTE_ERR_PERM",
|
"ORTE_ERR_PERM",
|
||||||
"ORTE_ERR_TYPE_MISMATCH",
|
"ORTE_ERR_TYPE_MISMATCH",
|
||||||
"ORTE_ERR_VALUE_OUT_OF_BOUNDS"
|
"ORTE_ERR_VALUE_OUT_OF_BOUNDS",
|
||||||
|
"ORTE_ERR_FILE_READ_FAILURE",
|
||||||
|
"ORTE_ERR_FILE_WRITE_FAILURE"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -90,11 +90,11 @@ static void orte_setup_hnp_wait(pid_t wpid, int status, void *data);
|
|||||||
int orte_setup_hnp(char *target_cluster, char *headnode, char *username)
|
int orte_setup_hnp(char *target_cluster, char *headnode, char *username)
|
||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
char **argv, *param, *uri, *uid, *hn;
|
char **argv, *param, *uri, *uid, *hn=NULL;
|
||||||
char *path, *name_string, *orteprobe;
|
char *path, *name_string, *orteprobe;
|
||||||
int argc, rc=ORTE_SUCCESS, id;
|
int argc, rc=ORTE_SUCCESS, id;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
orte_cellid_t cellid;
|
orte_cellid_t cellid=ORTE_CELLID_MAX;
|
||||||
orte_jobid_t jobid;
|
orte_jobid_t jobid;
|
||||||
orte_vpid_t vpid;
|
orte_vpid_t vpid;
|
||||||
|
|
||||||
@ -140,13 +140,14 @@ int orte_setup_hnp(char *target_cluster, char *headnode, char *username)
|
|||||||
orte_setup_hnp_cbdata.headnode = strdup(headnode);
|
orte_setup_hnp_cbdata.headnode = strdup(headnode);
|
||||||
orte_setup_hnp_cbdata.jobid = jobid;
|
orte_setup_hnp_cbdata.jobid = jobid;
|
||||||
|
|
||||||
/* get rsh/ssh launch mechanism parameters */
|
/* get name of probe application - just in case user specified something different */
|
||||||
id = mca_base_param_register_string("pls","rsh","agent",NULL,"/usr/bin/ssh");
|
|
||||||
mca_base_param_lookup_string(id, ¶m);
|
|
||||||
|
|
||||||
id = mca_base_param_register_string("orteprobe",NULL,NULL,NULL,"orteprobe");
|
id = mca_base_param_register_string("orteprobe",NULL,NULL,NULL,"orteprobe");
|
||||||
mca_base_param_lookup_string(id, &orteprobe);
|
mca_base_param_lookup_string(id, &orteprobe);
|
||||||
|
|
||||||
|
/* get rsh/ssh launch mechanism parameters */
|
||||||
|
id = mca_base_param_register_string("pls","rsh","agent",NULL,"ssh");
|
||||||
|
mca_base_param_lookup_string(id, ¶m);
|
||||||
|
|
||||||
/* Initialize the argv array */
|
/* Initialize the argv array */
|
||||||
argv = ompi_argv_split(param, ' ');
|
argv = ompi_argv_split(param, ' ');
|
||||||
argc = ompi_argv_count(argv);
|
argc = ompi_argv_count(argv);
|
||||||
@ -218,7 +219,6 @@ int orte_setup_hnp(char *target_cluster, char *headnode, char *username)
|
|||||||
|
|
||||||
if (pid == 0) { /* child */
|
if (pid == 0) { /* child */
|
||||||
/* exec the probe launch */
|
/* exec the probe launch */
|
||||||
ompi_output(0, "exec'ing %s", path);
|
|
||||||
execv(path, argv);
|
execv(path, argv);
|
||||||
ORTE_ERROR_LOG(ORTE_ERROR);
|
ORTE_ERROR_LOG(ORTE_ERROR);
|
||||||
ompi_output(0, "orte_setup_hnp: execv failed with errno=%d\n", errno);
|
ompi_output(0, "orte_setup_hnp: execv failed with errno=%d\n", errno);
|
||||||
|
@ -409,6 +409,82 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
gpr_module->dump_all(0);
|
gpr_module->dump_all(0);
|
||||||
|
|
||||||
|
fprintf(stderr, "get with no tokens, KEYS_OR\n");
|
||||||
|
keys[0] = strdup("stupid-test-1");
|
||||||
|
keys[1] = strdup("stupid-test-3");
|
||||||
|
keys[2] = strdup("stupid-test-5");
|
||||||
|
keys[3] = strdup("stupid-test-8");
|
||||||
|
keys[4] = NULL;
|
||||||
|
if (ORTE_SUCCESS != (rc = gpr_module->get(ORTE_GPR_KEYS_OR | ORTE_GPR_TOKENS_OR,
|
||||||
|
"test-put-segment",
|
||||||
|
NULL, keys,
|
||||||
|
&cnt, &values))) {
|
||||||
|
fprintf(test_out, "gpr_test: get failed with error code %s\n",
|
||||||
|
ORTE_ERROR_NAME(rc));
|
||||||
|
test_failure("gpr_test: get failed");
|
||||||
|
test_finalize();
|
||||||
|
return rc;
|
||||||
|
} else {
|
||||||
|
fprintf(test_out, "gpr_test: get with no tokens, KEYS_OR passed\n");
|
||||||
|
}
|
||||||
|
for (i=0; i < 4; i++) free(keys[i]);
|
||||||
|
free(names[0]);
|
||||||
|
|
||||||
|
fprintf(stderr, "get results:\n");
|
||||||
|
for (j=0; j < cnt; j++) {
|
||||||
|
fprintf(stderr, "value %lu: cnt %lu\t segment %s num_tokens %lu\n",
|
||||||
|
(unsigned long) j, (unsigned long) values[j]->cnt,
|
||||||
|
values[j]->segment, (unsigned long) values[j]->num_tokens);
|
||||||
|
for (i=0; i < values[j]->num_tokens; i++) {
|
||||||
|
fprintf(stderr, "token: %lu %s\n", (unsigned long) i,
|
||||||
|
values[j]->tokens[i]);
|
||||||
|
}
|
||||||
|
kvals = values[j]->keyvals;
|
||||||
|
for (i=0; i < values[j]->cnt; i++) {
|
||||||
|
fprintf(stderr, "\tkey %s type %d\n", kvals[i]->key, kvals[i]->type);
|
||||||
|
}
|
||||||
|
OBJ_RELEASE(values[j]);
|
||||||
|
}
|
||||||
|
free(values);
|
||||||
|
|
||||||
|
fprintf(stderr, "get with no tokens, KEYS_AND\n");
|
||||||
|
keys[0] = strdup("stupid-test-1");
|
||||||
|
keys[1] = strdup("stupid-test-3");
|
||||||
|
keys[2] = strdup("stupid-test-5");
|
||||||
|
keys[3] = strdup("stupid-test-8");
|
||||||
|
keys[4] = NULL;
|
||||||
|
if (ORTE_SUCCESS != (rc = gpr_module->get(ORTE_GPR_KEYS_AND | ORTE_GPR_TOKENS_OR,
|
||||||
|
"test-put-segment",
|
||||||
|
NULL, keys,
|
||||||
|
&cnt, &values))) {
|
||||||
|
fprintf(test_out, "gpr_test: get failed with error code %s\n",
|
||||||
|
ORTE_ERROR_NAME(rc));
|
||||||
|
test_failure("gpr_test: get failed");
|
||||||
|
test_finalize();
|
||||||
|
return rc;
|
||||||
|
} else {
|
||||||
|
fprintf(test_out, "gpr_test: get with no tokens, KEYS_AND passed\n");
|
||||||
|
}
|
||||||
|
for (i=0; i < 4; i++) free(keys[i]);
|
||||||
|
free(names[0]);
|
||||||
|
|
||||||
|
fprintf(stderr, "get results:\n");
|
||||||
|
for (j=0; j < cnt; j++) {
|
||||||
|
fprintf(stderr, "value %lu: cnt %lu\t segment %s num_tokens %lu\n",
|
||||||
|
(unsigned long) j, (unsigned long) values[j]->cnt,
|
||||||
|
values[j]->segment, (unsigned long) values[j]->num_tokens);
|
||||||
|
for (i=0; i < values[j]->num_tokens; i++) {
|
||||||
|
fprintf(stderr, "token: %lu %s\n", (unsigned long) i,
|
||||||
|
values[j]->tokens[i]);
|
||||||
|
}
|
||||||
|
kvals = values[j]->keyvals;
|
||||||
|
for (i=0; i < values[j]->cnt; i++) {
|
||||||
|
fprintf(stderr, "\tkey %s type %d\n", kvals[i]->key, kvals[i]->type);
|
||||||
|
}
|
||||||
|
OBJ_RELEASE(values[j]);
|
||||||
|
}
|
||||||
|
free(values);
|
||||||
|
|
||||||
fprintf(stderr, "now finalize and see if all memory cleared\n");
|
fprintf(stderr, "now finalize and see if all memory cleared\n");
|
||||||
test_component_close(&handle);
|
test_component_close(&handle);
|
||||||
orte_dps_close();
|
orte_dps_close();
|
||||||
|
@ -42,7 +42,7 @@ int main(int argc, char **argv)
|
|||||||
orte_jobid_t job;
|
orte_jobid_t job;
|
||||||
orte_vpid_t vpid;
|
orte_vpid_t vpid;
|
||||||
int i, j, rc;
|
int i, j, rc;
|
||||||
char *tmp;
|
char *tmp, *site, *resource;
|
||||||
test_component_handle_t ns_handle;
|
test_component_handle_t ns_handle;
|
||||||
mca_ns_base_component_t *ns_component = NULL;
|
mca_ns_base_component_t *ns_component = NULL;
|
||||||
mca_ns_base_module_t *ns_module = NULL;
|
mca_ns_base_module_t *ns_module = NULL;
|
||||||
@ -130,7 +130,7 @@ int main(int argc, char **argv)
|
|||||||
free(test_name);
|
free(test_name);
|
||||||
|
|
||||||
/* create a cellid */
|
/* create a cellid */
|
||||||
if (ORTE_SUCCESS != (rc = ns_module->create_cellid(&cell))) { /* got error */
|
if (ORTE_SUCCESS != (rc = ns_module->create_cellid(&cell, "dummy-site", "dummy-resource"))) { /* got error */
|
||||||
test_failure("test_ns_replica orte_ns test create_cellid failed");
|
test_failure("test_ns_replica orte_ns test create_cellid failed");
|
||||||
fprintf(test_out, "create cellid: error with error %s\n", ORTE_ERROR_NAME(rc));
|
fprintf(test_out, "create cellid: error with error %s\n", ORTE_ERROR_NAME(rc));
|
||||||
test_finalize();
|
test_finalize();
|
||||||
@ -140,6 +140,17 @@ int main(int argc, char **argv)
|
|||||||
test_success();
|
test_success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* get cellid info */
|
||||||
|
if (ORTE_SUCCESS != (rc = ns_module->get_cell_info(cell, &site, &resource))) { /* got error */
|
||||||
|
test_failure("test_ns_replica orte_ns test get_cell_info failed");
|
||||||
|
fprintf(test_out, "get_cell_info: error with error %s\n", ORTE_ERROR_NAME(rc));
|
||||||
|
test_finalize();
|
||||||
|
exit(1);
|
||||||
|
} else {
|
||||||
|
fprintf(test_out, "get_cell_info: %lu %s %s\n", (unsigned long) cell, site, resource);
|
||||||
|
test_success();
|
||||||
|
}
|
||||||
|
|
||||||
for (i=0; i<10; i++) { /* loop through */
|
for (i=0; i<10; i++) { /* loop through */
|
||||||
/* create jobid */
|
/* create jobid */
|
||||||
if (ORTE_SUCCESS != (rc = ns_module->create_jobid(&job))) { /* got error */
|
if (ORTE_SUCCESS != (rc = ns_module->create_jobid(&job))) { /* got error */
|
||||||
|
@ -19,7 +19,8 @@ include $(top_srcdir)/config/Makefile.options
|
|||||||
AM_CPPFLAGS = -I$(top_srcdir)/test/support
|
AM_CPPFLAGS = -I$(top_srcdir)/test/support
|
||||||
|
|
||||||
check_PROGRAMS = \
|
check_PROGRAMS = \
|
||||||
test_rds
|
test_rds \
|
||||||
|
test_rds2
|
||||||
|
|
||||||
TESTS = \
|
TESTS = \
|
||||||
$(check_PROGRAMS)
|
$(check_PROGRAMS)
|
||||||
@ -29,3 +30,9 @@ test_rds_LDADD = \
|
|||||||
$(top_builddir)/test/support/libsupport.a \
|
$(top_builddir)/test/support/libsupport.a \
|
||||||
$(top_builddir)/src/libmpi.la
|
$(top_builddir)/src/libmpi.la
|
||||||
test_rds_DEPENDENCIES = $(test_rds_LDADD)
|
test_rds_DEPENDENCIES = $(test_rds_LDADD)
|
||||||
|
|
||||||
|
test_rds2_SOURCES = test_rds2.c
|
||||||
|
test_rds2_LDADD = \
|
||||||
|
$(top_builddir)/test/support/libsupport.a \
|
||||||
|
$(top_builddir)/src/libmpi.la
|
||||||
|
test_rds2_DEPENDENCIES = $(test_rds2_LDADD)
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "util/output.h"
|
#include "util/output.h"
|
||||||
|
|
||||||
#include "mca/gpr/base/base.h"
|
#include "mca/gpr/base/base.h"
|
||||||
|
#include "mca/ns/base/base.h"
|
||||||
#include "mca/rds/base/base.h"
|
#include "mca/rds/base/base.h"
|
||||||
|
|
||||||
/* output files needed by the test */
|
/* output files needed by the test */
|
||||||
@ -45,9 +46,11 @@ main(int argc, char **argv)
|
|||||||
int rc;
|
int rc;
|
||||||
bool allow, have;
|
bool allow, have;
|
||||||
int priority;
|
int priority;
|
||||||
test_component_handle_t gpr_handle;
|
test_component_handle_t gpr_handle, ns_handle;
|
||||||
mca_gpr_base_component_t *gpr_component = NULL;
|
mca_gpr_base_component_t *gpr_component = NULL;
|
||||||
orte_gpr_base_module_t *gpr_module = NULL;
|
orte_gpr_base_module_t *gpr_module = NULL;
|
||||||
|
mca_ns_base_component_t *ns_component = NULL;
|
||||||
|
mca_ns_base_module_t *ns_module = NULL;
|
||||||
test_component_handle_t rds_handle;
|
test_component_handle_t rds_handle;
|
||||||
orte_rds_base_component_t *rds_component = NULL;
|
orte_rds_base_component_t *rds_component = NULL;
|
||||||
orte_rds_base_module_t *rds_module = NULL;
|
orte_rds_base_module_t *rds_module = NULL;
|
||||||
@ -68,6 +71,9 @@ main(int argc, char **argv)
|
|||||||
/* ENSURE THE GPR REPLICA IS ISOLATED */
|
/* ENSURE THE GPR REPLICA IS ISOLATED */
|
||||||
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
|
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
|
||||||
|
|
||||||
|
/* ensure the NS replica is isolated */
|
||||||
|
setenv("OMPI_MCA_ns_replica_isolate", "1", 1);
|
||||||
|
|
||||||
/* Open up the output streams */
|
/* Open up the output streams */
|
||||||
if (!ompi_output_init()) {
|
if (!ompi_output_init()) {
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
@ -107,6 +113,18 @@ main(int argc, char **argv)
|
|||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Open the ns replica component and initialize a module */
|
||||||
|
if (OMPI_SUCCESS !=
|
||||||
|
test_component_open("ns", "replica", &ns_handle,
|
||||||
|
(mca_base_component_t**) &ns_component) ||
|
||||||
|
NULL == ns_component) {
|
||||||
|
test_fail_stop("Could not open ns replica\n", 1);
|
||||||
|
}
|
||||||
|
ns_module = ns_component->ns_init(&priority);
|
||||||
|
if (NULL == ns_module) {
|
||||||
|
test_fail_stop("NS replica component did not return a module\n", 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Open the gpr replica component and initialize a module */
|
/* Open the gpr replica component and initialize a module */
|
||||||
if (OMPI_SUCCESS !=
|
if (OMPI_SUCCESS !=
|
||||||
test_component_open("gpr", "replica", &gpr_handle,
|
test_component_open("gpr", "replica", &gpr_handle,
|
||||||
@ -137,9 +155,33 @@ main(int argc, char **argv)
|
|||||||
if (NULL == rds_module) {
|
if (NULL == rds_module) {
|
||||||
test_fail_stop("rds hostfile component did not return a module\n", 1);
|
test_fail_stop("rds hostfile component did not return a module\n", 1);
|
||||||
}
|
}
|
||||||
fprintf(test_out, "RDS host component started\n");
|
|
||||||
|
|
||||||
fprintf(stderr, "now finalize and see if all memory cleared\n");
|
// rds_module->query();
|
||||||
|
|
||||||
|
fprintf(test_out, "RDS hostfile component executed\n");
|
||||||
|
|
||||||
|
if (NULL != rds_module->finalize) {
|
||||||
|
rds_module->finalize();
|
||||||
|
}
|
||||||
|
test_component_close(&rds_handle);
|
||||||
|
|
||||||
|
fprintf(stderr, "test the resource file component\n");
|
||||||
|
if (OMPI_SUCCESS !=
|
||||||
|
test_component_open("rds", "resfile", &rds_handle,
|
||||||
|
(mca_base_component_t**) &rds_component) ||
|
||||||
|
NULL == rds_component) {
|
||||||
|
test_fail_stop("Could not open rds resource file component\n", 1);
|
||||||
|
}
|
||||||
|
rds_module = rds_component->rds_init();
|
||||||
|
if (NULL == rds_module) {
|
||||||
|
test_fail_stop("rds resource file component did not return a module\n", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
rds_module->query();
|
||||||
|
|
||||||
|
fprintf(test_out, "RDS resource file component executed\n");
|
||||||
|
|
||||||
|
gpr_module->dump_segments(0);
|
||||||
|
|
||||||
if (NULL != rds_module->finalize) {
|
if (NULL != rds_module->finalize) {
|
||||||
rds_module->finalize();
|
rds_module->finalize();
|
||||||
|
74
test/mca/rds/test_rds2.c
Обычный файл
74
test/mca/rds/test_rds2.c
Обычный файл
@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
|
* All rights reserved.
|
||||||
|
* $COPYRIGHT$
|
||||||
|
*
|
||||||
|
* Additional copyrights may follow
|
||||||
|
*
|
||||||
|
* $HEADER$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "orte_config.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "support.h"
|
||||||
|
#include "components.h"
|
||||||
|
|
||||||
|
#include "include/orte_constants.h"
|
||||||
|
|
||||||
|
#include "runtime/runtime.h"
|
||||||
|
#include "mca/gpr/gpr.h"
|
||||||
|
#include "mca/rds/base/base.h"
|
||||||
|
|
||||||
|
/* output files needed by the test */
|
||||||
|
static FILE *test_out=NULL;
|
||||||
|
|
||||||
|
static char *cmd_str="diff ./test_ns_replica_out ./test_ns_replica_out_std";
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
test_init("test_rds_fn");
|
||||||
|
|
||||||
|
if (getenv("TEST_WRITE_TO_FILE") != NULL) {
|
||||||
|
test_out = fopen( "test_rds_fn", "w+" );
|
||||||
|
} else {
|
||||||
|
test_out = stderr;
|
||||||
|
}
|
||||||
|
if( test_out == NULL ) {
|
||||||
|
test_failure("rds_fn couldn't open test file failed");
|
||||||
|
test_finalize();
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
orte_init();
|
||||||
|
|
||||||
|
orte_rds_base_query();
|
||||||
|
|
||||||
|
orte_gpr.dump_segments(0);
|
||||||
|
|
||||||
|
orte_finalize();
|
||||||
|
|
||||||
|
fclose( test_out );
|
||||||
|
/* result = system( cmd_str );
|
||||||
|
if( result == 0 ) {
|
||||||
|
test_success();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
test_failure( "test_rds failed");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
test_finalize();
|
||||||
|
|
||||||
|
exit (0);
|
||||||
|
}
|
Загрузка…
x
Ссылка в новой задаче
Block a user