applying a diff-file from Jeff with one minor correction. Major problem was that I dereferenced comm_null accidentally four times instead of ones comm_null, twice group_null and once the error handler of comm_parent, in case a parent communicator other then comm_null has been established.
This commit was SVN r3525.
Этот коммит содержится в:
родитель
9659288e74
Коммит
b3d5c0a04f
@ -1007,26 +1007,17 @@ int ompi_topo_create (ompi_communicator_t *old_comm,
|
||||
ompi_proc_t **topo_procs;
|
||||
int num_procs;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* Allocate a comm structure. This structure is used later to pass
|
||||
* down to topo_base_comm_select so that the actions structure
|
||||
* pertaining to the selected topology component can be used to
|
||||
* re-aarange the procs.
|
||||
*/
|
||||
*comm_topo = MPI_COMM_NULL;
|
||||
new_comm = OBJ_NEW (ompi_communicator_t);
|
||||
mca_topo_base_comm_t *topo_comm=NULL;
|
||||
|
||||
/* allocate the data for the common good */
|
||||
new_comm->c_topo_comm = (mca_topo_base_comm_t *)malloc(sizeof(mca_topo_base_comm_t));
|
||||
topo_comm = (mca_topo_base_comm_t *)malloc(sizeof(mca_topo_base_comm_t));
|
||||
|
||||
if (NULL == new_comm->c_topo_comm) {
|
||||
if (NULL == topo_comm) {
|
||||
OBJ_RELEASE(new_comm);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
/* select the topology component on the communicator */
|
||||
|
||||
/* select the topology compo nent on the communicator */
|
||||
if (OMPI_SUCCESS != (ret = mca_topo_base_comm_select (new_comm, NULL))) {
|
||||
free(new_comm->c_topo_comm);
|
||||
OBJ_RELEASE(new_comm);
|
||||
|
@ -13,8 +13,10 @@
|
||||
#include "communicator/communicator.h"
|
||||
#include "datatype/datatype.h"
|
||||
#include "errhandler/errhandler.h"
|
||||
#include "group/group.h"
|
||||
#include "proc/proc.h"
|
||||
#include "threads/mutex.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/bit_ops.h"
|
||||
#include "util/bufpack.h"
|
||||
#include "util/argv.h"
|
||||
@ -324,7 +326,11 @@ int ompi_comm_start_processes (char *command, char **argv, int maxprocs,
|
||||
mca_pcm_base_build_base_env(environ, &(sched->envc), &(sched->env));
|
||||
|
||||
/* set initial contact info */
|
||||
my_contact_info = strdup(ompi_universe_info.ns_replica);
|
||||
if (ompi_process_info.seed) {
|
||||
my_contact_info = mca_oob_get_contact_info();
|
||||
} else {
|
||||
my_contact_info = strdup(ompi_universe_info.ns_replica);
|
||||
}
|
||||
|
||||
asprintf(&tmp, "OMPI_MCA_ns_base_replica=%s", my_contact_info);
|
||||
ompi_argv_append(&(sched->envc), &(sched->env), tmp);
|
||||
@ -412,6 +418,8 @@ int ompi_comm_dyn_init (void)
|
||||
int tag, root=0, send_first=1;
|
||||
ompi_communicator_t *newcomm=NULL;
|
||||
ompi_process_name_t *port_proc_name=NULL;
|
||||
ompi_group_t *group = NULL;
|
||||
ompi_errhandler_t *errhandler = NULL;
|
||||
|
||||
/* get jobid */
|
||||
myproc = ompi_proc_self(&size);
|
||||
@ -438,12 +446,15 @@ int ompi_comm_dyn_init (void)
|
||||
* now we have to decrease the reference counters to the according
|
||||
* objects
|
||||
*/
|
||||
|
||||
|
||||
oldcomm = &ompi_mpi_comm_null;
|
||||
OBJ_RELEASE(oldcomm);
|
||||
OBJ_RELEASE(oldcomm);
|
||||
OBJ_RELEASE(oldcomm);
|
||||
OBJ_RELEASE(oldcomm);
|
||||
group = &ompi_mpi_group_null;
|
||||
OBJ_RELEASE(group);
|
||||
group = &ompi_mpi_group_null;
|
||||
OBJ_RELEASE(group);
|
||||
errhandler = &ompi_mpi_errors_are_fatal;
|
||||
OBJ_RELEASE(errhandler);
|
||||
|
||||
/* Set name for debugging purposes */
|
||||
snprintf(newcomm->c_name, MPI_MAX_OBJECT_NAME, "MPI_COMM_PARENT");
|
||||
|
@ -197,7 +197,7 @@ int ompi_comm_finalize(void)
|
||||
if( ompi_mpi_comm_parent != &ompi_mpi_comm_null ) {
|
||||
ompi_mpi_comm_parent->c_local_group->grp_flags = 0;
|
||||
ompi_mpi_comm_parent->c_flags = 0;
|
||||
OBJ_RETAIN (&ompi_mpi_comm_parent);
|
||||
OBJ_DESTRUCT (&ompi_mpi_comm_parent);
|
||||
}
|
||||
|
||||
ompi_mpi_comm_null.c_local_group->grp_flags = 0;
|
||||
|
@ -427,6 +427,11 @@ void
|
||||
ompi_rte_int_node_schedule_construct(ompi_object_t *obj)
|
||||
{
|
||||
ompi_rte_node_schedule_t *sched = (ompi_rte_node_schedule_t*) obj;
|
||||
sched->argv = NULL;
|
||||
sched->argc = 0;
|
||||
sched->env = NULL;
|
||||
sched->envc = 0;
|
||||
sched->cwd = NULL;
|
||||
sched->nodelist = OBJ_NEW(ompi_list_t);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ struct ompi_if_t {
|
||||
typedef struct ompi_if_t ompi_if_t;
|
||||
|
||||
static ompi_list_t ompi_if_list;
|
||||
|
||||
static bool already_done = false;
|
||||
|
||||
/*
|
||||
* Discover the list of configured interfaces. Don't care about any
|
||||
@ -76,15 +76,17 @@ static int ompi_ifinit(void)
|
||||
int sd;
|
||||
ifconf.ifc_len = sizeof(buff);
|
||||
ifconf.ifc_buf = buff;
|
||||
|
||||
if (ompi_list_get_size(&ompi_if_list) > 0)
|
||||
|
||||
if (already_done) {
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
already_done = true;
|
||||
|
||||
if((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
|
||||
ompi_output(0, "ompi_ifinit: socket() failed with errno=%d\n", errno);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
|
||||
if(ioctl(sd, SIOCGIFCONF, &ifconf) < 0) {
|
||||
ompi_output(0, "ompi_ifinit: ioctl(SIOCGIFCONF) failed with errno=%d", errno);
|
||||
close(sd);
|
||||
@ -207,9 +209,10 @@ static int ompi_ifinit(void)
|
||||
ompi_if_t *intf_ptr;
|
||||
|
||||
/* return if this has been done before */
|
||||
if (0 > ompi_list_get_size(&ompi_if_list)) {
|
||||
if (already_done) {
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
already_done = true;
|
||||
|
||||
/* create a socket */
|
||||
sd = WSASocket (AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, 0);
|
||||
@ -379,7 +382,7 @@ int ompi_ifaddrtoname(const char* if_addr, char* if_name, int length)
|
||||
* Return the number of discovered interface.
|
||||
*/
|
||||
|
||||
int ompi_ifcount()
|
||||
int ompi_ifcount(void)
|
||||
{
|
||||
if(ompi_ifinit() != OMPI_SUCCESS)
|
||||
return (-1);
|
||||
@ -392,7 +395,7 @@ int ompi_ifcount()
|
||||
* interface in our list.
|
||||
*/
|
||||
|
||||
int ompi_ifbegin()
|
||||
int ompi_ifbegin(void)
|
||||
{
|
||||
ompi_if_t *intf;
|
||||
if(ompi_ifinit() != OMPI_SUCCESS)
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user