static char **parse_argv = NULL;
static m_process_code_t parse_code = NULL;
static m_host_t parse_host = NULL;
-
+static double start_time = 0.0;
+static double kill_time = -1.0;
+
static void parse_process_init(void)
{
parse_host = MSG_get_host_by_name(A_process_host);
parse_argc++;
parse_argv = xbt_realloc(parse_argv, (parse_argc) * sizeof(char *));
parse_argv[(parse_argc) - 1] = xbt_strdup(A_process_function);
+ surf_parse_get_double(&start_time,A_process_start_time);
+ surf_parse_get_double(&kill_time,A_process_kill_time);
}
static void parse_argument(void)
static void parse_process_finalize(void)
{
- MSG_process_create_with_arguments(parse_argv[0], parse_code, NULL, parse_host,
- parse_argc,parse_argv);
+ process_arg_t arg = NULL;
+ m_process_t process = NULL;
+ if(start_time>MSG_get_clock()) {
+ arg = xbt_new0(s_process_arg_t,1);
+ arg->name = parse_argv[0];
+ arg->code = parse_code;
+ arg->data = NULL;
+ arg->host = parse_host;
+ arg->argc = parse_argc;
+ arg->argv = parse_argv;
+ arg-> kill_time = kill_time;
+
+ surf_timer_resource->extension_public->set(start_time, (void*) &MSG_process_create_with_arguments,
+ arg);
+ }
+ if(start_time==MSG_get_clock()) {
+ process = MSG_process_create_with_arguments(parse_argv[0], parse_code,
+ NULL, parse_host,
+ parse_argc,parse_argv);
+ if(kill_time > MSG_getClock()) {
+ surf_timer_resource->extension_public->set(kill_time,
+ (void*) &MSG_process_kill,
+ (void*) process);
+ }
+ }
}
/** \ingroup msg_easier_life
* \brief An application deployer.
*
* Creates the process described in \a file.
- * @param file a file containing an XML description of the application.
+ * \param file a filename of a xml description of the application. This file
+ * follows this DTD :
+ *
+ * \include surfxml.dtd
+ *
+ * Here is a small example of such a platform
+ *
+ * \include small_deployment.xml
+ *
+ * Have a look in the directory examples/msg/ to have a bigger example.
*/
void MSG_launch_application(const char *file)
{