File: mimic_mpi.c

package info (click to toggle)
openmx 3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 134,876 kB
  • sloc: ansic: 152,771; python: 876; makefile: 576; xml: 63; perl: 18; sh: 4
file content (133 lines) | stat: -rw-r--r-- 2,521 bytes parent folder | download | duplicates (2)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef nompi
#include "mimic_mpi.h"

int MPI_Init(int *argc, char **argv[])
{}

int MPI_Comm_size(MPI_Comm comm, int *numprocs)
{
  *numprocs = 1; 
}

int MPI_Comm_rank(MPI_Comm comm, int *myid)
{
  *myid = 0; 
}


int MPI_Isend( void *buf, int count, MPI_Datatype datatype, int dest, int tag,
	       MPI_Comm comm, MPI_Request *request )
{}

int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
              MPI_Comm comm, MPI_Request *request)
{}

int MPI_Waitall(int aaa, MPI_Request *request, MPI_Status *status)
{}


int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm)
{}


int MPI_Recv( void *buf, int count, MPI_Datatype datatype, int source, 
	      int tag, MPI_Comm comm, MPI_Status *status )
{}

int MPI_Wait(MPI_Request *request, MPI_Status *stat)
{}

int MPI_Finalize()
{}

int MPI_Abort(MPI_Comm comm, int count)
{}

int MPI_Bcast ( void *buffer, int count, MPI_Datatype datatype, int root, 
		MPI_Comm comm )
{}

int MPI_Reduce ( void *sendbuf, void *recvbuf, int count, 
		 MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm )
{

  static int i;
  static int *is,*ir;
  static long int *lis,*lir;
  static double *ds,*dr;

  if (datatype==6){ /* MPI_INT */
    is = sendbuf;
    ir = recvbuf;
    for (i=0; i<count; i++) *ir++ = *is++;
  }

  else if (datatype==8){ /* MPI_LONG */
    lis = sendbuf;
    lir = recvbuf;
    for (i=0; i<count; i++) *lir++ = *lis++;
  }

  else if (datatype==11){ /* MPI_DOUBLE */
    ds = sendbuf;
    dr = recvbuf;
    for (i=0; i<count; i++) *dr++ = *ds++;
  }

}

int MPI_Allreduce ( void *sendbuf, void *recvbuf, int count,
		    MPI_Datatype datatype, MPI_Op op, MPI_Comm comm )
{

  static int i;
  static int *is,*ir;
  static long int *lis,*lir;
  static double *ds,*dr;

  if (datatype==6){
    is = sendbuf;
    ir = recvbuf;
    for (i=0; i<count; i++) *ir++ = *is++;
  }

  else if (datatype==8){
    lis = sendbuf;
    lir = recvbuf;
    for (i=0; i<count; i++) *lir++ = *lis++;
  }

  else if (datatype==11){
    ds = sendbuf;
    dr = recvbuf;
    for (i=0; i<count; i++) *dr++ = *ds++;
  }

}

int MPI_Barrier ( MPI_Comm comm )
{}


int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *comm1)
{}

int MPI_Group_incl(MPI_Group group, int i1, int *j1, MPI_Group *group2)
{}

int MPI_Comm_group(MPI_Comm comm, MPI_Group *group)
{}

int MPI_Comm_free(MPI_Comm *comm)
{}

int MPI_Group_free(MPI_Comm *comm)
{}

#endif