* fix a bunch of memory badness so that we can get through init :)
This commit was SVN r5513.
Этот коммит содержится в:
родитель
73d284eb13
Коммит
ec4264a925
@ -37,6 +37,7 @@ EXTRA_DIST = \
|
|||||||
portals_SOURCES = \
|
portals_SOURCES = \
|
||||||
ptl_portals.h \
|
ptl_portals.h \
|
||||||
ptl_portals_compat.h \
|
ptl_portals_compat.h \
|
||||||
|
ptl_portals.c \
|
||||||
ptl_portals_component.c \
|
ptl_portals_component.c \
|
||||||
ptl_portals_stubs.c \
|
ptl_portals_stubs.c \
|
||||||
ptl_portals_compat_utcp.c
|
ptl_portals_compat_utcp.c
|
||||||
|
@ -26,37 +26,40 @@
|
|||||||
#include "util/output.h"
|
#include "util/output.h"
|
||||||
|
|
||||||
#include "ptl_portals.h"
|
#include "ptl_portals.h"
|
||||||
#include "ptl_portals_nal.h"
|
#include "ptl_portals_compat.h"
|
||||||
|
|
||||||
mca_ptl_portals_module_t mca_ptl_portals_module = {
|
mca_ptl_portals_module_t mca_ptl_portals_module = {
|
||||||
{
|
{
|
||||||
&mca_ptl_portals_component.super,
|
&mca_ptl_portals_component.super,
|
||||||
1, /* max size of request cache */
|
1, /* max size of request cache */
|
||||||
0, /* byest required by ptl for a request */
|
1, /* byest required by ptl for a request */
|
||||||
0, /* max size of first frag */
|
128, /* max size of first frag */
|
||||||
0, /* min size of frag */
|
0, /* min size of frag */
|
||||||
0, /* max size of frag */
|
128, /* max size of frag */
|
||||||
50, /* latency */
|
0, /* exclusivity */
|
||||||
0, /* bandwidth */
|
50, /* latency */
|
||||||
0, /* ptl flags */
|
0, /* bandwidth */
|
||||||
|
0, /* ptl flags */
|
||||||
|
|
||||||
mca_ptl_portals_add_procs,
|
mca_ptl_portals_add_procs,
|
||||||
mca_ptl_portals_del_procs,
|
mca_ptl_portals_del_procs,
|
||||||
mca_ptl_portals_finalize,
|
mca_ptl_portals_finalize,
|
||||||
mca_ptl_portals_send,
|
mca_ptl_portals_send,
|
||||||
mca_ptl_portals_put,
|
NULL,
|
||||||
mca_ptl_portals_get,
|
NULL,
|
||||||
mca_ptl_portals_matched,
|
mca_ptl_portals_matched,
|
||||||
mca_ptl_portals_request_init,
|
mca_ptl_portals_request_init,
|
||||||
mca_ptl_portals_request_fini,
|
mca_ptl_portals_request_fini,
|
||||||
|
|
||||||
mca_ptl_portals_match,
|
NULL,
|
||||||
mca_ptl_portals_send_progess,
|
NULL,
|
||||||
mca_ptl_portals_recv_progress,
|
NULL,
|
||||||
|
|
||||||
NULL, /* PTL stack */
|
NULL, /* PTL stack */
|
||||||
NULL /* PML use */
|
NULL /* PML use */
|
||||||
}
|
},
|
||||||
|
|
||||||
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -65,11 +68,11 @@ int
|
|||||||
mca_ptl_portals_add_procs(struct mca_ptl_base_module_t* ptl,
|
mca_ptl_portals_add_procs(struct mca_ptl_base_module_t* ptl,
|
||||||
size_t nprocs, struct ompi_proc_t **procs,
|
size_t nprocs, struct ompi_proc_t **procs,
|
||||||
struct mca_ptl_base_peer_t** peers,
|
struct mca_ptl_base_peer_t** peers,
|
||||||
ompi_bitmap_t* reachable);
|
ompi_bitmap_t* reachable)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct ompi_proc_t *local_proc = ompi_proc_local();
|
struct ompi_proc_t *local_proc = ompi_proc_local();
|
||||||
struct ompi_ptoc_t *curr_proc;
|
struct ompi_proc_t *curr_proc;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
ret = mca_ptl_portals_add_procs_compat(ptl, nprocs, procs,
|
ret = mca_ptl_portals_add_procs_compat(ptl, nprocs, procs,
|
||||||
|
@ -16,3 +16,25 @@
|
|||||||
|
|
||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include "portals_config.h"
|
#include "portals_config.h"
|
||||||
|
|
||||||
|
#include "include/constants.h"
|
||||||
|
#include "util/output.h"
|
||||||
|
|
||||||
|
#include "ptl_portals.h"
|
||||||
|
#include "ptl_portals_compat.h"
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
mca_ptl_portals_init(mca_ptl_portals_component_t *comp)
|
||||||
|
{
|
||||||
|
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
mca_ptl_portals_add_procs_compat(struct mca_ptl_base_module_t* ptl_base,
|
||||||
|
size_t nprocs, struct ompi_proc_t **procs,
|
||||||
|
struct mca_ptl_base_peer_t** peers,
|
||||||
|
ompi_bitmap_t* reachable)
|
||||||
|
{
|
||||||
|
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "util/output.h"
|
#include "util/output.h"
|
||||||
|
|
||||||
#include "ptl_portals.h"
|
#include "ptl_portals.h"
|
||||||
|
#include "ptl_portals_compat.h"
|
||||||
|
|
||||||
/* how's this for source code diving? - find private method for
|
/* how's this for source code diving? - find private method for
|
||||||
getting interface */
|
getting interface */
|
||||||
@ -73,6 +74,7 @@ mca_ptl_portals_init(mca_ptl_portals_component_t *comp)
|
|||||||
"malloc failed in mca_ptl_portals_init");
|
"malloc failed in mca_ptl_portals_init");
|
||||||
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
|
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
|
*(comp->portals_modules[0]) = mca_ptl_portals_module;
|
||||||
|
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -85,10 +87,11 @@ mca_ptl_portals_add_procs_compat(struct mca_ptl_base_module_t* ptl_base,
|
|||||||
ompi_bitmap_t* reachable)
|
ompi_bitmap_t* reachable)
|
||||||
{
|
{
|
||||||
int ret, my_rid;
|
int ret, my_rid;
|
||||||
char *env;
|
|
||||||
ptl_process_id_t *info;
|
ptl_process_id_t *info;
|
||||||
char *nidmap = NULL;
|
char *nidmap = NULL;
|
||||||
char *pidmap = NULL;
|
char *pidmap = NULL;
|
||||||
|
char *nid_str;
|
||||||
|
char *pid_str;
|
||||||
const size_t map_size = nprocs * 12 + 1; /* 12 is max length of long in decimal */
|
const size_t map_size = nprocs * 12 + 1; /* 12 is max length of long in decimal */
|
||||||
size_t size, i;
|
size_t size, i;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
@ -102,7 +105,10 @@ mca_ptl_portals_add_procs_compat(struct mca_ptl_base_module_t* ptl_base,
|
|||||||
/* each nid is a int, so need 10 there, plus the : */
|
/* each nid is a int, so need 10 there, plus the : */
|
||||||
nidmap = malloc(map_size);
|
nidmap = malloc(map_size);
|
||||||
pidmap = malloc(map_size);
|
pidmap = malloc(map_size);
|
||||||
if (NULL == nidmap || NULL == pidmap) return OMPI_ERROR;
|
nid_str = malloc(12 + 1);
|
||||||
|
pid_str = malloc(12 + 1);
|
||||||
|
if (NULL == nidmap || NULL == pidmap || NULL == nid_str || NULL == pid_str)
|
||||||
|
return OMPI_ERROR;
|
||||||
|
|
||||||
for (i = 0 ; i < nprocs ; ++i) {
|
for (i = 0 ; i < nprocs ; ++i) {
|
||||||
if (proc_self == procs[i]) my_rid = i;
|
if (proc_self == procs[i]) my_rid = i;
|
||||||
@ -124,9 +130,12 @@ mca_ptl_portals_add_procs_compat(struct mca_ptl_base_module_t* ptl_base,
|
|||||||
snprintf(nidmap, map_size, "%u", info->nid);
|
snprintf(nidmap, map_size, "%u", info->nid);
|
||||||
snprintf(pidmap, map_size, "%u", info->pid);
|
snprintf(pidmap, map_size, "%u", info->pid);
|
||||||
} else {
|
} else {
|
||||||
snprintf(nidmap, map_size, "%s:%u", nidmap, info->nid);
|
snprintf(nid_str, 12 + 1, ":%u", info->nid);
|
||||||
snprintf(pidmap, map_size, "%s:%u", nidmap, info->pid);
|
snprintf(pid_str, 12 + 1, ":%u", info->pid);
|
||||||
|
strncat(nidmap, nid_str, 12);
|
||||||
|
strncat(pidmap, pid_str, 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ompi_output_verbose(100, mca_ptl_portals_component.portals_output,
|
ompi_output_verbose(100, mca_ptl_portals_component.portals_output,
|
||||||
|
@ -110,14 +110,11 @@ mca_ptl_portals_param_register_int(const char* param_name,
|
|||||||
int
|
int
|
||||||
mca_ptl_portals_component_open(void)
|
mca_ptl_portals_component_open(void)
|
||||||
{
|
{
|
||||||
int debug_level;
|
|
||||||
|
|
||||||
/* initialize state */
|
/* initialize state */
|
||||||
mca_ptl_portals_component.portals_num_modules = 0;
|
mca_ptl_portals_component.portals_num_modules = 0;
|
||||||
mca_ptl_portals_component.portals_modules = NULL;
|
mca_ptl_portals_component.portals_modules = NULL;
|
||||||
|
|
||||||
/* initialize objects */
|
/* initialize objects */
|
||||||
printf("here\n");
|
|
||||||
|
|
||||||
/* register portals module parameters */
|
/* register portals module parameters */
|
||||||
#if PTL_PORTALS_UTCP
|
#if PTL_PORTALS_UTCP
|
||||||
@ -127,13 +124,13 @@ mca_ptl_portals_component_open(void)
|
|||||||
portals_output_stream.lds_verbose_level =
|
portals_output_stream.lds_verbose_level =
|
||||||
mca_ptl_portals_param_register_int("debug_level", 1000);
|
mca_ptl_portals_param_register_int("debug_level", 1000);
|
||||||
|
|
||||||
ompi_output_verbose(100, mca_ptl_portals_component.portals_output,
|
|
||||||
"mca_ptl_portals_component_open()");
|
|
||||||
|
|
||||||
/* finish with objects */
|
/* finish with objects */
|
||||||
mca_ptl_portals_component.portals_output =
|
mca_ptl_portals_component.portals_output =
|
||||||
ompi_output_open(&portals_output_stream);
|
ompi_output_open(&portals_output_stream);
|
||||||
|
|
||||||
|
ompi_output_verbose(100, mca_ptl_portals_component.portals_output,
|
||||||
|
"mca_ptl_portals_component_open()");
|
||||||
|
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user