1
1

* Sync trunk to r4977 of the tim branch

This commit was SVN r4978.

The following SVN revisions from the original message are invalid or
inconsistent and therefore were not cross-referenced:
  r4977
Этот коммит содержится в:
Brian Barrett 2005-03-22 00:31:17 +00:00
родитель ce43580e01
Коммит aa70a35fea
50 изменённых файлов: 909 добавлений и 787 удалений

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

@ -62,3 +62,6 @@ Post-milestone:
- Jeff: collapse MCA params from 3 names to 1 name
- ?: Apply LANL copyright to trunk (post all merging activity)
- Probably during/after OMPI/ORTE split:
- re-merge [orte|ompi]_pointer_array and [orte|ompi]_value_array

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

@ -1,6 +1,71 @@
This file contains information on merging the branches/tim tree into the
trunk.
UPDATE MERGE 6:
svn merge -r4943:4977 svn+ssh://svn.open-mpi.org/l/svn/ompi/branches/tim .
A test/mca/ns/ns_nds.c
A test/mca/gpr/gpr_overwrite.c
A test/mca/gpr/gpr_triggers.c
A test/mca/gpr/gpr_put_get.c
A test/mca/gpr/gpr_mem_leaks.c
U test/mca/gpr/Makefile.am
A test/mca/gpr/gpr_internal_fns.c
D test/mca/gpr/gpr_test_trigs.c
D test/mca/gpr/gpr_test.c
D test/mca/gpr/gpr_test_proxy.c
D test/mca/gpr/gpr_test_overwrite.c
U test/mca/Makefile.am
A test/runtime/ompi_session_dir.c
A test/runtime/sigchld.c
U test/Makefile.am
U test/support/support.c
D test/ns
D test/plsnds/plsnds_test.c
D test/plsnds/Makefile.am
D test/plsnds
D test/rte/ompi_session_dir.c
D test/rte/run_tests
D test/rte/Makefile.am
D test/rte/sigchld.c
D test/rte
U include/ompi_config_bottom.h
U src/event/signal.c
U src/runtime/orte_restart.c
U src/dps/dps_unpack.c
U src/tools/ompi_info/ompi_info.cc
U src/tools/orterun/orterun.c
U src/mca/oob/tcp/oob_tcp_msg.h
U src/mca/oob/tcp/oob_tcp_msg.c
U src/mca/oob/base/oob_base_send_nb.c
U src/mca/oob/base/oob_base_recv_nb.c
U src/mca/ns/base/ns_base_nds_env.c
U src/mca/gpr/replica/communications/gpr_replica_put_get_cm.c
U src/mca/gpr/replica/gpr_replica_component.c
U src/mca/gpr/replica/functional_layer/gpr_replica_messaging_fn.c
U src/mca/gpr/proxy/gpr_proxy_put_get.c
U src/mca/gpr/base/gpr_base_open.c
U src/mca/rds/hostfile/rds_hostfile.c
U src/mca/soh/base/base.h
U src/mca/soh/base/soh_base_open.c
U src/mca/soh/base/soh_base_local_functions.c
U src/mca/rml/oob/Makefile.am
U src/mca/rml/oob/rml_oob_component.c
D src/mca/rml/oob/rml_oob.c
U src/mca/rml/base/rml_base_open.c
U src/mca/pls/bproc_seed/pls_bproc_seed.c
U src/mca/pls/bproc_seed/pls_bproc_seed_component.c
U src/mca/rmgr/urm/rmgr_urm.c
U src/mca/rmgr/base/rmgr_base_context.c
U src/mca/rmgr/rmgr.h
U src/mca/iof/base/iof_base_fragment.c
U src/util/proc_info.c
U src/util/sys_info.c
U ISSUES
UPDATE MERGE 5:
svn merge -r4937:4943 svn+ssh://svn.open-mpi.org/l/svn/ompi/branches/tim .

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

@ -165,7 +165,7 @@ typedef long long bool;
* If we're mem debugging, make the OMPI_DEBUG_ZERO resolve to memset
*/
# include <string.h>
# define OMPI_DEBUG_ZERO(obj) memset(&obj, 0, sizeof(obj))
# define OMPI_DEBUG_ZERO(obj) memset(&(obj), 0, sizeof(obj))
#else
# define OMPI_DEBUG_ZERO(obj)
#endif

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

@ -143,7 +143,6 @@ int orte_dps_unpack_nobuffer(void *dst, void *src, size_t num_vals,
{
int rc;
size_t i;
size_t j;
size_t n;
uint16_t * d16;
uint32_t * d32;

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

@ -64,11 +64,14 @@ extern struct ompi_event_list ompi_signalqueue;
static short ompi_evsigcaught[NSIG];
static int ompi_needrecalc;
static int ompi_event_signal_pipe[2];
#if 0
static ompi_event_t ompi_event_signal_pipe_event;
#endif
volatile sig_atomic_t ompi_event_signal_count = 0;
static bool initialized = false;
volatile sig_atomic_t ompi_evsignal_caught = 0;
#if 0
static void ompi_event_signal_pipe_handler(int sd, short flags, void* user)
{
ompi_output(0, "ompi_event_signal_pipe_handler: %d\n", ompi_event_signal_count);
@ -77,6 +80,7 @@ static void ompi_event_signal_pipe_handler(int sd, short flags, void* user)
read(ompi_event_signal_pipe[0], &byte, 1);
}
}
#endif
void ompi_evsignal_handler(int sig);
@ -146,12 +150,16 @@ int
ompi_evsignal_del(sigset_t *evsigmask, struct ompi_event *ev)
{
int evsignal;
struct sigaction sa;
evsignal = OMPI_EVENT_SIGNAL(ev);
sigdelset(evsigmask, evsignal);
ompi_needrecalc = 1;
return (sigaction(OMPI_EVENT_SIGNAL(ev),(struct sigaction *)SIG_DFL, NULL));
memset(&sa, 0, sizeof(sa));
sa.sa_handler = SIG_DFL;
return sigaction(evsignal, &sa, NULL);
}
void

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

@ -56,6 +56,12 @@ static void orte_gpr_keyval_destructor(orte_gpr_keyval_t* keyval)
if (NULL != byteptr->bytes) {
free(byteptr->bytes);
}
} else if (ORTE_STRING == keyval->type) {
if (NULL != keyval->value.strptr)
free(keyval->value.strptr);
} else if (ORTE_APP_CONTEXT == keyval->type) {
if (NULL != keyval->value.app_context)
OBJ_RELEASE(keyval->value.app_context);
}
}

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

@ -164,4 +164,4 @@ int orte_gpr_proxy_get_nb(orte_gpr_addr_mode_t addr_mode,
orte_gpr_notify_cb_fn_t cbfunc, void *user_tag)
{
return ORTE_ERR_NOT_IMPLEMENTED;
}
}

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

@ -284,6 +284,14 @@ int orte_gpr_replica_recv_get_cmd(orte_buffer_t *input_buffer,
free(keytags);
}
if (NULL != values) {
for (i=0; i < cnt; i++) {
if (NULL != values[i])
OBJ_RELEASE(values[i]);
}
free(values);
}
/* pack response code */
if (ORTE_SUCCESS != (rc = orte_dps.pack(output_buffer, &ret, 1, ORTE_INT))) {
ORTE_ERROR_LOG(rc);

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

@ -369,7 +369,7 @@ MOVEON:
return ORTE_ERR_OUT_OF_RESOURCE;
}
(*data_values)->cnt = n;
kptr = &((*data_values)->keyvals[n-cnt-1]);
kptr = &((*data_values)->keyvals[n-cnt]);
} else {
(*data_values)->keyvals = (orte_gpr_keyval_t**)malloc(values[i]->cnt * sizeof(orte_gpr_keyval_t*));
if (NULL == (*data_values)->keyvals) {
@ -399,7 +399,9 @@ MOVEON:
return rc;
}
}
OBJ_RELEASE(values[i]);
} /* for i */
free(values);
return ORTE_SUCCESS;
}

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

@ -146,6 +146,9 @@ static void orte_gpr_replica_segment_destructor(orte_gpr_replica_segment_t* seg)
dptr = (orte_gpr_replica_dict_t**)((seg->dict)->addr);
for (i=0; i < (seg->dict)->size; i++) {
if (NULL != dptr[i]) {
if (NULL != dptr[i]->entry) {
free(dptr[i]->entry);
}
free(dptr[i]);
}
}
@ -234,6 +237,12 @@ static void orte_gpr_replica_itagval_destructor(orte_gpr_replica_itagval_t* ptr)
{
if (ORTE_BYTE_OBJECT == ptr->type) {
free(((ptr->value).byteobject).bytes);
} else if (ORTE_STRING == ptr->type) {
if (NULL != ptr->value.strptr)
free(ptr->value.strptr);
} else if (ORTE_APP_CONTEXT == ptr->type) {
if (NULL != ptr->value.app_context)
OBJ_RELEASE(ptr->value.app_context);
}
}
@ -373,6 +382,10 @@ static void orte_gpr_replica_callbacks_destructor(orte_gpr_replica_callbacks_t*
free(cb->requestor);
cb->requestor = NULL;
}
if (NULL != cb->message) {
OBJ_RELEASE(cb->message);
}
}
/* define instance of ompi_class_t */

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

@ -26,6 +26,7 @@
static void orte_iof_base_frag_construct(orte_iof_base_frag_t* frag)
{
OMPI_DEBUG_ZERO(*frag);
frag->frag_owner = NULL;
frag->frag_len = 0;
frag->frag_iov[0].iov_base = (void*)&frag->frag_hdr;

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

@ -192,7 +192,7 @@ int orte_ns_nds_env_put(const orte_process_name_t* name,
free(param);
free(value);
asprintf(&value, "%d", num_procs);
asprintf(&value, "%ld", num_procs);
if(NULL == (param = mca_base_param_environ_variable("ns","nds","num_procs"))) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;

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

@ -110,7 +110,7 @@ int mca_oob_recv_packed_nb(
oob_cbdata->cbdata = cbdata;
rc = mca_oob.oob_recv_nb(peer, &oob_cbdata->cbiov, 1, tag, flags|MCA_OOB_ALLOC, mca_oob_recv_callback, oob_cbdata);
if(rc != OMPI_SUCCESS) {
if(rc < 0) {
free(oob_cbdata);
}
return rc;

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

@ -115,7 +115,7 @@ int mca_oob_send_packed_nb(
/* queue up the request */
rc = mca_oob.oob_send_nb(peer, &oob_cbdata->cbiov, 1, tag, flags, mca_oob_send_callback, oob_cbdata);
if(rc != OMPI_SUCCESS) {
if(rc < 0) {
free(oob_cbdata);
}
return rc;

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

@ -383,7 +383,7 @@ static void mca_oob_tcp_msg_data(mca_oob_tcp_msg_t* msg, mca_oob_tcp_peer_t* pee
* the message header has already been converted back to host -
* so must convert back to network to match.
*/
post = mca_oob_tcp_msg_match_post(&peer->peer_name, msg->msg_hdr.msg_tag, true);
post = mca_oob_tcp_msg_match_post(&peer->peer_name, msg->msg_hdr.msg_tag);
if(NULL != post) {
if(post->msg_flags & MCA_OOB_ALLOC) {
@ -513,7 +513,7 @@ mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_recv(orte_process_name_t* name, int tag
* Note - this routine requires the caller to be holding the module lock.
*/
mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_post(orte_process_name_t* name, int tag, bool peek)
mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_post(orte_process_name_t* name, int tag)
{
mca_oob_tcp_msg_t* msg;
for(msg = (mca_oob_tcp_msg_t*) ompi_list_get_first(&mca_oob_tcp_component.tcp_msg_post);
@ -525,7 +525,7 @@ mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_post(orte_process_name_t* name, int tag
if((0 == cmpval1) || (0 == cmpval2)) {
if (msg->msg_hdr.msg_tag == tag) {
if((msg->msg_flags & MCA_OOB_PEEK) == 0 || peek) {
if((msg->msg_flags & MCA_OOB_PEEK) == 0) {
ompi_list_remove_item(&mca_oob_tcp_component.tcp_msg_post, &msg->super);
return msg;
} else {

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

@ -167,13 +167,12 @@ mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_recv(orte_process_name_t* name, int tag
*
* @param name (IN) Name associated with peer or wildcard to match first posted recv.
* @param tag (IN) Message tag.
* @param peek (IN) Match message with MCA_OOB_PEEK flag set.
* @return msg Matched message or NULL.
*
* Note - this routine requires the caller to be holding the module lock.
*/
mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_post(orte_process_name_t* name, int tag, bool peek);
mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_post(orte_process_name_t* name, int tag);
/**
* Allocate space for iovec array - if the request number of elements is less than

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

@ -295,7 +295,7 @@ static void orte_pls_bproc_wait_proc(pid_t pid, int status, void* cbdata)
if(ORTE_SUCCESS != rc) {
ORTE_ERROR_LOG(rc);
}
OBJ_RELEASE(proc);
OBJ_RELEASE(proc);
}
/* release any waiting threads */
@ -325,7 +325,7 @@ static void orte_pls_bproc_wait_node(pid_t pid, int status, void* cbdata)
ORTE_ERROR_LOG(rc);
}
}
/* OBJ_RELEASE(node); */
OBJ_RELEASE(node);
/* release any waiting threads */
OMPI_THREAD_LOCK(&mca_pls_bproc_seed_component.lock);
@ -612,7 +612,7 @@ int orte_pls_bproc_seed_launch(orte_jobid_t jobid)
}
if(ORTE_SUCCESS != (rc = orte_rmaps_base_get_vpid_range(jobid, &vpid_start, &vpid_range))) {
ORTE_ERROR_LOG(rc);
return rc;
goto cleanup;
}
/* for each application context - launch across the first n nodes required */

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

@ -75,9 +75,9 @@ int orte_pls_bproc_seed_component_open(void)
mca_pls_bproc_seed_component.num_children = 0;
/* init parameters */
mca_pls_bproc_seed_component.debug = orte_pls_bproc_param_register_int("debug", 1);
mca_pls_bproc_seed_component.debug = orte_pls_bproc_param_register_int("debug", 0);
mca_pls_bproc_seed_component.reap = orte_pls_bproc_param_register_int("reap", 1);
mca_pls_bproc_seed_component.image_frag_size = orte_pls_bproc_param_register_int("image_frag_size", 256*1024);
mca_pls_bproc_seed_component.image_frag_size = orte_pls_bproc_param_register_int("image_frag_size", 1*1024*1024);
mca_pls_bproc_seed_component.priority = orte_pls_bproc_param_register_int("priority", 100);
mca_pls_bproc_seed_component.terminate_sig = orte_pls_bproc_param_register_int("terminate_sig", 9);

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

@ -234,7 +234,9 @@ static int orte_rds_hostfile_query(void)
}
goto cleanup;
}
rc = orte_ras_base_node_insert(&updates);
if(ompi_list_get_size(&updates)) {
rc = orte_ras_base_node_insert(&updates);
}
cleanup:
while(NULL != (item = ompi_list_remove_first(&existing))) {

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

@ -86,6 +86,7 @@ int orte_rmgr_base_put_app_context(
(value->keyvals[i])->key = strdup(ORTE_JOB_APP_CONTEXT_KEY);
(value->keyvals[i])->type = ORTE_APP_CONTEXT;
(value->keyvals[i])->value.app_context = app;
OBJ_RETAIN(app);
app->idx = i;
job_slots += app->num_procs;
}

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

@ -168,7 +168,7 @@ typedef int (*orte_rmgr_base_module_proc_stage_gate_init_fn_t)(orte_jobid_t job)
* usually, broadcasting a message to all processes in the job that allows them
* to proceed.
*/
typedef void (*orte_rmgr_base_module_proc_stage_gate_mgr_fn_t)(orte_gpr_notify_message_t *notify_msg, void *user_tag);
typedef void (*orte_rmgr_base_module_proc_stage_gate_mgr_fn_t)(orte_gpr_notify_data_t *data, void *user_tag);
/**
* Cleanup resources held by rmgr.

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

@ -184,7 +184,6 @@ static void orte_rmgr_urm_callback(orte_gpr_notify_data_t *data, void *cbdata)
}
}
}
OBJ_RELEASE(data);
}

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

@ -38,25 +38,7 @@
*/
orte_rml_base_t orte_rml_base;
orte_rml_module_t orte_rml = {
mca_oob_base_module_init,
NULL,
(orte_rml_module_get_uri_fn_t)mca_oob_get_contact_info,
(orte_rml_module_set_uri_fn_t)mca_oob_set_contact_info,
(orte_rml_module_parse_uris_fn_t)mca_oob_parse_contact_info,
(orte_rml_module_ping_fn_t)mca_oob_ping,
(orte_rml_module_send_fn_t)mca_oob_send,
(orte_rml_module_send_nb_fn_t)mca_oob_send_nb,
(orte_rml_module_send_buffer_fn_t)mca_oob_send_packed,
(orte_rml_module_send_buffer_nb_fn_t)mca_oob_send_packed_nb,
(orte_rml_module_recv_fn_t)mca_oob_recv,
(orte_rml_module_recv_nb_fn_t)mca_oob_recv_nb,
(orte_rml_module_recv_buffer_fn_t)mca_oob_recv_packed,
(orte_rml_module_recv_buffer_nb_fn_t)mca_oob_recv_packed_nb,
(orte_rml_module_recv_cancel_fn_t)mca_oob_recv_cancel,
(orte_rml_module_barrier_fn_t)mca_oob_barrier,
(orte_rml_module_xcast_fn_t)mca_oob_xcast
};
orte_rml_module_t orte_rml;
orte_process_name_t orte_rml_name_any = { ORTE_CELLID_MAX, ORTE_JOBID_MAX, ORTE_VPID_MAX };
orte_process_name_t orte_rml_name_seed = { 0, 0, 0 };

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

@ -18,7 +18,6 @@ include $(top_ompi_srcdir)/config/Makefile.options
sources = \
rml_oob.h \
rml_oob.c \
rml_oob_component.c
# Make the output library in this directory, and name it either

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

@ -1,46 +0,0 @@
/*
* 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$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include "include/constants.h"
#include "util/output.h"
#include "mca/rml/rml.h"
#include "mca/oob/oob.h"
#include "mca/oob/base/base.h"
orte_rml_module_t orte_rml_oob_module = {
mca_oob_base_module_init,
NULL,
(orte_rml_module_get_uri_fn_t)mca_oob_get_contact_info,
(orte_rml_module_set_uri_fn_t)mca_oob_set_contact_info,
(orte_rml_module_parse_uris_fn_t)mca_oob_parse_contact_info,
(orte_rml_module_ping_fn_t)mca_oob_ping,
(orte_rml_module_send_fn_t)mca_oob_send,
(orte_rml_module_send_nb_fn_t)mca_oob_send_nb,
(orte_rml_module_send_buffer_fn_t)mca_oob_send_packed,
(orte_rml_module_send_buffer_nb_fn_t)mca_oob_send_packed_nb,
(orte_rml_module_recv_fn_t)mca_oob_recv,
(orte_rml_module_recv_nb_fn_t)mca_oob_recv_nb,
(orte_rml_module_recv_buffer_fn_t)mca_oob_recv_packed,
(orte_rml_module_recv_buffer_nb_fn_t)mca_oob_recv_packed_nb,
(orte_rml_module_recv_cancel_fn_t)mca_oob_recv_cancel,
(orte_rml_module_barrier_fn_t)mca_oob_barrier,
(orte_rml_module_xcast_fn_t)mca_oob_xcast
};

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

@ -21,7 +21,61 @@
#include "mca/oob/oob.h"
#include "mca/oob/base/base.h"
#include "rml_oob.h"
#include "mca/errmgr/errmgr.h"
static orte_rml_module_t* orte_rml_oob_init(int* priority);
static int orte_rml_oob_open(void);
static int orte_rml_oob_close(void);
/**
* component definition
*/
orte_rml_component_t mca_rml_oob_component = {
/* First, the mca_base_component_t struct containing meta
information about the component itself */
{
/* Indicate that we are a rml v1.0.0 component (which also
implies a specific MCA version) */
ORTE_RML_BASE_VERSION_1_0_0,
"oob", /* MCA component name */
1, /* MCA component major version */
0, /* MCA component minor version */
0, /* MCA component release version */
orte_rml_oob_open, /* component open */
orte_rml_oob_close, /* component close */
},
/* Next the MCA v1.0.0 component meta data */
{
/* Whether the component is checkpointable or not */
false
},
orte_rml_oob_init
};
orte_rml_module_t orte_rml_oob_module = {
mca_oob_base_module_init,
NULL,
(orte_rml_module_get_uri_fn_t)mca_oob_get_contact_info,
(orte_rml_module_set_uri_fn_t)mca_oob_set_contact_info,
(orte_rml_module_parse_uris_fn_t)mca_oob_parse_contact_info,
(orte_rml_module_ping_fn_t)mca_oob_ping,
(orte_rml_module_send_fn_t)mca_oob_send,
(orte_rml_module_send_nb_fn_t)mca_oob_send_nb,
(orte_rml_module_send_buffer_fn_t)mca_oob_send_packed,
(orte_rml_module_send_buffer_nb_fn_t)mca_oob_send_packed_nb,
(orte_rml_module_recv_fn_t)mca_oob_recv,
(orte_rml_module_recv_nb_fn_t)mca_oob_recv_nb,
(orte_rml_module_recv_buffer_fn_t)mca_oob_recv_packed,
(orte_rml_module_recv_buffer_nb_fn_t)mca_oob_recv_packed_nb,
(orte_rml_module_recv_cancel_fn_t)mca_oob_recv_cancel,
(orte_rml_module_barrier_fn_t)mca_oob_barrier,
(orte_rml_module_xcast_fn_t)mca_oob_xcast
};
static orte_rml_module_t* orte_rml_oob_init(int* priority)
@ -33,33 +87,36 @@ static orte_rml_module_t* orte_rml_oob_init(int* priority)
}
/**
* component definition
/*
* initialize the underlying oob infrastructure so that all the
* pointers in the RML struct can be valid.
*/
static int
orte_rml_oob_open(void)
{
int rc;
orte_rml_component_t mca_rml_oob_component = {
/* First, the mca_base_component_t struct containing meta
information about the component itself */
if (ORTE_SUCCESS != (rc = mca_oob_base_open())) {
ORTE_ERROR_LOG(rc);
return rc;
}
{
/* Indicate that we are a rml v1.0.0 component (which also
implies a specific MCA version) */
return rc;
}
ORTE_RML_BASE_VERSION_1_0_0,
"rml", /* MCA component name */
1, /* MCA component major version */
0, /* MCA component minor version */
0, /* MCA component release version */
mca_oob_base_open, /* component open */
mca_oob_base_close /* component close */
},
/*
* shut down the OOB, since we started it.
*/
static int
orte_rml_oob_close(void)
{
int rc;
/* Next the MCA v1.0.0 component meta data */
{
/* Whether the component is checkpointable or not */
false
},
orte_rml_oob_init
};
if (ORTE_SUCCESS != (rc = mca_oob_base_close())) {
return rc;
}
return rc;
}

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

@ -57,7 +57,7 @@ int orte_soh_base_set_node_soh_not_available(orte_cellid_t cell,
char *nodename,
orte_node_state_t state);
int orte_soh_base_begin_monitoring(orte_jobid_t job);
int orte_soh_base_begin_monitoring_not_available(orte_jobid_t job);
int orte_soh_base_module_finalize_not_available (void);

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

@ -41,6 +41,11 @@ int orte_soh_base_set_node_soh_not_available(orte_cellid_t cell,
return ORTE_ERR_NOT_IMPLEMENTED;
}
int orte_soh_base_begin_monitoring_not_available(orte_jobid_t job)
{
return ORTE_ERR_NOT_IMPLEMENTED;
}
int orte_soh_base_module_finalize_not_available (void)
{
return ORTE_ERR_NOT_IMPLEMENTED;

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

@ -51,6 +51,7 @@ orte_soh_base_module_t orte_soh = {
orte_soh_base_set_proc_soh,
orte_soh_base_get_node_soh_not_available,
orte_soh_base_set_node_soh_not_available,
orte_soh_base_begin_monitoring_not_available,
orte_soh_base_module_finalize_not_available
};

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

@ -49,10 +49,9 @@
int orte_restart(orte_process_name_t *name, const char* uri)
{
int rc, id;
int rc;
orte_process_name_t* old_name;
orte_process_name_t* new_name;
char *jobid_str, *procid_str;
if (ORTE_SUCCESS != (rc = orte_ns.copy_process_name(&old_name, orte_process_info.my_name))) {
ORTE_ERROR_LOG(rc);

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

@ -38,6 +38,7 @@
#include "communicator/communicator.h"
#include "mca/base/base.h"
#include "tools/ompi_info/ompi_info.h"
#include "threads/mutex.h"
using namespace std;
using namespace ompi_info;
@ -108,6 +109,9 @@ int main(int argc, char *argv[])
--ret;
}
// set our threading level
ompi_set_using_threads(false);
// Get MCA parameters, if any */
mca_base_open();

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

@ -411,6 +411,8 @@ static int parse_locals(int argc, char* argv[])
}
if (made_app) {
ompi_pointer_array_add(&apps_pa, app);
} else {
OBJ_RELEASE(app);
}
/* Reset the temps */
@ -434,6 +436,8 @@ static int parse_locals(int argc, char* argv[])
}
if (made_app) {
ompi_pointer_array_add(&apps_pa, app);
} else {
OBJ_RELEASE(app);
}
}
ompi_argv_free(temp_argv);

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

@ -141,4 +141,4 @@ int orte_proc_info_finalize(void)
}
return ORTE_SUCCESS;
}
}

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

@ -47,11 +47,10 @@ orte_sys_info_t orte_system_info = {
int orte_sys_info(void)
{
struct utsname sys_info;
char *path_name;
#ifndef WIN32
struct passwd *pwdent;
char sep[2];
char *sep = "/";
#else
#define INFO_BUF_SIZE 32768
TCHAR info_buf[INFO_BUF_SIZE];
@ -95,24 +94,7 @@ int orte_sys_info(void)
orte_system_info.machine = strdup(sys_info.machine);
}
#ifndef WIN32
if (NULL != (path_name = getcwd(NULL, 0))) {
if (strlen(path_name) > 1) {
sep[0] = path_name[strlen(path_name)-strlen(basename(path_name))-1];
}
else {
sep[0] = path_name[0];
}
sep[1] = '\0';
orte_system_info.path_sep = strdup(sep);
free(path_name);
}
#else
/* we can hardcode windows path seperator to be "\" */
orte_system_info.path_sep = strdup(sep);
#endif
/* get the name of the user */
#ifndef WIN32

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

@ -14,4 +14,4 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = support util class rte dps mca runtime
SUBDIRS = class dps include mca mpi runtime support threads util

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

@ -14,4 +14,4 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = ns gpr rds
SUBDIRS = gpr ns oob rds

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

@ -17,31 +17,38 @@ include $(top_srcdir)/config/Makefile.options
AM_CPPFLAGS = -I$(top_srcdir)/test/support -DOMPI_ENABLE_DEBUG_OVERRIDE=1 -g
noinst_PROGRAMS = \
gpr_test \
gpr_test_trigs \
gpr_test_proxy \
gpr_test_overwrite
gpr_internal_fns \
gpr_mem_leaks \
gpr_overwrite \
gpr_put_get \
gpr_triggers
gpr_test_SOURCES = gpr_test.c
gpr_test_LDADD = \
gpr_internals_SOURCES = gpr_internals.c
gpr_internals_LDADD = \
$(top_builddir)/src/libmpi.la \
$(top_builddir)/test/support/libsupport.la
gpr_test_DEPENDENCIES = $(gpr_test_LDADD)
gpr_internals_DEPENDENCIES = $(gpr_internals_LDADD)
gpr_test_trigs_SOURCES = gpr_test_trigs.c
gpr_test_trigs_LDADD = \
gpr_mem_leaks_SOURCES = gpr_mem_leaks.c
gpr_mem_leaks_LDADD = \
$(top_builddir)/src/libmpi.la \
$(top_builddir)/test/support/libsupport.la
gpr_test_trigs_DEPENDENCIES = $(gpr_test_trigs_LDADD)
gpr_mem_leaks_DEPENDENCIES = $(gpr_mem_leaks_LDADD)
gpr_test_proxy_SOURCES = gpr_test_proxy.c
gpr_test_proxy_LDADD = \
gpr_overwrite_SOURCES = gpr_overwrite.c
gpr_overwrite_LDADD = \
$(top_builddir)/src/libmpi.la \
$(top_builddir)/test/support/libsupport.la
gpr_test_proxy_DEPENDENCIES = $(gpr_test_proxy_LDADD)
gpr_overwrite_DEPENDENCIES = $(gpr_overwrite_LDADD)
gpr_test_overwrite_SOURCES = gpr_test_overwrite.c
gpr_test_overwrite_LDADD = \
gpr_put_get_SOURCES = gpr_put_get.c
gpr_put_get_LDADD = \
$(top_builddir)/src/libmpi.la \
$(top_builddir)/test/support/libsupport.la
gpr_test_overwrite_DEPENDENCIES = $(gpr_test_overwrite_LDADD)
gpr_put_get_DEPENDENCIES = $(gpr_put_get_LDADD)
gpr_triggers_SOURCES = gpr_triggers.c
gpr_triggers_LDADD = \
$(top_builddir)/src/libmpi.la \
$(top_builddir)/test/support/libsupport.la
gpr_triggers_DEPENDENCIES = $(gpr_triggers_LDADD)

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

@ -315,6 +315,34 @@ int main(int argc, char **argv)
}
fprintf(stderr, "update multiple keyvals in a container\n");
if(ORTE_SUCCESS != orte_gpr_replica_find_seg(&seg, false, "test-put-segment")) {
return -1;
}
cptrs = (orte_gpr_replica_container_t**)((seg->containers)->addr);
for (i=0; i < (seg->containers)->size; i++) {
if (NULL != cptrs[i]) {
cptr = cptrs[i];
}
}
kptr = OBJ_NEW(orte_gpr_keyval_t);
kptr->key = strdup("really-stupid-value");
kptr->type = ORTE_INT32;
kptr->value.i32 = 123456;
if (ORTE_SUCCESS != (rc = orte_gpr_replica_update_keyval(seg, cptr, kptr))) {
fprintf(test_out, "gpr_test: update multiple keyvals failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: update multiple keyvals failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: update multiple keyvals passed\n");
}
orte_gpr.dump_all(0);
fprintf(stderr, "check itag list\n");
if (orte_gpr_replica_check_itag_list(ORTE_GPR_REPLICA_XAND, 0, NULL, 15, itaglist)) {
fprintf(test_out, "check_itag_list: trivial NULL case passed\n");
@ -353,233 +381,6 @@ int main(int argc, char **argv)
}
fprintf(stderr, "put one value with single keyval\n");
val = OBJ_NEW(orte_gpr_value_t);
val->addr_mode = ORTE_GPR_NO_OVERWRITE | ORTE_GPR_TOKENS_XAND;
val->cnt = 1;
val->segment = strdup("test-put-segment");
val->num_tokens = 14;
val->tokens = (char**)malloc(val->num_tokens * sizeof(char*));
for (i=0; i < 14; i++) {
asprintf(&(val->tokens[i]), "dummy%d", i);
}
val->keyvals = (orte_gpr_keyval_t**)malloc(sizeof(orte_gpr_keyval_t*));
val->keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
(val->keyvals[0])->key = strdup("stupid-value-next-one");
(val->keyvals[0])->type = ORTE_INT32;
(val->keyvals[0])->value.i32 = 654321;
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put(1, &val))) {
fprintf(test_out, "gpr_test: put of 1 value/1 keyval failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put of 1 value/1 keyval failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: put of 1 value/1 keyval passed\n");
}
OBJ_RELEASE(val);
fprintf(stderr, "put one value with multiple keyvals\n");
val = OBJ_NEW(orte_gpr_value_t);
val->addr_mode = ORTE_GPR_NO_OVERWRITE | ORTE_GPR_TOKENS_XAND;
val->cnt = 20;
val->segment = strdup("test-put-segment");
val->num_tokens = 14;
val->tokens = (char**)malloc(val->num_tokens * sizeof(char*));
for (i=0; i < 14; i++) {
asprintf(&(val->tokens[i]), "dummy%d", i);
}
val->keyvals = (orte_gpr_keyval_t**)malloc(20*sizeof(orte_gpr_keyval_t*));
for (i=0; i<20; i++) {
val->keyvals[i] = OBJ_NEW(orte_gpr_keyval_t);
asprintf(&((val->keyvals[i])->key), "stupid-test-%d", i);
(val->keyvals[i])->type = ORTE_UINT32;
(val->keyvals[i])->value.ui32 = (uint32_t)i;
}
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put(1, &val))) {
fprintf(test_out, "gpr_test: put 1 value/multiple keyval failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put 1 value/multiple keyval failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: put 1 value/multiple keyval passed\n");
}
fprintf(stderr, "put 1 value/multiple keyvals - second container\n");
val->num_tokens = 10;
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put(1, &val))) {
fprintf(test_out, "gpr_test: put 1 value/multiple keyval in second container failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put 1 value/multiple keyval in second container failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: put 1 value/multiple keyval in second container passed\n");
}
OBJ_RELEASE(val);
fprintf(stderr, "dump\n");
if (ORTE_SUCCESS != (rc = orte_gpr.dump_all(0))) {
fprintf(test_out, "gpr_test: dump failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: dump failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: dump passed\n");
}
fprintf(stderr, "get\n");
names[0] = strdup("dummy0");
names[1] = NULL;
keys[0] = strdup("stupid-test-1");
keys[1] = NULL;
if (ORTE_SUCCESS != (rc = orte_gpr_replica_get(ORTE_GPR_KEYS_OR | ORTE_GPR_TOKENS_OR,
"test-put-segment",
names, 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 passed\n");
}
fprintf(stderr, "get results:\n");
for (j=0; j < cnt; j++) {
fprintf(stderr, "value %d: cnt %d\t segment %s num_tokens %d\n", j,
values[j]->cnt,
values[j]->segment, values[j]->num_tokens);
for (i=0; i < values[j]->num_tokens; i++) {
fprintf(stderr, "token: %d %s\n", 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 multiple in one segment, multiple containers\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 = orte_gpr_replica_get(ORTE_GPR_KEYS_OR | ORTE_GPR_TOKENS_OR,
"test-put-segment",
names, 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 passed\n");
}
fprintf(stderr, "get results:\n");
for (j=0; j < cnt; j++) {
fprintf(stderr, "value %d: cnt %d\t segment %s num_tokens %d\n", j,
values[j]->cnt,
values[j]->segment, values[j]->num_tokens);
for (i=0; i < values[j]->num_tokens; i++) {
fprintf(stderr, "token: %d %s\n", 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, "put multiple copies of same entry in single container\n");
val = OBJ_NEW(orte_gpr_value_t);
val->addr_mode = ORTE_GPR_NO_OVERWRITE | ORTE_GPR_TOKENS_XAND;
val->cnt = 1;
val->segment = strdup("test-put-segment");
val->num_tokens = 5;
val->tokens = (char**)malloc(val->num_tokens * sizeof(char*));
for (i=0; i < 5; i++) {
asprintf(&(val->tokens[i]), "multi-dum-dum-%d", i);
}
val->keyvals = (orte_gpr_keyval_t**)malloc(sizeof(orte_gpr_keyval_t*));
val->keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
(val->keyvals[0])->key = strdup("stupid-value-next-one");
(val->keyvals[0])->type = ORTE_STRING;
(val->keyvals[0])->value.strptr = strdup("try-string-value");
for (i = 0; i < 10; i++) {
fprintf(stderr, "\tputting copy %d\n", i);
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put(1, &val))) {
fprintf(test_out, "gpr_test: put multiple copies of one keyval in a container failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put multiple copies of one keyval in a container failed");
test_finalize();
return rc;
}
}
OBJ_RELEASE(val);
orte_gpr.dump_all(0);
fprintf(stderr, "update multiple keyvals in a container\n");
if(ORTE_SUCCESS != orte_gpr_replica_find_seg(&seg, false, "test-put-segment")) {
return -1;
}
cptrs = (orte_gpr_replica_container_t**)((seg->containers)->addr);
for (i=0; i < (seg->containers)->size; i++) {
if (NULL != cptrs[i]) {
cptr = cptrs[i];
}
}
kptr = OBJ_NEW(orte_gpr_keyval_t);
kptr->key = strdup("really-stupid-value");
kptr->type = ORTE_INT32;
kptr->value.i32 = 123456;
if (ORTE_SUCCESS != (rc = orte_gpr_replica_update_keyval(seg, cptr, kptr))) {
fprintf(test_out, "gpr_test: update multiple keyvals failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: update multiple keyvals failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: update multiple keyvals passed\n");
}
orte_gpr.dump_all(0);
fprintf(stderr, "put with no tokens puts in every container\n");
val = OBJ_NEW(orte_gpr_value_t);
val->addr_mode = ORTE_GPR_NO_OVERWRITE;
val->cnt = 1;
val->segment = strdup("test-put-segment");
val->num_tokens = 0;
val->tokens = NULL;
val->keyvals = (orte_gpr_keyval_t**)malloc(sizeof(orte_gpr_keyval_t*));
val->keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
(val->keyvals[0])->key = strdup("stupid-value-next-one");
(val->keyvals[0])->type = ORTE_STRING;
(val->keyvals[0])->value.strptr = strdup("try-string-value");
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put(1, &val))) {
fprintf(test_out, "gpr_test: put with no tokens failed - returned %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put with no tokens failed");
test_finalize();
} else {
fprintf(test_out, "gpr_test: put with no tokens passed\n");
}
OBJ_RELEASE(val);
orte_gpr.dump_all(0);
fprintf(stderr, "\nreleasing segment\n");
if (ORTE_SUCCESS != (rc = orte_gpr_replica_release_segment(&seg)) ||
NULL != seg) {

234
test/mca/gpr/gpr_mem_leaks.c Обычный файл
Просмотреть файл

@ -0,0 +1,234 @@
/*
* 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$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - unit test
*
*/
/*
* includes
*/
#include "orte_config.h"
#include <stdio.h>
#include <string.h>
#include "include/orte_constants.h"
#include "include/orte_schema.h"
#include "support.h"
#include "class/orte_pointer_array.h"
#include "dps/dps.h"
#include "runtime/runtime.h"
#include "util/proc_info.h"
#include "util/sys_info.h"
#include "mca/gpr/base/base.h"
#include "mca/gpr/gpr.h"
/* output files needed by the test */
static FILE *test_out=NULL;
static char *cmd_str="diff ./test_gpr_replica_out ./test_gpr_replica_out_std";
int main(int argc, char **argv)
{
int rc;
int32_t i, cnt;
char *names[15], *keys[5];
orte_gpr_value_t **values, *val;
test_init("test_gpr_replica");
/* test_out = fopen( "test_gpr_replica_out", "w+" ); */
test_out = stderr;
if( test_out == NULL ) {
test_failure("gpr_test couldn't open test file failed");
test_finalize();
exit(1);
}
/* ENSURE THE REPLICA IS ISOLATED */
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
/* Open up the output streams */
if (!ompi_output_init()) {
return OMPI_ERROR;
}
/*
* If threads are supported - assume that we are using threads - and reset otherwise.
*/
ompi_set_using_threads(OMPI_HAVE_THREADS);
/* For malloc debugging */
ompi_malloc_init();
/* Ensure the system_info structure is instantiated and initialized */
if (ORTE_SUCCESS != (rc = orte_sys_info())) {
return rc;
}
/* Ensure the process info structure is instantiated and initialized */
if (ORTE_SUCCESS != (rc = orte_proc_info())) {
return rc;
}
orte_process_info.seed = true;
orte_process_info.my_name = (orte_process_name_t*)malloc(sizeof(orte_process_name_t));
orte_process_info.my_name->cellid = 0;
orte_process_info.my_name->jobid = 0;
orte_process_info.my_name->vpid = 0;
/* startup the MCA */
if (OMPI_SUCCESS == mca_base_open()) {
fprintf(test_out, "MCA started\n");
} else {
fprintf(test_out, "MCA could not start\n");
exit (1);
}
if (ORTE_SUCCESS == orte_gpr_base_open()) {
fprintf(test_out, "GPR started\n");
} else {
fprintf(test_out, "GPR could not start\n");
exit (1);
}
if (ORTE_SUCCESS == orte_gpr_base_select()) {
fprintf(test_out, "GPR replica selected\n");
} else {
fprintf(test_out, "GPR replica could not be selected\n");
exit (1);
}
if (ORTE_SUCCESS == orte_dps_open()) {
fprintf(test_out, "DPS started\n");
} else {
fprintf(test_out, "DPS could not start\n");
exit (1);
}
fprintf(stderr, "do a put of a value with multiple keyvals\n");
val = OBJ_NEW(orte_gpr_value_t);
val->addr_mode = ORTE_GPR_NO_OVERWRITE | ORTE_GPR_TOKENS_XAND;
val->cnt = 20;
val->segment = strdup("test-put-segment");
val->num_tokens = 14;
val->tokens = (char**)malloc(val->num_tokens * sizeof(char*));
for (i=0; i < 14; i++) {
asprintf(&(val->tokens[i]), "dummy%d", i);
}
val->keyvals = (orte_gpr_keyval_t**)malloc(20*sizeof(orte_gpr_keyval_t*));
for (i=0; i<20; i++) {
val->keyvals[i] = OBJ_NEW(orte_gpr_keyval_t);
asprintf(&((val->keyvals[i])->key), "stupid-test-%d", i);
(val->keyvals[i])->type = ORTE_UINT32;
(val->keyvals[i])->value.ui32 = (uint32_t)i;
}
if (ORTE_SUCCESS != (rc = orte_gpr.put(1, &val))) {
fprintf(test_out, "gpr_test: put 1 value/multiple keyval failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put 1 value/multiple keyval failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: put 1 value/multiple keyval passed\n");
}
OBJ_RELEASE(val);
fprintf(stderr, "do a get\n");
names[0] = strdup("dummy0");
names[1] = NULL;
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 = orte_gpr.get(ORTE_GPR_KEYS_OR | ORTE_GPR_TOKENS_OR,
"test-put-segment",
names, 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 passed\n");
}
/* cleanup the results */
free(names[0]);
for (i=0; i < 4; i++) free(keys[i]);
for (i=0; i < cnt; i++) {
OBJ_RELEASE(values[i]);
}
free(values);
fprintf(stderr, "put multiple copies of same entry in single container\n");
val = OBJ_NEW(orte_gpr_value_t);
val->addr_mode = ORTE_GPR_NO_OVERWRITE | ORTE_GPR_TOKENS_XAND;
val->cnt = 1;
val->segment = strdup("test-put-segment");
val->num_tokens = 5;
val->tokens = (char**)malloc(val->num_tokens * sizeof(char*));
for (i=0; i < 5; i++) {
asprintf(&(val->tokens[i]), "multi-dum-dum-%d", i);
}
val->keyvals = (orte_gpr_keyval_t**)malloc(sizeof(orte_gpr_keyval_t*));
val->keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
(val->keyvals[0])->key = strdup("stupid-value-next-one");
(val->keyvals[0])->type = ORTE_STRING;
(val->keyvals[0])->value.strptr = strdup("try-string-value");
for (i = 0; i < 10; i++) {
fprintf(stderr, "\tputting copy %d\n", i);
if (ORTE_SUCCESS != (rc = orte_gpr.put(1, &val))) {
fprintf(test_out, "gpr_test: put multiple copies of one keyval in a container failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put multiple copies of one keyval in a container failed");
test_finalize();
return rc;
}
}
OBJ_RELEASE(val);
fprintf(stderr, "generate a trigger event\n");
fprintf(stderr, "now finalize and see if all memory cleared\n");
orte_dps_close();
orte_gpr_base_close();
orte_sys_info_finalize();
orte_proc_info_finalize();
mca_base_close();
ompi_malloc_finalize();
ompi_output_finalize();
fclose( test_out );
/* result = system( cmd_str );
if( result == 0 ) {
test_success();
}
else {
test_failure( "test_gpr_replica failed");
}
*/
test_finalize();
return(0);
}

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

372
test/mca/gpr/gpr_put_get.c Обычный файл
Просмотреть файл

@ -0,0 +1,372 @@
/*
* 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$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - unit test
*
*/
/*
* includes
*/
#include "orte_config.h"
#include <stdio.h>
#include <string.h>
#include "include/orte_constants.h"
#include "include/orte_schema.h"
#include "support.h"
#include "class/orte_pointer_array.h"
#include "dps/dps.h"
#include "runtime/runtime.h"
#include "util/proc_info.h"
#include "util/sys_info.h"
#include "mca/gpr/base/base.h"
#include "mca/gpr/replica/api_layer/gpr_replica_api.h"
#include "mca/gpr/replica/functional_layer/gpr_replica_fn.h"
#include "mca/gpr/replica/communications/gpr_replica_comm.h"
#include "mca/gpr/replica/transition_layer/gpr_replica_tl.h"
/* output files needed by the test */
static FILE *test_out=NULL;
static char *cmd_str="diff ./test_gpr_replica_out ./test_gpr_replica_out_std";
int main(int argc, char **argv)
{
int rc, num_names, num_found;
int32_t i, j, cnt;
char *tmp=NULL, *tmp2=NULL, *names[15], *keys[5];
orte_gpr_replica_segment_t *seg=NULL;
orte_gpr_replica_itag_t itag[10], itag2, *itaglist;
orte_gpr_replica_container_t *cptr=NULL, **cptrs=NULL;
orte_gpr_keyval_t *kptr=NULL, **kvals;
orte_gpr_replica_itagval_t **ivals=NULL, *iptr;
orte_gpr_value_t **values, *val;
orte_process_name_t seed={0,0,0};
bool found;
test_init("test_gpr_replica");
/* test_out = fopen( "test_gpr_replica_out", "w+" ); */
test_out = stderr;
if( test_out == NULL ) {
test_failure("gpr_test couldn't open test file failed");
test_finalize();
exit(1);
}
/* ENSURE THE REPLICA IS ISOLATED */
setenv("OMPI_MCA_gpr_replica_isolate", "1", 1);
/* Open up the output streams */
if (!ompi_output_init()) {
return OMPI_ERROR;
}
/*
* If threads are supported - assume that we are using threads - and reset otherwise.
*/
ompi_set_using_threads(OMPI_HAVE_THREADS);
/* For malloc debugging */
ompi_malloc_init();
/* Ensure the system_info structure is instantiated and initialized */
if (ORTE_SUCCESS != (rc = orte_sys_info())) {
return rc;
}
/* Ensure the process info structure is instantiated and initialized */
if (ORTE_SUCCESS != (rc = orte_proc_info())) {
return rc;
}
orte_process_info.seed = true;
orte_process_info.my_name = &seed;
/* startup the MCA */
if (OMPI_SUCCESS == mca_base_open()) {
fprintf(test_out, "MCA started\n");
} else {
fprintf(test_out, "MCA could not start\n");
exit (1);
}
if (ORTE_SUCCESS == orte_gpr_base_open()) {
fprintf(test_out, "GPR started\n");
} else {
fprintf(test_out, "GPR could not start\n");
exit (1);
}
if (ORTE_SUCCESS == orte_gpr_base_select()) {
fprintf(test_out, "GPR replica selected\n");
} else {
fprintf(test_out, "GPR replica could not be selected\n");
exit (1);
}
if (ORTE_SUCCESS == orte_dps_open()) {
fprintf(test_out, "DPS started\n");
} else {
fprintf(test_out, "DPS could not start\n");
exit (1);
}
fprintf(stderr, "put one value with single keyval\n");
val = OBJ_NEW(orte_gpr_value_t);
val->addr_mode = ORTE_GPR_NO_OVERWRITE | ORTE_GPR_TOKENS_XAND;
val->cnt = 1;
val->segment = strdup("test-put-segment");
val->num_tokens = 14;
val->tokens = (char**)malloc(val->num_tokens * sizeof(char*));
for (i=0; i < 14; i++) {
asprintf(&(val->tokens[i]), "dummy%d", i);
}
val->keyvals = (orte_gpr_keyval_t**)malloc(sizeof(orte_gpr_keyval_t*));
val->keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
(val->keyvals[0])->key = strdup("stupid-value-next-one");
(val->keyvals[0])->type = ORTE_INT32;
(val->keyvals[0])->value.i32 = 654321;
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put(1, &val))) {
fprintf(test_out, "gpr_test: put of 1 value/1 keyval failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put of 1 value/1 keyval failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: put of 1 value/1 keyval passed\n");
}
OBJ_RELEASE(val);
fprintf(stderr, "put one value with multiple keyvals\n");
val = OBJ_NEW(orte_gpr_value_t);
val->addr_mode = ORTE_GPR_NO_OVERWRITE | ORTE_GPR_TOKENS_XAND;
val->cnt = 20;
val->segment = strdup("test-put-segment");
val->num_tokens = 14;
val->tokens = (char**)malloc(val->num_tokens * sizeof(char*));
for (i=0; i < 14; i++) {
asprintf(&(val->tokens[i]), "dummy%d", i);
}
val->keyvals = (orte_gpr_keyval_t**)malloc(20*sizeof(orte_gpr_keyval_t*));
for (i=0; i<20; i++) {
val->keyvals[i] = OBJ_NEW(orte_gpr_keyval_t);
asprintf(&((val->keyvals[i])->key), "stupid-test-%d", i);
(val->keyvals[i])->type = ORTE_UINT32;
(val->keyvals[i])->value.ui32 = (uint32_t)i;
}
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put(1, &val))) {
fprintf(test_out, "gpr_test: put 1 value/multiple keyval failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put 1 value/multiple keyval failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: put 1 value/multiple keyval passed\n");
}
fprintf(stderr, "put 1 value/multiple keyvals - second container\n");
val->num_tokens = 10;
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put(1, &val))) {
fprintf(test_out, "gpr_test: put 1 value/multiple keyval in second container failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put 1 value/multiple keyval in second container failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: put 1 value/multiple keyval in second container passed\n");
}
OBJ_RELEASE(val);
fprintf(stderr, "dump\n");
if (ORTE_SUCCESS != (rc = orte_gpr.dump_all(0))) {
fprintf(test_out, "gpr_test: dump failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: dump failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: dump passed\n");
}
fprintf(stderr, "get\n");
names[0] = strdup("dummy0");
names[1] = NULL;
keys[0] = strdup("stupid-test-1");
keys[1] = NULL;
if (ORTE_SUCCESS != (rc = orte_gpr_replica_get(ORTE_GPR_KEYS_OR | ORTE_GPR_TOKENS_OR,
"test-put-segment",
names, 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 passed\n");
}
fprintf(stderr, "get results:\n");
for (j=0; j < cnt; j++) {
fprintf(stderr, "value %d: cnt %d\t segment %s num_tokens %d\n", j,
values[j]->cnt,
values[j]->segment, values[j]->num_tokens);
for (i=0; i < values[j]->num_tokens; i++) {
fprintf(stderr, "token: %d %s\n", 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 multiple in one segment, multiple containers\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 = orte_gpr_replica_get(ORTE_GPR_KEYS_OR | ORTE_GPR_TOKENS_OR,
"test-put-segment",
names, 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 passed\n");
}
fprintf(stderr, "get results:\n");
for (j=0; j < cnt; j++) {
fprintf(stderr, "value %d: cnt %d\t segment %s num_tokens %d\n", j,
values[j]->cnt,
values[j]->segment, values[j]->num_tokens);
for (i=0; i < values[j]->num_tokens; i++) {
fprintf(stderr, "token: %d %s\n", 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, "put multiple copies of same entry in single container\n");
val = OBJ_NEW(orte_gpr_value_t);
val->addr_mode = ORTE_GPR_NO_OVERWRITE | ORTE_GPR_TOKENS_XAND;
val->cnt = 1;
val->segment = strdup("test-put-segment");
val->num_tokens = 5;
val->tokens = (char**)malloc(val->num_tokens * sizeof(char*));
for (i=0; i < 5; i++) {
asprintf(&(val->tokens[i]), "multi-dum-dum-%d", i);
}
val->keyvals = (orte_gpr_keyval_t**)malloc(sizeof(orte_gpr_keyval_t*));
val->keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
(val->keyvals[0])->key = strdup("stupid-value-next-one");
(val->keyvals[0])->type = ORTE_STRING;
(val->keyvals[0])->value.strptr = strdup("try-string-value");
for (i = 0; i < 10; i++) {
fprintf(stderr, "\tputting copy %d\n", i);
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put(1, &val))) {
fprintf(test_out, "gpr_test: put multiple copies of one keyval in a container failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put multiple copies of one keyval in a container failed");
test_finalize();
return rc;
}
}
OBJ_RELEASE(val);
orte_gpr.dump_all(0);
fprintf(stderr, "update multiple keyvals in a container\n");
if(ORTE_SUCCESS != orte_gpr_replica_find_seg(&seg, false, "test-put-segment")) {
return -1;
}
cptrs = (orte_gpr_replica_container_t**)((seg->containers)->addr);
for (i=0; i < (seg->containers)->size; i++) {
if (NULL != cptrs[i]) {
cptr = cptrs[i];
}
}
kptr = OBJ_NEW(orte_gpr_keyval_t);
kptr->key = strdup("really-stupid-value");
kptr->type = ORTE_INT32;
kptr->value.i32 = 123456;
if (ORTE_SUCCESS != (rc = orte_gpr_replica_update_keyval(seg, cptr, kptr))) {
fprintf(test_out, "gpr_test: update multiple keyvals failed with error code %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: update multiple keyvals failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test: update multiple keyvals passed\n");
}
orte_gpr.dump_all(0);
fprintf(stderr, "put with no tokens puts in every container\n");
val = OBJ_NEW(orte_gpr_value_t);
val->addr_mode = ORTE_GPR_NO_OVERWRITE;
val->cnt = 1;
val->segment = strdup("test-put-segment");
val->num_tokens = 0;
val->tokens = NULL;
val->keyvals = (orte_gpr_keyval_t**)malloc(sizeof(orte_gpr_keyval_t*));
val->keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
(val->keyvals[0])->key = strdup("stupid-value-next-one");
(val->keyvals[0])->type = ORTE_STRING;
(val->keyvals[0])->value.strptr = strdup("try-string-value");
if (ORTE_SUCCESS != (rc = orte_gpr_replica_put(1, &val))) {
fprintf(test_out, "gpr_test: put with no tokens failed - returned %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test: put with no tokens failed");
test_finalize();
} else {
fprintf(test_out, "gpr_test: put with no tokens passed\n");
}
OBJ_RELEASE(val);
orte_gpr.dump_all(0);
fclose( test_out );
/* result = system( cmd_str );
if( result == 0 ) {
test_success();
}
else {
test_failure( "test_gpr_replica failed");
}
*/
test_finalize();
return(0);
}

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

@ -1,291 +0,0 @@
/*
* 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$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - unit test
*
*/
/*
* includes
*/
#include "orte_config.h"
#include <stdio.h>
#include <string.h>
#include "include/orte_constants.h"
#include "support.h"
#include "util/cmd_line.h"
#include "class/orte_pointer_array.h"
#include "dps/dps.h"
#include "runtime/runtime.h"
#include "util/output.h"
#include "util/proc_info.h"
#include "util/sys_info.h"
#include "mca/errmgr/errmgr.h"
#include "mca/errmgr/base/base.h"
#include "mca/gpr/base/base.h"
#include "mca/gpr/replica/api_layer/gpr_replica_api.h"
#include "mca/gpr/replica/functional_layer/gpr_replica_fn.h"
#include "mca/gpr/replica/communications/gpr_replica_comm.h"
#include "mca/gpr/replica/transition_layer/gpr_replica_tl.h"
/* output files needed by the test */
static FILE *test_out=NULL;
static void test_cbfunc(orte_gpr_notify_data_t *data, void *user_tag);
int main(int argc, char **argv)
{
ompi_cmd_line_t cmd_line;
int rc, num_counters=6;
int i;
orte_gpr_value_t *values, value, trig, *trigs;
orte_gpr_subscription_t *subscription;
orte_gpr_notify_id_t sub;
char* keys[] = {
/* changes to this ordering need to be reflected in code below */
ORTE_PROC_NUM_AT_STG1,
ORTE_PROC_NUM_AT_STG2,
ORTE_PROC_NUM_AT_STG3,
ORTE_PROC_NUM_FINALIZED,
ORTE_PROC_NUM_ABORTED,
ORTE_PROC_NUM_TERMINATED
};
test_init("test_gpr_proxy");
/* test_out = fopen( "test_gpr_replica_out", "w+" ); */
test_out = stderr;
if( test_out == NULL ) {
test_failure("gpr_test couldn't open test file failed");
test_finalize();
exit(1);
}
if (ORTE_SUCCESS != (rc = orte_init())) {
fprintf(test_out, "orte_init failed to start started\n");
} else {
fprintf(test_out, "orte_init_started\n");
}
subscription = OBJ_NEW(orte_gpr_subscription_t);
subscription->addr_mode = ORTE_GPR_TOKENS_OR;
subscription->segment = strdup("test-segment");
subscription->num_tokens = 0;
subscription->tokens = NULL;
subscription->num_keys = 0;
subscription->keys = NULL;
subscription->cbfunc = test_cbfunc;
subscription->user_tag = NULL;
fprintf(stderr, "register subscription on segment\n");
if (ORTE_SUCCESS != (rc = orte_gpr.subscribe(ORTE_GPR_NOTIFY_ADD_ENTRY,
1, &subscription,
0, NULL,
&sub))) {
fprintf(test_out, "gpr_test_trigs: subscribe on seg failed with error %s\n",
ORTE_ERROR_NAME(rc));
test_failure("gpr_test_trigs: subscribe on seg failed");
test_finalize();
return rc;
} else {
fprintf(test_out, "gpr_test_trigs: subscribe on seg registered\n");
}
orte_gpr.dump_all(0);
/* setup some test counters */
OBJ_CONSTRUCT(&value, orte_gpr_value_t);
value.addr_mode = ORTE_GPR_TOKENS_XAND | ORTE_GPR_KEYS_OR;
value.segment = strdup("test-segment");
value.tokens = (char**)malloc(sizeof(char*));
if (NULL == value.tokens) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&value);
return ORTE_ERR_OUT_OF_RESOURCE;
}
value.tokens[0] = strdup(ORTE_JOB_GLOBALS); /* put counters in the segment's globals container */
value.num_tokens = 1;
value.cnt = num_counters;
value.keyvals = (orte_gpr_keyval_t**)malloc(num_counters * sizeof(orte_gpr_keyval_t*));
if (NULL == value.keyvals) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&value);
return ORTE_ERR_OUT_OF_RESOURCE;
}
for (i=0; i < num_counters; i++) {
value.keyvals[i] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == value.keyvals[i]) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&value);
return ORTE_ERR_OUT_OF_RESOURCE;
}
value.keyvals[i]->key = strdup(keys[i]);
value.keyvals[i]->type = ORTE_INT32;
value.keyvals[i]->value.i32 = 0;
}
/* set value in keys[0] to 3 */
value.keyvals[0]->value.i32 = 3;
values = &value;
fprintf(test_out, "putting counters on registry\n");
/* put the counters on the registry */
if (ORTE_SUCCESS != (rc = orte_gpr.put(1, &values))) {
ORTE_ERROR_LOG(rc);
OBJ_DESTRUCT(&value);
return rc;
}
orte_gpr.dump_all(0);
fprintf(test_out, "incrementing all counters\n");
/* increment the counters */
if (ORTE_SUCCESS != (rc = orte_gpr.increment_value(&value))) {
ORTE_ERROR_LOG(rc);
OBJ_DESTRUCT(&value);
return rc;
}
orte_gpr.dump_all(0);
fprintf(test_out, "decrementing all counters\n");
/* decrement the counters */
if (ORTE_SUCCESS != (rc = orte_gpr.decrement_value(&value))) {
ORTE_ERROR_LOG(rc);
OBJ_DESTRUCT(&value);
return rc;
}
OBJ_DESTRUCT(&value);
orte_gpr.dump_all(0);
/* for testing the trigger, we'll just use the prior subscription setup.
* setup the trigger information - initialize the common elements */
OBJ_CONSTRUCT(&trig, orte_gpr_value_t);
trig.addr_mode = ORTE_GPR_TOKENS_XAND;
trig.segment = strdup("test-segment");
trig.tokens = (char**)malloc(sizeof(char*));
if (NULL == trig.tokens) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&value);
OBJ_DESTRUCT(&trig);
return ORTE_ERR_OUT_OF_RESOURCE;
}
trig.tokens[0] = strdup(ORTE_JOB_GLOBALS);
trig.num_tokens = 1;
trig.cnt = 2;
trig.keyvals = (orte_gpr_keyval_t**)malloc(2*sizeof(orte_gpr_keyval_t*));
trig.keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
trig.keyvals[0]->key = strdup(keys[0]);
trig.keyvals[0]->type = ORTE_NULL;
trig.keyvals[1] = OBJ_NEW(orte_gpr_keyval_t);
trig.keyvals[1]->key = strdup(keys[1]);
trig.keyvals[1]->type = ORTE_NULL;
fprintf(test_out, "setting trigger\n");
trigs = &trig;
rc = orte_gpr.subscribe(
ORTE_GPR_TRIG_ALL_CMP,
1, &subscription,
1, &trigs,
&sub);
if(ORTE_SUCCESS != rc) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(subscription);
OBJ_DESTRUCT(&trig);
return rc;
}
orte_gpr.dump_all(0);
fprintf(test_out, "incrementing until trigger\n");
/* increment the value in keys[1] until the trig fires */
OBJ_CONSTRUCT(&value, orte_gpr_value_t);
value.addr_mode = ORTE_GPR_TOKENS_XAND | ORTE_GPR_KEYS_OR;
value.segment = strdup("test-segment");
value.tokens = (char**)malloc(sizeof(char*));
if (NULL == value.tokens) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&value);
return ORTE_ERR_OUT_OF_RESOURCE;
}
value.tokens[0] = strdup(ORTE_JOB_GLOBALS); /* put counters in the segment's globals container */
value.num_tokens = 1;
value.keyvals = (orte_gpr_keyval_t**)malloc(sizeof(orte_gpr_keyval_t*));
if (NULL == value.keyvals) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&value);
return ORTE_ERR_OUT_OF_RESOURCE;
}
value.cnt = 1;
value.keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == value.keyvals[0]) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&value);
return ORTE_ERR_OUT_OF_RESOURCE;
}
value.keyvals[0]->key = strdup(keys[1]);
value.keyvals[0]->type = ORTE_NULL;
for (i=0; i < 10; i++) {
fprintf(test_out, "\tincrement %s\n", keys[1]);
if (ORTE_SUCCESS != (rc = orte_gpr.increment_value(&value))) {
ORTE_ERROR_LOG(rc);
OBJ_DESTRUCT(&value);
return rc;
}
}
orte_gpr.dump_all(0);
fclose( test_out );
/* result = system( cmd_str );
if( result == 0 ) {
test_success();
}
else {
test_failure( "test_gpr_replica failed");
}
*/
test_finalize();
return(0);
}
void test_cbfunc(orte_gpr_notify_data_t *data, void *tag)
{
fprintf(test_out, "TRIGGER FIRED AND RECEIVED\n");
/* fprintf(test_out, "\tSegment: %s\tNumber of values: %d\n", (msg->values[0])->segment, msg->cnt);
*/
orte_gpr.dump_all(0);
OBJ_RELEASE(data);
}

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

@ -274,10 +274,11 @@ int main(int argc, char **argv)
1, &trigs,
&sub);
OBJ_RELEASE(subscription);
OBJ_DESTRUCT(&trig);
if(ORTE_SUCCESS != rc) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(subscription);
OBJ_DESTRUCT(&trig);
return rc;
}
@ -324,17 +325,28 @@ int main(int argc, char **argv)
orte_gpr.dump_all(0);
fprintf(test_out, "updating value in keys[1] to test update_storage_locations\n");
/* now update the value in keys[1] and do it again */
value.addr_mode = value.addr_mode | ORTE_GPR_OVERWRITE;
value.keyvals[0]->type = ORTE_UINT32;
value.keyvals[0]->value.ui32 = 0;
values = &value;
orte_gpr.put(1, &values);
if (j == 0) {
fprintf(test_out, "updating value in keys[1] to test update_storage_locations\n");
/* now update the value in keys[1] and do it again */
value.addr_mode = value.addr_mode | ORTE_GPR_OVERWRITE;
value.keyvals[0]->type = ORTE_UINT32;
value.keyvals[0]->value.ui32 = 0;
values = &value;
orte_gpr.put(1, &values);
}
OBJ_DESTRUCT(&value);
}
orte_dps_close();
orte_gpr_base_close();
orte_sys_info_finalize();
orte_proc_info_finalize();
mca_base_close();
ompi_malloc_finalize();
ompi_output_finalize();
fclose( test_out );
/* result = system( cmd_str );
if( result == 0 ) {
@ -353,9 +365,5 @@ void test_cbfunc(orte_gpr_notify_data_t *data, void *tag)
{
fprintf(test_out, "TRIGGER FIRED AND RECEIVED\n");
/* fprintf(test_out, "\tSegment: %s\tNumber of values: %d\n", (msg->values[0])->segment, msg->cnt);
*/
orte_gpr.dump_notify_data(data, 0);
OBJ_RELEASE(data);
}

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

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

@ -1,25 +0,0 @@
#
# 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$
#
# Additional copyrights may follow
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
AM_CPPFLAGS = -I$(top_srcdir)/test/support -DOMPI_ENABLE_DEBUG_OVERRIDE=1 -g
noinst_PROGRAMS = \
plsnds_test
plsnds_test_SOURCES = plsnds_test.c
plsnds_test_LDADD = \
$(top_builddir)/src/libmpi.la \
$(top_builddir)/test/support/libsupport.la
plsnds_test_DEPENDENCIES = $(plsnds_test_LDADD)

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

@ -1,29 +0,0 @@
# -*- makefile -*-
#
# 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$
#
# Additional copyrights may follow
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
AM_CPPFLAGS = \
-I$(top_srcdir)/test/support
bin_PROGRAMS = \
sigchld
sigchld_SOURCES = \
sigchld.c
sigchld_LDADD = \
$(top_builddir)/src/libmpi.la
sigchld_LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS)
sigchld_DEPENDENCIES = $(sigchld_LDADD)

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

@ -1,51 +0,0 @@
#! /bin/csh -f
# Name
# ====
# run script for rte tests
# Arguements
# ==========
#
# test_list = no args runs all tests
# or
# openmpi runs openmpi test
# Usage
#
# =====
# To invoke this script, enter either
# run_tests
# with no arguments to run all tests, or
# run_tests <test_name>
umask 007
if ("x$1" == "x") then
./openmpi
else
foreach target ($argv)
switch ($target)
case "all":
./openmpi
breaksw
case "openmpi":
./$target
breaksw
case "help":
echo "correct use: "
echo " run_tests help (this message)"
echo " run_tests (to run all rte tests)"
echo "or run_tests <openmpi>"
break
breaksw
default:
echo "There is no program <$target> to run"
echo "correct use: "
echo " run_tests (to run all rte tests)"
echo "or run_tests <openmpi>"
break
endsw
end
endif

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

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

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

@ -131,6 +131,9 @@ int test_finalize(void)
return_value = 0;
}
if (NULL != ompi_description)
free(ompi_description);
return return_value;
}