1
/* $Header: /tmp/hpctools/ga/tcgmsg/ipcv4.0/sndrcvP.h,v 1.17 2002-05-14 22:12:14 d3h325 Exp $ */
4
This include file contains definitions PRIVATE to the message
5
passing routines and not for public use. These items should not
6
be directly manipulated even in the message passing routines, except
7
by the appropriate lowlevel routines.
9
Actual instances of the extern data items are declared in defglobals.h
10
which is included by cluster.c.
16
#include "msgtypesc.h"
19
/******************************
20
Defines and macro definitions
21
*****************************/
23
#define MAX_CLUSTER 128 /* Maximum no. of clusters */
24
#define MAX_SLAVE 512 /* Maximum no. of slaves per cluster */
25
#define MAX_PROCESS 8192 /* Maximum no. of processes */
27
#define TYPE_SETUP 32768 /* used for setup communication */
28
#define TYPE_CHECK 32769 /* used for checking communication */
29
#define TYPE_END 32770 /* used for propagating end message */
30
#define TYPE_NXTVAL (MSGINT | 32771) /* Used in nxtval */
31
#define TYPE_CONNECT (MSGINT | 32772) /* Used in RemoteConnect */
32
#define TYPE_BEGIN 32773 /* Used in pbegin and parallel */
33
#define TYPE_CLOCK_SYNCH 32774; /* Used to synch clocks */
35
#ifdef BIG_MESSAGE_PROTECTION
36
#define BIG_MESSAGE 41943040ul /* 40Mb max message only for safety check.
39
#define BIG_MESSAGE 2147483647ul /* 2GB */
42
/* Shared memory allocated per process .. make even multiple of
43
page size ... usually 4096 */
44
#if defined(SGI) || defined(SGITFP)
45
#define SHMEM_BUF_SIZE 262144
48
#define SHMEM_BUF_SIZE 524288
51
#define SHMEM_BUF_SIZE 524288
54
#define SHMEM_BUF_SIZE 4096
57
#define SHMEM_BUF_SIZE 16384
60
#define SHMEM_BUF_SIZE 262144
63
#define SHMEM_BUF_SIZE 65536
66
#define SHMEM_BUF_SIZE 253952
71
#define SHMEM_BUF_SIZE KSR_SHMEM_BUF_SIZE
73
#if !defined(SHMEM_BUF_SIZE)
74
#define SHMEM_BUF_SIZE 131072
77
#if defined(PARTIALSPIN) && !defined(NOSPIN)
81
#define SR_SOCK_BUF_SIZE 32768 /* Size that system buffers set to */
83
#define PACKET_SIZE SR_SOCK_BUF_SIZE /* Internal packet size over sockets */
85
#define TIMEOUT_ACCEPT 180 /* timeout for connection in secs */
89
#define DEBUG_ SR_debug /* substitute name of debug flag */
91
/*********************************************************
92
Global information and structures ... all begin with SR_
93
********************************************************/
95
extern long SR_n_clus; /* No. of clusters */
96
extern long SR_n_proc; /* No. of processes excluding dummy
99
extern long SR_clus_id; /* Logical id of current cluster */
100
extern long SR_proc_id; /* Logical id of current process */
102
extern long SR_debug; /* flag for debug output */
104
extern long SR_parallel; /* True if job started with parallel */
105
extern long SR_exit_on_error; /* flag to exit on error */
106
extern long SR_error; /* flag indicating error has been called
107
with SR_exit_on_error == FALSE */
109
extern long SR_numchild; /* no. of forked processes */
110
extern long SR_pids[MAX_SLAVE]; /* pids of forked processes */
111
extern int SR_socks[MAX_PROCESS]; /* Sockets used for each process */
112
extern int SR_socks_proc[MAX_PROCESS]; /* Process associated with a given socket */
113
extern int SR_nsock; /* No. of sockets in the list */
114
extern long SR_using_shmem; /* 1=if shmem is used for an process, 0 if all
115
processes are connected to this one by sockets */
118
/* This is used to store info from the PROCGRP file about each
119
cluster of processes */
121
struct cluster_info_struct {
122
char *user; /* user name */
123
char *hostname; /* hostname */
124
long nslave; /* no. slave on this host */
125
char *image; /* path executable image */
126
char *workdir; /* work directory */
127
long masterid; /* process no. of cluster master */
128
int swtchport; /* Switch port for alliant hippi */
131
extern struct cluster_info_struct SR_clus_info[MAX_CLUSTER];
133
typedef struct message_header_struct {
134
long nodefrom; /* originating node of message */
135
long nodeto; /* target node of message */
136
long type; /* user defined type */
137
long length; /* length of message in bytes */
138
long tag; /* No. of this message for id */
141
/* This is used to store all info about processes */
143
struct process_info_struct {
144
long clusid; /* cluster no. for this process */
145
long slaveid; /* slave no. in cluster 0,1,...,nslave */
146
long local; /* boolean flag for local/remote */
147
int sock; /* socket to remote process */
148
char *shmem; /* shared memory region */
149
long shmem_size; /* shared memory region size */
150
long shmem_id; /* shared memory region id */
151
char *buffer; /* shared memory message buffer */
152
long buflen; /* shared memory message buffer size */
153
MessageHeader *header; /* shared memory message header */
154
long semid; /* semaphore group id */
155
long sem_pend; /* semaphore no. posted when data pending */
156
long sem_read; /* semaphore no. posted when data read */
157
long sem_written; /* semaphore no. posted when data written */
158
long n_rcv; /* No. of messages received */
159
double nb_rcv; /* No. of bytes received */
160
double t_rcv; /* Time spent receiving in sec */
161
long n_snd; /* No. of messages sent */
162
double nb_snd; /* No. of bytes sent */
163
double t_snd; /* Time spent sending in sec */
164
long peeked; /* True if have peeked at socket */
165
MessageHeader head_peek; /* Header that we peeked at */
166
long *buffer_full; /* Flag indicating full buffer */
169
extern struct process_info_struct SR_proc_info[MAX_PROCESS];