git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7802
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
ADD_TEST(mc-bugged1 ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/examples/msg/mc bugged1.tesh)
ADD_TEST(mc-bugged2 ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/examples/msg/mc bugged2.tesh)
ADD_TEST(mc-centralized ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/examples/msg/mc centralized.tesh)
ADD_TEST(mc-bugged1 ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/examples/msg/mc bugged1.tesh)
ADD_TEST(mc-bugged2 ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/examples/msg/mc bugged2.tesh)
ADD_TEST(mc-centralized ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/examples/msg/mc centralized.tesh)
if(HAVE_JAVA)
# java examples
if(HAVE_JAVA)
# java examples
SET(HAVE_TRACING 1)
endif(enable_tracing)
SET(HAVE_TRACING 1)
endif(enable_tracing)
-if(enable_model-checking)
+if(enable_model-checking AND HAVE_MMAP)
+ SET(HAVE_MC 1)
SET(MMALLOC_WANT_OVERIDE_LEGACY 1)
SET(MMALLOC_WANT_OVERIDE_LEGACY 1)
-endif(enable_model-checking)
+endif(enable_model-checking AND HAVE_MMAP)
if(enable_lua)
exec_program("lua -v" OUTPUT_VARIABLE LUA_VERSION)
if(enable_lua)
exec_program("lua -v" OUTPUT_VARIABLE LUA_VERSION)
src/xbt/cunit.c
src/xbt/graphxml_parse.c
src/xbt/setset.c
src/xbt/cunit.c
src/xbt/graphxml_parse.c
src/xbt/setset.c
+if(HAVE_MMAP)
+ set(XBT_SRC
+ ${XBT_SRC}
+ src/xbt/mmalloc/mm.c
+ )
+endif(HAVE_MMAP)
+
set(GTNETS_SRC
src/surf/gtnets/gtnets_simulator.cc
src/surf/gtnets/gtnets_topology.cc
set(GTNETS_SRC
src/surf/gtnets/gtnets_simulator.cc
src/surf/gtnets/gtnets_topology.cc
set(install_HEADERS
include/xbt/misc.h
include/xbt/sysdep.h
set(install_HEADERS
include/xbt/misc.h
include/xbt/sysdep.h
${GRAS_COMMON_SRC}
${GRAS_SG_SRC}
${AMOK_SRC}
${GRAS_COMMON_SRC}
${GRAS_SG_SRC}
${AMOK_SRC}
+if(enable_model-checking AND HAVE_MMAP)
+ set(simgrid_sources
+ ${simgrid_source}
+ ${MC_SRC}
+ )
+endif(enable_model-checking AND HAVE_MMAP)
+
### Gras Lib sources
set(gras_sources
${XBT_SRC}
### Gras Lib sources
set(gras_sources
${XBT_SRC}
add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/masterslave)
add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/trace)
add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/tracing)
add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/masterslave)
add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/trace)
add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/tracing)
-add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/mc)
+
+if(HAVE_MC)
+ add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/mc)
+endif(HAVE_MC)
+
if(HAVE_GTNETS)
add_definitions("-lgtnets -L${gtnets_path}/lib -I${gtnets_path}/include/gtnets")
add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/gtnets)
if(HAVE_GTNETS)
add_definitions("-lgtnets -L${gtnets_path}/lib -I${gtnets_path}/include/gtnets")
add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/gtnets)
/* Set to true if enable_model-checking is true */
#cmakedefine MMALLOC_WANT_OVERIDE_LEGACY @MMALLOC_WANT_OVERIDE_LEGACY@
/* Set to true if enable_model-checking is true */
#cmakedefine MMALLOC_WANT_OVERIDE_LEGACY @MMALLOC_WANT_OVERIDE_LEGACY@
+#cmakedefine HAVE_MC @HAVE_MC@
/* Define if building universal (internal helper macro) */
#cmakedefine AC_APPLE_UNIVERSAL_BUILD @AC_APPLE_UNIVERSAL_BUILD@
/* Define if building universal (internal helper macro) */
#cmakedefine AC_APPLE_UNIVERSAL_BUILD @AC_APPLE_UNIVERSAL_BUILD@
fflush(stderr);
SIMIX_init();
fflush(stderr);
SIMIX_init();
if (_surf_do_model_check)
MC_modelcheck(1);
else
if (_surf_do_model_check)
MC_modelcheck(1);
else
while (SIMIX_solve(NULL, NULL) != -1.0);
return MSG_OK;
while (SIMIX_solve(NULL, NULL) != -1.0);
return MSG_OK;
smx_comm_t comm;
/*If running in model-checking mode then intercept the communication action*/
smx_comm_t comm;
/*If running in model-checking mode then intercept the communication action*/
- if (_surf_do_model_check)
- MC_trans_intercept_isend(rdv);
-
+ #ifdef HAVE_MC
+ if (_surf_do_model_check)
+ MC_trans_intercept_isend(rdv);
+ #endif
/* Look for communication request matching our needs.
If it is not found then create it and push it into the rendez-vous point */
comm = SIMIX_rdv_get_request(rdv, comm_recv);
/* Look for communication request matching our needs.
If it is not found then create it and push it into the rendez-vous point */
comm = SIMIX_rdv_get_request(rdv, comm_recv);
smx_comm_t comm;
/*If running in model-checking mode then intercept the communication action*/
smx_comm_t comm;
/*If running in model-checking mode then intercept the communication action*/
if (_surf_do_model_check)
MC_trans_intercept_irecv(rdv);
if (_surf_do_model_check)
MC_trans_intercept_irecv(rdv);
/* Look for communication request matching our needs.
* If it is not found then create it and push it into the rendez-vous point
*/
/* Look for communication request matching our needs.
* If it is not found then create it and push it into the rendez-vous point
*/
XBT_INLINE void SIMIX_network_wait(smx_comm_t comm, double timeout)
{
/*If running in model-checking mode then intercept the communication action*/
XBT_INLINE void SIMIX_network_wait(smx_comm_t comm, double timeout)
{
/*If running in model-checking mode then intercept the communication action*/
if (_surf_do_model_check)
MC_trans_intercept_wait(comm);
if (_surf_do_model_check)
MC_trans_intercept_wait(comm);
/* Wait for communication completion */
SIMIX_communication_wait_for_completion(comm, timeout);
}
/* Wait for communication completion */
SIMIX_communication_wait_for_completion(comm, timeout);
}
XBT_INLINE int SIMIX_network_test(smx_comm_t comm)
{
/*If running in model-checking mode then intercept the communication action*/
XBT_INLINE int SIMIX_network_test(smx_comm_t comm)
{
/*If running in model-checking mode then intercept the communication action*/
if (_surf_do_model_check)
MC_trans_intercept_test(comm);
if (_surf_do_model_check)
MC_trans_intercept_test(comm);
/* Copy data if the communication is done */
if(comm->sem && !SIMIX_sem_would_block(comm->sem)){
/* Copy data if the communication is done */
if(comm->sem && !SIMIX_sem_would_block(comm->sem)){
smx_comm_t comm,comm_finished=NULL;
/*If running in model-checking mode then intercept the communication action*/
smx_comm_t comm,comm_finished=NULL;
/*If running in model-checking mode then intercept the communication action*/
if (_surf_do_model_check)
MC_trans_intercept_waitany(comms);
if (_surf_do_model_check)
MC_trans_intercept_waitany(comms);
xbt_dynar_foreach(comms,cursor,comm)
xbt_dynar_push(sems,&(comm->sem));
xbt_dynar_foreach(comms,cursor,comm)
xbt_dynar_push(sems,&(comm->sem));
/* Check for errors and cleanup the comm */
SIMIX_communication_wait_for_completion(comm_finished,-1);
return found_comm;
/* Check for errors and cleanup the comm */
SIMIX_communication_wait_for_completion(comm_finished,-1);
return found_comm;
-}
\ No newline at end of file
history = tmgr_history_new();
surf_config_init(argc, argv);
history = tmgr_history_new();
surf_config_init(argc, argv);
if (_surf_do_model_check)
MC_memory_init();
if (_surf_do_model_check)
MC_memory_init();