File: mt_pt2pt_common.h

package info (click to toggle)
mpich 4.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 423,384 kB
  • sloc: ansic: 1,088,434; cpp: 71,364; javascript: 40,763; f90: 22,829; sh: 17,463; perl: 14,773; xml: 14,418; python: 10,265; makefile: 9,246; fortran: 8,008; java: 4,355; asm: 324; ruby: 176; lisp: 19; php: 8; sed: 4
file content (66 lines) | stat: -rw-r--r-- 1,470 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
 * Copyright (C) by Argonne National Laboratory
 *     See COPYRIGHT in top-level directory
 */

#ifndef MT_PT2PT_COMMON_H_INCLUDED
#define MT_PT2PT_COMMON_H_INCLUDED

#include "mpi.h"
#include "mpitest.h"
#include "mpithreadtest.h"

#include <stdio.h>
#include <stdlib.h>

#define NTHREADS 4

/* Set blocking send function */
#if defined(BSEND)
#define SEND_FUN MPI_Bsend
#elif defined(SSEND)
#define SEND_FUN MPI_Ssend
#elif defined(RSEND)
#define SEND_FUN MPI_Rsend
#else /* default */
#define SEND_FUN MPI_Send
#endif

/* Set nonblocking send function */
#if defined(IBSEND)
#define ISEND_FUN MPI_Ibsend
#elif defined(ISSEND)
#define ISEND_FUN MPI_Issend
#elif defined(IRSEND)
#define ISEND_FUN MPI_Irsend
#else /* default */
#define ISEND_FUN MPI_Isend
#endif

/* Large data transfer */
#if defined(HUGE_COUNT)
#define BUFF_ELEMENT_COUNT(iter, count) (count)
/* Medium data transfer */
#else
#define BUFF_ELEMENT_COUNT(iter, count) (iter)
#endif /* #if defined(HUGE_COUNT) */
#define DATA_WARN_THRESHOLD 10

#define RECORD_ERROR(expr) if (expr) errs++;    /* track an error */

#define SETVAL(i, j) (i + j)

struct thread_param {
    int id;                     /* Thread id */
    int iter;
    int count;
    MPI_Comm comm;
    int tag;
    int *buff;
    int verify;                 /* Perform data verification? */
    int result;
};

MTEST_THREAD_RETURN_TYPE run_test(void *arg);   /* common interface for mt tests */

#endif /* MT_PT2PT_COMMON_INCLUDED */