-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemt.h
More file actions
108 lines (80 loc) · 2.35 KB
/
Copy pathemt.h
File metadata and controls
108 lines (80 loc) · 2.35 KB
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
#pragma once
#ifndef _EMT_H
#define _EMT_H
#define CalcNum 30
#define EMT_COMM_NUM 24
#define PRINT_DETAIL 0
#define _ADDTIMEBUFF
enum SIMUTYPE_ALL
{
// 1~100�������
SIMUTYPE_STCTRL=1, // ��������
SIMUTYPE_STSUB, // ��������
SIMUTYPE_STUD, // ����UD�
SIMUTYPE_STMAT, // ����Matlab�
SIMUTYPE_STPHY, // ���������ӿ�
// 101~200Ϊ��Ž���
SIMUTYPE_EMTSUB=101, // �������
SIMUTYPE_EMTUD, // ���UD�
SIMUTYPE_EMTMAT, // ���Matlab�
SIMUTYPE_EMTPHY, // ��������ӿ�
// 201����ΪIO����
SIMUTYPE_STIO=201, // ����IO����
SIMUTYPE_EMTIO, // ���IO����
SIMUTYPE_GUI=301
};
// MPIͨ������Ϣ
struct SPROCINFO {
MPI_Comm CommCAL;
MPI_Comm CommST;
MPI_Comm CommEMT;
MPI_Comm CommEMTCAL;
int NumProc;
int NumProcCAL;
int NumProcST;
int NumProcEMT;
int NumProcEMTCAL;
int NumProcEMTPhy;
int NumProcEMTIO;
int Id; // �����������н����е�ID
int CALId; // ��������CommCAL���е�ID
int EMTId; // ��������CommEMT���е�ID
int EMTCALId; // ��������CommEMTCAL���е�ID
int* EMTPhyId; // �����̶�Ӧ��EMTPhy����ID
int EMTIOId; // �����̶�Ӧ��EMTIO����ID
int SimType;
} ProcInfo;
//#define SHM_EMTIO
#ifdef SHM_EMTIO
#define SHM_READ_COMPLETE 0x5A5A5A5A
#define SHM_WRITE_COMPLETE 0xA5A5A5A5
#define SHM_SIZE_PER_TASK 4096
#define SHM_BLOCK_SIZE 256
#define SHM_BLOCK_NUM (SHM_SIZE_PER_TASK/SHM_BLOCK_SIZE)
struct shm_blk
{
unsigned int sem;
double data[EMT_COMM_NUM];
};
struct shm_per_task
{
int shm_size; /* shm size used by shmget */
void *mem; /* address of shm */
int blk_num; /* shm_size is divided into blk_num blocks */
int blk_size; /* size of each block */
int prod_ind; /* block index for producer task */
int cons_ind; /* block index for consumer task */
};
#endif
extern struct sockaddr_in;
extern struct hostent;
struct sockaddr_in serv_addr;
struct hostent *server;
int sockfd;
enum GSTATUS
{
ginit=0,
gstart=1,
gstop=2
};
#endif