2004-08-21 00:49:07 +00:00
|
|
|
/*
|
2004-11-22 01:38:40 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 20:09:25 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-08-21 00:49:07 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
2005-09-06 21:41:55 +00:00
|
|
|
/** @file */
|
2004-08-21 00:49:07 +00:00
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
2005-08-12 21:42:07 +00:00
|
|
|
#include "ompi/include/constants.h"
|
2004-08-21 00:49:07 +00:00
|
|
|
#include "coll_sm.h"
|
|
|
|
|
2005-01-30 01:42:57 +00:00
|
|
|
|
2005-09-06 21:41:55 +00:00
|
|
|
/**
|
|
|
|
* Shared memory allreduce.
|
2005-01-30 01:42:57 +00:00
|
|
|
*
|
2005-09-06 21:41:55 +00:00
|
|
|
* For the moment, all we're doing is a reduce to root==0 and then a
|
|
|
|
* broadcast. It is possible that we'll do something better someday.
|
2005-01-30 01:42:57 +00:00
|
|
|
*/
|
|
|
|
int mca_coll_sm_allreduce_intra(void *sbuf, void *rbuf, int count,
|
|
|
|
struct ompi_datatype_t *dtype,
|
|
|
|
struct ompi_op_t *op,
|
|
|
|
struct ompi_communicator_t *comm)
|
|
|
|
{
|
2005-09-06 21:41:55 +00:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = mca_coll_sm_reduce_intra(sbuf, rbuf, count, dtype, op, 0, comm);
|
|
|
|
return (ret == OMPI_SUCCESS) ?
|
|
|
|
mca_coll_sm_bcast_intra(rbuf, count, dtype, 0, comm) : ret;
|
2005-01-30 01:42:57 +00:00
|
|
|
}
|