Constants and types of Grapnel API

Constants and types defined in grptyps.h

#define TRUE        1
#define True        1 
#define true        1
#define FALSE       0
#define False       0
#define false       0
General definitions.
struct TProcessInfo
{
  char *Name;
  int  tid;
  int  Info;
  char *cpu;
  struct TProcessInfo *next;
};
This kind of structure is used in server process to store information about processes. Name points to the name of the process, tid holds the identification number of it, and Info is TRUE if process has been started successfully. cpu holds the name of the host where the process must be started on, or it can be NULL if host is not defined.
struct Tchannel
{
  int  MsgTag;
  int  Type;
  int  SID;
  char *ToName;
  int  tid;
  int  ToSID;
};
This structure holds information about a channel, it is used in the processes to define an array of channels. MsgTag identifies the channel. Type and SID are type and identification number of the port which connects the process and the channel. ToName and tid is the name and process id of the process which is connected by the channel and ToSID is the ID number of the port which connects the channel and the other process.
#define MagicNothing	0x00
#define MagicTypes	0x01
#define MagicBlocked	0x80
These constants can be used to specify how many additional, administrational information will be sent with the message through a channel between two processes.
MagicNothing
No additional information will be sent with the message.
MagicTypes
An integer will be included into the message prior to every data which specifies the type of the following data.
MagicBlocked
Communication is blocked. Receiver must send back a reply to the sender who must wait for it after it has sent the message to the receiver.

Constants and types defined in grpdef.h

#define OK          FALSE
#define TIMEOUT     TRUE
Definitions for common usage.
#define STR_LEN     1024
Maximum long of the expanded format string in grp_printf() function.
#define SEND_MODE   PvmDataDefault
Data sending mode. This is a target specific constant.
#define GRP_PcDefault 0
#define GRP_PcDebug   PvmTaskDebug
Options of process creation. GRP_PcDefault is used by default to create processes. If the server process is started with the -d flag, every processes are created with the GRP_PcDebug option.
#define GRP_PRINT   1
#define GRP_EXIT    2
#define GRP_CHINIT  3
#define GRP_ACK     4
#define GRP_DEBUG   5
#define GRP_FATAL   6
#define GRP_SYNC    7
#define GRP_SCANF   8
#define GRP_MCHINIT 9
#define GRP_SRVID   10
#define GRP_GETPINF 11
#define GRP_NOTIFY  12
Message tags for internal use. These tags identify internal messages sent by different functions between processes and server process.
#define TYPE_MASK   7
#define BYTE        0
#define DOUBLE      1
#define FLOAT       2
#define INT         3
#define LONG        4
#define STR         5
#define UNKNOWN     6

#define COMM_MASK   8
#define C_SYNC      0
#define C_NOSYNC    8
Supported data and communication types in channel communication.
/* Channels are identified by pvm message tags. */
#define GRP_MCAST   50
#define GRP_CHAN    100
#define CHAN_ACK    0x10000
Channels are identified by message tags. The 16th bit of the message tag is used to send syncronisation messages. Therefore the number of available channels is limited to 2^16. GRP_MCAST is used for multicasting. GRP_CHAN can be used as start value of the identification for the allocated channels. CHAN_ACK is a flag which is used to acknowledge a message in synchronized communications.
#define CODE_XXX        0
#define CODE_PROCICON   514
#define CODE_SEQ        1025
#define CODE_CAI        1541
#define CODE_CAO        2053
#define CODE_CAIALT     2565
#define CODE_CONDS      3113
#define CODE_CONDE      3633
#define CODE_RES        4161
#define CODE_LOOPS      4617
#define CODE_LOOPE      5137
#define CODE_INPORT     5763
#define CODE_OUTPORT    6275
#define CODE_INOUTPORT  6787
#define CODE_GLOBAL     7297
#define CODE_LOCAL      7809
#define CODE_PARAMS     8321
#define CODE_STP        8769
#define CODE_DPS        9217
#define CODE_DUMMYS     10113
#define CODE_DUMMYE     10625
#define CODE_GRPH       10817

#define event_GRAPNEL   87
#define event_PROCNAME	88
#define event_CHANNEL   89
Code definitions for monitoring/visualisation support. CODE_XXX constants are used identify program blocks' types in the trace records. event_XXX are the event record types used to identify special GRAPNEL events in trace file.

Back to Grapnel Compiler