X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1d5439c122fc2718dc2ef620fbdccec5ca83ab5c..31a999f9a0f6420f98301e553cb0e5f0c8b2a1c8:/src/mc/mc_private.h diff --git a/src/mc/mc_private.h b/src/mc/mc_private.h index 2f886d969b..a44df30612 100644 --- a/src/mc/mc_private.h +++ b/src/mc/mc_private.h @@ -95,6 +95,13 @@ typedef struct s_mc_snapshot_ignored_data { void* data; } s_mc_snapshot_ignored_data_t, *mc_snapshot_ignored_data_t; +typedef struct s_fd_infos{ + char *filename; + int number; + off_t current_position; + int flags; +}s_fd_infos_t, *fd_infos_t; + typedef struct s_mc_snapshot{ size_t heap_bytes_used; mc_mem_region_t regions[NB_REGIONS]; @@ -106,8 +113,11 @@ typedef struct s_mc_snapshot{ xbt_dynar_t to_ignore; uint64_t hash; xbt_dynar_t ignored_data; + int total_fd; + fd_infos_t *current_fd; } s_mc_snapshot_t; + /** @brief Process index used when no process is available * * The expected behaviour is that if a process index is needed it will fail. @@ -247,9 +257,23 @@ char* MC_request_to_string(smx_simcall_t req, int value); unsigned int MC_request_testany_fail(smx_simcall_t req); /*int MC_waitany_is_enabled_by_comm(smx_req_t req, unsigned int comm);*/ int MC_request_is_visible(smx_simcall_t req); + +/** Can this requests can be executed. + * + * Most requests are always enabled but WAIT and WAITANY + * are not always enabled: a WAIT where the communication does not + * have both a source and a destination yet is not enabled + * (unless timeout is enabled in the wait and enabeld in SimGridMC). + */ int MC_request_is_enabled(smx_simcall_t req); int MC_request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx); + +/** Is the process ready to execute its simcall? + * + * This is true if the request associated with the process is ready. + */ int MC_process_is_enabled(smx_process_t process); + char *MC_request_get_dot_output(smx_simcall_t req, int value); @@ -276,7 +300,7 @@ typedef struct mc_procstate{ typedef struct mc_state { unsigned long max_pid; /* Maximum pid at state's creation time */ mc_procstate_t proc_status; /* State's exploration status by process */ - s_smx_action_t internal_comm; /* To be referenced by the internal_req */ + s_smx_synchro_t internal_comm; /* To be referenced by the internal_req */ s_smx_simcall_t internal_req; /* Internal translation of request */ s_smx_simcall_t executed_req; /* The executed request of the state */ int req_num; /* The request number (in the case of a @@ -499,7 +523,6 @@ extern mc_object_info_t mc_object_infos[2]; extern size_t mc_object_infos_size; void MC_find_object_address(memory_map_t maps, mc_object_info_t result); -void MC_post_process_types(mc_object_info_t info); void MC_post_process_object_info(mc_object_info_t info); // ***** Expressions @@ -695,7 +718,7 @@ typedef struct s_local_variable{ typedef struct s_mc_comm_pattern{ int num; - smx_action_t comm; + smx_synchro_t comm; e_smx_comm_type_t type; unsigned long src_proc; unsigned long dst_proc; @@ -735,7 +758,8 @@ static inline mc_call_type mc_get_call_type(smx_simcall_t req) { } void get_comm_pattern(xbt_dynar_t communications_pattern, smx_simcall_t request, mc_call_type call_type); -void complete_comm_pattern(xbt_dynar_t list, smx_action_t comm); +void mc_update_comm_pattern(mc_call_type call_type, smx_simcall_t request, int value, xbt_dynar_t current_pattern); +void complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm); void MC_pre_modelcheck_comm_determinism(void); void MC_modelcheck_comm_determinism(void); @@ -885,6 +909,15 @@ void* mc_snapshot_read_pointer_region(void* addr, mc_mem_region_t region) xbt_free(req_str); \ } +/** @brief Dump the stacks of the application processes + * + * This functions is currently not used but it is quite convenient + * to call from the debugger. + * + * Does not work when an application thread is running. + */ +void MC_dump_stacks(FILE* file); + SG_END_DECL() #endif