Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Missing chunks
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 2 Nov 2004 15:52:59 +0000 (15:52 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 2 Nov 2004 15:52:59 +0000 (15:52 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@463 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/amok/bandwidth.h [new file with mode: 0644]
include/amok/base.h [new file with mode: 0644]
include/xbt/misc.h [new file with mode: 0644]

diff --git a/include/amok/bandwidth.h b/include/amok/bandwidth.h
new file mode 100644 (file)
index 0000000..884fb19
--- /dev/null
@@ -0,0 +1,105 @@
+/* $Id$ */
+
+/* amok_bandwidth - Bandwidth test facilities                               */
+
+/* Authors: Martin Quinson                                                  */
+/* Copyright (C) 2003, 2004 the OURAGAN project.                            */
+
+/* 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. */
+
+#ifndef AMOK_BANDWIDTH_H
+#define AMOK_BANDWIDTH_H
+
+#include "amok/base.h"
+
+/* module handling */
+
+void amok_bw_init(void);
+void amok_bw_exit(void);
+   
+
+
+/* ***************************************************************************
+ * Bandwidth tests
+ * ***************************************************************************/
+/**
+ * amok_bw_test:
+ * @peer: A (regular) socket at which the the host with which we should conduct the experiment can be contacted
+ * @buf_size: Size of the socket buffer
+ * @exp_size: Total size of data sent across the network
+ * @msg_size: Size of each message sent. Ie, (@expSize % @msgSize) messages will be sent.
+ * @sec: where the result (in seconds) should be stored.
+ * @bw: observed Bandwidth (in Mb/s) 
+ *
+ * Conduct a bandwidth test from the local process to the given peer.
+ * This call is blocking until the end of the experiment.
+ */
+gras_error_t amok_bw_test(gras_socket_t peer,
+                         unsigned int buf_size,unsigned int exp_size,unsigned int msg_size,
+                         /*OUT*/ double *sec, double *bw);
+
+#if 0   
+/**
+ * grasbw_request:
+ * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
+ * @from_port: port on which the process we are asking for an experiment is listening for message
+ * @to_name: Name of the host with which we should conduct the experiment
+ * @to_port: port on which the peer process is listening (for message, do not 
+ * give a raw socket here. The needed raw socket will be negociated between 
+ * the peers)
+ * @bufSize: Size of the socket buffer
+ * @expSize: Total size of data sent across the network
+ * @msgSize: Size of each message sent. Ie, (@expSize % @msgSize) messages will be sent.
+ * @sec: where the result (in seconds) should be stored.
+ * @bw: observed Bandwidth (in Mb/s)
+ *
+ * Conduct a bandwidth test from the process from_host:from_port to to_host:to_port.
+ * This call is blocking until the end of the experiment.
+ */
+gras_error_t grasbw_request(const char* from_name,unsigned int from_port,
+                          const char* to_name,unsigned int to_port,
+                          unsigned int bufSize,unsigned int expSize,unsigned int msgSize,
+                          /*OUT*/ double *sec, double*bw);
+
+
+/* ***************************************************************************
+ * Link saturation
+ * ***************************************************************************/
+
+/**
+ * grasbw_saturate_start:
+ * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
+ * @from_port: port on which the process we are asking for an experiment is listening
+ * (for message, do not give a raw socket here. The needed raw socket will be negociated 
+ * between the peers)
+ * @to_name: Name of the host with which we should conduct the experiment
+ * @to_port: port on which the peer process is listening for message
+ * @msgSize: Size of each message sent.
+ * @timeout: How long in maximum should be the saturation.
+ *
+ * Ask the process 'from_name:from_port' to start to saturate the link between itself
+ * and to_name:to_name.
+ */
+gras_error_t grasbw_saturate_start(const char* from_name,unsigned int from_port,
+                                 const char* to_name,unsigned int to_port,
+                                 unsigned int msgSize, unsigned int timeout);
+
+/**
+ * grasbw_saturate_stop:
+ * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
+ * @from_port: port on which the process we are asking for an experiment is listening
+ * (for message, do not give a raw socket here. The needed raw socket will be negociated 
+ * between the peers)
+ * @to_name: Name of the host with which we should conduct the experiment
+ * @to_port: port on which the peer process is listening for message
+ *
+ * Ask the process 'from_name:from_port' to stop saturating the link between itself
+ * and to_name:to_name.
+ */
+gras_error_t grasbw_saturate_stop(const char* from_name,unsigned int from_port,
+                                const char* to_name,unsigned int to_port);
+
+
+#endif /* if 0 */
+#endif /* AMOK_BANDWIDTH_H */
diff --git a/include/amok/base.h b/include/amok/base.h
new file mode 100644 (file)
index 0000000..e91010a
--- /dev/null
@@ -0,0 +1,72 @@
+/* $Id$ */
+
+/* amok_base - things needed in amok, but too small to constitute a module  */
+
+/* Authors: Martin Quinson                                                  */
+/* Copyright (C) 2003, 2004 the OURAGAN project.                            */
+
+/* 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. */
+
+#ifndef AMOK_BASE_H
+#define AMOK_BASE_H
+
+#include "gras/messages.h"
+
+/* ****************************************************************************
+ * The common types used as payload in the messages and their definitions
+ * ****************************************************************************/
+
+/**
+ * amok_remoterr_t:
+ *
+ * how to indicate an eventual error
+ */
+
+typedef struct {
+  char *msg;
+  unsigned int code;
+} s_amok_remoterr_t,*amok_remoterr_t;
+
+amok_remoterr_t amok_remoterr_new(gras_error_t errcode, 
+                                 const char* format, ...);
+amok_remoterr_t amok_remoterr_new_va(gras_error_t param_errcode, 
+                                    const char* format,va_list ap);
+void amok_remoterr_free(amok_remoterr_t *err);
+
+
+/**
+ * amok_result_t:
+ *
+ * how to report the result of an experiment
+ */
+
+typedef struct {
+  unsigned int timestamp;
+  double value;
+} amok_result_t;
+
+/**
+ * amok_repport_error:
+ *
+ * Repports an error to the process listening on socket sock. 
+ *
+ * The information will be embeeded in a message of type id, which must take a msgError_t as first
+ * sequence (and SeqCount sequences in total). Other sequences beside the error one will be of
+ * length 0.
+ *
+ * The message will be builded as sprintf would, using the given format and extra args.
+ *
+ * If the message cannot be builded and sent to recipient, the string severeError will be printed
+ * on localhost's stderr.
+ */
+void
+amok_repport_error (gras_socket_t sock, gras_msgtype_t msgtype,
+                   gras_error_t errcode, const char* format,...);
+
+
+void amok_base_init(void);
+void amok_base_exit(void);
+
+
+#endif /* AMOK_BASE_H */
diff --git a/include/xbt/misc.h b/include/xbt/misc.h
new file mode 100644 (file)
index 0000000..7cb25f5
--- /dev/null
@@ -0,0 +1,49 @@
+/* $Id$ */
+
+/* xbt.h - Public interface to the xbt (gras's toolbox)                   */
+
+/* Authors: Martin Quinson                                                  */
+/* Copyright (C) 2004 the OURAGAN project.                                  */
+
+/* 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. */
+
+#ifndef XBT_MISC_H
+#define XBT_MISC_H
+
+#define max(a, b) (((a) > (b))?(a):(b))
+#define min(a, b) (((a) < (b))?(a):(b))
+
+#define TRUE  1
+#define FALSE 0
+
+#define GRAS_MAX_CHANNEL 10 /* FIXME: killme */
+/*! C++ users need love */
+#ifndef BEGIN_DECL
+# ifdef __cplusplus
+#  define BEGIN_DECL extern "C" {
+# else
+#  define BEGIN_DECL 
+# endif
+#endif
+
+/*! C++ users need love */
+#ifndef END_DECL
+# ifdef __cplusplus
+#  define END_DECL }
+# else
+#  define END_DECL 
+# endif
+#endif
+/* End of cruft for C++ */
+
+BEGIN_DECL
+/* Dunno where to place this: needed by config and amok */
+typedef struct {  
+   char *name;
+   int port;
+} gras_host_t;
+
+END_DECL
+
+#endif /* XBT_MISC_H */