Fix a couple of minor bugs that prevented the clean handshake of contact info.
This commit was SVN r5749.
Этот коммит содержится в:
родитель
91c75cb7d8
Коммит
bb9c90b6ae
@ -38,6 +38,7 @@
|
||||
|
||||
|
||||
#include "include/orte_constants.h"
|
||||
#include "dps/dps.h"
|
||||
#include "event/event.h"
|
||||
#include "threads/mutex.h"
|
||||
#include "threads/condition.h"
|
||||
@ -462,8 +463,16 @@ static void orte_setup_hnp_recv(int status, orte_process_name_t* sender,
|
||||
orte_buffer_t* buffer, orte_rml_tag_t tag,
|
||||
void* cbdata)
|
||||
{
|
||||
char *orted_uri;
|
||||
size_t n=1;
|
||||
int rc;
|
||||
|
||||
OMPI_THREAD_LOCK(&orte_setup_hnp_mutex);
|
||||
ompi_output(0, "HE CALLED HOME!!");
|
||||
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &orted_uri, &n, ORTE_STRING))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
ompi_output(0, "got a uri of: %s", orted_uri);
|
||||
ompi_condition_signal(&orte_setup_hnp_condition);
|
||||
OMPI_THREAD_UNLOCK(&orte_setup_hnp_mutex);
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ int main(int argc, char *argv[])
|
||||
/* if requested, report my uri to the indicated pipe */
|
||||
if (orted_globals.uri_pipe > 0) {
|
||||
write(orted_globals.uri_pipe, orte_universe_info.seed_uri,
|
||||
strlen(orte_universe_info.seed_uri));
|
||||
strlen(orte_universe_info.seed_uri)+1); /* need to add 1 to get the NULL */
|
||||
close(orted_globals.uri_pipe);
|
||||
}
|
||||
|
||||
|
@ -399,12 +399,12 @@ int main(int argc, char *argv[])
|
||||
} else {
|
||||
/* This is the parent process.
|
||||
Close write end first. */
|
||||
read(orted_pipe[0], &orted_uri, 255);
|
||||
read(orted_pipe[0], orted_uri, 255);
|
||||
close(orted_pipe[0]);
|
||||
|
||||
/* send back the info */
|
||||
OBJ_CONSTRUCT(&buffer, orte_buffer_t);
|
||||
if (ORTE_SUCCESS != (ret = orte_dps.pack(&buffer, orted_uri, 1, ORTE_STRING))) {
|
||||
if (ORTE_SUCCESS != (ret = orte_dps.pack(&buffer, &orted_uri, 1, ORTE_STRING))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
exit(1);
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user