"Fossies" - the Fresh Open Source Software Archive

Member "openmpi-4.0.4/ompi/contrib/libompitrace/accumulate.c" (10 Jun 2020, 2342 Bytes) of package /linux/misc/openmpi-4.0.4.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "accumulate.c" see the Fossies "Dox" file reference documentation.

    1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
    2 /*
    3  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
    4  *                         University Research and Technology
    5  *                         Corporation.  All rights reserved.
    6  * Copyright (c) 2004-2005 The University of Tennessee and The University
    7  *                         of Tennessee Research Foundation.  All rights
    8  *                         reserved.
    9  * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
   10  *                         University of Stuttgart.  All rights reserved.
   11  * Copyright (c) 2004-2005 The Regents of the University of California.
   12  *                         All rights reserved.
   13  * Copyright (c) 2009      Sun Microsystmes, Inc.  All rights reserved.
   14  * Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
   15  * Copyright (c) 2013      Los Alamos National Security, LLC.  All rights
   16  *                         reserved.
   17  * $COPYRIGHT$
   18  *
   19  * Additional copyrights may follow
   20  *
   21  * $HEADER$
   22  */
   23 #include "ompi_config.h"
   24 
   25 #include <stdio.h>
   26 
   27 #include "opal_stdint.h"
   28 #include "ompi/op/op.h"
   29 #include "ompi/mpi/c/bindings.h"
   30 
   31 int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
   32                    int target_rank, MPI_Aint target_disp, int target_count,
   33                    MPI_Datatype target_datatype, MPI_Op op, MPI_Win win)
   34 {
   35 
   36     char typename[MPI_MAX_OBJECT_NAME], target_dt[MPI_MAX_OBJECT_NAME];
   37     char winname[MPI_MAX_OBJECT_NAME];
   38     int len;
   39     int rank;
   40 
   41     PMPI_Comm_rank(MPI_COMM_WORLD, &rank);
   42     PMPI_Type_get_name(origin_datatype, typename, &len);
   43     PMPI_Type_get_name(target_datatype, target_dt, &len);
   44     PMPI_Win_get_name(win, winname, &len);
   45 
   46     fprintf(stderr, "MPI_ACCUMULATE[%d]: origin_addr %0" PRIxPTR " origin_count %d origin_datatype %s\n"
   47             "\ttarget_rank %d target_disp %" PRIdPTR " target_count %d target_datatype %s op %s win %s\n",
   48             rank, (uintptr_t)origin_addr, origin_count, typename, target_rank, (intptr_t) target_disp,
   49             target_count, target_dt, op->o_name, winname);
   50     fflush(stderr);
   51 
   52     return PMPI_Accumulate(origin_addr, origin_count, origin_datatype,
   53                            target_rank, target_disp, target_count,
   54                            target_datatype, op, win);
   55 }