1
1

- Add mca_mpi_init_select_modules()

- Add base.h

This commit was SVN r600.
Этот коммит содержится в:
Jeff Squyres 2004-01-30 03:51:25 +00:00
родитель de7855fc08
Коммит 2421a37f73
4 изменённых файлов: 140 добавлений и 1 удалений

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

@ -6,5 +6,19 @@ include $(top_srcdir)/config/Makefile.options
noinst_LTLIBRARIES = libmca_mpi_base.la
headers = \
base.h
libmca_mpi_base_la_SOURCES = \
$(headers) \
mca_mpi_init_select_modules.c \
mca_mpi_mem.c
# Conditionally install the header files
if WANT_INSTALL_HEADERS
lamdir = $(includedir)/lam/mca/mpi/base
lam_HEADERS = $(headers)
else
lamdir = $(includedir)
endif

51
src/mca/mpi/base/base.h Обычный файл
Просмотреть файл

@ -0,0 +1,51 @@
/*
* $HEADER$
*/
#ifndef MCA_MPI_BASE_H
#define MCA_MPI_BASE_H
#include "lam_config.h"
#include "mpi.h"
#include "mca/mca.h"
/*
* Types for each function
*/
typedef int (*mca_mpi_init_cb_t)(void);
typedef int (*mca_mpi_alloc_mem_fn_t)(MPI_Aint size, MPI_Info info,
void **base);
typedef int (*mca_mpi_free_mem_fn_t)(void *base);
/*
* Global functions for MPI MCA modules
*/
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
int mca_mpi_alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr);
int mca_mpi_free_mem(void *baseptr);
int mca_mpi_init_select_modules(int requested, int *provided);
#if 0
/* JMS Not implemented yet */
int mca_mpi_init_callback(mca_mpi_init_cb_t func);
int mca_mpi_init_callbacks_invoke(void);
int mca_mpi_module_select(int requested);
int mca_mpi_param_associate(int index, int keyval);
int mca_mpi_param_lookup_int(int index, MPI_Comm comm);
char *mca_mpi_param_lookup_string(int index, MPI_Comm comm);
#endif
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

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

@ -0,0 +1,74 @@
/*
* $HEADER$
*/
#include "lam_config.h"
#include <stdio.h>
#include "lam/constants.h"
#include "lam/lfc/list.h"
#include "lam/mem/malloc.h"
#include "mca/mpi/base/base.h"
#include "mca/mpi/coll/coll.h"
#include "mca/mpi/coll/base/base.h"
#include "mca/mpi/ptl/ptl.h"
#include "mca/mpi/ptl/base/base.h"
#include "mca/mpi/pml/pml.h"
#include "mca/mpi/pml/base/base.h"
/*
* Look at available pml, ptl, and coll modules and find a set that
* works nicely. Also set the final MPI thread level. There are many
* factors involved here, and this first implementation is rather
* simplistic.
*
* The contents of this function will likely be replaced
*/
int mca_mpi_init_select_modules(int requested, int *provided)
{
lam_list_t ptls;
lam_list_t colls;
/* Make final lists of available modules (i.e., call the query/init
functions and see if they return happiness). For pml, there will
only be one (because there's only one for the whole process), but
for ptl and coll, we'll get lists back. */
/* JMS: At some point, we'll need to feed it the thread level to
ensure to pick one high enough (e.g., if we need CR) */
if (LAM_SUCCESS != mca_pml_base_select(&mca_pml)) {
return LAM_ERROR;
}
lam_list_init(&ptls);
if (LAM_SUCCESS != mca_ptl_base_select(&ptls)) {
return LAM_ERROR;
}
lam_list_init(&colls);
if (LAM_SUCCESS != mca_coll_base_select(&colls)) {
return LAM_ERROR;
}
/* Now that we have a final list of all available modules, do the
selection. pml is already selected. */
/* JMS ...Do more here with the thread level, etc.... */
*provided = requested;
/* Tell the selected pml module about all the selected ptl
modules */
#if TIM_HASNT_IMPLEMENTED_THIS_YET
mca_pml.pml_add_ptls(&ptls);
#else
mca_pml.pml_add_ptls(NULL, 0);
#endif
/* All done */
return LAM_SUCCESS;
}

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

@ -10,7 +10,7 @@
#include "lam/mem/malloc.h"
#include "mpi.h"
#include "mca/mca.h"
#include "mca/mpi/mpi.h"
#include "mca/mpi/base/base.h"
int mca_mpi_alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)