A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Rewrite the kill_time mecanism.
[simgrid.git]
/
src
/
gras
/
Virtu
/
sg_process.c
diff --git
a/src/gras/Virtu/sg_process.c
b/src/gras/Virtu/sg_process.c
index 1ea5b265f39a0b5c7ef1321ab284c149ca2b4a2e..b5244179d08c9693c3328165838ca34f6497cae1 100644
(file)
--- a/
src/gras/Virtu/sg_process.c
+++ b/
src/gras/Virtu/sg_process.c
@@
-28,8
+28,8
@@
void gras_agent_spawn(const char *name,
{
smx_process_t process;
-
SIMIX_req
_process_create(&process, name, code, NULL,
- gras_os_myname(), argc, argv, properties);
+
simcall
_process_create(&process, name, code, NULL,
+ gras_os_myname(),
-1.0,
argc, argv, properties);
}
/* **************************************************************************
@@
-38,6
+38,7
@@
void gras_agent_spawn(const char *name,
void gras_process_init()
{
+ smx_process_t self = SIMIX_process_self();
gras_hostdata_t *hd =
(gras_hostdata_t *) SIMIX_host_self_get_data();
gras_procdata_t *pd = xbt_new0(gras_procdata_t, 1);
@@
-54,21
+55,21
@@
void gras_process_init()
hd->refcount++;
}
- SIMIX_process_self_set_data((void *) pd);
+ SIMIX_process_self_set_data(
self,
(void *) pd);
gras_procdata_init();
trp_pd = (gras_trp_procdata_t) gras_libdata_by_name("gras_trp");
pd->pid = pid;
- if (
SIMIX_process_self()
!= NULL) {
+ if (
self
!= NULL) {
pd->ppid = gras_os_getpid();
} else
pd->ppid = -1;
- trp_pd->msg_selectable_sockets = xbt_queue_new(0, sizeof(
gras
_socket_t));
+ trp_pd->msg_selectable_sockets = xbt_queue_new(0, sizeof(
xbt
_socket_t));
trp_pd->meas_selectable_sockets =
- xbt_queue_new(0, sizeof(
gras
_socket_t));
+ xbt_queue_new(0, sizeof(
xbt
_socket_t));
XBT_VERB("Creating process '%s' (%d)", SIMIX_process_self_get_name(),
gras_os_getpid());
@@
-78,12
+79,12
@@
void gras_process_exit()
{
xbt_dynar_t sockets =
((gras_trp_procdata_t) gras_libdata_by_name("gras_trp"))->sockets;
-
gras
_socket_t sock_iter;
+
xbt
_socket_t sock_iter;
unsigned int cursor;
gras_hostdata_t *hd =
(gras_hostdata_t *) SIMIX_host_self_get_data();
gras_procdata_t *pd =
- (gras_procdata_t *)
SIMIX_req
_process_get_data(SIMIX_process_self());
+ (gras_procdata_t *)
simcall
_process_get_data(SIMIX_process_self());
gras_msg_procdata_t msg_pd =
(gras_msg_procdata_t) gras_libdata_by_name("gras_msg");
@@
-98,20
+99,20
@@
void gras_process_exit()
xbt_assert(hd, "Run gras_process_init (ie, gras_init)!!");
XBT_VERB("GRAS: Finalizing process '%s' (%d)",
-
SIMIX_req
_process_get_name(SIMIX_process_self()), gras_os_getpid());
+
simcall
_process_get_name(SIMIX_process_self()), gras_os_getpid());
- if (
xbt_dynar_length
(msg_pd->msg_queue)) {
+ if (
!xbt_dynar_is_empty
(msg_pd->msg_queue)) {
unsigned int cpt;
s_gras_msg_t msg;
XBT_WARN
- ("process %d terminated, but %l
d
messages are still queued. Message list:",
+ ("process %d terminated, but %l
u
messages are still queued. Message list:",
gras_os_getpid(), xbt_dynar_length(msg_pd->msg_queue));
xbt_dynar_foreach(msg_pd->msg_queue, cpt, msg) {
XBT_WARN(" Message %s (%s) from %s@%s:%d", msg.type->name,
e_gras_msg_kind_names[msg.kind],
-
gras
_socket_peer_proc(msg.expe),
-
gras
_socket_peer_name(msg.expe),
-
gras
_socket_peer_port(msg.expe));
+
xbt
_socket_peer_proc(msg.expe),
+
xbt
_socket_peer_name(msg.expe),
+
xbt
_socket_peer_port(msg.expe));
}
}
@@
-137,7
+138,7
@@
void gras_process_exit()
gras_procdata_t *gras_procdata_get(void)
{
gras_procdata_t *pd =
- (gras_procdata_t *)
SIMIX_req
_process_get_data(SIMIX_process_self());
+ (gras_procdata_t *)
simcall
_process_get_data(SIMIX_process_self());
xbt_assert(pd, "Run gras_process_init! (ie, gras_init)");
@@
-146,12
+147,12
@@
gras_procdata_t *gras_procdata_get(void)
void *gras_libdata_by_name_from_remote(const char *name, smx_process_t p)
{
- gras_procdata_t *pd = (gras_procdata_t *)
SIMIX_req
_process_get_data(p);
+ gras_procdata_t *pd = (gras_procdata_t *)
simcall
_process_get_data(p);
xbt_assert(pd,
"process '%s' on '%s' didn't run gras_process_init! (ie, gras_init)",
-
SIMIX_req
_process_get_name(p),
-
SIMIX_req_host_get_name(SIMIX_req
_process_get_host(p)));
+
simcall
_process_get_name(p),
+
simcall_host_get_name(simcall
_process_get_host(p)));
return gras_libdata_by_name_from_procdata(name, pd);
}
@@
-159,7
+160,7
@@
void *gras_libdata_by_name_from_remote(const char *name, smx_process_t p)
/** @brief retrieve the value of a given process property (or NULL if not defined) */
const char *gras_process_property_value(const char *name)
{
- return xbt_dict_get_or_null(
SIMIX_req
_process_get_properties
+ return xbt_dict_get_or_null(
simcall
_process_get_properties
(SIMIX_process_self()), name);
}
@@
-168,7
+169,7
@@
const char *gras_process_property_value(const char *name)
*/
xbt_dict_t gras_process_properties(void)
{
- return
SIMIX_req
_process_get_properties(SIMIX_process_self());
+ return
simcall
_process_get_properties(SIMIX_process_self());
}
/* **************************************************************************
@@
-179,7
+180,7
@@
xbt_dict_t gras_process_properties(void)
int gras_os_getpid(void)
{
gras_procdata_t *data;
- data = (gras_procdata_t *) SIMIX_process_self_get_data();
+ data = (gras_procdata_t *) SIMIX_process_self_get_data(
SIMIX_process_self()
);
if (data != NULL)
return data->pid;
@@
-190,8
+191,8
@@
int gras_os_getpid(void)
const char *gras_os_host_property_value(const char *name)
{
return
- xbt_dict_get_or_null(
SIMIX_req
_host_get_properties
- (
SIMIX_req
_process_get_host(SIMIX_process_self())),
+ xbt_dict_get_or_null(
simcall
_host_get_properties
+ (
simcall
_process_get_host(SIMIX_process_self())),
name);
}
@@
-201,7
+202,7
@@
const char *gras_os_host_property_value(const char *name)
xbt_dict_t gras_os_host_properties(void)
{
return
-
SIMIX_req_host_get_properties(SIMIX_req
_process_get_host
+
simcall_host_get_properties(simcall
_process_get_host
(SIMIX_process_self()));
}
@@
-210,12
+211,8
@@
xbt_dict_t gras_os_host_properties(void)
* (these functions are called by the stuff generated by gras_stub_generator)
* **************************************************************************/
-XBT_LOG_EXTERNAL_CATEGORY(gras_trp);
-XBT_LOG_EXTERNAL_CATEGORY(gras_trp_sg);
-
void gras_global_init(int *argc, char **argv)
{
- XBT_LOG_CONNECT(gras_trp_sg, gras_trp);
SIMIX_global_init(argc, argv);
}