From e73215230407688a75f7a762dd45f1a24dfbae52 Mon Sep 17 00:00:00 2001 From: Devendar Bureddy Date: Mon, 29 Dec 2014 22:16:35 +0200 Subject: [PATCH] HCOLL: Fix hcoll supported datatype checks corretcly --- ompi/mca/coll/hcoll/coll_hcoll_ops.c | 36 ++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/ompi/mca/coll/hcoll/coll_hcoll_ops.c b/ompi/mca/coll/hcoll/coll_hcoll_ops.c index 61fa8b339e..266f1e2103 100644 --- a/ompi/mca/coll/hcoll/coll_hcoll_ops.c +++ b/ompi/mca/coll/hcoll/coll_hcoll_ops.c @@ -36,7 +36,8 @@ int mca_coll_hcoll_bcast(void *buff, int count, HCOL_VERBOSE(20,"RUNNING HCOL BCAST"); mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module; dtype = ompi_dtype_2_dte_dtype(datatype); - if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(dtype)) && mca_coll_hcoll_component.hcoll_datatype_fallback){ + if (OPAL_UNLIKELY((HCOL_DTE_IS_ZERO(dtype) || HCOL_DTE_IS_COMPLEX(dtype))) + && mca_coll_hcoll_component.hcoll_datatype_fallback){ /*If we are here then datatype is not simple predefined datatype */ /*In future we need to add more complex mapping to the dte_data_representation_t */ /* Now use fallback */ @@ -68,7 +69,9 @@ int mca_coll_hcoll_allgather(void *sbuf, int scount, mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module; stype = ompi_dtype_2_dte_dtype(sdtype); rtype = ompi_dtype_2_dte_dtype(rdtype); - if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype)) && mca_coll_hcoll_component.hcoll_datatype_fallback){ + if (OPAL_UNLIKELY((HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) + || HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_COMPLEX(rtype))) + && mca_coll_hcoll_component.hcoll_datatype_fallback){ /*If we are here then datatype is not simple predefined datatype */ /*In future we need to add more complex mapping to the dte_data_representation_t */ /* Now use fallback */ @@ -106,7 +109,9 @@ int mca_coll_hcoll_gather(void *sbuf, int scount, mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module; stype = ompi_dtype_2_dte_dtype(sdtype); rtype = ompi_dtype_2_dte_dtype(rdtype); - if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))){ + if (OPAL_UNLIKELY((HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) + || HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_COMPLEX(rtype))) + && mca_coll_hcoll_component.hcoll_datatype_fallback){ /*If we are here then datatype is not simple predefined datatype */ /*In future we need to add more complex mapping to the dte_data_representation_t */ /* Now use fallback */ @@ -143,7 +148,8 @@ int mca_coll_hcoll_allreduce(void *sbuf, void *rbuf, int count, HCOL_VERBOSE(20,"RUNNING HCOL ALLREDUCE"); mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module; Dtype = ompi_dtype_2_dte_dtype(dtype); - if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(Dtype)) && mca_coll_hcoll_component.hcoll_datatype_fallback){ + if (OPAL_UNLIKELY((HCOL_DTE_IS_ZERO(Dtype) || HCOL_DTE_IS_COMPLEX(Dtype))) + && mca_coll_hcoll_component.hcoll_datatype_fallback){ /*If we are here then datatype is not simple predefined datatype */ /*In future we need to add more complex mapping to the dte_data_representation_t */ /* Now use fallback */ @@ -192,7 +198,9 @@ int mca_coll_hcoll_alltoall(void *sbuf, int scount, mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module; stype = ompi_dtype_2_dte_dtype(sdtype); rtype = ompi_dtype_2_dte_dtype(rdtype); - if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype)) && mca_coll_hcoll_component.hcoll_datatype_fallback){ + if (OPAL_UNLIKELY((HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) + || HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_COMPLEX(rtype))) + && mca_coll_hcoll_component.hcoll_datatype_fallback){ /*If we are here then datatype is not simple predefined datatype */ /*In future we need to add more complex mapping to the dte_data_representation_t */ /* Now use fallback */ @@ -231,7 +239,9 @@ int mca_coll_hcoll_gatherv(void* sbuf, int scount, mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module; stype = ompi_dtype_2_dte_dtype(sdtype); rtype = ompi_dtype_2_dte_dtype(rdtype); - if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))){ + if (OPAL_UNLIKELY((HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) + || HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_COMPLEX(rtype))) + && mca_coll_hcoll_component.hcoll_datatype_fallback){ /*If we are here then datatype is not simple predefined datatype */ /*In future we need to add more complex mapping to the dte_data_representation_t */ /* Now use fallback */ @@ -284,7 +294,8 @@ int mca_coll_hcoll_ibcast(void *buff, int count, mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module; rt_handle = (void**) request; dtype = ompi_dtype_2_dte_dtype(datatype); - if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(dtype)) && mca_coll_hcoll_component.hcoll_datatype_fallback){ + if (OPAL_UNLIKELY((HCOL_DTE_IS_ZERO(dtype) || HCOL_DTE_IS_COMPLEX(dtype))) + && mca_coll_hcoll_component.hcoll_datatype_fallback){ /*If we are here then datatype is not simple predefined datatype */ /*In future we need to add more complex mapping to the dte_data_representation_t */ /* Now use fallback */ @@ -319,7 +330,9 @@ int mca_coll_hcoll_iallgather(void *sbuf, int scount, rt_handle = (void**) request; stype = ompi_dtype_2_dte_dtype(sdtype); rtype = ompi_dtype_2_dte_dtype(rdtype); - if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype)) && mca_coll_hcoll_component.hcoll_datatype_fallback){ + if (OPAL_UNLIKELY((HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) + || HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_COMPLEX(rtype))) + && mca_coll_hcoll_component.hcoll_datatype_fallback){ /*If we are here then datatype is not simple predefined datatype */ /*In future we need to add more complex mapping to the dte_data_representation_t */ /* Now use fallback */ @@ -360,7 +373,8 @@ int mca_coll_hcoll_iallreduce(void *sbuf, void *rbuf, int count, mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module; rt_handle = (void**) request; Dtype = ompi_dtype_2_dte_dtype(dtype); - if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(Dtype)) && mca_coll_hcoll_component.hcoll_datatype_fallback){ + if (OPAL_UNLIKELY((HCOL_DTE_IS_ZERO(Dtype) || HCOL_DTE_IS_COMPLEX(Dtype))) + && mca_coll_hcoll_component.hcoll_datatype_fallback){ /*If we are here then datatype is not simple predefined datatype */ /*In future we need to add more complex mapping to the dte_data_representation_t */ /* Now use fallback */ @@ -413,7 +427,9 @@ int mca_coll_hcoll_igatherv(void* sbuf, int scount, rt_handle = (void**) request; stype = ompi_dtype_2_dte_dtype(sdtype); rtype = ompi_dtype_2_dte_dtype(rdtype); - if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))){ + if (OPAL_UNLIKELY((HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype) + || HCOL_DTE_IS_COMPLEX(stype) || HCOL_DTE_IS_COMPLEX(rtype))) + && mca_coll_hcoll_component.hcoll_datatype_fallback){ /*If we are here then datatype is not simple predefined datatype */ /*In future we need to add more complex mapping to the dte_data_representation_t */ /* Now use fallback */