1 <!-- ##### SECTION ./tmpl/ErrLog.sgml:Long_Description ##### -->
7 <!-- ##### SECTION ./tmpl/ErrLog.sgml:See_Also ##### -->
13 <!-- ##### SECTION ./tmpl/ErrLog.sgml:Short_Description ##### -->
17 <!-- ##### SECTION ./tmpl/ErrLog.sgml:Title ##### -->
21 <!-- ##### SECTION ./tmpl/config.sgml:Long_Description ##### -->
27 <!-- ##### SECTION ./tmpl/config.sgml:See_Also ##### -->
33 <!-- ##### SECTION ./tmpl/config.sgml:Short_Description ##### -->
37 <!-- ##### SECTION ./tmpl/config.sgml:Title ##### -->
41 <!-- ##### SECTION ./tmpl/dico.sgml:Long_Description ##### -->
47 <!-- ##### SECTION ./tmpl/dico.sgml:See_Also ##### -->
53 <!-- ##### SECTION ./tmpl/dico.sgml:Short_Description ##### -->
57 <!-- ##### SECTION ./tmpl/dico.sgml:Title ##### -->
61 <!-- ##### SECTION ./tmpl/dynar.sgml:Long_Description ##### -->
63 This module provide the quite usual dynamic array facility.
67 <!-- ##### SECTION ./tmpl/dynar.sgml:See_Also ##### -->
73 <!-- ##### SECTION ./tmpl/dynar.sgml:Short_Description ##### -->
77 <!-- ##### SECTION ./tmpl/dynar.sgml:Title ##### -->
81 <!-- ##### SECTION ./tmpl/gras-overview.sgml:Long_Description ##### -->
82 <para>This document introduce the GRAS library (<emphasis>Grid Reality
83 And Simulation</emphasis>, or according to my english dictionary,
84 <emphasis>Generally Recognized As Safe</emphasis> ;).</para>
87 <title>Overview</title>
88 <para>The purpose of the GRAS is to allow the developpement of
89 distributed programs which will work with as few as possible
90 modification both on the SimGrid simulator (SG), and in the Real Life
93 <para>Here are the problems when you want to do so:
96 <para>Communication in SG is done by passing tasks, while in
97 RL, you have to deal with sockets (or any wrapper to it).</para>
99 <listitem><para>In RL, each process should provide a main()
100 function, and it's obviously not the case in SG.</para>
106 <title>Application class target</title>
107 <para>If you want to run your code both in RL and in SG, you won't be
108 able to use the full set of features offered by any of those two
109 worlds. GRAS tries to provide a suffisent set of features to develop
110 your application, and implement them in both worlds.</para>
112 <para>GRAS uses the paradigm of <emphasis>event-driven
113 programming</emphasis>, which is an extension to the message-passing
114 one. Any process of a typical event-driven application declares
115 callback to incoming events, which can be messages from other
116 processes, timers or others.</para>
118 <para>All messages have an header, specifying its type, and attached
119 data, represented as one or several C structures. In order to send
120 the data over the network in RL, a type-description mecanism is
121 provided, and the RL version of GRAS implements CDR
122 functionnalities. That is to say that the data are sent in the native
123 format of the sender host, and converted on the destination host only
126 <para>In order to not reimplement the wheel, GRAS use existing code,
127 and adapt them to make them work together. The SG version naturally
128 use the SimGrid toolkit, while the RL version is based over the
129 communication library used in NWS (note that this library was somehow
130 modified, since the previous version use XDR, ie both the sender and
131 the receiver convert the data from/to a so called network
132 format). That's why some basic knowledge about how NWS work is
133 supposed in this document. But don't worry, you only have to know the
134 basics about NWS, the internals needed to understand the document
135 will be presented when needed.</para>
139 <!-- ##### SECTION ./tmpl/gras-overview.sgml:See_Also ##### -->
145 <!-- ##### SECTION ./tmpl/gras-overview.sgml:Short_Description ##### -->
146 Overview of the GRAS library
149 <!-- ##### SECTION ./tmpl/gras-overview.sgml:Title ##### -->
153 <!-- ##### SECTION ./tmpl/gras.sgml:Long_Description ##### -->
159 <!-- ##### SECTION ./tmpl/gras.sgml:See_Also ##### -->
165 <!-- ##### SECTION ./tmpl/gras.sgml:Short_Description ##### -->
169 <!-- ##### SECTION ./tmpl/gras.sgml:Title ##### -->
173 <!-- ##### SECTION ./tmpl/nws_comm.sgml:Long_Description ##### -->
179 <!-- ##### SECTION ./tmpl/nws_comm.sgml:See_Also ##### -->
185 <!-- ##### SECTION ./tmpl/nws_comm.sgml:Short_Description ##### -->
189 <!-- ##### SECTION ./tmpl/nws_comm.sgml:Title ##### -->
193 <!-- ##### MACRO BEGIN_DECL ##### -->
199 <!-- ##### MACRO CCRITICAL0 ##### -->
207 <!-- ##### MACRO CCRITICAL1 ##### -->
216 <!-- ##### MACRO CCRITICAL2 ##### -->
226 <!-- ##### MACRO CCRITICAL3 ##### -->
237 <!-- ##### MACRO CCRITICAL4 ##### -->
249 <!-- ##### MACRO CCRITICAL5 ##### -->
262 <!-- ##### MACRO CDEBUG0 ##### -->
270 <!-- ##### MACRO CDEBUG1 ##### -->
279 <!-- ##### MACRO CDEBUG2 ##### -->
289 <!-- ##### MACRO CDEBUG3 ##### -->
300 <!-- ##### MACRO CDEBUG4 ##### -->
312 <!-- ##### MACRO CDEBUG5 ##### -->
325 <!-- ##### MACRO CERROR0 ##### -->
333 <!-- ##### MACRO CERROR1 ##### -->
342 <!-- ##### MACRO CERROR2 ##### -->
352 <!-- ##### MACRO CERROR3 ##### -->
363 <!-- ##### MACRO CERROR4 ##### -->
375 <!-- ##### MACRO CERROR5 ##### -->
388 <!-- ##### MACRO CINFO0 ##### -->
396 <!-- ##### MACRO CINFO1 ##### -->
405 <!-- ##### MACRO CINFO2 ##### -->
415 <!-- ##### MACRO CINFO3 ##### -->
426 <!-- ##### MACRO CINFO4 ##### -->
438 <!-- ##### MACRO CINFO5 ##### -->
451 <!-- ##### MACRO CLOG0 ##### -->
460 <!-- ##### MACRO CLOG1 ##### -->
470 <!-- ##### MACRO CLOG2 ##### -->
481 <!-- ##### MACRO CLOG3 ##### -->
493 <!-- ##### MACRO CLOG4 ##### -->
506 <!-- ##### MACRO CLOG5 ##### -->
520 <!-- ##### MACRO CLOG6 ##### -->
535 <!-- ##### MACRO CRITICAL0 ##### -->
542 <!-- ##### MACRO CRITICAL1 ##### -->
550 <!-- ##### MACRO CRITICAL2 ##### -->
559 <!-- ##### MACRO CRITICAL3 ##### -->
569 <!-- ##### MACRO CRITICAL4 ##### -->
580 <!-- ##### MACRO CRITICAL5 ##### -->
592 <!-- ##### FUNCTION CallAddr ##### -->
603 <!-- ##### FUNCTION CreateLocalChild ##### -->
613 <!-- ##### FUNCTION DROP_SOCKET ##### -->
621 <!-- ##### MACRO END_DECL ##### -->
627 <!-- ##### MACRO EODD ##### -->
633 <!-- ##### FUNCTION EstablishAnEar ##### -->
644 <!-- ##### MACRO GRAS_LOG_MAYDAY ##### -->
650 <!-- ##### MACRO GRAS_LOG_ROOT_CAT ##### -->
656 <!-- ##### MACRO HAVE_DLFCN_H ##### -->
662 <!-- ##### MACRO HAVE_INTTYPES_H ##### -->
668 <!-- ##### MACRO HAVE_LIBPTHREAD ##### -->
674 <!-- ##### MACRO HAVE_MEMORY_H ##### -->
680 <!-- ##### MACRO HAVE_STDINT_H ##### -->
686 <!-- ##### MACRO HAVE_STDLIB_H ##### -->
692 <!-- ##### MACRO HAVE_STRINGS_H ##### -->
698 <!-- ##### MACRO HAVE_STRING_H ##### -->
704 <!-- ##### MACRO HAVE_SYS_STAT_H ##### -->
710 <!-- ##### MACRO HAVE_SYS_TYPES_H ##### -->
716 <!-- ##### MACRO HAVE_UNISTD_H ##### -->
722 <!-- ##### TYPEDEF IPAddress ##### -->
728 <!-- ##### FUNCTION IPAddressImage ##### -->
736 <!-- ##### FUNCTION IPAddressImage_r ##### -->
744 <!-- ##### FUNCTION IPAddressMachine ##### -->
752 <!-- ##### FUNCTION IPAddressMachine_r ##### -->
760 <!-- ##### MACRO IPAddressValue ##### -->
768 <!-- ##### FUNCTION IPAddressValues ##### -->
778 <!-- ##### FUNCTION IncomingRequest ##### -->
788 <!-- ##### FUNCTION IsOkay ##### -->
796 <!-- ##### FUNCTION IsPipe ##### -->
804 <!-- ##### MACRO IsValidIP ##### -->
811 <!-- ##### MACRO LOG6 ##### -->
825 <!-- ##### FUNCTION MyMachineName ##### -->
832 <!-- ##### MACRO NO_SOCKET ##### -->
838 <!-- ##### FUNCTION NotifyOnDisconnection ##### -->
845 <!-- ##### FUNCTION OpenClientSocket ##### -->
855 <!-- ##### FUNCTION OpenServerSocket ##### -->
866 <!-- ##### MACRO PACKAGE ##### -->
872 <!-- ##### MACRO PACKAGE_BUGREPORT ##### -->
878 <!-- ##### MACRO PACKAGE_NAME ##### -->
884 <!-- ##### MACRO PACKAGE_STRING ##### -->
890 <!-- ##### MACRO PACKAGE_TARNAME ##### -->
896 <!-- ##### MACRO PACKAGE_VERSION ##### -->
902 <!-- ##### FUNCTION PassSocket ##### -->
911 <!-- ##### FUNCTION Peer ##### -->
919 <!-- ##### FUNCTION PeerName ##### -->
927 <!-- ##### FUNCTION PeerName_r ##### -->
935 <!-- ##### MACRO STDC_HEADERS ##### -->
941 <!-- ##### TYPEDEF Socket ##### -->
947 <!-- ##### FUNCTION SocketFailure ##### -->
954 <!-- ##### USER_FUNCTION SocketFunction ##### -->
961 <!-- ##### FUNCTION SocketInUse ##### -->
969 <!-- ##### FUNCTION SocketIsAvailable ##### -->
977 <!-- ##### MACRO VERSION ##### -->
983 <!-- ##### USER_FUNCTION grasCallbackFunction ##### -->
992 <!-- ##### FUNCTION grasCloseSocket ##### -->
1000 <!-- ##### FUNCTION grasDataDescCmp ##### -->
1012 <!-- ##### FUNCTION grasDataDescCount ##### -->
1020 <!-- ##### FUNCTION grasDataRecv ##### -->
1028 @description_length:
1032 <!-- ##### FUNCTION grasDataSend ##### -->
1040 @description_length:
1044 <!-- ##### FUNCTION grasDataSize ##### -->
1053 <!-- ##### ENUM grasError_t ##### -->
1068 <!-- ##### FUNCTION grasLock ##### -->
1075 <!-- ##### TYPEDEF grasMessageType_t ##### -->
1081 <!-- ##### FUNCTION grasMsgDiscard ##### -->
1089 <!-- ##### FUNCTION grasMsgEntryGet ##### -->
1097 <!-- ##### TYPEDEF grasMsgEntry_t ##### -->
1103 <!-- ##### FUNCTION grasMsgFree ##### -->
1110 <!-- ##### FUNCTION grasMsgHandle ##### -->
1117 <!-- ##### FUNCTION grasMsgHeaderNew ##### -->
1127 <!-- ##### FUNCTION grasMsgNew ##### -->
1138 <!-- ##### FUNCTION grasMsgRegister ##### -->
1149 <!-- ##### FUNCTION grasMsgSend ##### -->
1160 <!-- ##### FUNCTION grasMsgWait ##### -->
1172 <!-- ##### FUNCTION grasMyMachineName ##### -->
1179 <!-- ##### FUNCTION grasOpenClientSocket ##### -->
1189 <!-- ##### FUNCTION grasOpenServerSocket ##### -->
1199 <!-- ##### MACRO grasPROTOCOL ##### -->
1205 <!-- ##### FUNCTION grasPeerGetAddress ##### -->
1213 <!-- ##### FUNCTION grasPeerGetName ##### -->
1221 <!-- ##### FUNCTION grasRecvData ##### -->
1231 <!-- ##### FUNCTION grasRegisterCallback ##### -->
1240 <!-- ##### FUNCTION grasSendData ##### -->
1250 <!-- ##### FUNCTION grasUnlock ##### -->
1257 <!-- ##### FUNCTION grasUserdataGet ##### -->
1263 <!-- ##### MACRO grasUserdataNew ##### -->
1270 <!-- ##### FUNCTION grasUserdataSet ##### -->
1277 <!-- ##### FUNCTION gras_dynar_first ##### -->
1286 <!-- ##### FUNCTION gras_dynar_next ##### -->
1296 <!-- ##### FUNCTION gras_log_parent_set ##### -->
1304 <!-- ##### FUNCTION gras_log_threshold_set ##### -->