Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Convert MSG pids from int to long int so that they match the GRAS ones
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 2 Jul 2007 14:42:54 +0000 (14:42 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 2 Jul 2007 14:42:54 +0000 (14:42 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3641 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/msg/msg.h
src/msg/global.c
src/msg/gos.c
src/msg/m_process.c
src/msg/private.h

index e593310..2d7db1e 100644 (file)
@@ -53,19 +53,19 @@ XBT_PUBLIC(m_process_t) MSG_process_create_with_arguments(const char *name,
                                              m_process_code_t code, void *data,
                                              m_host_t host, int argc, char **argv);
 XBT_PUBLIC(void) MSG_process_kill(m_process_t process);
-XBT_PUBLIC(int) MSG_process_killall(int reset_PIDs);
+XBT_PUBLIC(int) MSG_process_killall(long int reset_PIDs);
 
 XBT_PUBLIC(MSG_error_t) MSG_process_change_host(m_process_t process, m_host_t host);
 
 XBT_PUBLIC(void*) MSG_process_get_data(m_process_t process);
 XBT_PUBLIC(MSG_error_t) MSG_process_set_data(m_process_t process, void *data);
 XBT_PUBLIC(m_host_t) MSG_process_get_host(m_process_t process);
-XBT_PUBLIC(m_process_t) MSG_process_from_PID(int PID);
-XBT_PUBLIC(int) MSG_process_get_PID(m_process_t process);
-XBT_PUBLIC(int) MSG_process_get_PPID(m_process_t process);
+XBT_PUBLIC(m_process_t) MSG_process_from_PID(long int PID);
+XBT_PUBLIC(long int) MSG_process_get_PID(m_process_t process);
+XBT_PUBLIC(long int) MSG_process_get_PPID(m_process_t process);
 XBT_PUBLIC(const char *)MSG_process_get_name(m_process_t process);
-XBT_PUBLIC(int) MSG_process_self_PID(void);
-XBT_PUBLIC(int) MSG_process_self_PPID(void);
+XBT_PUBLIC(long int) MSG_process_self_PID(void);
+XBT_PUBLIC(long int) MSG_process_self_PPID(void);
 XBT_PUBLIC(m_process_t) MSG_process_self(void);
 
 XBT_PUBLIC(MSG_error_t) MSG_process_suspend(m_process_t process);
@@ -106,10 +106,10 @@ XBT_PUBLIC(MSG_error_t) MSG_parallel_task_execute(m_task_t task);
 XBT_PUBLIC(void) MSG_task_set_priority(m_task_t task, double priority);
 
 XBT_PUBLIC(int) MSG_task_Iprobe(m_channel_t channel);
-XBT_PUBLIC(int) MSG_task_probe_from(m_channel_t channel);
+XBT_PUBLIC(long int) MSG_task_probe_from(m_channel_t channel);
 XBT_PUBLIC(int) MSG_task_probe_from_host(int channel, m_host_t host);
 XBT_PUBLIC(MSG_error_t) MSG_channel_select_from(m_channel_t channel, double max_duration,
-                                   int *PID);
+                                   long int *PID);
 XBT_PUBLIC(MSG_error_t) MSG_process_sleep(double nb_sec);
 XBT_PUBLIC(MSG_error_t) MSG_get_errno(void);
 
index a09b97c..6371a18 100644 (file)
@@ -181,7 +181,7 @@ MSG_error_t MSG_main(void)
  *   number means no reset and a positive number will be used to set the PID
  *   of the next newly created process.
  */
-int MSG_process_killall(int reset_PIDs)
+int MSG_process_killall(long int reset_PIDs)
 {
   m_process_t p = NULL;
   m_process_t self = MSG_process_self();
index fcd53b2..1102b88 100644 (file)
@@ -247,7 +247,7 @@ int MSG_task_Iprobe(m_channel_t channel)
    number of channels fixed with MSG_set_channel_number().
  * \return -1 if there is no pending communication and the PID of the process who sent it otherwise
  */
-int MSG_task_probe_from(m_channel_t channel)
+long int MSG_task_probe_from(m_channel_t channel)
 {
   m_host_t h = NULL;
   xbt_fifo_item_t item;
@@ -284,7 +284,7 @@ int MSG_task_probe_from(m_channel_t channel)
    and #MSG_OK otherwise.
  */
 MSG_error_t MSG_channel_select_from(m_channel_t channel, double max_duration,
-               int *PID)
+               long int *PID)
 {
        m_host_t h = NULL;
        simdata_host_t h_simdata = NULL;
index f318b22..6e025d3 100644 (file)
@@ -134,7 +134,7 @@ void MSG_process_kill(m_process_t process)
 {
   simdata_process_t p_simdata = process->simdata;
 
-  DEBUG3("Killing %s(%d) on %s",process->name, p_simdata->PID, p_simdata->host->name);
+  DEBUG3("Killing %s(%ld) on %s",process->name, p_simdata->PID, p_simdata->host->name);
 
        if(p_simdata->waiting_task) {
                DEBUG1("Canceling waiting task %s",p_simdata->waiting_task->name);
@@ -215,7 +215,7 @@ m_host_t MSG_process_get_host(m_process_t process)
    whose PID is equal to \a PID. If no host is found, \c NULL is returned. 
    Note that the PID are uniq in the whole simulation, not only on a given host.
  */
-m_process_t MSG_process_from_PID(int PID)
+m_process_t MSG_process_from_PID(long int PID)
 {
   xbt_fifo_item_t i = NULL;
   m_process_t process = NULL;
@@ -232,7 +232,7 @@ m_process_t MSG_process_from_PID(int PID)
  * This functions checks whether \a process is a valid pointer or not 
    and return its PID.
  */
-int MSG_process_get_PID(m_process_t process)
+long int MSG_process_get_PID(m_process_t process)
 {
   xbt_assert0(((process != NULL) && (process->simdata)), "Invalid parameters");
 
@@ -246,7 +246,7 @@ int MSG_process_get_PID(m_process_t process)
    and return its PID. Returns -1 if the agent has not been created by 
    another agent.
  */
-int MSG_process_get_PPID(m_process_t process)
+long int MSG_process_get_PPID(m_process_t process)
 {
   xbt_assert0(((process != NULL) && (process->simdata)), "Invalid parameters");
 
@@ -271,7 +271,7 @@ const char *MSG_process_get_name(m_process_t process)
  *
  * This functions returns the PID of the currently running #m_process_t.
  */
-int MSG_process_self_PID(void)
+long int MSG_process_self_PID(void)
 {
   return (MSG_process_get_PID(MSG_process_self()));
 }
@@ -282,7 +282,7 @@ int MSG_process_self_PID(void)
  * This functions returns the PID of the parent of the currently
  * running #m_process_t.
  */
-int MSG_process_self_PPID(void)
+long int MSG_process_self_PPID(void)
 {
   return (MSG_process_get_PPID(MSG_process_self()));
 }
index e78420d..2184dbe 100644 (file)
@@ -57,8 +57,8 @@ typedef struct simdata_task {
 typedef struct simdata_process {
   m_host_t host;                /* the host on which the process is running */
        smx_process_t smx_process;
-  int PID;                     /* used for debugging purposes */
-  int PPID;                    /* The parent PID */
+  long int PID;                        /* used for debugging purposes */
+  long int PPID;               /* The parent PID */
   m_host_t put_host;           /* used for debugging purposes */
   m_channel_t put_channel;     /* used for debugging purposes */
        m_task_t waiting_task;