1
1
This commit was SVN r2333.
Этот коммит содержится в:
Tim Woodall 2004-08-27 16:59:59 +00:00
родитель dace5cd6d9
Коммит 743016b4be
3 изменённых файлов: 35 добавлений и 21 удалений

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

@ -135,9 +135,8 @@ int gpr_replica_put(ompi_registry_mode_t addr_mode, char *segment,
num_tokens, keys)) {
synchro->count++;
}
if ((OMPI_REGISTRY_SYNCHRO_MODE_ASCENDING & synchro->synch_mode ||
OMPI_REGISTRY_SYNCHRO_MODE_LEVEL & synchro->synch_mode) &&
synchro->count == synchro->trigger) {
if ((OMPI_REGISTRY_SYNCHRO_MODE_ASCENDING & synchro->synch_mode && synchro->count >= synchro->trigger) ||
(OMPI_REGISTRY_SYNCHRO_MODE_LEVEL & synchro->synch_mode && synchro->count == synchro->trigger)) {
notify_msg = gpr_replica_construct_notify_message(addr_mode, segment, tokens);
gpr_replica_process_triggers(notify_msg, synchro->id_tag);
}
@ -162,6 +161,8 @@ int gpr_replica_delete_object(ompi_registry_mode_t addr_mode,
ompi_list_t *keylist;
mca_gpr_replica_key_t *keys, *key2;
mca_gpr_replica_segment_t *seg;
mca_gpr_replica_synchro_list_t *synchro;
ompi_registry_notify_message_t *notify_msg;
int num_tokens;
keys = NULL;
@ -212,6 +213,21 @@ int gpr_replica_delete_object(ompi_registry_mode_t addr_mode,
}
}
/* update synchro list and check for trigger conditions */
for (synchro = (mca_gpr_replica_synchro_list_t*)ompi_list_get_first(&seg->synchros);
synchro != (mca_gpr_replica_synchro_list_t*)ompi_list_get_end(&seg->synchros);
synchro = (mca_gpr_replica_synchro_list_t*)ompi_list_get_next(synchro)) {
if (gpr_replica_check_key_list(synchro->addr_mode, synchro->num_keys, synchro->keys,
num_tokens, keys)) {
synchro->count--;
}
if ((OMPI_REGISTRY_SYNCHRO_MODE_DESCENDING & synchro->synch_mode && synchro->count <= synchro->trigger) ||
(OMPI_REGISTRY_SYNCHRO_MODE_LEVEL & synchro->synch_mode && synchro->count == synchro->trigger)) {
notify_msg = gpr_replica_construct_notify_message(addr_mode, segment, tokens);
gpr_replica_process_triggers(notify_msg, synchro->id_tag);
}
}
return OMPI_SUCCESS;
CLEANUP:

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

@ -337,29 +337,29 @@ mca_gpr_base_module_t *mca_gpr_replica_init(bool *allow_multi_user_threads, bool
/* initialize the registry head */
OBJ_CONSTRUCT(&mca_gpr_replica_head.registry, ompi_list_t);
ompi_output(0, "registry head setup");
/* ompi_output(0, "registry head setup"); */
/* initialize the global dictionary for segment id's */
OBJ_CONSTRUCT(&mca_gpr_replica_head.segment_dict, ompi_list_t);
OBJ_CONSTRUCT(&mca_gpr_replica_head.freekeys, ompi_list_t);
mca_gpr_replica_head.lastkey = 0;
ompi_output(0, "global dict setup");
/* ompi_output(0, "global dict setup"); */
/* initialize the notify request tracker */
OBJ_CONSTRUCT(&mca_gpr_replica_notify_request_tracker, ompi_list_t);
mca_gpr_replica_last_notify_id_tag = 0;
OBJ_CONSTRUCT(&mca_gpr_replica_free_notify_id_tags, ompi_list_t);
ompi_output(0, "req tracker setup");
/* ompi_output(0, "req tracker setup"); */
/* /\* issue the non-blocking receive *\/ */
/* rc = mca_oob_recv_packed_nb(MCA_OOB_NAME_ANY, MCA_OOB_TAG_GPR, 0, mca_gpr_replica_recv, NULL); */
/* if(rc != OMPI_SUCCESS && rc != OMPI_ERR_NOT_IMPLEMENTED) { */
/* return NULL; */
/* } */
/* issue the non-blocking receive */
rc = mca_oob_recv_packed_nb(MCA_OOB_NAME_ANY, MCA_OOB_TAG_GPR, 0, mca_gpr_replica_recv, NULL);
if(rc != OMPI_SUCCESS && rc != OMPI_ERR_NOT_IMPLEMENTED) {
return NULL;
}
ompi_output(0, "nb receive setup");
/* ompi_output(0, "nb receive setup"); */
/* Return the module */

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

@ -427,6 +427,7 @@ int gpr_replica_construct_synchro(ompi_registry_synchro_mode_t synchro_mode,
synch = OBJ_NEW(mca_gpr_replica_synchro_list_t);
synch->synch_mode = synchro_mode;
synch->addr_mode = addr_mode;
synch->trigger = trigger;
synch->count = 0;
@ -479,10 +480,6 @@ ompi_registry_notify_message_t *gpr_replica_construct_notify_message(ompi_regist
reg_entries = gpr_replica_get(addr_mode, segment, tokens);
if (ompi_list_is_empty(reg_entries)) {
return NULL;
}
/* compute number of tokens */
tokptr = tokens;
num_tokens = 0;
@ -533,10 +530,11 @@ void gpr_replica_process_triggers(ompi_registry_notify_message_t *message,
/* find corresponding notify request */
found = false;
for (trackptr = (mca_gpr_notify_request_tracker_t*)ompi_list_get_first(&mca_gpr_replica_notify_request_tracker);
trackptr != (mca_gpr_notify_request_tracker_t*)ompi_list_get_end(&mca_gpr_replica_notify_request_tracker) && !found;
trackptr = (mca_gpr_notify_request_tracker_t*)ompi_list_get_next(trackptr)) {
trackptr != (mca_gpr_notify_request_tracker_t*)ompi_list_get_end(&mca_gpr_replica_notify_request_tracker);
trackptr = (mca_gpr_notify_request_tracker_t*)ompi_list_get_next(trackptr)) {
if (trackptr->id_tag == id_tag) {
found = true;
break;
}
}
@ -549,7 +547,7 @@ void gpr_replica_process_triggers(ompi_registry_notify_message_t *message,
if (NULL == trackptr->requestor) { /* local request - callback fn with their tag */
trackptr->callback(message, trackptr->user_tag);
/* dismantle message and free memory */
while (NULL != (data = (ompi_registry_object_t*)ompi_list_get_first(&message->data))) {
while (NULL != (data = (ompi_registry_object_t*)ompi_list_remove_first(&message->data))) {
OBJ_RELEASE(data);
}
for (i=0, tokptr=message->tokens; i < message->num_tokens; i++, tokptr++) {
@ -564,8 +562,8 @@ void gpr_replica_process_triggers(ompi_registry_notify_message_t *message,
/* if one-shot, remove request from tracking system */
if (OMPI_REGISTRY_SYNCHRO_MODE_ONE_SHOT & trackptr->synchro) {
tmpptr = (mca_gpr_notify_request_tracker_t*)ompi_list_remove_item(&message->data, &trackptr->item);
OBJ_RELEASE(tmpptr);
ompi_list_remove_item(&mca_gpr_replica_notify_request_tracker, &trackptr->item);
OBJ_RELEASE(trackptr);
}
}