|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* (C) 2001 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include "mpiimpl.h"
|
|
Packit Service |
c5cf8c |
#include "mpir_op_util.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
* In MPI-2.1, this operation is valid only for C integer, Fortran integer,
|
|
Packit Service |
c5cf8c |
* and byte types (5.9.2 Predefined reduce operations)
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
#ifndef MPIR_LBAND
|
|
Packit Service |
c5cf8c |
#define MPIR_LBAND(a,b) ((a)&(b))
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPIR_BAND
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
void MPIR_BAND(void *invec, void *inoutvec, int *Len, MPI_Datatype * type)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int i, len = *Len;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
switch (*type) {
|
|
Packit Service |
c5cf8c |
#undef MPIR_OP_TYPE_MACRO
|
|
Packit Service |
c5cf8c |
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LBAND)
|
|
Packit Service |
c5cf8c |
/* no semicolons by necessity */
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(C_INTEGER)
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(BYTE)
|
|
Packit Service |
c5cf8c |
/* extra types that are not required to be supported by the MPI Standard */
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(C_INTEGER_EXTRA)
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER_EXTRA)
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(BYTE_EXTRA)
|
|
Packit Service |
c5cf8c |
#undef MPIR_OP_TYPE_MACRO
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
default:{
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPIR_Per_thread_t *per_thread = NULL;
|
|
Packit Service |
c5cf8c |
int err = 0;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPID_THREADPRIV_KEY_GET_ADDR(MPIR_ThreadInfo.isThreaded, MPIR_Per_thread_key,
|
|
Packit Service |
c5cf8c |
MPIR_Per_thread, per_thread, &err;;
|
|
Packit Service |
c5cf8c |
MPIR_Assert(err == 0);
|
|
Packit Service |
c5cf8c |
per_thread->op_errno =
|
|
Packit Service |
c5cf8c |
MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
|
|
Packit Service |
c5cf8c |
MPI_ERR_OP, "**opundefined", "**opundefined %s",
|
|
Packit Service |
c5cf8c |
"MPI_BAND");
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPIR_BAND_check_dtype
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
int MPIR_BAND_check_dtype(MPI_Datatype type)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
switch (type) {
|
|
Packit Service |
c5cf8c |
#undef MPIR_OP_TYPE_MACRO
|
|
Packit Service |
c5cf8c |
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) case (mpi_type_):
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(C_INTEGER)
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(BYTE)
|
|
Packit Service |
c5cf8c |
/* extra types that are not required to be supported by the MPI Standard */
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(C_INTEGER_EXTRA)
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER_EXTRA)
|
|
Packit Service |
c5cf8c |
MPIR_OP_TYPE_GROUP(BYTE_EXTRA)
|
|
Packit Service |
c5cf8c |
#undef MPIR_OP_TYPE_MACRO
|
|
Packit Service |
c5cf8c |
return MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
default:
|
|
Packit Service |
c5cf8c |
return MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__,
|
|
Packit Service |
c5cf8c |
MPI_ERR_OP, "**opundefined", "**opundefined %s",
|
|
Packit Service |
c5cf8c |
"MPI_BAND");
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|