|
1 |
| -/* -*- Mode: C; c-basic-offset:4 ; -*- */ |
| 1 | +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ |
2 | 2 | /*
|
3 | 3 | * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
4 | 4 | * University Research and Technology
|
|
13 | 13 | * Copyright (c) 2008 UT-Battelle, LLC
|
14 | 14 | * Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
|
15 | 15 | * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
| 16 | + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights |
| 17 | + * reserved. |
16 | 18 | * $COPYRIGHT$
|
17 | 19 | *
|
18 | 20 | * Additional copyrights may follow
|
@@ -594,6 +596,13 @@ static inline void ompi_op_reduce(ompi_op_t * op, void *source,
|
594 | 596 | return;
|
595 | 597 | }
|
596 | 598 |
|
| 599 | +static inline void ompi_3buff_op_user (ompi_op_t *op, void * restrict source1, void * restrict source2, |
| 600 | + void * restrict result, int count, struct ompi_datatype_t *dtype) |
| 601 | +{ |
| 602 | + ompi_datatype_copy_content_same_ddt (dtype, count, result, source1); |
| 603 | + op->o_func.c_fn (source2, result, &count, &dtype); |
| 604 | +} |
| 605 | + |
597 | 606 | /**
|
598 | 607 | * Perform a reduction operation.
|
599 | 608 | *
|
@@ -628,10 +637,14 @@ static inline void ompi_3buff_op_reduce(ompi_op_t * op, void *source1,
|
628 | 637 | src2 = source2;
|
629 | 638 | tgt = target;
|
630 | 639 |
|
631 |
| - op->o_3buff_intrinsic.fns[ompi_op_ddt_map[dtype->id]](src1, src2, |
632 |
| - tgt, &count, |
633 |
| - &dtype, |
634 |
| - op->o_3buff_intrinsic.modules[ompi_op_ddt_map[dtype->id]]); |
| 640 | + if (OPAL_LIKELY(ompi_op_is_intrinsic (op))) { |
| 641 | + op->o_3buff_intrinsic.fns[ompi_op_ddt_map[dtype->id]](src1, src2, |
| 642 | + tgt, &count, |
| 643 | + &dtype, |
| 644 | + op->o_3buff_intrinsic.modules[ompi_op_ddt_map[dtype->id]]); |
| 645 | + } else { |
| 646 | + ompi_3buff_op_user (op, src1, src2, tgt, count, dtype); |
| 647 | + } |
635 | 648 | }
|
636 | 649 |
|
637 | 650 | END_C_DECLS
|
|
0 commit comments