StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
myrinet.h
1 #ifndef MYRINET_HH
2 #define MYRINET_HH
3 
4 #include "iccp.h"
5 #include <stdio.h>
6 #include "platform.h"
7 
8 /* Myrinet functions */
9 
10 #ifdef __CINT__
11 #define unix
12 #endif
13 
14 #ifdef unix
15 typedef int INT32;
16 typedef short int INT16;
17 typedef unsigned int UINT32;
18 typedef unsigned short int UINT16;
19 #define OK 0
20 #define ERROR 1
21 #define IMPORT
22 typedef int STATUS;
23 #endif
24 
25 #if defined(unix) && defined(THREADS)
26 #include <UNIX/ThreadsMsgQueue.hh>
27 #endif
28 
29 #ifndef unix // Provide these functions to vxWorks only
30 #include <msgQLib.h>
31 int myriReadFile(char *filename, void *buffer, int size);
32 int myriWriteFile(char *filename, void *buffer, int size);
33 int myriReadFile(char *filename, void *buffer, int size, int node);
34 int myriWriteFile(char *filename, void *buffer, int size, int node);
35 #endif
36 
37 #if defined(__linux__) || defined(__APPLE__)
38 
39 // pnode should point to a UINT16 or be NULL!
40 extern void *vxFileRequestServer(void *pnode=NULL);
41 #endif
42 
43 int myriInit(pMSGQARRAY_PROTO(msgQueArray), int multinodeSupport=0);
44 
45 /*
46  * Description:
47  * Initializes myrinet gm_driver
48  * neccessary send/receive buffers for messages
49  * creates all necessary semephores
50  * spawns myriRcv task
51  *
52  * Arguments:
53  * MSG_Q_ID *msgQueArray :: msg que array for message delivery
54  * MSG_Q_ID errorQue :: optional que for invalid tasks
55  * int noNodeIDConvertion :: If 0, use DAQ id's in every call
56  * :: If 1, use normal MYRINET id's
57  *
58  * Return Values:
59  * OK, if initialized correctly, ERROR otherwise
60  */
61 
62 STATUS raw_myriMsgSend(UINT16 targetId, ic_msg *pMsg, int override_source_id);
63 STATUS myriMsgSend(UINT16 targetId, ic_msg *pMsg, int board=0);
64 
65 
66 STATUS myriMsgSend(UINT16 *targetList, ic_msg *pMsg, int board=0);
67 STATUS myriMsgSend(UINT16 targetId, ic_msg *msgList[], int board=0);
68 STATUS myriMsgSend(UINT16 *targetList, ic_msg *msgList[], int board=0);
69 
70 
71 
72 /*
73  * Description:
74  * Fills in the sourceID and transaction number fields in the payload of
75  * the iccp message buffer. Sends message via MYRINET to requested target.
76  *
77  * Arguments:
78  * UINT16 targetId: 16bit myrinet nodeID of target
79  * ic_msg *pMsg: pointer the DAQ message
80  *
81  * Return Values:
82  * OK, if sent correctly, otherwise ERROR
83  */
84 
85 
86 STATUS
87 myriMemcpy(UINT32 pTargetBuff_hi,
88  UINT32 pTargetBuff_lo,
89  UINT32 *pLocalBuff,
90  UINT32 len,
91  UINT16 targetId,
92  SEM_ID sem=NULL);
93 
94 // myriMemcpy2 is like myriMemcpy, but sends the data in
95 // a message...The max size of the message must be < 32k bytes
96 //
97 // The receiving node must have a handler that knows how to
98 // copy the received message into its own memory
99 //
100 // No chaser message is required to ensure that the message is received
101 //
102 
103 STATUS
104 myriMemcpy2(UINT32 *pLocalBuff,
105  UINT32 len,
106  UINT16 targetId,
107  SEM_ID sem=NULL);
108 
109 
110 STATUS myriAddAuxMem(void *start, unsigned long int size);
111 
112 /*
113  * Register extra memory
114  * For use with EVB's extended memory
115  *
116  */
117 
118 void setMyriLogLevel(int);
119 
120 UINT16 getDaqNodeId(char *nodename=NULL, int board=0);
121 
122 int myriStart();
123 
124 extern void *(*directMsgCallback)(void *,int,UINT16);
125 extern pTASKID myriRcvTaskId;
126 extern int myriErrorTask;
127 
128 void myriFreeMemcpy2Buff(char *buff);
129 int myriSetMemcpy2Buffs(char *start, int n, int size);
130 
131 #endif
132 
133 
Definition: iccp.h:685