Plug a memory leak that crept into the registry.
Modify the locking scheme to try and resolve a problem with dump_triggers that only occurs with multiple processes. Didn't resolve the problem, but should be more robust anyway. Still tracking this one down. This commit was SVN r5114.
Этот коммит содержится в:
родитель
74cc7ba381
Коммит
df7ef31b61
@ -86,11 +86,11 @@ int orte_gpr_replica_increment_value(orte_gpr_value_t *value)
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
orte_gpr_replica_process_callbacks();
|
||||
rc = orte_gpr_replica_process_callbacks();
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -148,10 +148,9 @@ int orte_gpr_replica_decrement_value(orte_gpr_value_t *value)
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
orte_gpr_replica_process_callbacks();
|
||||
rc = orte_gpr_replica_process_callbacks();
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
@ -40,14 +40,15 @@ int orte_gpr_replica_cleanup_job(orte_jobid_t jobid)
|
||||
|
||||
rc = orte_gpr_replica_cleanup_job_fn(jobid);
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
orte_gpr_replica_process_callbacks();
|
||||
rc = orte_gpr_replica_process_callbacks();
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@ -59,13 +60,15 @@ int orte_gpr_replica_cleanup_proc(orte_process_name_t *proc)
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
rc = orte_gpr_replica_cleanup_proc_fn(proc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
orte_gpr_replica_process_callbacks();
|
||||
rc = orte_gpr_replica_process_callbacks();
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@ -123,12 +123,11 @@ int orte_gpr_replica_exec_compound_cmd(void)
|
||||
ompi_condition_signal(&orte_gpr_replica_globals.compound_cmd_condition);
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.wait_for_compound_mutex);
|
||||
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
return rc;
|
||||
if (ORTE_SUCCESS == rc) {
|
||||
rc = orte_gpr_replica_process_callbacks();
|
||||
}
|
||||
|
||||
return orte_gpr_replica_process_callbacks();
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.wait_for_compound_mutex);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@ -119,8 +119,6 @@ int orte_gpr_replica_delete_entries(orte_gpr_addr_mode_t addr_mode,
|
||||
}
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
if (NULL != token_itags) {
|
||||
free(token_itags);
|
||||
}
|
||||
@ -135,6 +133,8 @@ int orte_gpr_replica_delete_entries(orte_gpr_addr_mode_t addr_mode,
|
||||
}
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -100,14 +100,12 @@ CLEANUP:
|
||||
if (NULL != itags) {
|
||||
free(itags);
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
|
||||
if (ORTE_SUCCESS == rc) {
|
||||
return orte_gpr_replica_process_callbacks();
|
||||
rc = orte_gpr_replica_process_callbacks();
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return rc;
|
||||
|
||||
|
@ -106,10 +106,10 @@ orte_gpr_replica_subscribe(orte_gpr_notify_action_t action,
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = orte_gpr_replica_process_callbacks();
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
orte_gpr_replica_process_callbacks();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -51,11 +51,9 @@ int orte_gpr_replica_recv_increment_value_cmd(orte_buffer_t *cmd, orte_buffer_t
|
||||
goto RETURN_ERROR;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
/* find the segment */
|
||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_find_seg(&seg, true, value->segment))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
ret = rc;
|
||||
goto RETURN_ERROR;
|
||||
}
|
||||
@ -64,7 +62,7 @@ int orte_gpr_replica_recv_increment_value_cmd(orte_buffer_t *cmd, orte_buffer_t
|
||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_get_itag_list(&itags, seg,
|
||||
value->tokens, &(value->num_tokens)))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
ret = rc;
|
||||
ret = rc;
|
||||
goto RETURN_ERROR;
|
||||
}
|
||||
|
||||
@ -82,7 +80,6 @@ int orte_gpr_replica_recv_increment_value_cmd(orte_buffer_t *cmd, orte_buffer_t
|
||||
if (ORTE_SUCCESS !=
|
||||
(rc = orte_gpr_replica_check_subscriptions(seg, ORTE_GPR_REPLICA_VALUE_INCREMENTED))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
@ -90,11 +87,8 @@ int orte_gpr_replica_recv_increment_value_cmd(orte_buffer_t *cmd, orte_buffer_t
|
||||
RETURN_ERROR:
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(answer, &ret, 1, ORTE_INT))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -120,11 +114,9 @@ int orte_gpr_replica_recv_decrement_value_cmd(orte_buffer_t *cmd, orte_buffer_t
|
||||
goto RETURN_ERROR;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
/* find the segment */
|
||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_find_seg(&seg, true, value->segment))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
ret = rc;
|
||||
goto RETURN_ERROR;
|
||||
}
|
||||
@ -133,7 +125,6 @@ int orte_gpr_replica_recv_decrement_value_cmd(orte_buffer_t *cmd, orte_buffer_t
|
||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_get_itag_list(&itags, seg,
|
||||
value->tokens, &(value->num_tokens)))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
ret = rc;
|
||||
goto RETURN_ERROR;
|
||||
}
|
||||
@ -152,7 +143,6 @@ int orte_gpr_replica_recv_decrement_value_cmd(orte_buffer_t *cmd, orte_buffer_t
|
||||
if (ORTE_SUCCESS !=
|
||||
(rc = orte_gpr_replica_check_subscriptions(seg, ORTE_GPR_REPLICA_VALUE_DECREMENTED))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
@ -160,11 +150,8 @@ int orte_gpr_replica_recv_decrement_value_cmd(orte_buffer_t *cmd, orte_buffer_t
|
||||
RETURN_ERROR:
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(answer, &ret, 1, ORTE_INT))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -43,8 +43,6 @@ int orte_gpr_replica_recv_cleanup_job_cmd(orte_buffer_t *input_buffer,
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
n = 1;
|
||||
if (ORTE_SUCCESS != (ret = orte_dps.unpack(input_buffer, &jobid, &n, ORTE_JOBID))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
@ -60,11 +58,9 @@ int orte_gpr_replica_recv_cleanup_job_cmd(orte_buffer_t *input_buffer,
|
||||
RETURN_ERROR:
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(output_buffer, &ret, 1, ORTE_INT))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -82,8 +78,6 @@ int orte_gpr_replica_recv_cleanup_proc_cmd(orte_buffer_t *input_buffer,
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
n = 1;
|
||||
if (ORTE_SUCCESS != (ret = orte_dps.unpack(input_buffer, &proc, &n, ORTE_NAME))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
@ -99,11 +93,9 @@ int orte_gpr_replica_recv_cleanup_proc_cmd(orte_buffer_t *input_buffer,
|
||||
RETURN_ERROR:
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(output_buffer, &ret, 1, ORTE_INT))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,6 @@ int orte_gpr_replica_recv_delete_segment_cmd(orte_buffer_t *buffer, orte_buffer_
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
n = 1;
|
||||
if (ORTE_SUCCESS != (ret = orte_dps.unpack(buffer, &segment, &n, ORTE_STRING))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
@ -63,12 +61,9 @@ int orte_gpr_replica_recv_delete_segment_cmd(orte_buffer_t *buffer, orte_buffer_
|
||||
RETURN_ERROR:
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(answer, &ret, 1, ORTE_INT))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -87,8 +82,6 @@ int orte_gpr_replica_recv_delete_entries_cmd(orte_buffer_t *buffer, orte_buffer_
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
n = 1;
|
||||
if (ORTE_SUCCESS != (ret = orte_dps.unpack(buffer, &addr_mode, &n, ORTE_GPR_ADDR_MODE))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
@ -197,12 +190,9 @@ int orte_gpr_replica_recv_delete_entries_cmd(orte_buffer_t *buffer, orte_buffer_
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(answer, &ret, 1, ORTE_INT))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -221,8 +211,6 @@ int orte_gpr_replica_recv_index_cmd(orte_buffer_t *buffer,
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
if (ORTE_SUCCESS != (ret = orte_dps.peek(buffer, &type, &n))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
goto RETURN_ERROR;
|
||||
@ -283,11 +271,8 @@ RETURN_PACK_ERROR:
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(answer, &ret, 1, ORTE_INT))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -41,9 +41,7 @@ int orte_gpr_replica_recv_dump_all_cmd(orte_buffer_t *answer)
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
rc = orte_gpr_replica_dump_all_fn(answer);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
@ -61,9 +59,7 @@ int orte_gpr_replica_recv_dump_segments_cmd(orte_buffer_t *answer)
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
rc = orte_gpr_replica_dump_segments_fn(answer);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
@ -81,9 +77,7 @@ int orte_gpr_replica_recv_dump_triggers_cmd(orte_buffer_t *answer)
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
rc = orte_gpr_replica_dump_triggers_fn(answer);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
@ -101,9 +95,7 @@ int orte_gpr_replica_recv_dump_callbacks_cmd(orte_buffer_t *answer)
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
rc = orte_gpr_replica_dump_callbacks_fn(answer);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
|
@ -46,8 +46,6 @@ int orte_gpr_replica_recv_put_cmd(orte_buffer_t *buffer, orte_buffer_t *answer)
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
cnt = 1;
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.peek(buffer, &type, &cnt))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
@ -103,7 +101,6 @@ int orte_gpr_replica_recv_put_cmd(orte_buffer_t *buffer, orte_buffer_t *answer)
|
||||
if (ORTE_SUCCESS !=
|
||||
(rc = orte_gpr_replica_check_subscriptions(seg, action_taken))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
@ -130,11 +127,9 @@ int orte_gpr_replica_recv_put_cmd(orte_buffer_t *buffer, orte_buffer_t *answer)
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(answer, &ret, 1, ORTE_INT))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -156,8 +151,6 @@ int orte_gpr_replica_recv_get_cmd(orte_buffer_t *input_buffer,
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
n = 1;
|
||||
if (ORTE_SUCCESS != (ret = orte_dps.unpack(input_buffer, &addr_mode, &n, ORTE_GPR_ADDR_MODE))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
@ -298,8 +291,6 @@ int orte_gpr_replica_recv_get_cmd(orte_buffer_t *input_buffer,
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(output_buffer, &ret, 1, ORTE_INT))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -49,6 +49,8 @@ void orte_gpr_replica_recv(int status, orte_process_name_t* sender,
|
||||
ORTE_NAME_ARGS(orte_process_info.my_name), ORTE_NAME_ARGS(sender));
|
||||
}
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
if (ORTE_SUCCESS == orte_gpr_replica_process_command_buffer(buffer, sender, &answer)) {
|
||||
if (0 > orte_rml.send_buffer(sender, answer, tag, 0)) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
|
||||
@ -64,6 +66,8 @@ void orte_gpr_replica_recv(int status, orte_process_name_t* sender,
|
||||
if (ORTE_SUCCESS != (rc = orte_gpr_replica_process_callbacks())) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
/* reissue the non-blocking receive */
|
||||
orte_rml.recv_buffer_nb(ORTE_RML_NAME_ANY, ORTE_RML_TAG_GPR, 0, orte_gpr_replica_recv, NULL);
|
||||
|
@ -85,10 +85,14 @@ int orte_gpr_replica_remote_notify(orte_process_name_t *recipient, ompi_list_t *
|
||||
OBJ_RELEASE(msg);
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
if (0 > orte_rml.send_buffer(recipient, &buffer, ORTE_RML_TAG_GPR_NOTIFY, 0)) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
return ORTE_ERR_COMM_FAILURE;
|
||||
}
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
@ -50,9 +50,6 @@ int orte_gpr_replica_recv_subscribe_cmd(orte_process_name_t* sender,
|
||||
return rc;
|
||||
}
|
||||
|
||||
/******* LOCK *****/
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
n = 1;
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.unpack(input_buffer, &action, &n, ORTE_NOTIFY_ACTION))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
@ -156,9 +153,6 @@ int orte_gpr_replica_recv_subscribe_cmd(orte_process_name_t* sender,
|
||||
return ret;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
/****** UNLOCK ******/
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -175,9 +169,6 @@ int orte_gpr_replica_recv_unsubscribe_cmd(orte_buffer_t *input_buffer,
|
||||
return rc;
|
||||
}
|
||||
|
||||
/******* LOCK *****/
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
|
||||
n = 1;
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.unpack(input_buffer, &sub_number, &n, ORTE_GPR_NOTIFY_ID))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
@ -193,13 +184,9 @@ int orte_gpr_replica_recv_unsubscribe_cmd(orte_buffer_t *input_buffer,
|
||||
RETURN_ERROR:
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.pack(output_buffer, &ret, 1, ORTE_INT))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
/****** UNLOCK ******/
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -394,7 +394,7 @@ static void orte_gpr_replica_dump_trigger(orte_buffer_t *buffer, int cnt,
|
||||
|
||||
} /* if data[i] not NULL */
|
||||
} /* for i */
|
||||
|
||||
|
||||
if (0 < trig->num_counters) {
|
||||
if (ORTE_GPR_TRIG_AT_LEVEL & trig->action) {
|
||||
asprintf(&tmp_out, "\tTrigger monitoring %d counters for level", trig->num_counters);
|
||||
|
@ -80,11 +80,14 @@ int orte_gpr_replica_process_callbacks(void)
|
||||
processed = false;
|
||||
for (k=0; k < (trig->subscribed_data)->size && !processed; k++) {
|
||||
if (NULL != sdata[k] && sdata[k]->index == data[i]->cb_num) {
|
||||
OMPI_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
|
||||
sdata[k]->callback(data[i], sdata[k]->user_tag);
|
||||
OMPI_THREAD_LOCK(&orte_gpr_replica_globals.mutex);
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
OBJ_RELEASE(msg);
|
||||
}
|
||||
} else { /* remote request - send messages back */
|
||||
if (orte_gpr_replica_globals.debug) {
|
||||
|
@ -138,7 +138,7 @@ static void orte_gpr_replica_segment_construct(orte_gpr_replica_segment_t* seg)
|
||||
/* destructor - used to free any resources held by instance */
|
||||
static void orte_gpr_replica_segment_destructor(orte_gpr_replica_segment_t* seg)
|
||||
{
|
||||
int i;
|
||||
int i, j;
|
||||
orte_gpr_replica_dict_t **dptr;
|
||||
orte_gpr_replica_container_t **cptr;
|
||||
|
||||
@ -163,7 +163,9 @@ static void orte_gpr_replica_segment_destructor(orte_gpr_replica_segment_t* seg)
|
||||
cptr = (orte_gpr_replica_container_t**)((seg->containers)->addr);
|
||||
for (i=0; i < (seg->containers)->size; i++) {
|
||||
if (NULL != cptr[i]) {
|
||||
j = i;
|
||||
OBJ_RELEASE(cptr[i]);
|
||||
orte_pointer_array_set_item(seg->containers, j, NULL);
|
||||
}
|
||||
}
|
||||
OBJ_RELEASE(seg->containers);
|
||||
@ -198,7 +200,7 @@ static void orte_gpr_replica_container_construct(orte_gpr_replica_container_t* r
|
||||
static void orte_gpr_replica_container_destructor(orte_gpr_replica_container_t* reg)
|
||||
{
|
||||
orte_gpr_replica_itagval_t **ptr;
|
||||
int i;
|
||||
int i, j;
|
||||
|
||||
if (NULL != reg->itags) {
|
||||
free(reg->itags);
|
||||
@ -208,7 +210,9 @@ static void orte_gpr_replica_container_destructor(orte_gpr_replica_container_t*
|
||||
ptr = (orte_gpr_replica_itagval_t**)((reg->itagvals)->addr);
|
||||
for (i=0; i < (reg->itagvals)->size; i++) {
|
||||
if (NULL != ptr[i]) {
|
||||
j = i;
|
||||
OBJ_RELEASE(ptr[i]);
|
||||
orte_pointer_array_set_item(reg->itagvals, j, NULL);
|
||||
}
|
||||
}
|
||||
OBJ_RELEASE(reg->itagvals);
|
||||
@ -233,7 +237,7 @@ static void orte_gpr_replica_itagval_construct(orte_gpr_replica_itagval_t* ptr)
|
||||
ptr->index = 0;
|
||||
ptr->itag = ORTE_GPR_REPLICA_ITAG_MAX;
|
||||
ptr->type = ORTE_NULL;
|
||||
(ptr->value).strptr = NULL;
|
||||
(ptr->value).i32 = 0;
|
||||
}
|
||||
|
||||
/* destructor - used to free any resources held by instance */
|
||||
@ -339,7 +343,7 @@ static void orte_gpr_replica_trigger_construct(orte_gpr_replica_triggers_t* trig
|
||||
/* destructor - used to free any resources held by instance */
|
||||
static void orte_gpr_replica_trigger_destructor(orte_gpr_replica_triggers_t* trig)
|
||||
{
|
||||
int i;
|
||||
int i, j;
|
||||
orte_gpr_replica_subscribed_data_t **data;
|
||||
orte_gpr_replica_counter_t **cntrs;
|
||||
|
||||
@ -350,7 +354,11 @@ static void orte_gpr_replica_trigger_destructor(orte_gpr_replica_triggers_t* tri
|
||||
if (NULL != trig->subscribed_data) {
|
||||
data = (orte_gpr_replica_subscribed_data_t**)((trig->subscribed_data)->addr);
|
||||
for (i=0; i < (trig->subscribed_data)->size; i++) {
|
||||
if (NULL != data[i]) OBJ_RELEASE(data[i]);
|
||||
if (NULL != data[i]) {
|
||||
j = i;
|
||||
OBJ_RELEASE(data[i]);
|
||||
orte_pointer_array_set_item(trig->subscribed_data, j, NULL);
|
||||
}
|
||||
}
|
||||
OBJ_RELEASE(trig->subscribed_data);
|
||||
}
|
||||
@ -358,7 +366,11 @@ static void orte_gpr_replica_trigger_destructor(orte_gpr_replica_triggers_t* tri
|
||||
if (NULL != trig->counters) {
|
||||
cntrs = (orte_gpr_replica_counter_t**)((trig->counters)->addr);
|
||||
for (i=0; i < (trig->counters)->size; i++) {
|
||||
if (NULL != cntrs[i]) OBJ_RELEASE(cntrs[i]);
|
||||
if (NULL != cntrs[i]) {
|
||||
j = i;
|
||||
OBJ_RELEASE(cntrs[i]);
|
||||
orte_pointer_array_set_item(trig->counters, j, NULL);
|
||||
}
|
||||
}
|
||||
OBJ_RELEASE(trig->counters);
|
||||
}
|
||||
@ -609,6 +621,7 @@ int orte_gpr_replica_finalize(void)
|
||||
OBJ_RELEASE(seg[i]);
|
||||
}
|
||||
}
|
||||
OBJ_RELEASE(orte_gpr_replica.segments);
|
||||
|
||||
trig = (orte_gpr_replica_triggers_t**)(orte_gpr_replica.triggers)->addr;
|
||||
for (i=0; i < (orte_gpr_replica.triggers)->size; i++) {
|
||||
@ -616,6 +629,7 @@ int orte_gpr_replica_finalize(void)
|
||||
OBJ_RELEASE(trig[i]);
|
||||
}
|
||||
}
|
||||
OBJ_RELEASE(orte_gpr_replica.triggers);
|
||||
|
||||
while (NULL != (cb = (orte_gpr_replica_callbacks_t*)ompi_list_remove_first(&orte_gpr_replica.callbacks))) {
|
||||
OBJ_RELEASE(cb);
|
||||
@ -628,6 +642,14 @@ int orte_gpr_replica_finalize(void)
|
||||
OBJ_RELEASE(orte_gpr_replica_globals.compound_cmd);
|
||||
}
|
||||
|
||||
if (NULL != orte_gpr_replica_globals.srch_cptr) {
|
||||
OBJ_RELEASE(orte_gpr_replica_globals.srch_cptr);
|
||||
}
|
||||
|
||||
if (NULL != orte_gpr_replica_globals.srch_ival) {
|
||||
OBJ_RELEASE(orte_gpr_replica_globals.srch_ival);
|
||||
}
|
||||
|
||||
/* All done */
|
||||
if (orte_gpr_replica_globals.isolate) {
|
||||
return ORTE_SUCCESS;
|
||||
|
@ -446,7 +446,8 @@ int main(int argc, char **argv)
|
||||
mca_base_close();
|
||||
ompi_malloc_finalize();
|
||||
ompi_output_finalize();
|
||||
|
||||
ompi_class_finalize();
|
||||
|
||||
fclose( test_out );
|
||||
/* result = system( cmd_str );
|
||||
if( result == 0 ) {
|
||||
|
@ -220,7 +220,8 @@ int main(int argc, char **argv)
|
||||
mca_base_close();
|
||||
ompi_malloc_finalize();
|
||||
ompi_output_finalize();
|
||||
|
||||
ompi_class_finalize();
|
||||
|
||||
fclose( test_out );
|
||||
/* result = system( cmd_str );
|
||||
if( result == 0 ) {
|
||||
|
@ -187,9 +187,25 @@ int main(int argc, char **argv)
|
||||
} else {
|
||||
fprintf(test_out, "gpr_test: put 1 value/multiple keyval passed\n");
|
||||
}
|
||||
|
||||
OBJ_RELEASE(val);
|
||||
|
||||
fprintf(stderr, "put 1 value/multiple keyvals - second container\n");
|
||||
val = OBJ_NEW(orte_gpr_value_t);
|
||||
val->addr_mode = ORTE_GPR_NO_OVERWRITE | ORTE_GPR_TOKENS_XAND;
|
||||
val->segment = strdup("test-put-segment");
|
||||
val->num_tokens = 10;
|
||||
val->tokens = (char**)malloc(val->num_tokens * sizeof(char*));
|
||||
for (i=0; i < val->num_tokens; i++) {
|
||||
asprintf(&(val->tokens[i]), "dummy%d", i);
|
||||
}
|
||||
val->cnt = 20;
|
||||
val->keyvals = (orte_gpr_keyval_t**)malloc(val->cnt * sizeof(orte_gpr_keyval_t*));
|
||||
for (i=0; i<val->cnt; 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 in second container failed with error code %s\n",
|
||||
ORTE_ERROR_NAME(rc));
|
||||
@ -199,8 +215,6 @@ int main(int argc, char **argv)
|
||||
} else {
|
||||
fprintf(test_out, "gpr_test: put 1 value/multiple keyval in second container passed\n");
|
||||
}
|
||||
/* reset the num_tokens so we cleanup properly */
|
||||
val->num_tokens = 14;
|
||||
OBJ_RELEASE(val);
|
||||
|
||||
fprintf(stderr, "dump\n");
|
||||
@ -339,6 +353,7 @@ int main(int argc, char **argv)
|
||||
|
||||
orte_gpr.dump_all(0);
|
||||
|
||||
|
||||
fprintf(stderr, "now finalize and see if all memory cleared\n");
|
||||
orte_dps_close();
|
||||
orte_gpr_base_close();
|
||||
@ -347,6 +362,7 @@ int main(int argc, char **argv)
|
||||
mca_base_close();
|
||||
ompi_malloc_finalize();
|
||||
ompi_output_finalize();
|
||||
ompi_class_finalize();
|
||||
|
||||
fclose( test_out );
|
||||
/* result = system( cmd_str );
|
||||
|
@ -171,7 +171,7 @@ int main(int argc, char **argv)
|
||||
mca_base_close();
|
||||
ompi_malloc_finalize();
|
||||
ompi_output_finalize();
|
||||
|
||||
ompi_class_finalize();
|
||||
|
||||
fclose( test_out );
|
||||
/* result = system( cmd_str );
|
||||
@ -190,7 +190,7 @@ int main(int argc, char **argv)
|
||||
|
||||
static int test1(void)
|
||||
{
|
||||
int rc, i;
|
||||
int rc, i, k;
|
||||
orte_gpr_value_t *values, value, trig, *trigs;
|
||||
orte_gpr_subscription_t *subscriptions[5];
|
||||
orte_gpr_notify_id_t sub[5];
|
||||
@ -319,121 +319,124 @@ static int test1(void)
|
||||
}
|
||||
OBJ_DESTRUCT(&value); /* clean up */
|
||||
|
||||
/* setup the subscriptions, each defining a set of data that is to be
|
||||
* returned to the corresponding callback function
|
||||
*/
|
||||
for (i=0; i < 5; i++) {
|
||||
subscriptions[i] = OBJ_NEW(orte_gpr_subscription_t);
|
||||
subscriptions[i]->addr_mode = ORTE_GPR_TOKENS_OR;
|
||||
subscriptions[i]->segment = strdup("test-segment");
|
||||
subscriptions[i]->user_tag = NULL;
|
||||
}
|
||||
/* sub-0 asks for the stupid-value-one data from the first
|
||||
* container ONLY
|
||||
*/
|
||||
subscriptions[0]->num_tokens = 2;
|
||||
subscriptions[0]->tokens = (char**)malloc(2*sizeof(char*));
|
||||
for (i=0; i < 2; i++) {
|
||||
asprintf(&(subscriptions[0]->tokens[i]), "dummy%d", i);
|
||||
}
|
||||
subscriptions[0]->num_keys = 1;
|
||||
subscriptions[0]->keys =(char**)malloc(sizeof(char*));
|
||||
subscriptions[0]->keys[0] = strdup("stupid-value-one");
|
||||
subscriptions[0]->cbfunc = test_cbfunc1;
|
||||
|
||||
/* sub-1 asks for the stupid-value-one data from ALL containers
|
||||
*/
|
||||
subscriptions[1]->num_tokens = 0;
|
||||
subscriptions[1]->tokens = NULL;
|
||||
subscriptions[1]->num_keys = 1;
|
||||
subscriptions[1]->keys =(char**)malloc(sizeof(char*));
|
||||
subscriptions[1]->keys[0] = strdup("stupid-value-one");
|
||||
subscriptions[1]->cbfunc = test_cbfunc2;
|
||||
|
||||
/* sub-2 asks for the stupid-value-multi data from the first
|
||||
* container ONLY
|
||||
*/
|
||||
subscriptions[2]->num_tokens = 2;
|
||||
subscriptions[2]->tokens = (char**)malloc(2*sizeof(char*));
|
||||
for (i=0; i < 2; i++) {
|
||||
asprintf(&(subscriptions[2]->tokens[i]), "dummy%d", i);
|
||||
}
|
||||
subscriptions[2]->num_keys = 1;
|
||||
subscriptions[2]->keys =(char**)malloc(sizeof(char*));
|
||||
subscriptions[2]->keys[0] = strdup("stupid-value-multi");
|
||||
subscriptions[2]->cbfunc = test_cbfunc3;
|
||||
|
||||
/* sub-3 asks for the stupid-value-three data from ALL containers */
|
||||
subscriptions[3]->num_tokens = 0;
|
||||
subscriptions[3]->tokens = NULL;
|
||||
subscriptions[3]->num_keys = 1;
|
||||
subscriptions[3]->keys =(char**)malloc(sizeof(char*));
|
||||
subscriptions[3]->keys[0] = strdup("stupid-value-three");
|
||||
subscriptions[3]->cbfunc = test_cbfunc4;
|
||||
|
||||
/* sub-4 asks for ALL data from ALL containers */
|
||||
subscriptions[4]->num_tokens = 0;
|
||||
subscriptions[4]->tokens = NULL;
|
||||
subscriptions[4]->num_keys = 0;
|
||||
subscriptions[4]->keys = NULL;
|
||||
subscriptions[4]->cbfunc = test_cbfunc5;
|
||||
|
||||
/* 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);
|
||||
for (k=0; k < 10; k++) {
|
||||
/* setup the subscriptions, each defining a set of data that is to be
|
||||
* returned to the corresponding callback function
|
||||
*/
|
||||
for (i=0; i < 5; i++) {
|
||||
subscriptions[i] = OBJ_NEW(orte_gpr_subscription_t);
|
||||
subscriptions[i]->addr_mode = ORTE_GPR_TOKENS_OR;
|
||||
subscriptions[i]->segment = strdup("test-segment");
|
||||
subscriptions[i]->user_tag = NULL;
|
||||
}
|
||||
/* sub-0 asks for the stupid-value-one data from the first
|
||||
* container ONLY
|
||||
*/
|
||||
subscriptions[0]->num_tokens = 2;
|
||||
subscriptions[0]->tokens = (char**)malloc(2*sizeof(char*));
|
||||
for (i=0; i < 2; i++) {
|
||||
asprintf(&(subscriptions[0]->tokens[i]), "dummy%d", i);
|
||||
}
|
||||
subscriptions[0]->num_keys = 1;
|
||||
subscriptions[0]->keys =(char**)malloc(sizeof(char*));
|
||||
subscriptions[0]->keys[0] = strdup("stupid-value-one");
|
||||
subscriptions[0]->cbfunc = test_cbfunc1;
|
||||
|
||||
/* sub-1 asks for the stupid-value-one data from ALL containers
|
||||
*/
|
||||
subscriptions[1]->num_tokens = 0;
|
||||
subscriptions[1]->tokens = NULL;
|
||||
subscriptions[1]->num_keys = 1;
|
||||
subscriptions[1]->keys =(char**)malloc(sizeof(char*));
|
||||
subscriptions[1]->keys[0] = strdup("stupid-value-one");
|
||||
subscriptions[1]->cbfunc = test_cbfunc2;
|
||||
|
||||
/* sub-2 asks for the stupid-value-multi data from the first
|
||||
* container ONLY
|
||||
*/
|
||||
subscriptions[2]->num_tokens = 2;
|
||||
subscriptions[2]->tokens = (char**)malloc(2*sizeof(char*));
|
||||
for (i=0; i < 2; i++) {
|
||||
asprintf(&(subscriptions[2]->tokens[i]), "dummy%d", i);
|
||||
}
|
||||
subscriptions[2]->num_keys = 1;
|
||||
subscriptions[2]->keys =(char**)malloc(sizeof(char*));
|
||||
subscriptions[2]->keys[0] = strdup("stupid-value-multi");
|
||||
subscriptions[2]->cbfunc = test_cbfunc3;
|
||||
|
||||
/* sub-3 asks for the stupid-value-three data from ALL containers */
|
||||
subscriptions[3]->num_tokens = 0;
|
||||
subscriptions[3]->tokens = NULL;
|
||||
subscriptions[3]->num_keys = 1;
|
||||
subscriptions[3]->keys =(char**)malloc(sizeof(char*));
|
||||
subscriptions[3]->keys[0] = strdup("stupid-value-three");
|
||||
subscriptions[3]->cbfunc = test_cbfunc4;
|
||||
|
||||
/* sub-4 asks for ALL data from ALL containers */
|
||||
subscriptions[4]->num_tokens = 0;
|
||||
subscriptions[4]->tokens = NULL;
|
||||
subscriptions[4]->num_keys = 0;
|
||||
subscriptions[4]->keys = NULL;
|
||||
subscriptions[4]->cbfunc = test_cbfunc5;
|
||||
|
||||
/* 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);
|
||||
for (i=0; i < 5; i++) OBJ_RELEASE(subscriptions[i]);
|
||||
OBJ_DESTRUCT(&trig);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
trig.tokens[0] = strdup("test-container");
|
||||
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;
|
||||
|
||||
/* enter things as three different subscriptions */
|
||||
rc = orte_gpr.subscribe(
|
||||
ORTE_GPR_TRIG_CMP_LEVELS | ORTE_GPR_TRIG_MONITOR_ONLY,
|
||||
2, subscriptions,
|
||||
1, &trigs,
|
||||
sub);
|
||||
|
||||
|
||||
rc = orte_gpr.subscribe(
|
||||
ORTE_GPR_TRIG_CMP_LEVELS | ORTE_GPR_TRIG_MONITOR_ONLY,
|
||||
2, &(subscriptions[2]),
|
||||
1, &trigs,
|
||||
sub);
|
||||
|
||||
rc = orte_gpr.subscribe(
|
||||
ORTE_GPR_TRIG_CMP_LEVELS | ORTE_GPR_TRIG_MONITOR_ONLY,
|
||||
1, &(subscriptions[4]),
|
||||
1, &trigs,
|
||||
sub);
|
||||
|
||||
for (i=0; i < 5; i++) OBJ_RELEASE(subscriptions[i]);
|
||||
OBJ_DESTRUCT(&trig);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
trig.tokens[0] = strdup("test-container");
|
||||
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;
|
||||
|
||||
/* enter things as three different subscriptions */
|
||||
rc = orte_gpr.subscribe(
|
||||
ORTE_GPR_TRIG_CMP_LEVELS | ORTE_GPR_TRIG_MONITOR_ONLY,
|
||||
2, subscriptions,
|
||||
1, &trigs,
|
||||
sub);
|
||||
|
||||
|
||||
rc = orte_gpr.subscribe(
|
||||
ORTE_GPR_TRIG_CMP_LEVELS | ORTE_GPR_TRIG_MONITOR_ONLY,
|
||||
2, &(subscriptions[2]),
|
||||
1, &trigs,
|
||||
sub);
|
||||
|
||||
rc = orte_gpr.subscribe(
|
||||
ORTE_GPR_TRIG_CMP_LEVELS | ORTE_GPR_TRIG_MONITOR_ONLY,
|
||||
1, &(subscriptions[4]),
|
||||
1, &trigs,
|
||||
sub);
|
||||
|
||||
for (i=0; i < 5; i++) OBJ_RELEASE(subscriptions[i]);
|
||||
OBJ_DESTRUCT(&trig);
|
||||
|
||||
if(ORTE_SUCCESS != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
if(ORTE_SUCCESS != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
orte_gpr.dump_triggers(0);
|
||||
return ORTE_SUCCESS;
|
||||
|
||||
fprintf(test_out, "incrementing until trigger\n");
|
||||
/* increment the value in keys[1] until the trig fires */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user