1
1
- Be sure to properly OBJ_CONSTRUCT the intrinsic MPI_Op's
- RETAIN/RELEASE the op's when used in the invoke function

This commit was SVN r7863.
Этот коммит содержится в:
Jeff Squyres 2005-10-25 16:24:00 +00:00
родитель b60bea9ada
Коммит f8fd10715c
2 изменённых файлов: 7 добавлений и 13 удалений

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

@ -555,8 +555,9 @@ int ompi_op_init(void)
/* Fill in the ddt.id->op_position map */ /* Fill in the ddt.id->op_position map */
for (i = 0; i < DT_MAX_PREDEFINED; ++i) for (i = 0; i < DT_MAX_PREDEFINED; ++i) {
ompi_op_ddt_map[i] = -1; ompi_op_ddt_map[i] = -1;
}
ompi_op_ddt_map[DT_BYTE] = OMPI_OP_TYPE_BYTE; ompi_op_ddt_map[DT_BYTE] = OMPI_OP_TYPE_BYTE;
ompi_op_ddt_map[DT_SHORT] = OMPI_OP_TYPE_SHORT; ompi_op_ddt_map[DT_SHORT] = OMPI_OP_TYPE_SHORT;
@ -677,22 +678,13 @@ ompi_op_t *ompi_op_create(bool commute,
static int add_intrinsic(ompi_op_t *op, int fort_handle) static int add_intrinsic(ompi_op_t *op, int fort_handle)
{ {
int ret_val;
/* Add the op to the table */ /* Add the op to the table */
ret_val = ompi_pointer_array_add(ompi_op_f_to_c_table, op); OBJ_CONSTRUCT(op, ompi_op_t);
if (-1 == ret_val){ if (op->o_f_to_c_index != fort_handle) {
return OMPI_ERROR; return OMPI_ERROR;
} }
/* Make sure that the op is in the right location in the table */
if (fort_handle != ret_val) {
return OMPI_ERROR;
};
op->o_f_to_c_index = ret_val;
/* All done */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;

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

@ -501,6 +501,7 @@ static inline void ompi_op_reduce(ompi_op_t *op, void *source, void *target,
* :-) * :-)
*/ */
OBJ_RETAIN(op);
if (0 != (op->o_flags & OMPI_OP_FLAGS_INTRINSIC) && if (0 != (op->o_flags & OMPI_OP_FLAGS_INTRINSIC) &&
dtype->id < DT_MAX_PREDEFINED) { dtype->id < DT_MAX_PREDEFINED) {
if (0 != (op->o_flags & OMPI_OP_FLAGS_FORTRAN_FUNC)) { if (0 != (op->o_flags & OMPI_OP_FLAGS_FORTRAN_FUNC)) {
@ -523,6 +524,7 @@ static inline void ompi_op_reduce(ompi_op_t *op, void *source, void *target,
} else { } else {
op->o_func[0].c_fn(source, target, &count, &dtype); op->o_func[0].c_fn(source, target, &count, &dtype);
} }
OBJ_RELEASE(op);
} }
#endif /* OMPI_OP_H */ #endif /* OMPI_OP_H */