1
1

Portals fixes after latest move

This commit was SVN r32330.
Этот коммит содержится в:
Ryan Grant 2014-07-28 19:25:03 +00:00
родитель bcade48e27
Коммит caa10a5faf
11 изменённых файлов: 46 добавлений и 44 удалений

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

@ -36,7 +36,7 @@ struct mca_coll_portals4_component_t {
ptl_handle_me_t barrier_unex_me_h;
ptl_handle_me_t finish_me_h;
/** Send MD handle(s). Use ompi_coll_portals4_get_md() to get the right md */
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
ptl_handle_md_t *md_hs;
#else
ptl_handle_md_t md_h;
@ -112,11 +112,11 @@ ompi_coll_portals4_get_nchildren(int cube_dim, int hibit, int rank, int size)
static inline void
ompi_coll_portals4_get_md(const void *ptr, ptl_handle_md_t *md_h, void **base_ptr)
{
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
int mask = (1ULL << (OMPI_PORTALS4_MAX_VA_SIZE - OMPI_PORTALS4_MAX_MD_SIZE + 1)) - 1;
int which = (((uintptr_t) ptr) >> (OMPI_PORTALS4_MAX_MD_SIZE - 1)) & mask;
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
int mask = (1ULL << (OPAL_PORTALS4_MAX_VA_SIZE - OPAL_PORTALS4_MAX_MD_SIZE + 1)) - 1;
int which = (((uintptr_t) ptr) >> (OPAL_PORTALS4_MAX_MD_SIZE - 1)) & mask;
*md_h = mca_coll_portals4_component.md_hs[which];
*base_ptr = (void*) (which * (1ULL << (OMPI_PORTALS4_MAX_MD_SIZE - 1)));
*base_ptr = (void*) (which * (1ULL << (OPAL_PORTALS4_MAX_MD_SIZE - 1)));
#else
*md_h = mca_coll_portals4_component.md_h;
*base_ptr = 0;
@ -127,8 +127,8 @@ ompi_coll_portals4_get_md(const void *ptr, ptl_handle_md_t *md_h, void **base_pt
static inline int
ompi_coll_portals4_get_num_mds(void)
{
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
return (1 << (OMPI_PORTALS4_MAX_VA_SIZE - OMPI_PORTALS4_MAX_MD_SIZE + 1));
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
return (1 << (OPAL_PORTALS4_MAX_VA_SIZE - OPAL_PORTALS4_MAX_MD_SIZE + 1));
#else
return 1;
#endif

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

@ -104,7 +104,7 @@ portals4_open(void)
mca_coll_portals4_component.eq_h = PTL_INVALID_HANDLE;
mca_coll_portals4_component.barrier_unex_me_h = PTL_INVALID_HANDLE;
mca_coll_portals4_component.finish_me_h = PTL_INVALID_HANDLE;
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
mca_coll_portals4_component.md_hs = NULL;
#else
mca_coll_portals4_component.md_h = PTL_INVALID_HANDLE;
@ -136,7 +136,7 @@ portals4_close(void)
OBJ_DESTRUCT(&mca_coll_portals4_component.requests);
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
if (NULL != mca_coll_portals4_component.md_hs) {
int i;
int num_mds = ompi_coll_portals4_get_num_mds();
@ -312,12 +312,12 @@ portals4_init_query(bool enable_progress_threads,
/* Bind MD/MDs across all memory. We prefer (for obvious reasons)
to have a single MD across all of memory */
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
{
int i;
int num_mds = ompi_coll_portals4_get_num_mds();
ptl_size_t size = (1ULL << OMPI_PORTALS4_MAX_MD_SIZE) - 1;
ptl_size_t offset_unit = (1ULL << OMPI_PORTALS4_MAX_MD_SIZE) / 2;
ptl_size_t size = (1ULL << OPAL_PORTALS4_MAX_MD_SIZE) - 1;
ptl_size_t offset_unit = (1ULL << OPAL_PORTALS4_MAX_MD_SIZE) / 2;
mca_coll_portals4_component.md_hs = malloc(sizeof(ptl_handle_md_t) * num_mds);
if (NULL == mca_coll_portals4_component.md_hs) {

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

@ -79,7 +79,7 @@ ompi_mtl_portals4_add_procs(struct mca_mtl_base_module_t *mtl,
"Portals 4 MTL does not support heterogeneous operations.");
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
"Proc %s architecture %x, mine %x.",
OMPI_NAME_PRINT(&procs[i]->proc_name),
OMPI_NAME_PRINT(&procs[i]->super.proc_name),
procs[i]->super.proc_arch, ompi_proc_local()->super.proc_arch);
return OMPI_ERR_NOT_SUPPORTED;
}
@ -170,7 +170,7 @@ ompi_mtl_portals4_finalize(struct mca_mtl_base_module_t *mtl)
PtlMEUnlink(ompi_mtl_portals4.long_overflow_me_h);
PtlMDRelease(ompi_mtl_portals4.zero_md_h);
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
{
int i;
int num_mds = ompi_mtl_portals4_get_num_mds();

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

@ -22,6 +22,7 @@
#include <portals4.h>
#include "opal/include/opal_config.h"
#include "opal/class/opal_free_list.h"
#include "opal/class/opal_list.h"
#include "opal/datatype/opal_convertor.h"
@ -73,7 +74,7 @@ struct mca_mtl_portals4_module_t {
ptl_handle_md_t zero_md_h;
/** Send MD handle(s). Use ompi_mtl_portals4_get_md() to get the right md */
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
ptl_handle_md_t *send_md_hs;
#else
ptl_handle_md_t send_md_h;
@ -241,11 +242,11 @@ extern mca_mtl_portals4_module_t ompi_mtl_portals4;
static inline void
ompi_mtl_portals4_get_md(const void *ptr, ptl_handle_md_t *md_h, void **base_ptr)
{
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
int mask = (1ULL << (OMPI_PORTALS4_MAX_VA_SIZE - OMPI_PORTALS4_MAX_MD_SIZE + 1)) - 1;
int which = (((uintptr_t) ptr) >> (OMPI_PORTALS4_MAX_MD_SIZE - 1)) & mask;
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
int mask = (1ULL << (OPAL_PORTALS4_MAX_VA_SIZE - OPAL_PORTALS4_MAX_MD_SIZE + 1)) - 1;
int which = (((uintptr_t) ptr) >> (OPAL_PORTALS4_MAX_MD_SIZE - 1)) & mask;
*md_h = ompi_mtl_portals4.send_md_hs[which];
*base_ptr = (void*) (which * (1ULL << (OMPI_PORTALS4_MAX_MD_SIZE - 1)));
*base_ptr = (void*) (which * (1ULL << (OPAL_PORTALS4_MAX_MD_SIZE - 1)));
#else
*md_h = ompi_mtl_portals4.send_md_h;
*base_ptr = 0;
@ -256,8 +257,8 @@ ompi_mtl_portals4_get_md(const void *ptr, ptl_handle_md_t *md_h, void **base_ptr
static inline int
ompi_mtl_portals4_get_num_mds(void)
{
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
return (1 << (OMPI_PORTALS4_MAX_VA_SIZE - OMPI_PORTALS4_MAX_MD_SIZE + 1));
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
return (1 << (OPAL_PORTALS4_MAX_VA_SIZE - OPAL_PORTALS4_MAX_MD_SIZE + 1));
#else
return 1;
#endif

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

@ -197,7 +197,7 @@ ompi_mtl_portals4_component_open(void)
ompi_mtl_portals4.recv_eq_h = PTL_INVALID_HANDLE;
ompi_mtl_portals4.zero_md_h = PTL_INVALID_HANDLE;
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
ompi_mtl_portals4.send_md_hs = NULL;
#else
ompi_mtl_portals4.send_md_h = PTL_INVALID_HANDLE;
@ -347,12 +347,12 @@ ompi_mtl_portals4_component_init(bool enable_progress_threads,
/* Bind MD/MDs across all memory. We prefer (for obvious reasons)
to have a single MD across all of memory */
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
{
int i;
int num_mds = ompi_mtl_portals4_get_num_mds();
ptl_size_t size = (1ULL << OMPI_PORTALS4_MAX_MD_SIZE) - 1;
ptl_size_t offset_unit = (1ULL << OMPI_PORTALS4_MAX_MD_SIZE) / 2;
ptl_size_t size = (1ULL << OPAL_PORTALS4_MAX_MD_SIZE) - 1;
ptl_size_t offset_unit = (1ULL << OPAL_PORTALS4_MAX_MD_SIZE) / 2;
ompi_mtl_portals4.send_md_hs = malloc(sizeof(ptl_handle_md_t) * num_mds);
if (NULL == ompi_mtl_portals4.send_md_hs) {
@ -478,7 +478,7 @@ ompi_mtl_portals4_component_init(bool enable_progress_threads,
if (!PtlHandleIsEqual(ompi_mtl_portals4.zero_md_h, PTL_INVALID_HANDLE)) {
PtlMDRelease(ompi_mtl_portals4.zero_md_h);
}
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
if (NULL != ompi_mtl_portals4.send_md_hs) {
int i;
int num_mds = ompi_mtl_portals4_get_num_mds();

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

@ -11,7 +11,6 @@
#define OSC_PORTALS4_PORTALS4_H
#include <portals4.h>
#include "ompi/class/ompi_free_list.h"
#include "ompi/group/group.h"
#include "ompi/communicator/communicator.h"
@ -74,7 +73,7 @@ struct ompi_osc_portals4_module_t {
ptl_handle_ni_t ni_h; /* network interface used by this window */
ptl_pt_index_t pt_idx; /* portal table index used by this window (this will be same across window) */
ptl_handle_ct_t ct_h; /* Counting event handle used for completion in this window */
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
ptl_handle_md_t *md_h; /* memory descriptor describing all of memory used by this window */
ptl_handle_md_t *req_md_h; /* memory descriptor with event completion used by this window */
#else
@ -127,11 +126,11 @@ static inline void
ompi_osc_portals4_get_md(const void *ptr, const ptl_handle_md_t *array,
ptl_handle_md_t *md_h, void **base_ptr)
{
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
int mask = (1ULL << (OMPI_PORTALS4_MAX_VA_SIZE - OMPI_PORTALS4_MAX_MD_SIZE + 1)) - 1;
int which = (((uintptr_t) ptr) >> (OMPI_PORTALS4_MAX_MD_SIZE - 1)) & mask;
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
int mask = (1ULL << (OPAL_PORTALS4_MAX_VA_SIZE - OPAL_PORTALS4_MAX_MD_SIZE + 1)) - 1;
int which = (((uintptr_t) ptr) >> (OPAL_PORTALS4_MAX_MD_SIZE - 1)) & mask;
*md_h = array[which];
*base_ptr = (void*) (which * (1ULL << (OMPI_PORTALS4_MAX_MD_SIZE - 1)));
*base_ptr = (void*) (which * (1ULL << (OPAL_PORTALS4_MAX_MD_SIZE - 1)));
#else
*md_h = array[0];
*base_ptr = 0;
@ -142,8 +141,8 @@ ompi_osc_portals4_get_md(const void *ptr, const ptl_handle_md_t *array,
static inline int
ompi_osc_portals4_get_num_mds(void)
{
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
return (1 << (OMPI_PORTALS4_MAX_VA_SIZE - OMPI_PORTALS4_MAX_MD_SIZE + 1));
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
return (1 << (OPAL_PORTALS4_MAX_VA_SIZE - OPAL_PORTALS4_MAX_MD_SIZE + 1));
#else
return 1;
#endif

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

@ -13,7 +13,6 @@
#include "ompi/mca/osc/base/base.h"
#include "ompi/mca/osc/base/osc_base_obj_convert.h"
#include "ompi/request/request.h"
#include "ompi/class/ompi_free_list.h"
#include "osc_portals4.h"
#include "osc_portals4_request.h"
@ -444,12 +443,12 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
goto error;
}
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
{
int i;
int num_mds = ompi_mtl_portals4_get_num_mds();
ptl_size_t size = 1ULL << OMPI_PORTALS4_MAX_MD_SIZE;
ptl_size_t offset_unit = (1ULL << OMPI_PORTALS4_MAX_MD_SIZE) / 2;
ptl_size_t size = 1ULL << OPAL_PORTALS4_MAX_MD_SIZE;
ptl_size_t offset_unit = (1ULL << OPAL_PORTALS4_MAX_MD_SIZE) / 2;
module->md_h = malloc(sizeof(ptl_handle_md_t) * num_mds);
if (NULL == module->md_h) {
@ -622,7 +621,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
/* BWB: FIX ME: This is all wrong... */
if (0 != module->ct_h) PtlCTFree(module->ct_h);
if (0 != module->data_me_h) PtlMEUnlink(module->data_me_h);
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
/* BWB: FIX ME */
#else
if (0 != module->req_md_h) PtlMDRelease(module->req_md_h[0]);
@ -662,7 +661,7 @@ ompi_osc_portals4_free(struct ompi_win_t *win)
/* cleanup */
PtlMEUnlink(module->data_me_h);
#if OMPI_PORTALS4_MAX_MD_SIZE < OMPI_PORTALS4_MAX_VA_SIZE
#if OPAL_PORTALS4_MAX_MD_SIZE < OPAL_PORTALS4_MAX_VA_SIZE
/* BWB: FIX ME */
#else
PtlMDRelease(module->md_h[0]);

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

@ -28,6 +28,7 @@
#include "opal/datatype/opal_convertor.h"
#include "opal/mca/btl/btl.h"
#include "opal/mca/btl/base/base.h"
#include "opal/mca/btl/base/btl_base_error.h"
BEGIN_C_DECLS

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

@ -20,8 +20,10 @@
#include "opal_config.h"
#include "opal/mca/event/event.h"
#include "opal/util/output.h"
#include "opal/util/show_help.h"
#include "opal/mca/btl/btl.h"
#include "opal/mca/btl/base/base.h"
#include "opal/mca/mpool/base/base.h"
#include "portals4.h"
#include "btl_portals4.h"

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

@ -28,7 +28,7 @@ mca_btl_portals4_put(struct mca_btl_base_module_t* btl_base,
{
opal_output(opal_btl_base_framework.framework_output, "mca_btl_portals4_put not implemented\n");
MPI_Abort(MPI_COMM_WORLD, 10);
BTL_ERROR(("mca_btl_portals4_put not implemented\n"));
return OPAL_SUCCESS;
}

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

@ -103,6 +103,6 @@ int mca_btl_portals4_sendi(struct mca_btl_base_module_t* btl_base,
mca_btl_base_descriptor_t** des)
{
opal_output(opal_btl_base_framework.framework_output, "mca_btl_portals_sendi is not implemented");
abort();
BTL_ERROR(("mca_btl_portals_sendi is not implemented"));
return OPAL_SUCCESS;
}