diff --git a/ompi/mca/bcol/bcol.h b/ompi/mca/bcol/bcol.h index bf480d5a05..c06f9eb44c 100644 --- a/ompi/mca/bcol/bcol.h +++ b/ompi/mca/bcol/bcol.h @@ -4,6 +4,8 @@ * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -355,9 +357,9 @@ struct bcol_function_args_t { /* root, for rooted operations */ int root; /* input buffer */ - void *sbuf; + const void *sbuf; void *rbuf; - void *userbuf; + const void *userbuf; struct mca_bcol_base_payload_buffer_desc_t *src_desc; struct mca_bcol_base_payload_buffer_desc_t *dst_desc; /* ml buffer size */ diff --git a/ompi/mca/coll/ml/coll_ml.h b/ompi/mca/coll/ml/coll_ml.h index e6b6f092f8..ab03c4f3e4 100644 --- a/ompi/mca/coll/ml/coll_ml.h +++ b/ompi/mca/coll/ml/coll_ml.h @@ -4,7 +4,7 @@ * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014 Research Organization for Information Science + * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -306,7 +306,7 @@ int mca_coll_ml_alltoall_nb(void *sbuf, int scount, /* allgather */ -int mca_coll_ml_allgather(void *sbuf, int scount, +int mca_coll_ml_allgather(const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, @@ -314,7 +314,7 @@ int mca_coll_ml_allgather(void *sbuf, int scount, mca_coll_base_module_t *module); /* non-blocking allgather */ -int mca_coll_ml_allgather_nb(void *sbuf, int scount, +int mca_coll_ml_allgather_nb(const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, @@ -779,37 +779,37 @@ int mca_coll_ml_ibarrier_intra(struct ompi_communicator_t *comm, mca_coll_base_module_t *module); /* Allreduce with EXTRA TOPO using - blocking */ -int mca_coll_ml_allreduce_dispatch(void *sbuf, void *rbuf, int count, +int mca_coll_ml_allreduce_dispatch(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, mca_coll_base_module_t *module); /* Allreduce with EXTRA TOPO using - Non-blocking */ -int mca_coll_ml_allreduce_dispatch_nb(void *sbuf, void *rbuf, int count, +int mca_coll_ml_allreduce_dispatch_nb(const void *sbuf, void *rbuf, int count, ompi_datatype_t *dtype, ompi_op_t *op, ompi_communicator_t *comm, ompi_request_t **req, mca_coll_base_module_t *module); /* Allreduce - blocking */ -int mca_coll_ml_allreduce(void *sbuf, void *rbuf, int count, +int mca_coll_ml_allreduce(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, mca_coll_base_module_t *module); /* Allreduce - Non-blocking */ -int mca_coll_ml_allreduce_nb(void *sbuf, void *rbuf, int count, +int mca_coll_ml_allreduce_nb(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **req, mca_coll_base_module_t *module); /* Reduce - Blocking */ -int mca_coll_ml_reduce(void *sbuf, void *rbuf, int count, +int mca_coll_ml_reduce(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, mca_coll_base_module_t *module); -int mca_coll_ml_reduce_nb(void *sbuf, void *rbuf, int count, +int mca_coll_ml_reduce_nb(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, ompi_request_t **req, diff --git a/ompi/mca/coll/ml/coll_ml_allgather.c b/ompi/mca/coll/ml/coll_ml_allgather.c index 9501112627..a1c71322cd 100644 --- a/ompi/mca/coll/ml/coll_ml_allgather.c +++ b/ompi/mca/coll/ml/coll_ml_allgather.c @@ -4,6 +4,8 @@ * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. * Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -132,7 +134,7 @@ static int mca_coll_ml_allgather_frag_progress(mca_coll_ml_collective_operation_ int ret; size_t frag_len, dt_size; - void *buf; + const void *buf; mca_bcol_base_payload_buffer_desc_t *src_buffer_desc; mca_coll_ml_collective_operation_progress_t *new_op; @@ -284,7 +286,7 @@ static int mca_coll_ml_allgather_frag_progress(mca_coll_ml_collective_operation_ } static inline __opal_attribute_always_inline__ -int mca_coll_ml_allgather_start (void *sbuf, int scount, +int mca_coll_ml_allgather_start (const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, @@ -580,7 +582,7 @@ int mca_coll_ml_allgather_start (void *sbuf, int scount, return OMPI_SUCCESS; } -int mca_coll_ml_allgather(void *sbuf, int scount, +int mca_coll_ml_allgather(const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, @@ -606,7 +608,7 @@ int mca_coll_ml_allgather(void *sbuf, int scount, return ret; } -int mca_coll_ml_allgather_nb(void *sbuf, int scount, +int mca_coll_ml_allgather_nb(const void *sbuf, int scount, struct ompi_datatype_t *sdtype, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, diff --git a/ompi/mca/coll/ml/coll_ml_allocation.c b/ompi/mca/coll/ml/coll_ml_allocation.c index e9f164c524..d040db3189 100644 --- a/ompi/mca/coll/ml/coll_ml_allocation.c +++ b/ompi/mca/coll/ml/coll_ml_allocation.c @@ -2,6 +2,8 @@ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -17,8 +19,6 @@ #include "coll_ml_inlines.h" #include "coll_ml_allocation.h" -static long memory_buffer_index; - mca_bcol_base_memory_block_desc_t *mca_coll_ml_allocate_block(struct mca_coll_ml_component_t *ml_component, mca_bcol_base_memory_block_desc_t *ml_memblock) { diff --git a/ompi/mca/coll/ml/coll_ml_allreduce.c b/ompi/mca/coll/ml/coll_ml_allreduce.c index e5ee83dbe3..85457254b8 100644 --- a/ompi/mca/coll/ml/coll_ml_allreduce.c +++ b/ompi/mca/coll/ml/coll_ml_allreduce.c @@ -4,6 +4,8 @@ * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -84,7 +86,7 @@ static int mca_coll_ml_allreduce_task_setup(mca_coll_ml_collective_operation_pro static int mca_coll_ml_allreduce_frag_progress(mca_coll_ml_collective_operation_progress_t *coll_op) { /* local variables */ - void *buf; + const void *buf; size_t dt_size; int ret, frag_len, count; @@ -239,7 +241,7 @@ static int mca_coll_ml_allreduce_frag_progress(mca_coll_ml_collective_operation_ } static inline __opal_attribute_always_inline__ -int parallel_allreduce_start(void *sbuf, void *rbuf, int count, +int parallel_allreduce_start(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, mca_coll_ml_module_t *ml_module, @@ -415,7 +417,7 @@ int parallel_allreduce_start(void *sbuf, void *rbuf, int count, return OMPI_SUCCESS; } -int mca_coll_ml_allreduce(void *sbuf, void *rbuf, int count, +int mca_coll_ml_allreduce(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, mca_coll_base_module_t *module) @@ -448,7 +450,7 @@ int mca_coll_ml_allreduce(void *sbuf, void *rbuf, int count, return OMPI_SUCCESS; } -int mca_coll_ml_allreduce_nb(void *sbuf, void *rbuf, int count, +int mca_coll_ml_allreduce_nb(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **req, @@ -478,7 +480,7 @@ int mca_coll_ml_allreduce_nb(void *sbuf, void *rbuf, int count, return OMPI_SUCCESS; } -int mca_coll_ml_allreduce_dispatch(void *sbuf, void *rbuf, int count, +int mca_coll_ml_allreduce_dispatch(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, mca_coll_base_module_t *module) { @@ -515,7 +517,7 @@ int mca_coll_ml_allreduce_dispatch(void *sbuf, void *rbuf, int count, return OMPI_SUCCESS; } -int mca_coll_ml_allreduce_dispatch_nb(void *sbuf, void *rbuf, int count, +int mca_coll_ml_allreduce_dispatch_nb(const void *sbuf, void *rbuf, int count, ompi_datatype_t *dtype, ompi_op_t *op, ompi_communicator_t *comm, ompi_request_t **req, diff --git a/ompi/mca/coll/ml/coll_ml_colls.h b/ompi/mca/coll/ml/coll_ml_colls.h index 35bb4da072..fcefa19b44 100644 --- a/ompi/mca/coll/ml/coll_ml_colls.h +++ b/ompi/mca/coll/ml/coll_ml_colls.h @@ -4,7 +4,7 @@ * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014 Research Organization for Information Science + * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -262,7 +262,7 @@ struct mca_coll_ml_collective_operation_progress_t { /* destination data address in user memory */ void *dest_user_addr; /* source data address in user memory */ - void *src_user_addr; + const void *src_user_addr; /* total message size */ size_t n_bytes_total; /* per-process total message size - relevant for operations @@ -493,7 +493,7 @@ enum { }; static inline __opal_attribute_always_inline__ - int mca_coll_ml_convertor_prepare(ompi_datatype_t *dtype, int count, void *buff, + int mca_coll_ml_convertor_prepare(ompi_datatype_t *dtype, int count, const void *buff, opal_convertor_t *convertor, int stream) { size_t bytes_packed; diff --git a/ompi/mca/coll/ml/coll_ml_copy_fns.c b/ompi/mca/coll/ml/coll_ml_copy_fns.c index fd2aa93c70..a3d41b06c0 100644 --- a/ompi/mca/coll/ml/coll_ml_copy_fns.c +++ b/ompi/mca/coll/ml/coll_ml_copy_fns.c @@ -1,6 +1,8 @@ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -54,7 +56,7 @@ int mca_coll_ml_pack_reorder_contiguous_data(mca_coll_ml_collective_operation_pr rank = topo_info->sort_list[i]; /* get the pointer to user data */ - user_buf=coll_op->full_message.src_user_addr; + user_buf=(void *)coll_op->full_message.src_user_addr; /* compute offset into the user buffer */ /* offset for data already processed */ @@ -106,7 +108,7 @@ int mca_coll_ml_pack_reorder_noncontiguous_data(mca_coll_ml_collective_operation rank = topo_info->sort_list[i]; /* get the pointer to user data */ - user_buf=coll_op->full_message.src_user_addr; + user_buf=(void *)coll_op->full_message.src_user_addr; /* compute offset into the user buffer */ /* offset for data already processed */ diff --git a/ompi/mca/coll/ml/coll_ml_inlines.h b/ompi/mca/coll/ml/coll_ml_inlines.h index ea32650899..d54b3b37aa 100644 --- a/ompi/mca/coll/ml/coll_ml_inlines.h +++ b/ompi/mca/coll/ml/coll_ml_inlines.h @@ -7,6 +7,8 @@ * reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -466,7 +468,7 @@ static inline __opal_attribute_always_inline__ mca_coll_ml_collective_operation_ mca_coll_ml_alloc_op_prog_single_frag_dag( mca_coll_ml_module_t *ml_module, mca_coll_ml_collective_operation_description_t *coll_schedule, - void *src, void *dst, size_t total_bytes, + const void *src, void *dst, size_t total_bytes, size_t offset_into_user_buffer ) { @@ -511,7 +513,7 @@ mca_coll_ml_duplicate_op_prog_single_frag_dag( new_op = mca_coll_ml_alloc_op_prog_single_frag_dag(ml_module, ml_module->coll_ml_bcast_functions[old_op->fragment_data.current_coll_op], old_op->fragment_data.message_descriptor->dest_user_addr, - old_op->fragment_data.message_descriptor->src_user_addr, + (void *)old_op->fragment_data.message_descriptor->src_user_addr, old_op->fragment_data.message_descriptor->n_bytes_total, old_op->fragment_data.message_descriptor->n_bytes_scheduled); diff --git a/ompi/mca/coll/ml/coll_ml_reduce.c b/ompi/mca/coll/ml/coll_ml_reduce.c index 5379852436..cfec0743a7 100644 --- a/ompi/mca/coll/ml/coll_ml_reduce.c +++ b/ompi/mca/coll/ml/coll_ml_reduce.c @@ -2,6 +2,8 @@ /* * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -268,7 +270,7 @@ static int mca_coll_ml_reduce_frag_progress(mca_coll_ml_collective_operation_pro } static inline __opal_attribute_always_inline__ -int parallel_reduce_start (void *sbuf, void *rbuf, int count, +int parallel_reduce_start (const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, @@ -457,7 +459,7 @@ int parallel_reduce_start (void *sbuf, void *rbuf, int count, } -int mca_coll_ml_reduce(void *sbuf, void *rbuf, int count, +int mca_coll_ml_reduce(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, mca_coll_base_module_t *module) { @@ -492,7 +494,7 @@ int mca_coll_ml_reduce(void *sbuf, void *rbuf, int count, } -int mca_coll_ml_reduce_nb(void *sbuf, void *rbuf, int count, +int mca_coll_ml_reduce_nb(const void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, ompi_request_t **req,