1
1

* fix a bunch of memory badness so that we can get through init :)

This commit was SVN r5513.
Этот коммит содержится в:
Brian Barrett 2005-04-27 15:03:55 +00:00
родитель 73d284eb13
Коммит ec4264a925
5 изменённых файлов: 59 добавлений и 27 удалений

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

@ -37,6 +37,7 @@ EXTRA_DIST = \
portals_SOURCES = \
ptl_portals.h \
ptl_portals_compat.h \
ptl_portals.c \
ptl_portals_component.c \
ptl_portals_stubs.c \
ptl_portals_compat_utcp.c

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

@ -26,37 +26,40 @@
#include "util/output.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_component.super,
1, /* max size of request cache */
0, /* byest required by ptl for a request */
0, /* max size of first frag */
0, /* min size of frag */
0, /* max size of frag */
50, /* latency */
0, /* bandwidth */
0, /* ptl flags */
1, /* max size of request cache */
1, /* byest required by ptl for a request */
128, /* max size of first frag */
0, /* min size of frag */
128, /* max size of frag */
0, /* exclusivity */
50, /* latency */
0, /* bandwidth */
0, /* ptl flags */
mca_ptl_portals_add_procs,
mca_ptl_portals_del_procs,
mca_ptl_portals_finalize,
mca_ptl_portals_send,
mca_ptl_portals_put,
mca_ptl_portals_get,
NULL,
NULL,
mca_ptl_portals_matched,
mca_ptl_portals_request_init,
mca_ptl_portals_request_fini,
mca_ptl_portals_match,
mca_ptl_portals_send_progess,
mca_ptl_portals_recv_progress,
NULL,
NULL,
NULL,
NULL, /* PTL stack */
NULL /* PML use */
}
},
0,
};
@ -65,11 +68,11 @@ int
mca_ptl_portals_add_procs(struct mca_ptl_base_module_t* ptl,
size_t nprocs, struct ompi_proc_t **procs,
struct mca_ptl_base_peer_t** peers,
ompi_bitmap_t* reachable);
ompi_bitmap_t* reachable)
{
int ret;
struct ompi_proc_t *local_proc = ompi_proc_local();
struct ompi_ptoc_t *curr_proc;
struct ompi_proc_t *curr_proc;
size_t i;
ret = mca_ptl_portals_add_procs_compat(ptl, nprocs, procs,

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

@ -16,3 +16,25 @@
#include "ompi_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 "ptl_portals.h"
#include "ptl_portals_compat.h"
/* how's this for source code diving? - find private method for
getting interface */
@ -73,6 +74,7 @@ mca_ptl_portals_init(mca_ptl_portals_component_t *comp)
"malloc failed in mca_ptl_portals_init");
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
}
*(comp->portals_modules[0]) = mca_ptl_portals_module;
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)
{
int ret, my_rid;
char *env;
ptl_process_id_t *info;
char *nidmap = 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 */
size_t size, i;
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 : */
nidmap = 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) {
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(pidmap, map_size, "%u", info->pid);
} else {
snprintf(nidmap, map_size, "%s:%u", nidmap, info->nid);
snprintf(pidmap, map_size, "%s:%u", nidmap, info->pid);
snprintf(nid_str, 12 + 1, ":%u", info->nid);
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,

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

@ -110,14 +110,11 @@ mca_ptl_portals_param_register_int(const char* param_name,
int
mca_ptl_portals_component_open(void)
{
int debug_level;
/* initialize state */
mca_ptl_portals_component.portals_num_modules = 0;
mca_ptl_portals_component.portals_modules = NULL;
/* initialize objects */
printf("here\n");
/* register portals module parameters */
#if PTL_PORTALS_UTCP
@ -127,13 +124,13 @@ mca_ptl_portals_component_open(void)
portals_output_stream.lds_verbose_level =
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 */
mca_ptl_portals_component.portals_output =
ompi_output_open(&portals_output_stream);
ompi_output_verbose(100, mca_ptl_portals_component.portals_output,
"mca_ptl_portals_component_open()");
return OMPI_SUCCESS;
}