-SUBDIRS=include base examples
-# modules (before examples)
+SUBDIRS=.
+# amok not ported to GRAS NG yet
+AM_CFLAGS= -DNDEBUG
+
+# -DNLOG cuts absolutely all logs at compilation time.
+# -DNDEBUG cuts asserts and logs at "trace" and "debug" levels.
+
+# -g -ffast-math -funroll-loops -O3 -fno-strict-aliasing
+# Those should be added by configure when using gcc
+# fast-math is nasty when using IEEE floating point semantic
+# strict-aliasing breaks my type-punning bad habit.
+
+
+MAINTAINERCLEANFILES=Makefile.in
+INCLUDES= -I$(top_srcdir)/src/include \
+ @CFLAGS_SimGrid@
+EXTRA_DIST= \
+ gros/dict_private.h \
+ \
+ gras/gras_private.h \
+ gras/Transport/transport_interface.h \
+ gras/Virtu/virtu_interface.h \
+ gras/Virtu/virtu_rl.h \
+ gras/Virtu/virtu_sg.h \
+ gras/DataDesc/ddt_parse.yy.l gras/DataDesc/ddt_parse.yy.c
+
+#LIBRARY_VERSION= 0:0:0
+# | | |
+# +------+ | +---+
+# | | |
+# current:revision:age
+# | | |
+# | | +- Increment if interfaces have been added
+# | | Set to zero if interfaces have been removed or
+# | | changed
+# | +- Increment if source code has changed
+# | Set to zero if current is incremented
+# +- Increment if interfaces have been added, removed or changed
+
+VERSION_INFO= -release 20040722 -version-info 0:0:0
+# from `info libtool "Updating version info"`
+# and `info libtool "Release numbers"`
+#
+# A) For stable library (interface wise), you should use --version-info:
+#
+# - Begin with C:R:A = 0:0:0 (ie here, VERSION_INFO= -version-info 0:0:0)
+# - Do not update it before public release (keep numbers small)
+#
+# ----------------------------------------------------------------------+
+# + Interface | code of existing | Interface | New version info |
+# | removal/change? | interface changed? | addition? | |
+# +-----------------+--------------------+-----------+------------------+
+# | yes | must be yes ;) | | C++ : 0 : 0 |
+# | no | yes | yes | C : R++ : A++ |
+# | no | yes | no | C : R++ : A |
+# | no | no | yes | C : R : A++ |
+# | no | no | no | C : R : A |
+# +-----------------+--------------------+-----------+------------------+
+#
+# B) For rapidely changing library, you should go for the -release flag
+#
+# It modifies the library name, and you thus cannot say that a library
+# using this trick is ready for a "stable" release (say, in Debian).
+
+if HAVE_SG
+ lib_LTLIBRARIES= libgrasrl.la libgrassg.la
+else
+ lib_LTLIBRARIES= libgrasrl.la
+endif
+
+# gros/config.c
+
+COMMON_S=\
+ \
+ gros/module.c gros/core_interface.h \
+ gros/log.c gros/log_default_appender.c gros/error.c \
+ gros/dynar.c \
+ gros/dict.c gros/dict_elm.c gros/dict_cursor.c \
+ gros/set.c \
+ \
+ \
+ gras/Transport/transport.c gras/Transport/transport_private.h gras/Transport/transport_plugin_buf.c \
+ \
+ gras/DataDesc/ddt_create.c \
+ gras/DataDesc/ddt_convert.c gras/DataDesc/ddt_exchange.c \
+ gras/DataDesc/cbps.c gras/DataDesc/datadesc.c \
+ gras/DataDesc/datadesc_interface.h gras/DataDesc/datadesc_private.h \
+ gras/DataDesc/ddt_parse.c gras/DataDesc/ddt_parse.yy.c gras/DataDesc/ddt_parse.yy.h \
+ \
+ gras/Msg/msg.c gras/Msg/msg_interface.h gras/Msg/msg_private.h \
+ \
+ gras/Virtu/process.c
+
+gras/DataDesc/ddt_parse.yy.c: gras/DataDesc/ddt_parse.yy.l
+ @LEX@ -o$@ -Pgras_ddt_parse_ $^
+
+libgrasrl_la_SOURCES= $(COMMON_S) \
+ gras/Transport/rl_transport.c gras/Transport/transport_plugin_tcp.c gras/Transport/transport_plugin_file.c \
+ \
+ gras/Virtu/rl_process.c gras/Virtu/rl_time.c gras/Virtu/rl_conditional.c
+libgrasrl_la_LDFLAGS = $(VERSION_INFO)
+
+if HAVE_SG
+ libgrassg_la_SOURCES= $(COMMON_S) \
+ gras/Transport/sg_transport.c gras/Transport/transport_plugin_sg.c \
+ \
+ gras/Virtu/sg_process.c gras/Virtu/sg_time.c gras/Virtu/sg_conditional.c
+ libgrassg_la_LDFLAGS = $(VERSION_INFO)
+endif
/* This program is free software; you can redistribute it and/or modify it
under the terms of the license (GNU LGPL) which comes with this package. */
-#include "DataDesc/datadesc_private.h"
+#include "gras/DataDesc/datadesc_private.h"
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(cbps,datadesc);
typedef struct {
/* This program is free software; you can redistribute it and/or modify it
under the terms of the license (GNU LGPL) which comes with this package. */
-#include "DataDesc/datadesc_private.h"
+#include "gras/DataDesc/datadesc_private.h"
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(datadesc,GRAS);
/* FIXME: make this host-dependent using a trick such as UserData*/
#define GRAS_DATADESC_PRIVATE_H
#include "gras_private.h"
-#include "DataDesc/datadesc_interface.h"
+#include "gras/DataDesc/datadesc_interface.h"
/**
* aligned:
/* C combines the power of assembler with the portability of assembler. */
/************************************************************************/
-#include "DataDesc/datadesc_private.h"
+#include "gras/DataDesc/datadesc_private.h"
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(convert,datadesc);
/* This program is free software; you can redistribute it and/or modify it
under the terms of the license (GNU LGPL) which comes with this package. */
-#include "DataDesc/datadesc_private.h"
+#include "gras/DataDesc/datadesc_private.h"
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(ddt_create,datadesc);
/* This program is free software; you can redistribute it and/or modify it
under the terms of the license (GNU LGPL) which comes with this package. */
-#include "DataDesc/datadesc_private.h"
-#include "Transport/transport_interface.h" /* gras_trp_chunk_send/recv */
+#include "gras/DataDesc/datadesc_private.h"
+#include "gras/Transport/transport_interface.h" /* gras_trp_chunk_send/recv */
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(exchange,datadesc);
#include <ctype.h> /* isdigit */
-#include "DataDesc/datadesc_private.h"
-#include "DataDesc/ddt_parse.yy.h"
+#include "gras/DataDesc/datadesc_private.h"
+#include "gras/DataDesc/ddt_parse.yy.h"
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(ddt_parse,datadesc);
#define yyrestart gras_ddt_parse_restart
#define yytext gras_ddt_parse_text
-#line 19 "DataDesc/ddt_parse.yy.c"
+#line 19 "gras/DataDesc/ddt_parse.yy.c"
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
-#line 1 "DataDesc/ddt_parse.yy.l"
+#line 1 "gras/DataDesc/ddt_parse.yy.l"
#define INITIAL 0
/* $Id$ */
/* DataDesc/ddt_parse -- automatic parsing of data structures */
/* Copyright (C) 2003, 2004 Martin Quinson. */
/* This program is free software; you can redistribute it and/or modify it
under the terms of the license (GNU LGPL) which comes with this package. */
-#line 13 "DataDesc/ddt_parse.yy.l"
-#include"DataDesc/datadesc_private.h"
-#include"DataDesc/ddt_parse.yy.h"
+#line 13 "gras/DataDesc/ddt_parse.yy.l"
+#include "gras/DataDesc/datadesc_private.h"
+#include "gras/DataDesc/ddt_parse.yy.h"
#include <string.h>
YY_BUFFER_STATE input_buffer;
FILE *file_to_parse;
#define comment 2
#define foo 3
-#line 451 "DataDesc/ddt_parse.yy.c"
+#line 451 "gras/DataDesc/ddt_parse.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 33 "DataDesc/ddt_parse.yy.l"
+#line 33 "gras/DataDesc/ddt_parse.yy.l"
int comment_caller=0;
int annotate_caller=0;
char string_buf[GRAS_DDT_PARSE_MAX_STR_CONST];
char *string_buf_ptr = NULL;
-#line 621 "DataDesc/ddt_parse.yy.c"
+#line 621 "gras/DataDesc/ddt_parse.yy.c"
if ( yy_init )
{
case 1:
YY_RULE_SETUP
-#line 40 "DataDesc/ddt_parse.yy.l"
+#line 40 "gras/DataDesc/ddt_parse.yy.l"
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 42 "DataDesc/ddt_parse.yy.l"
+#line 42 "gras/DataDesc/ddt_parse.yy.l"
{ /****************** ANNOTATION ************************/
DEBUG0("Begin annotation");
annotate_caller = INITIAL;
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 49 "DataDesc/ddt_parse.yy.l"
+#line 49 "gras/DataDesc/ddt_parse.yy.l"
{ /* trim annotation */
DEBUG0("Begin annotation");
annotate_caller = foo;
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 57 "DataDesc/ddt_parse.yy.l"
+#line 57 "gras/DataDesc/ddt_parse.yy.l"
{
DEBUG0("End annotation");
gras_ddt_parse_char_pos+= strlen(yytext);
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 64 "DataDesc/ddt_parse.yy.l"
+#line 64 "gras/DataDesc/ddt_parse.yy.l"
{
PARSE_ERROR0("``/*g'' construct closed by a regular ``*/''");
}
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 67 "DataDesc/ddt_parse.yy.l"
+#line 67 "gras/DataDesc/ddt_parse.yy.l"
{
PARSE_ERROR0("Type annotation cannot spread over several lines");
}
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 71 "DataDesc/ddt_parse.yy.l"
+#line 71 "gras/DataDesc/ddt_parse.yy.l"
{ /* eat the rest */
gras_ddt_parse_char_pos+= strlen(yytext);
gras_ddt_parse_col_pos+= strlen(yytext);
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 77 "DataDesc/ddt_parse.yy.l"
+#line 77 "gras/DataDesc/ddt_parse.yy.l"
{ /****************** COMMENTS ************************/
// constructs like /*g [string] g*/ are not comments but size annotations
comment_caller = INITIAL;
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 83 "DataDesc/ddt_parse.yy.l"
+#line 83 "gras/DataDesc/ddt_parse.yy.l"
{
comment_caller = foo;
BEGIN(comment);
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 88 "DataDesc/ddt_parse.yy.l"
+#line 88 "gras/DataDesc/ddt_parse.yy.l"
{ /* eat anything that's not a '*' */
}
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 90 "DataDesc/ddt_parse.yy.l"
+#line 90 "gras/DataDesc/ddt_parse.yy.l"
{ /* eat up '*'s not followed by '/'s */
}
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 92 "DataDesc/ddt_parse.yy.l"
+#line 92 "gras/DataDesc/ddt_parse.yy.l"
{
++gras_ddt_parse_line_pos;
gras_ddt_parse_col_pos=0;
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 97 "DataDesc/ddt_parse.yy.l"
+#line 97 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos+= strlen(yytext);
gras_ddt_parse_col_pos+= strlen(yytext);
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 103 "DataDesc/ddt_parse.yy.l"
+#line 103 "gras/DataDesc/ddt_parse.yy.l"
{ /****************** STATEMENTS ************************/
gras_ddt_parse_char_pos += strlen(yytext);
gras_ddt_parse_col_pos += strlen(yytext);
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 109 "DataDesc/ddt_parse.yy.l"
+#line 109 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos++;
gras_ddt_parse_col_pos++;
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 115 "DataDesc/ddt_parse.yy.l"
+#line 115 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos++;
gras_ddt_parse_col_pos++;
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 121 "DataDesc/ddt_parse.yy.l"
+#line 121 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos++;
gras_ddt_parse_col_pos++;
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 127 "DataDesc/ddt_parse.yy.l"
+#line 127 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos++;
gras_ddt_parse_col_pos++;
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 133 "DataDesc/ddt_parse.yy.l"
+#line 133 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos++;
gras_ddt_parse_col_pos++;
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 139 "DataDesc/ddt_parse.yy.l"
+#line 139 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos++;
gras_ddt_parse_col_pos++;
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 145 "DataDesc/ddt_parse.yy.l"
+#line 145 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos++;
gras_ddt_parse_col_pos++;
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 151 "DataDesc/ddt_parse.yy.l"
+#line 151 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos++;
gras_ddt_parse_col_pos++;
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 157 "DataDesc/ddt_parse.yy.l"
+#line 157 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos++;
gras_ddt_parse_col_pos++;
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 163 "DataDesc/ddt_parse.yy.l"
+#line 163 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_line_pos++;
gras_ddt_parse_char_pos++;
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 169 "DataDesc/ddt_parse.yy.l"
+#line 169 "gras/DataDesc/ddt_parse.yy.l"
{
gras_ddt_parse_char_pos++;
gras_ddt_parse_col_pos++;
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 174 "DataDesc/ddt_parse.yy.l"
+#line 174 "gras/DataDesc/ddt_parse.yy.l"
ECHO;
YY_BREAK
-#line 935 "DataDesc/ddt_parse.yy.c"
+#line 935 "gras/DataDesc/ddt_parse.yy.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(annotate):
case YY_STATE_EOF(comment):
return 0;
}
#endif
-#line 174 "DataDesc/ddt_parse.yy.l"
+#line 174 "gras/DataDesc/ddt_parse.yy.l"
/* {space}+ { return(TOKEN_SPACE);} */
%option noyywrap
%{
-#include"DataDesc/datadesc_private.h"
-#include"DataDesc/ddt_parse.yy.h"
+#include "gras/DataDesc/datadesc_private.h"
+#include "gras/DataDesc/ddt_parse.yy.h"
#include <string.h>
YY_BUFFER_STATE input_buffer;
FILE *file_to_parse;
/* This program is free software; you can redistribute it and/or modify it
under the terms of the license (GNU LGPL) which comes with this package. */
-#include "Msg/msg_private.h"
-#include "DataDesc/datadesc_interface.h"
-#include "Transport/transport_interface.h" /* gras_trp_chunk_send/recv */
-#include "Virtu/virtu_interface.h"
+#include "gras/Msg/msg_private.h"
+#include "gras/DataDesc/datadesc_interface.h"
+#include "gras/Transport/transport_interface.h" /* gras_trp_chunk_send/recv */
+#include "gras/Virtu/virtu_interface.h"
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(msg,GRAS);
#define GRAS_MESSAGE_PRIVATE_H
#include "gras_private.h"
-#include "Msg/msg_interface.h"
+#include "gras/Msg/msg_interface.h"
/**
* gras_msgtype_t:
#include <sys/types.h>
#include <sys/socket.h>
-#include "Transport/transport_private.h"
+#include "gras/Transport/transport_private.h"
GRAS_LOG_EXTERNAL_CATEGORY(transport);
GRAS_LOG_DEFAULT_CATEGORY(transport);
#include <time.h> /* time() */
-#include "Transport/transport_private.h"
+#include "gras/Transport/transport_private.h"
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(transport,GRAS);
#define GRAS_TRP_PRIVATE_H
#include "gras_private.h"
-#include "Transport/transport_interface.h"
-#include "Virtu/virtu_interface.h" /* socketset_get() */
+#include "gras/Transport/transport_interface.h"
+#include "gras/Virtu/virtu_interface.h" /* socketset_get() */
/**
* s_gras_socket:
under the terms of the license (GNU LGPL) which comes with this package. */
#include "gras_private.h"
-#include "Virtu/virtu_interface.h"
-#include "Msg/msg_interface.h" /* FIXME: Get rid of this cyclic */
+#include "gras/Virtu/virtu_interface.h"
+#include "gras/Msg/msg_interface.h" /* FIXME: Get rid of this cyclic */
/* **************************************************************************
* Process data
/* This program is free software; you can redistribute it and/or modify it
under the terms of the license (GNU LGPL) which comes with this package. */
-#include "Virtu/virtu_rl.h"
+#include "gras/Virtu/virtu_rl.h"
int gras_if_RL(void) {
return 1;
/* This program is free software; you can redistribute it and/or modify it
under the terms of the license (GNU LGPL) which comes with this package. */
-#include "Virtu/virtu_rl.h"
+#include "gras/Virtu/virtu_rl.h"
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(process,GRAS);
#define VIRTU_RL_H
#include "gras_private.h"
-#include "Virtu/virtu_interface.h"
+#include "gras/Virtu/virtu_interface.h"
#endif /* VIRTU_RL_H */
under the terms of the license (GNU LGPL) which comes with this package. */
-#include "Core/core_interface.h"
+#include "gros_interface.h"
#include "gras_private.h"
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-
typedef struct {
char *catname;
gras_log_priority_t thresh;
gras_assert1(*dot == '.' && *eq == '=',
"Invalid control string '%s'",control_string);
- if (!strncmp(dot + 1, "thresh", MIN(eq - dot - 1,strlen("thresh")))) {
+ if (!strncmp(dot + 1, "thresh", min(eq - dot - 1,strlen("thresh")))) {
int i;
char *neweq=strdup(eq+1);
char *p=neweq-1;
free(neweq);
} else {
char buff[512];
- snprintf(buff,MIN(512,eq - dot - 1),"%s",dot+1);
+ snprintf(buff,min(512,eq - dot - 1),"%s",dot+1);
gras_assert1(FALSE,"Unknown setting of the log category: %s",buff);
}
if (!(set->catname=malloc(dot - name+1)))