Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
msg_simix alpha. All functions implemented.
[simgrid.git] / src / msg_simix / msg_simix_process.c
index 789862b..a40a81a 100644 (file)
@@ -34,7 +34,6 @@ static void MSG_process_cleanup(void *arg)
 {
        /* arg is a pointer to a simix process, we can get the msg process with the field data */
        m_process_t proc = ((smx_process_t)arg)->data;
-       printf("remove MSG process %s\n", proc->name);
   xbt_fifo_remove(msg_global->process_list, proc);
        SIMIX_process_cleanup(arg);
   free(proc->name);
@@ -94,8 +93,7 @@ m_process_t MSG_process_create_with_arguments(const char *name,
   simdata->host = host;
   simdata->argc = argc;
   simdata->argv = argv;
-       simdata->smx_process = SIMIX_process_create_with_arguments(name, (smx_process_code_t)code,
-                                                                                                                                                                                                                                                       (void*)process, host->name, argc, argv, MSG_process_cleanup );
+       simdata->smx_process = SIMIX_process_create_with_arguments(name, (smx_process_code_t)code, (void*)process, host->name, argc, argv, MSG_process_cleanup );
 
        if (SIMIX_process_self()) {
                simdata->PPID = MSG_process_get_PID(SIMIX_process_self()->data);
@@ -327,8 +325,11 @@ m_process_t MSG_process_self(void)
  */
 MSG_error_t MSG_process_suspend(m_process_t process)
 {
-       xbt_die("not implemented yet");
-       return MSG_OK;
+  xbt_assert0(((process != NULL) && (process->simdata)), "Invalid parameters");
+  CHECK_HOST();
+
+       SIMIX_process_suspend(process->simdata->smx_process);
+  MSG_RETURN(MSG_OK);
 }
 
 /** \ingroup m_process_management
@@ -339,8 +340,12 @@ MSG_error_t MSG_process_suspend(m_process_t process)
  */
 MSG_error_t MSG_process_resume(m_process_t process)
 {
-       xbt_die("not implemented yet");
-       MSG_RETURN(MSG_OK);
+
+  xbt_assert0(((process != NULL) && (process->simdata)), "Invalid parameters");
+  CHECK_HOST();
+
+       SIMIX_process_resume(process->simdata->smx_process);
+  MSG_RETURN(MSG_OK);
 }
 
 /** \ingroup m_process_management
@@ -351,21 +356,7 @@ MSG_error_t MSG_process_resume(m_process_t process)
  */
 int MSG_process_is_suspended(m_process_t process)
 {
-       xbt_die("not implemented yet");
-       return 0;
-}
-
-int __MSG_process_block(double max_duration, const char *info)
-{
-    return 1;
-}
-
-MSG_error_t __MSG_process_unblock(m_process_t process)
-{
-    MSG_RETURN(MSG_OK);
+  xbt_assert0(((process != NULL) && (process->simdata)), "Invalid parameters");
+       return SIMIX_process_is_suspended(process->simdata->smx_process);
 }
 
-int __MSG_process_isBlocked(m_process_t process)
-{
-       return 0;
-}