As far as I know there is no standard way to print out a size_t data. Most of the time a %ld should suffice
otherwise we have to cast everything back to int before printing it out. This commit was SVN r5556.
Этот коммит содержится в:
родитель
bd75b69fa1
Коммит
b25a5a24be
@ -90,36 +90,36 @@ int orte_gpr_replica_dump_segments_fn(orte_buffer_t *buffer)
|
||||
for (i=0; i < (orte_gpr_replica.segments)->size; i++) {
|
||||
if (NULL != seg[i]) {
|
||||
|
||||
sprintf(tmp_out, "\nGPR Dump for Segment: %s", seg[i]->name);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
sprintf(tmp_out, "\nGPR Dump for Segment: %s", seg[i]->name);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
|
||||
num_objects = (seg[i]->containers)->size - (seg[i]->containers)->number_free;
|
||||
num_objects = (seg[i]->containers)->size - (seg[i]->containers)->number_free;
|
||||
|
||||
sprintf(tmp_out, "\tNumber of containers: %d\n", num_objects);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
sprintf(tmp_out, "\tNumber of containers: %d\n", (int)num_objects);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
|
||||
/* loop through all containers and print their info and contents */
|
||||
/* loop through all containers and print their info and contents */
|
||||
cptr = (orte_gpr_replica_container_t**)(seg[i]->containers)->addr;
|
||||
for (j=0; j < (seg[i]->containers)->size; j++) {
|
||||
if (NULL != cptr[j]) {
|
||||
sprintf(tmp_out, "\n\tInfo for container %d\tNumber of keyvals: %d\n\tTokens:\n",
|
||||
j, (cptr[j]->itagvals)->size - (cptr[j]->itagvals)->number_free);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
|
||||
/* reverse lookup tokens and print them */
|
||||
for (j=0; j < (seg[i]->containers)->size; j++) {
|
||||
if (NULL != cptr[j]) {
|
||||
sprintf(tmp_out, "\n\tInfo for container %d\tNumber of keyvals: %ld\n\tTokens:\n",
|
||||
(int)j, (cptr[j]->itagvals)->size - (cptr[j]->itagvals)->number_free);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
|
||||
/* reverse lookup tokens and print them */
|
||||
itaglist = cptr[j]->itags;
|
||||
for (k=0; k < cptr[j]->num_itags; k++) {
|
||||
if (ORTE_SUCCESS != orte_gpr_replica_dict_reverse_lookup(
|
||||
&token, seg[i], itaglist[k])) {
|
||||
sprintf(tmp_out, "\t\titag num %d: No entry found for itag %X",
|
||||
k, itaglist[k]);
|
||||
} else {
|
||||
sprintf(tmp_out, "\t\titag num %d: itag %d\tToken: %s",
|
||||
k, itaglist[k], token);
|
||||
free(token);
|
||||
}
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
}
|
||||
for (k=0; k < cptr[j]->num_itags; k++) {
|
||||
if (ORTE_SUCCESS != orte_gpr_replica_dict_reverse_lookup(
|
||||
&token, seg[i], itaglist[k])) {
|
||||
sprintf(tmp_out, "\t\titag num %d: No entry found for itag %X",
|
||||
(uint32_t)k, (uint32_t)itaglist[k]);
|
||||
} else {
|
||||
sprintf(tmp_out, "\t\titag num %d: itag %d\tToken: %s",
|
||||
(uint32_t)k, (uint32_t)itaglist[k], token);
|
||||
free(token);
|
||||
}
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
}
|
||||
|
||||
sprintf(tmp_out, "\n\tKeyval info:");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
@ -127,22 +127,22 @@ int orte_gpr_replica_dump_segments_fn(orte_buffer_t *buffer)
|
||||
/* loop through all itagvals and print their info */
|
||||
iptr = (orte_gpr_replica_itagval_t**)(cptr[j]->itagvals)->addr;
|
||||
for (k=0; k < (cptr[j]->itagvals)->size; k++) {
|
||||
if (NULL != iptr[k]) {
|
||||
if (ORTE_SUCCESS != orte_gpr_replica_dict_reverse_lookup(
|
||||
&token, seg[i], iptr[k]->itag)) {
|
||||
sprintf(tmp_out, "\n\t\titag num %d: No entry found for itag %X",
|
||||
k, iptr[k]->itag);
|
||||
} else {
|
||||
sprintf(tmp_out, "\n\t\tEntry %d: itag %d\tKey: %s",
|
||||
k, iptr[k]->itag, token);
|
||||
free(token);
|
||||
}
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
orte_gpr_replica_dump_itagval_value(buffer, iptr[k]);
|
||||
}
|
||||
if (NULL != iptr[k]) {
|
||||
if (ORTE_SUCCESS != orte_gpr_replica_dict_reverse_lookup(
|
||||
&token, seg[i], iptr[k]->itag)) {
|
||||
sprintf(tmp_out, "\n\t\titag num %ld: No entry found for itag %X",
|
||||
k, (int32_t)iptr[k]->itag);
|
||||
} else {
|
||||
sprintf(tmp_out, "\n\t\tEntry %ld: itag %d\tKey: %s",
|
||||
k, (int32_t)iptr[k]->itag, token);
|
||||
free(token);
|
||||
}
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
orte_gpr_replica_dump_itagval_value(buffer, iptr[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ int orte_gpr_replica_dump_callbacks_fn(orte_buffer_t *buffer)
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
return ORTE_SUCCESS;
|
||||
} else {
|
||||
sprintf(tmp_out, "--- %d callback(s) registered at this time", k);
|
||||
sprintf(tmp_out, "--- %ld callback(s) registered at this time", k);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
}
|
||||
|
||||
@ -182,11 +182,11 @@ int orte_gpr_replica_dump_callbacks_fn(orte_buffer_t *buffer)
|
||||
cb != (orte_gpr_replica_callbacks_t*)ompi_list_get_end(&(orte_gpr_replica.callbacks));
|
||||
cb = (orte_gpr_replica_callbacks_t*)ompi_list_get_next(cb)) {
|
||||
if (NULL == cb) {
|
||||
sprintf(tmp_out, "\n\t--- BAD CALLBACK POINTER %d ---", i);
|
||||
sprintf(tmp_out, "\n\t--- BAD CALLBACK POINTER %ld ---", i);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
sprintf(tmp_out, "\nInfo for callback %d", i);
|
||||
sprintf(tmp_out, "\nInfo for callback %ld", i);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
if (NULL == cb->requestor) {
|
||||
sprintf(tmp_out, "Local requestor");
|
||||
@ -195,14 +195,14 @@ int orte_gpr_replica_dump_callbacks_fn(orte_buffer_t *buffer)
|
||||
}
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
j = ompi_list_get_size(&(cb->messages));
|
||||
sprintf(tmp_out, "Num messages: %d", j);
|
||||
sprintf(tmp_out, "Num messages: %ld", j);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
for (k=0, item = ompi_list_get_first(&(cb->messages));
|
||||
item != ompi_list_get_end(&(cb->messages));
|
||||
item = ompi_list_get_next(item), k++) {
|
||||
msg = (orte_gpr_replica_notify_msg_list_t*)item;
|
||||
sprintf(tmp_out, "\n\nInfo for message %d sending %d data objects to notifier id %d",
|
||||
k, (msg->message)->cnt, (msg->message)->idtag);
|
||||
sprintf(tmp_out, "\n\nInfo for message %ld sending %ld data objects to notifier id %d",
|
||||
k, (msg->message)->cnt, (int32_t)(msg->message)->idtag);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
orte_gpr_base_dump_notify_msg(buffer, msg->message);
|
||||
}
|
||||
@ -232,7 +232,7 @@ int orte_gpr_replica_dump_triggers_fn(orte_buffer_t *buffer)
|
||||
if (NULL != trig[j]) k++;
|
||||
}
|
||||
|
||||
sprintf(tmp_out, "Number of triggers: %d\n", k);
|
||||
sprintf(tmp_out, "Number of triggers: %ld\n", k);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp);
|
||||
|
||||
/* dump the trigger info for the registry */
|
||||
@ -260,47 +260,47 @@ static void orte_gpr_replica_dump_trigger(orte_buffer_t *buffer, size_t cnt,
|
||||
return;
|
||||
}
|
||||
|
||||
sprintf(tmp_out, "\nData for trigger %d", cnt);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
|
||||
/* output recipient info */
|
||||
if (NULL == trig->requestor) {
|
||||
sprintf(tmp_out, "\tIntended recipient: LOCAL @ notifier idtag %d",
|
||||
trig->index);
|
||||
} else {
|
||||
sprintf(tmp_out, "\tIntended recipient: [%d,%d,%d] @ notifier idtag %d",
|
||||
ORTE_NAME_ARGS(trig->requestor), trig->remote_idtag);
|
||||
}
|
||||
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
sprintf(tmp_out, "\tActions:");
|
||||
sprintf(tmp_out, "\nData for trigger %ld", cnt);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
if (ORTE_GPR_NOTIFY_VALUE_CHG & trig->action) {
|
||||
|
||||
/* output recipient info */
|
||||
if (NULL == trig->requestor) {
|
||||
sprintf(tmp_out, "\tIntended recipient: LOCAL @ notifier idtag %ld",
|
||||
trig->index);
|
||||
} else {
|
||||
sprintf(tmp_out, "\tIntended recipient: [%d,%d,%d] @ notifier idtag %d",
|
||||
ORTE_NAME_ARGS(trig->requestor), (int32_t)trig->remote_idtag);
|
||||
}
|
||||
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
sprintf(tmp_out, "\tActions:");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
if (ORTE_GPR_NOTIFY_VALUE_CHG & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_NOTIFY_VALUE_CHG");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
} else if (ORTE_GPR_NOTIFY_VALUE_CHG_TO & trig->action) {
|
||||
} else if (ORTE_GPR_NOTIFY_VALUE_CHG_TO & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_NOTIFY_VALUE_CHG_TO");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
} else if (ORTE_GPR_NOTIFY_VALUE_CHG_FRM & trig->action) {
|
||||
} else if (ORTE_GPR_NOTIFY_VALUE_CHG_FRM & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_NOTIFY_VALUE_CHG_FRM");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
}
|
||||
if (ORTE_GPR_NOTIFY_DEL_ENTRY & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_NOTIFY_DEL_ENTRY");
|
||||
if (ORTE_GPR_NOTIFY_DEL_ENTRY & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_NOTIFY_DEL_ENTRY");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
}
|
||||
if (ORTE_GPR_NOTIFY_ADD_ENTRY & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_NOTIFY_ADD_ENTRY");
|
||||
}
|
||||
if (ORTE_GPR_NOTIFY_ADD_ENTRY & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_NOTIFY_ADD_ENTRY");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
}
|
||||
if (ORTE_GPR_NOTIFY_PRE_EXISTING & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_NOTIFY_PRE_EXISTING");
|
||||
}
|
||||
if (ORTE_GPR_NOTIFY_PRE_EXISTING & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_NOTIFY_PRE_EXISTING");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
}
|
||||
if (ORTE_GPR_TRIG_ONE_SHOT & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_TRIG_ONE_SHOT");
|
||||
}
|
||||
if (ORTE_GPR_TRIG_ONE_SHOT & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_TRIG_ONE_SHOT");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
}
|
||||
}
|
||||
if (ORTE_GPR_TRIG_AT_LEVEL & trig->action) {
|
||||
sprintf(tmp_out, "\t\tORTE_GPR_TRIG_AT_LEVEL");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
@ -322,8 +322,8 @@ static void orte_gpr_replica_dump_trigger(orte_buffer_t *buffer, size_t cnt,
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
}
|
||||
|
||||
sprintf(tmp_out, "\n\tData covered by this subscription");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
sprintf(tmp_out, "\n\tData covered by this subscription");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
|
||||
data = (orte_gpr_replica_subscribed_data_t**)((trig->subscribed_data)->addr);
|
||||
for (i=0; i < (trig->subscribed_data)->size; i++) {
|
||||
@ -336,7 +336,7 @@ static void orte_gpr_replica_dump_trigger(orte_buffer_t *buffer, size_t cnt,
|
||||
sprintf(tmp_out, "\t\tNULL token (wildcard)");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
} else {
|
||||
sprintf(tmp_out, "\t\tNumber of tokens: %d", k);
|
||||
sprintf(tmp_out, "\t\tNumber of tokens: %ld", k);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
|
||||
for (j=0; j < k; j++) {
|
||||
@ -378,7 +378,7 @@ static void orte_gpr_replica_dump_trigger(orte_buffer_t *buffer, size_t cnt,
|
||||
sprintf(tmp_out, "\t\tNULL key (wildcard)");
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
} else {
|
||||
sprintf(tmp_out, "\t\tNumber of keys: %d", k);
|
||||
sprintf(tmp_out, "\t\tNumber of keys: %ld", k);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
|
||||
for (j=0; j < k; j++) {
|
||||
@ -420,9 +420,9 @@ static void orte_gpr_replica_dump_trigger(orte_buffer_t *buffer, size_t cnt,
|
||||
|
||||
if (0 < trig->num_counters) {
|
||||
if (ORTE_GPR_TRIG_AT_LEVEL & trig->action) {
|
||||
sprintf(tmp_out, "\tTrigger monitoring %d counters for level", trig->num_counters);
|
||||
sprintf(tmp_out, "\tTrigger monitoring %ld counters for level", trig->num_counters);
|
||||
} else {
|
||||
sprintf(tmp_out, "\tTrigger monitoring %d counters for compare", trig->num_counters);
|
||||
sprintf(tmp_out, "\tTrigger monitoring %ld counters for compare", trig->num_counters);
|
||||
}
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
cntr = (orte_gpr_replica_counter_t**)((trig->counters)->addr);
|
||||
@ -430,7 +430,7 @@ static void orte_gpr_replica_dump_trigger(orte_buffer_t *buffer, size_t cnt,
|
||||
if (NULL != cntr[i] &&
|
||||
ORTE_SUCCESS == orte_gpr_replica_dict_reverse_lookup(&token, cntr[i]->seg,
|
||||
(cntr[i]->iptr)->itag)) {
|
||||
sprintf(tmp_out, "\t\tCounter: %d\tSegment: %s\tName: %s", i,
|
||||
sprintf(tmp_out, "\t\tCounter: %ld\tSegment: %s\tName: %s", i,
|
||||
(cntr[i]->seg)->name, token);
|
||||
free(token);
|
||||
orte_gpr_replica_dump_load_string(buffer, &tmp_out);
|
||||
@ -472,7 +472,7 @@ void orte_gpr_replica_dump_itagval_value(orte_buffer_t *buffer,
|
||||
break;
|
||||
|
||||
case ORTE_SIZE:
|
||||
sprintf(tmp, "\t\tData type: ORTE_SIZE\tValue: %d", iptr->value.size);
|
||||
sprintf(tmp, "\t\tData type: ORTE_SIZE\tValue: %ld", iptr->value.size);
|
||||
break;
|
||||
|
||||
case ORTE_INT:
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user