Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SMPI: move the last queue (received_message_queue) from global to process data
[simgrid.git] / src / smpi / private.h
index 3c57388..109ce23 100644 (file)
@@ -83,31 +83,13 @@ typedef struct smpi_global_t {
   double reference_speed;
 
   // state vars
-  int root_ready:1;
-  int ready_process_count;
-  smx_mutex_t start_stop_mutex;
-  smx_cond_t start_stop_cond;
 
-  smx_host_t *hosts;
+  smx_host_t *hosts; //FIXME:killme
   int host_count;
   xbt_mallocator_t request_mallocator;
   xbt_mallocator_t message_mallocator;
 
-  // FIXME: request queues should be moved to host data...
-  xbt_fifo_t *pending_send_request_queues;
-  smx_mutex_t *pending_send_request_queues_mutexes;
-
-  xbt_fifo_t *pending_recv_request_queues;
-  smx_mutex_t *pending_recv_request_queues_mutexes;
-
-  xbt_fifo_t *received_message_queues;
-  smx_mutex_t *received_message_queues_mutexes;
-
-  smx_process_t *sender_processes;
-  smx_process_t *receiver_processes;
-
-  int running_hosts_count;
-  smx_mutex_t running_hosts_count_mutex;
+  smx_process_t *main_processes;
 
   xbt_os_timer_t timer;
   smx_mutex_t timer_mutex;
@@ -126,12 +108,22 @@ typedef struct smpi_host_data_t {
   int index;
   smx_mutex_t mutex;
   smx_cond_t cond;
+
+  smx_process_t main;
+  smx_process_t sender;
+  smx_process_t receiver;
+
+  int finalize; /* so that main process stops its sender&receiver */
+
+  xbt_fifo_t pending_recv_request_queue;
+  xbt_fifo_t pending_send_request_queue;
+  xbt_fifo_t received_message_queue;
 } s_smpi_host_data_t;
 typedef struct smpi_host_data_t *smpi_host_data_t;
 
 // function prototypes
-void smpi_init_process(void);
-void smpi_mpi_finalize(void);
+void smpi_process_init(void);
+void smpi_process_finalize(void);
 int smpi_mpi_comm_rank(smpi_mpi_communicator_t comm);
 
 int smpi_mpi_barrier(smpi_mpi_communicator_t comm);
@@ -157,8 +149,7 @@ int smpi_create_request(void *buf, int count, smpi_mpi_datatype_t datatype,
                         smpi_mpi_communicator_t comm,
                         smpi_mpi_request_t * request);
 
-int smpi_sender(int argc, char **argv);
-
-int smpi_receiver(int argc, char **argv);
+int smpi_sender(int argc,char*argv[]);
+int smpi_receiver(int argc, char*argv[]);
 
 #endif