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
SIMIX refactoring: replace 'request' by a more precise term: 'simcall'
[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
9cbfc46
..
781ab57
100644
(file)
--- a/
src/gras/Virtu/sg_process.c
+++ b/
src/gras/Virtu/sg_process.c
@@
-28,7
+28,7
@@
void gras_agent_spawn(const char *name,
{
smx_process_t process;
-
SIMIX_req
_process_create(&process, name, code, NULL,
+
simcall
_process_create(&process, name, code, NULL,
gras_os_myname(), 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,13
+55,13
@@
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;
@@
-83,7
+84,7
@@
void gras_process_exit()
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,9
+99,9
@@
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
@@
-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,18
+191,18
@@
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);
}
-/** @brief retrieve the host properties diction
n
ary
+/** @brief retrieve the host properties dictionary
* @warning it's the original one, not a copy. Don't mess with it
*/
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()));
}