From: mquinson Date: Tue, 28 Apr 2009 10:10:05 +0000 (+0000) Subject: Add SIMIX_process_set_name() X-Git-Tag: SVN~1371 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0b2482fb84dd0615cd537f7c5bb8cb2dc4b0110c?hp=18310bec7dad709ad3013db1241ff5878112d5c0 Add SIMIX_process_set_name() git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6262 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/include/simix/simix.h b/src/include/simix/simix.h index 9c0a13a94c..60620aec1e 100644 --- a/src/include/simix/simix.h +++ b/src/include/simix/simix.h @@ -65,6 +65,7 @@ XBT_PUBLIC(void) SIMIX_host_set_data(smx_host_t host, void *data); XBT_PUBLIC(void*) SIMIX_host_get_data(smx_host_t host); XBT_PUBLIC(const char *) SIMIX_host_get_name(smx_host_t host); +XBT_PUBLIC(void) SIMIX_process_set_name(smx_process_t process, char *name); XBT_PUBLIC(smx_host_t) SIMIX_host_self(void); XBT_PUBLIC(double) SIMIX_host_get_speed(smx_host_t host); XBT_PUBLIC(double) SIMIX_host_get_available_speed(smx_host_t host); diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index fa1fc6640e..a1abeceade 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -262,6 +262,21 @@ const char *SIMIX_process_get_name(smx_process_t process) return (process->name); } +/** + * \brief Changes the name of an agent. + * + * This functions checks whether \a process is a valid pointer or not and return its name. + * \param process SIMIX process + * \param name The new process name + */ +void SIMIX_process_set_name(smx_process_t process, char *name) +{ + xbt_assert0(((process != NULL) + && (process->simdata)), "Invalid parameters"); + + process->name = name; +} + /** \ingroup m_process_management * \brief Return the properties *