root/ompi/mpi/fortran/use-mpi-tkr/test/send_t.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. mpi_send_1di
  2. mpi_send_1di1

   1 /**
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2012 Cisco Systems, Inc.  All rights reserved.
  13  * $COPYRIGHT$
  14  *
  15  * Additional copyrights may follow
  16  *
  17  * $HEADER$
  18  *
  19  * send_t.c - tests mpi_send variants
  20  *
  21  * Actual tests do not use MPI, they just test parameters and types.
  22  */
  23 
  24 #include <stdio.h>
  25 
  26 #define MPI_COMM_WORLD 0
  27 #define MPI_COMM_SELF  1
  28 
  29 #define MPI_INTEGER   7
  30 #define MPI_INTEGER1  8
  31 
  32 
  33 void mpi_send_1di(int* a, int* count, int* datatype,
  34                   int* dest, int* tag, int* comm, int* ierr)
  35 {
  36   int i;
  37 
  38   *ierr = 0;
  39   for (i = 0; i < *count; i++) {
  40     if (a[i] != 10 - i) {
  41       printf("a[%d] = %d\n", i, a[i]);
  42       *ierr = 1;
  43     }
  44   }
  45   if (*count != 10) *ierr = 1;
  46   if (*datatype != MPI_INTEGER) *ierr = 1;
  47   if (*dest != 59) *ierr = 1;
  48   if (*tag != 999) *ierr = 1;
  49   if (*comm != MPI_COMM_WORLD) *ierr = 1;
  50 }
  51 
  52 
  53 void mpi_send_1di1(char* a, int* count, int* datatype,
  54                    int* dest, int* tag, int* comm, int* ierr)
  55 {
  56   int i;
  57 
  58   *ierr = 0;
  59   for (i = 0; i < *count; i++) {
  60     if (a[i] != i+1) {
  61       printf("a[%d] = %d\n", i, a[i]);
  62       *ierr = 1;
  63     }
  64   }
  65   if (*count != 10) *ierr = 1;
  66   if (*datatype != MPI_INTEGER1) *ierr = 1;
  67   if (*dest != 59) *ierr = 1;
  68   if (*tag != 999) *ierr = 1;
  69   if (*comm != MPI_COMM_SELF) *ierr = 1;
  70 }
  71 

/* [<][>][^][v][top][bottom][index][help] */