Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added round trip time contraint to the SDP program, this parameter
[simgrid.git] / src / gras / DataDesc / datadesc_private.h
index 00898c2..0e79380 100644 (file)
 
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
-#include "xbt/error.h"
 #include "xbt/dynar.h"
 #include "xbt/dict.h"
 #include "xbt/set.h"
 
-#include "gras_config.h" /* GRAS_THISARCH */
+#include "portable.h" /* GRAS_THISARCH */
 
 #include "gras/transport.h"  /* socket handling */
 
 #include "gras/DataDesc/datadesc_interface.h" /* semi-public API */
 
 /**
- * aligned:
+ * ddt_aligned:
  * 
  * Align the data v on the boundary a.
  */
-#define aligned(v, a) (((v) + (a - 1)) & ~(a - 1))
+#define ddt_aligned(v, a) (((v) + (a - 1)) & ~(a - 1))
 
 /*@null@*/extern xbt_set_t gras_datadesc_set_local;
 void gras_ddt_freev(void *ddt);
@@ -43,7 +42,7 @@ void gras_ddt_freev(void *ddt);
  * Descriptions of all known architectures *
  *******************************************/
 
-#define gras_arch_count 9
+#define gras_arch_count 11
 typedef enum {
   gras_ddt_scalar_char      = 0,
   gras_ddt_scalar_short     = 1,
@@ -63,9 +62,7 @@ typedef struct {
 
   int endian;
 
-  int sizeofs[9]; /* char,short,int,long,long_long,
-                  pdata,pfunc,
-                  float,double */
+  int sizeofs[9]; /* char,short,int,long,long_long,pdata,pfunc,float,double */
   int boundaries[9]; /* idem */
 } gras_arch_desc_t;
 
@@ -200,13 +197,6 @@ union u_gras_datadesc_category {
         gras_dd_cat_array_t    array_data;
 };
 
-/* flags about the datadesc */
-enum {
-   gras_datadesc_flag_cycle = 1, /* true if the datatype may contain cycle */
-   gras_datadesc_flag_sentinel = 1024
-} gras_datadesc_flag_t;
-
-
 /****************************************/
 /* The holy grail: type descriptor type */
 /****************************************/
@@ -233,9 +223,11 @@ typedef struct s_gras_datadesc_type {
   gras_datadesc_type_cb_void_t         send;
   gras_datadesc_type_cb_void_t         recv;
    
-  int                                  flags; /* possible flags are in gras_datadesc_flag_t */
+  /* flags */
+  int                                  cycle :1;
    
-  char                                 extra[SIZEOF_MAX]; /* random value for users (like default value or whatever) */
+  /* random value for users (like default value or whatever) */
+  char                                 extra[SIZEOF_MAX]; 
 
 } s_gras_datadesc_type_t;
 
@@ -244,7 +236,7 @@ typedef struct s_gras_datadesc_type {
  ***************************/
 void gras_datadesc_free(gras_datadesc_type_t *type);
 
-gras_datadesc_type_t 
+  gras_datadesc_type_t
   gras_datadesc_scalar(const char                       *name,
                       gras_ddt_scalar_type_t           type,
                       enum e_gras_dd_scalar_encoding   encoding);
@@ -254,14 +246,20 @@ gras_datadesc_type_t
  ****************************************************/
 gras_cbps_t gras_cbps_new(void);
 void gras_cbps_free(gras_cbps_t *state);
+void gras_cbps_reset(gras_cbps_t state);
 
 /***************
  * Convertions *
  ***************/
-xbt_error_t
+void
 gras_dd_convert_elm(gras_datadesc_type_t type, int count,
                    int r_arch, 
                    void *src, void *dst);
 
+/********************************************************************
+ * Dictionnary containing the constant values for the parsing macro *
+ ********************************************************************/
+extern xbt_dict_t gras_dd_constants; /* lives in ddt_parse.c of course */
+
 #endif /* GRAS_DATADESC_PRIVATE_H */