fix bug in initialization of routing

This commit is contained in:
tqchen
2015-01-14 19:40:41 -08:00
parent 797fe27efe
commit f161d2f1e5
9 changed files with 28 additions and 12 deletions

View File

@@ -242,8 +242,10 @@ class ReduceHandle {
static int TypeSize(const MPI::Datatype &dtype);
protected:
// handle data field
// handle function field
void *handle_;
// reduce function of the reducer
IEngine::ReduceFunction *redfunc_;
// handle to the type field
void *htype_;
// the created type in 4 bytes

View File

@@ -201,7 +201,7 @@ inline void ReducerFunc_(const void *src_, void *dst_, int len_, const MPI::Data
const char *psrc = reinterpret_cast<const char*>(src_);
char *pdst = reinterpret_cast<char*>(dst_);
DType tdst, tsrc;
for (size_t i = 0; i < len_; ++i) {
for (int i = 0; i < len_; ++i) {
// use memcpy to avoid alignment issue
std::memcpy(&tdst, pdst + i * kUnit, sizeof(tdst));
std::memcpy(&tsrc, psrc + i * kUnit, sizeof(tsrc));