Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SMPI: Change the reference speed to a command line option
[simgrid.git] / src / smpi / private.h
index f33b9ba..487d129 100644 (file)
@@ -83,21 +83,11 @@ typedef struct smpi_global_t {
   double reference_speed;
 
   // state vars
-
-  smx_host_t *hosts;
-  int host_count;
+  int process_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;
-  xbt_fifo_t *pending_recv_request_queues;
-  xbt_fifo_t *received_message_queues;
-
-  smx_process_t *sender_processes;
-  smx_process_t *receiver_processes;
-
-  int running_hosts_count;
+  smx_process_t *main_processes;
 
   xbt_os_timer_t timer;
   smx_mutex_t timer_mutex;
@@ -116,14 +106,21 @@ 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;
-} s_smpi_host_data_t;
-typedef struct smpi_host_data_t *smpi_host_data_t;
+
+  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_process_data_t;
+typedef struct smpi_host_data_t *smpi_process_data_t;
 
 // function prototypes
-void smpi_process_init(void);
+void smpi_process_init(int *argc,char ***argv);
 void smpi_process_finalize(void);
 int smpi_mpi_comm_rank(smpi_mpi_communicator_t comm);
 
@@ -141,9 +138,9 @@ void smpi_bench_skip(void);
 
 void smpi_global_init(void);
 void smpi_global_destroy(void);
-int smpi_host_index(void);
-smx_mutex_t smpi_host_mutex(void);
-smx_cond_t smpi_host_cond(void);
+int smpi_process_index(void);
+smx_mutex_t smpi_process_mutex(void);
+smx_cond_t smpi_process_cond(void);
 int smpi_run_simulation(int *argc, char **argv);
 int smpi_create_request(void *buf, int count, smpi_mpi_datatype_t datatype,
                         int src, int dst, int tag,