git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@756
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
-/**** MSG_LICENCE DO NOT REMOVE ****/
+/* $Id$ */
+
+/* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved. */
+
+/* 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 MESSAGES_H
#define MESSAGES_H
#ifndef MESSAGES_H
#define MESSAGES_H
<argument value="iRMX"/>
<argument value="Bousquet"/>
<argument value="Soucy"/>
<argument value="iRMX"/>
<argument value="Bousquet"/>
<argument value="Soucy"/>
- <argument value="Kuenning"/>
+ <argument value="Jackson"/>
</process>
<process host="iRMX" function="slave"/>
<process host="Bousquet" function="slave"/>
<process host="Soucy" function="slave"/>
<process host="Kuenning" function="slave"/>
</process>
<process host="iRMX" function="slave"/>
<process host="Bousquet" function="slave"/>
<process host="Soucy" function="slave"/>
<process host="Kuenning" function="slave"/>
+ <process host="Jackson" function="forwarder">
+ <argument value="Kuenning"/>
+ </process>
-/* Copyright (c) 2002,2004,2004 Arnaud Legrand. All rights reserved. */
+/* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved. */
/* 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. */
/* 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. */
int unix_forwarder(int argc, char *argv[])
{
int unix_forwarder(int argc, char *argv[])
{
- int todo_count = 0;
- m_task_t *todo = (m_task_t *) calloc(NB_TASK, sizeof(m_task_t));
int i;
print_args(argc,argv);
int i;
print_args(argc,argv);
+ if(argc<2)
+ DIE("Need somebody to which I can send my work! ");
+
+ slave = MSG_get_host_by_name(argv[1]);
+
+ if(slave==NULL) {
+ PRINT_MESSAGE("Unknown host %s. Stopping Now! \n", argv[1]);
+ abort();
+ }
+
for (i = 0; i < NB_TASK;) {
for (i = 0; i < NB_TASK;) {
int a;
PRINT_MESSAGE("Awaiting Task %d \n", i);
int a;
PRINT_MESSAGE("Awaiting Task %d \n", i);
- a = MSG_task_get(&(todo[i]), PORT_22);
+ a = MSG_task_get(&task, PORT_22);
- todo_count++;
- PRINT_MESSAGE("Received \"%s\" \n", todo[i]->name);
- PRINT_MESSAGE("Processing \"%s\" \n", todo[i]->name);
- MSG_task_execute(todo[i]);
- PRINT_MESSAGE("\"%s\" done \n", todo[i]->name);
- MSG_task_destroy(todo[i]);
+ PRINT_MESSAGE("Received \"%s\" \n", task->name);
+ PRINT_MESSAGE("Sending to somebody else \"%s\" \n", task->name);
+ MSG_task_put(task,slave,PORT_22);
i++;
} else {
PRINT_MESSAGE("Hey ?! What's up ? \n");
DIE("Unexpected behaviour");
}
}
i++;
} else {
PRINT_MESSAGE("Hey ?! What's up ? \n");
DIE("Unexpected behaviour");
}
}
PRINT_MESSAGE("I'm done. See you!\n");
return 0;
}
PRINT_MESSAGE("I'm done. See you!\n");
return 0;
}
{ /* Application deployment */
MSG_function_register("master", unix_emitter);
MSG_function_register("slave", unix_receiver);
{ /* Application deployment */
MSG_function_register("master", unix_emitter);
MSG_function_register("slave", unix_receiver);
+ MSG_function_register("forwarder", unix_forwarder);
MSG_launch_application(application_file);
}
MSG_main();
MSG_launch_application(application_file);
}
MSG_main();