osc/rdma: ensure fragment headers and the packed datatype are 8-byte aligned.
The datatype unpacking code assumes that the packed datatype buffer has the same alignment as an OPAL_PTRDIFF_TYPE. This was not enforced by the rdma one-sided component. I changed the ordering and sized of various osc/rdma headers to ensure their sizes are a multiple of 8-bytes and modified the fragment allocation call to ensure all headers are 8-byte aligned. While not the cleanest way to handle this situation it should resolve the issue. Fixes trac:4315 cmr=v1.7.5:reviewer=jsquyres This commit was SVN r30974. The following Trac tickets were found above: Ticket 4315 --> https://svn.open-mpi.org/trac/ompi/ticket/4315
Этот коммит содержится в:
родитель
85515f2587
Коммит
5df8cd75a9
@ -1360,7 +1360,9 @@ static inline int process_frag (ompi_osc_rdma_module_t *module,
|
|||||||
abort(); /* FIX ME */
|
abort(); /* FIX ME */
|
||||||
}
|
}
|
||||||
|
|
||||||
header = (ompi_osc_rdma_header_t *) ((uintptr_t) header + ret);
|
/* the next header will start on an 8-byte boundary. this is done to ensure
|
||||||
|
* that the packed datatype is properly aligned */
|
||||||
|
header = (ompi_osc_rdma_header_t *) (((uintptr_t) header + ret + 0x07) & ~0x07);
|
||||||
}
|
}
|
||||||
|
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
|
@ -54,6 +54,9 @@ static inline int ompi_osc_rdma_frag_alloc(ompi_osc_rdma_module_t *module, int t
|
|||||||
ompi_osc_rdma_frag_t *curr = module->peers[target].active_frag;
|
ompi_osc_rdma_frag_t *curr = module->peers[target].active_frag;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/* ensure the next fragment will be allocated on an 8-byte boundary */
|
||||||
|
request_len = (request_len + 0x7) & ~0x7;
|
||||||
|
|
||||||
if (request_len > mca_osc_rdma_component.buffer_size) {
|
if (request_len > mca_osc_rdma_component.buffer_size) {
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
}
|
}
|
||||||
@ -114,18 +117,19 @@ static inline int ompi_osc_rdma_frag_alloc(ompi_osc_rdma_module_t *module, int t
|
|||||||
/*
|
/*
|
||||||
* Note: module lock must be held for this operation
|
* Note: module lock must be held for this operation
|
||||||
*/
|
*/
|
||||||
static inline int
|
static inline int ompi_osc_rdma_frag_finish(ompi_osc_rdma_module_t *module,
|
||||||
ompi_osc_rdma_frag_finish(ompi_osc_rdma_module_t *module,
|
ompi_osc_rdma_frag_t* buffer)
|
||||||
ompi_osc_rdma_frag_t* buffer)
|
|
||||||
{
|
{
|
||||||
int ret = OMPI_SUCCESS;
|
if (0 == --buffer->pending && 0 == buffer->remain_len) {
|
||||||
|
if (OPAL_LIKELY(buffer == module->peers[buffer->target].active_frag)) {
|
||||||
buffer->pending--;
|
/* this is the active fragment. need to set the current fragment to null
|
||||||
if (0 == buffer->pending && 0 == buffer->remain_len) {
|
* or it will be started multiple times */
|
||||||
ret = ompi_osc_rdma_frag_start(module, buffer);
|
module->peers[buffer->target].active_frag = NULL;
|
||||||
|
}
|
||||||
|
return ompi_osc_rdma_frag_start(module, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -78,9 +78,9 @@ struct ompi_osc_rdma_header_acc_t {
|
|||||||
|
|
||||||
uint16_t tag;
|
uint16_t tag;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
|
uint32_t op;
|
||||||
uint64_t len;
|
uint64_t len;
|
||||||
uint64_t displacement;
|
uint64_t displacement;
|
||||||
uint32_t op;
|
|
||||||
};
|
};
|
||||||
typedef struct ompi_osc_rdma_header_acc_t ompi_osc_rdma_header_acc_t;
|
typedef struct ompi_osc_rdma_header_acc_t ompi_osc_rdma_header_acc_t;
|
||||||
|
|
||||||
@ -105,9 +105,9 @@ struct ompi_osc_rdma_header_get_acc_t {
|
|||||||
|
|
||||||
uint16_t tag;
|
uint16_t tag;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
|
uint32_t op;
|
||||||
uint64_t len;
|
uint64_t len;
|
||||||
uint64_t displacement;
|
uint64_t displacement;
|
||||||
uint32_t op;
|
|
||||||
};
|
};
|
||||||
typedef struct ompi_osc_rdma_header_get_acc_t ompi_osc_rdma_header_get_acc_t;
|
typedef struct ompi_osc_rdma_header_get_acc_t ompi_osc_rdma_header_get_acc_t;
|
||||||
|
|
||||||
@ -172,6 +172,7 @@ struct ompi_osc_rdma_frag_header_t {
|
|||||||
uint16_t windx; /* cid of communicator backing window (our window id) */
|
uint16_t windx; /* cid of communicator backing window (our window id) */
|
||||||
uint32_t source; /* rank in window of source process */
|
uint32_t source; /* rank in window of source process */
|
||||||
uint16_t num_ops; /* number of operations in this buffer */
|
uint16_t num_ops; /* number of operations in this buffer */
|
||||||
|
uint16_t pad[3]; /* ensure the fragment header is a multiple of 8 bytes */
|
||||||
};
|
};
|
||||||
typedef struct ompi_osc_rdma_frag_header_t ompi_osc_rdma_frag_header_t;
|
typedef struct ompi_osc_rdma_frag_header_t ompi_osc_rdma_frag_header_t;
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user