5 * Copyright 2006,2007 Martin Quinson, Malek Cherier
\r
6 * All right reserved.
\r
8 * This program is free software; you can redistribute
\r
9 * it and/or modify it under the terms of the license
\r
10 *(GNU LGPL) which comes with this package.
\r
14 /* Msg functions implementation.
\r
20 #include <msg/msg.h>
\r
21 #include <msg/private.h>
\r
31 #define SIMGRIDX_DEFAULT_CHANNEL_NUMBER ((int)10)
\r
33 void init(int argc, char** argv)
\r
35 MSG_global_init(&argc,argv);
\r
37 if(getMaxChannelNumber() == 0)
\r
38 setMaxChannelNumber(SIMGRIDX_DEFAULT_CHANNEL_NUMBER);
\r
42 throw (MsgException)
\r
44 if(MSG_OK != MSG_clean())
\r
45 throw MsgException("MSG_clean() failed");
\r
49 void info(const char* s)
\r
52 printf("[SimGridX/info] %s\n", s);
\r
55 double getClock(void)
\r
57 return MSG_get_clock();
\r
60 void setMaxChannelNumber(int number)
\r
61 throw(InvalidArgumentException, LogicException)
\r
63 if(msg_global->max_channel > 0)
\r
64 throw LogicException("Max channel number already setted");
\r
67 throw InvalidArgumentException("number");
\r
69 msg_global->max_channel = number;
\r
72 int getMaxChannelNumber(void)
\r
74 return msg_global->max_channel;
\r
79 } // namespace SimGrid
\r