Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Make snapshots compatible with SMPI privatization of global variables
[simgrid.git] / src / smpi / private.h
index 864cb33..74ee1b6 100644 (file)
@@ -1,12 +1,13 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 * under the terms of the license (GNU LGPL) which comes with this package. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #ifndef SMPI_PRIVATE_H
 #define SMPI_PRIVATE_H
 
+#include "internal_config.h"
 #include "xbt.h"
 #include "xbt/xbt_os_time.h"
 #include "simgrid/simix.h"
@@ -27,6 +28,15 @@ typedef struct s_smpi_process_data *smpi_process_data_t;
 #define ISEND          0x20
 #define SSEND          0x40
 #define PREPARED       0x80
+#define FINISHED       0x100
+
+
+enum smpi_process_state{
+  SMPI_UNINITIALIZED,
+  SMPI_INITIALIZED,
+  SMPI_FINALIZED
+};
+
 // this struct is here to handle the problem of non-contignous data
 // for each such structure these function should be implemented (vector
 // index hvector hindex struct)
@@ -94,7 +104,6 @@ typedef struct s_smpi_mpi_request {
 #endif
 } s_smpi_mpi_request_t;
 
-void smpi_process_init(int *argc, char ***argv);
 void smpi_process_destroy(void);
 void smpi_process_finalize(void);
 int smpi_process_finalized(void);
@@ -114,6 +123,8 @@ smx_rdv_t smpi_process_remote_mailbox_small(int index);
 xbt_os_timer_t smpi_process_timer(void);
 void smpi_process_simulated_start(void);
 double smpi_process_simulated_elapsed(void);
+void smpi_process_set_sampling(int s);
+int smpi_process_get_sampling(void);
 
 void print_request(const char *message, MPI_Request request);
 
@@ -193,6 +204,8 @@ MPI_Request smpi_isend_init(void *buf, int count, MPI_Datatype datatype,
                             int dst, int tag, MPI_Comm comm);
 MPI_Request smpi_mpi_isend(void *buf, int count, MPI_Datatype datatype,
                            int dst, int tag, MPI_Comm comm);
+MPI_Request smpi_issend_init(void *buf, int count, MPI_Datatype datatype,
+                            int dst, int tag, MPI_Comm comm);
 MPI_Request smpi_mpi_issend(void *buf, int count, MPI_Datatype datatype,
                            int dst, int tag, MPI_Comm comm);
 MPI_Request smpi_irecv_init(void *buf, int count, MPI_Datatype datatype,
@@ -286,10 +299,21 @@ int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts,
                               MPI_Comm comm);
 
 // utilities
+extern double smpi_cpu_threshold;
+extern double smpi_running_power;
+extern int smpi_privatize_global_variables;
+extern char* start_data_exe; //start of the data+bss segment of the executable
+extern int size_data_exe; //size of the data+bss segment of the executable
+
+
+void switch_data_segment(int);
+void smpi_get_executable_global_size(void);
+void smpi_initialize_global_memory_segments(void);
+void smpi_destroy_global_memory_segments(void);
 void smpi_bench_destroy(void);
 void smpi_bench_begin(void);
 void smpi_bench_end(void);
-void smpi_execute_flops(double flops);
+
 
 // f77 wrappers
 void mpi_init_(int*);
@@ -548,10 +572,25 @@ void mpi_comm_get_parent_ ( int*parent, int* ierr);
 /* from smpi_instr.c */
 void TRACE_internal_smpi_set_category (const char *category);
 const char *TRACE_internal_smpi_get_category (void);
-void TRACE_smpi_collective_in(int rank, int root, const char *operation);
+void TRACE_smpi_collective_in(int rank, int root, const char *operation, instr_extra_data extra);
 void TRACE_smpi_collective_out(int rank, int root, const char *operation);
 void TRACE_smpi_computing_init(int rank);
 void TRACE_smpi_computing_out(int rank);
-void TRACE_smpi_computing_in(int rank);
+void TRACE_smpi_computing_in(int rank, instr_extra_data extra);
+void TRACE_smpi_alloc(void);
+void TRACE_smpi_release(void);
+void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation,  instr_extra_data extra);
+void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation);
+void TRACE_smpi_send(int rank, int src, int dst, int size);
+void TRACE_smpi_recv(int rank, int src, int dst);
+void TRACE_smpi_init(int rank);
+void TRACE_smpi_finalize(int rank);
+
+
+const char* encode_datatype(MPI_Datatype datatype);
+
+// TODO, make this static and expose it more cleanly
+extern void** mappings;
+extern int loaded_page;
 
 #endif