From: Martin Quinson Date: Thu, 8 May 2014 08:44:11 +0000 (+0200) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3_11~88^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1bfdc9a38c22af6a9becf133be154a2fa2bc6589?hp=13ee46b3a96091710df934f6af7e87170f3f2eef Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/.gitignore b/.gitignore index e865778409..4a612b2acf 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ *.plist *.trace *.class +\#* ################################################ ### Maintainer mode @@ -762,22 +763,8 @@ teshsuite/simdag/partask/test_comp_only_par teshsuite/simdag/partask/test_comp_only_seq teshsuite/xbt/log_large_test teshsuite/xbt/parallel_log_crashtest -testsuite/xbt/parmap_bench teshsuite/xbt/mmalloc_test teshsuite/xbt/parmap_test -testsuite/run_tests -testsuite/simdag/sd_test -testsuite/surf/lmm_usage -testsuite/surf/maxmin_bench -testsuite/surf/surf_usage -testsuite/surf/surf_usage2 -testsuite/surf/trace_usage -testsuite/testgraph.dot -testsuite/testgraph.xml -testsuite/xbt/context_usage -testsuite/xbt/graphxml_usage -testsuite/xbt/heap_bench -testsuite/xbt/log_usage tools/tesh/tesh examples/msg/tracing/categories examples/msg/tracing/ms diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ea7ddf60c..e90ed43bbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,7 @@ else() endif() set(SIMGRID_VERSION_STRING - "SimGrid version ${release_version}${SIMGRID_VERSION_EXTRA}\\nCopyright (c) ${SIMGRID_VERSION_DATE}. The Simgrid Team.") + "SimGrid version ${release_version}${SIMGRID_VERSION_EXTRA}\\nCopyright (c) 2004-${SIMGRID_VERSION_DATE}. The Simgrid Team.") set(libsimgrid_version "${release_version}") set(libsimgrid-java_version "${release_version}") @@ -99,6 +99,9 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU") endif() endif() +exec_program("${CMAKE_LINKER} --version" OUTPUT_VARIABLE "LINKER_VERSION") +string(REGEX MATCH "[0-9].[0-9]*" LINKER_VERSION "${LINKER_VERSION}") + string(REGEX MATCH "cl.exe" VBC "${CMAKE_C_COMPILER}") if(VBC) message(FATAL_ERROR "VB is not yet supported by Simgrid.") @@ -228,6 +231,10 @@ endif() include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MakeExe.cmake) ### Make tests +if(enable_memcheck_xml) + set(enable_memcheck true) +endif() + include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/AddTests.cmake) include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/CTestConfig.cmake) diff --git a/ChangeLog b/ChangeLog index 5abdda77c9..6e9e4b902b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,11 +25,37 @@ SimGrid (3.11) NOT RELEASED; urgency=low - examples/msg/cloud/simple_vm.tesh - examples/java/cloud/cloud.tesh - examples/java/cloud/migration/migration.tesh + * Add java surf examples: + - examples/java/surfPlugin/surf_plugin.tesh + - examples/java/reservationSurfPlugin/reservation_surf_plugin.tes + - examples/java/surfCpuModel/surf_cpu_model.tesh + * Add SMPI+MSG example: + - examples/smpi/smpi_msg_masterslave/ + + TeshSuite: + * Add tests: + - msg process test + - msg task destroy cancel test + - msg_host on/off test + * Move all tests in testsuite to teshsuite (adding tesh files) + * Restructure teshsuites + - one folder for each kind of test + * Restructure AddTests.cmake + - unify tests names + - structure the order of tests (with sections) MSG: * Add virtual machine - creation of a VM on a PM - migration of a VM from a PM to another PM + * New functions + - MSG_process_join(msg_process_t process, double timeout) + - msg_bar_t MSG_barrier_init(unsigned int count) + - int MSG_barrier_wait(msg_bar_t barrier) + - void MSG_barrier_destroy(msg_bar_t barrier) + - msg_as_t MSG_environment_as_get_by_name(const char * name) + * New option "msg/debug_multiple_use" to help debugging when a task is used + several times SIMIX: * Protect context stacks against stack overflow. The number of protected memory @@ -41,12 +67,15 @@ SimGrid (3.11) NOT RELEASED; urgency=low * Clean simcalls - remove sem_destroy, file_set_data, comm_destroy, vm_set_state, host_set_data, host_get_data + * New simcalls + - simcall_process_join(smx_process_t process, double timeout) + * Fix bug where sleeping processing could not be suspended. SURF: * Translate surf models from C to C++ - Generic classes for all models: Model, Resource, Action - - A generic interface for each kind of model (cpu, network, storage - workstation, workstationvm) + - A generic interface for each kind of model (CPU, Network, Storage + Workstation, WorkstationVM) - C bindings * Translate surf routings from C to C++ * Add callbacks using sigc++ or boost::signals2 @@ -54,20 +83,43 @@ SimGrid (3.11) NOT RELEASED; urgency=low - Add callback functions for action state change - Handle Energy as a plugin * Replace swag by boost::intrusive - * Add new routing model for torus clusters + * Add new routing model for torus clusters + - topology="TORUS" and topo_parameters="ndim1,ndim2,...,ndimn" parameters + for cluster tag + - see examples/platforms/torus_cluster.xml * More documentation SMPI: - * hostfiles support host:nb_processes construct to deploy several processes on - one node + * Hostfiles support host:nb_processes construct to deploy several processes on + one node. * Collective communication algorithms should not crash if used with improper number of nodes and report the error. + * SMPI now partially supports MPI_Topologies : MPI_Cart_create, MPI_Cart_shift, + MPI_Cart_rank, MPI_Cart_get, MPI_Cart_coords, MPI_Cartdim_get, + MPI_Dims_create, MPI_Cart_sub are supported. + * New interface to use SMPI programmatically (still depends on MSG for + some parts, see examples/smpi/smpi_msg_masterslave) : + - SMPI_app_instance_register(const char *name, xbt_main_func_t code, + int num_processes) + - SMPI_init() + - SMPI_finalize(); + * Global variables privatization in MPI executables is now performed at runtime + with the option smpi/privatize_global_variables (default:no). + Limitations : Linux/BSD only, with mmap enabled. Global variables inside + dynamic libraries loaded by the application are not privatized (static + linking with these libraries is advised in this case) + + Tracing: + * Options defined in XML work correctly now. Java: * New cmake option, enable_lib_in_jar, to control whether native libraries are copied into simgrid.jar or not (ON by default). Use this option if you want to reduce the size of the installed simgrid.jar, *and* the native libraries are kept installed elsewhere. + * Surf binding with SWIG (code generated in maintainer mode only): + - plugin to handle callbacks + - CPU model only for the moment Build System: * Supernovae build mode is definitively removed. It was used to improve @@ -75,6 +127,15 @@ SimGrid (3.11) NOT RELEASED; urgency=low link-time optimizations commonly available in compilers. * Update ns-3 find lib. Bindings for ns-3 should work again now. * Add boost dependency for surf++ + * Add new macro for tests + - ADD_TESH(name ) + - ADD_TESH_FACTORIES(name "thread;ucontext;raw" ) + + XBT: + * New functions + - xbt_bar_t XBT_barrier_init(unsigned int count) + - int XBT_barrier_wait(xbt_bar_t barrier) + - void XBT_barrier_destroy(xbt_bar_t barrier) -- $date Da SimGrid team diff --git a/README.coding b/README.coding index c78b39b68c..a5c9b96484 100644 --- a/README.coding +++ b/README.coding @@ -23,12 +23,6 @@ The tree is not split on projects, but on file finality: src/include -> another location for protected headers. Used by SURF, and other should be converted, since this is the Right Thing. - testsuite/ -> The more test the better. - Same organization than src/ and include/ - Tests are allowed to load some headers of the module they test. - All tests should be listed in run_test.in so that they get - run on 'make check'. - examples/ -> Supposed to be copy/pastable by the user, so keep it clear and avoid any kind of trick. In particular, do only include the public headers here. @@ -39,9 +33,6 @@ The tree is not split on projects, but on file finality: unusual behaviors. All tests written in this section should leverage our tesh(1) utility. - testsuite/ -> Old test suite, that should be converted to tesh and - moved to teshsuite at some point. - ** ** Indentation standard ** diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index 106e4c3753..00e03ca228 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -1,15 +1,16 @@ -if(enable_memcheck) +IF(enable_memcheck) include(FindValgrind) -endif() +ENDIF() -if(enable_smpi AND NOT WIN32) +IF(enable_smpi AND NOT WIN32) exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicc" OUTPUT_VARIABLE "OKITOKI") + exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicxx" OUTPUT_VARIABLE "OKITOKI") exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif2c" OUTPUT_VARIABLE "OKITOKI") exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpiff" OUTPUT_VARIABLE "OKITOKI") exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif90" OUTPUT_VARIABLE "OKITOKI") exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpirun" OUTPUT_VARIABLE "OKITOKI") -endif() +ENDIF() ### For code coverage ### Set some variables @@ -21,706 +22,496 @@ SET(DROP_SITE_CDASH TRUE) SET(TRIGGER_SITE "http://cdash.inria.fr/CDash/cgi-bin/Submit-Random-TestingResults.cgi") #If you use the --read-var-info option Memcheck will run more slowly but may give a more detailed description of any illegal address. -if(WIN32) +IF(WIN32) SET(TESH_COMMAND perl.exe ${CMAKE_BINARY_DIR}/bin/tesh) SET(TESH_OPTION $TESH_OPTION --timeout 50) -else() +ELSE() SET(TESH_COMMAND ${CMAKE_BINARY_DIR}/bin/tesh) -endif() +ENDIF() #some tests may take forever on non futexes systems, using busy_wait with n cores < n workers # default to posix for these tests if futexes are not supported -if(NOT HAVE_FUTEX_H) +IF(NOT HAVE_FUTEX_H) SET(CONTEXTS_SYNCHRO --cfg contexts/synchro:posix) -endif() - +ENDIF() + +MACRO(ADD_TESH NAME) + SET(ARGR ${ARGV}) + LIST(REMOVE_AT ARGR 0) + ADD_TEST(${NAME} ${TESH_COMMAND} ${TESH_OPTION} ${ARGR}) +ENDMACRO() + +MACRO(ADD_TESH_FACTORIES NAME FACTORIES) + SET(ARGR ${ARGV}) + LIST(REMOVE_AT ARGR 0) # remove name + FOREACH(I ${FACTORIES}) # remove all factories + LIST(REMOVE_AT ARGR 0) + ENDFOREACH() + FOREACH(FACTORY ${FACTORIES}) + if ((${FACTORY} STREQUAL "thread") OR + (${FACTORY} STREQUAL "raw" AND HAVE_RAWCTX) OR + (${FACTORY} STREQUAL "ucontext" AND CONTEXT_UCONTEXT)) + ADD_TESH("${NAME}-${FACTORY}" "--cfg" "contexts/factory:${FACTORY}" ${ARGR}) + ENDIF() + ENDFOREACH() +ENDMACRO() INCLUDE(CTest) ENABLE_TESTING() -if(NOT enable_memcheck) - ADD_TEST(tesh-self-basic ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/basic.tesh) - ADD_TEST(tesh-self-cd ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/cd.tesh) - ADD_TEST(tesh-self-IO-broken-pipe ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-broken-pipe.tesh) - ADD_TEST(tesh-self-IO-orders ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-orders.tesh) - ADD_TEST(tesh-self-IO-bigsize ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-bigsize.tesh) - ADD_TEST(tesh-self-set-return ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-return.tesh) - ADD_TEST(tesh-self-set-timeout ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-timeout.tesh) - ADD_TEST(tesh-self-set-output-ignore ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-output-ignore.tesh) - ADD_TEST(tesh-self-set-output-sort ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-output-sort.tesh) - ADD_TEST(tesh-self-catch-return ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-return.tesh) - ADD_TEST(tesh-self-catch-timeout ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-timeout.tesh) - ADD_TEST(tesh-self-catch-wrong-output ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-wrong-output.tesh) - ADD_TEST(tesh-self-bg-basic ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/bg-basic.tesh) - ADD_TEST(tesh-self-background ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/background.tesh) - - if(NOT WIN32) - ADD_TEST(tesh-self-set-signal ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-signal.tesh) - ADD_TEST(tesh-self-bg-set-signal ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/bg-set-signal.tesh) - ADD_TEST(tesh-self-catch-signal ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-signal.tesh) - endif() +IF(NOT enable_memcheck) + ## CORE ## + ### TESH ### + ADD_TESH(tesh-self-basic --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/basic.tesh) + ADD_TESH(tesh-self-cd --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/cd.tesh) + ADD_TESH(tesh-self-IO-broken-pipe --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-broken-pipe.tesh) + ADD_TESH(tesh-self-IO-orders --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-orders.tesh) + ADD_TESH(tesh-self-IO-bigsize --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-bigsize.tesh) + ADD_TESH(tesh-self-set-return --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-return.tesh) + ADD_TESH(tesh-self-set-timeout --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-timeout.tesh) + ADD_TESH(tesh-self-set-output-ignore --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-output-ignore.tesh) + ADD_TESH(tesh-self-set-output-sort --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-output-sort.tesh) + ADD_TESH(tesh-self-catch-return --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-return.tesh) + ADD_TESH(tesh-self-catch-timeout --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-timeout.tesh) + ADD_TESH(tesh-self-catch-wrong-output --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-wrong-output.tesh) + ADD_TESH(tesh-self-bg-basic --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/bg-basic.tesh) + ADD_TESH(tesh-self-background --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/background.tesh) + IF(NOT WIN32) + ADD_TESH(tesh-self-set-signal --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-signal.tesh) + ADD_TESH(tesh-self-bg-set-signal --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/bg-set-signal.tesh) + ADD_TESH(tesh-self-catch-signal --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-signal.tesh) + ENDIF() + + ### GENERIC ### # BEGIN TESH TESTS - # test for code coverage - ADD_TEST(help ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test --help) - ADD_TEST(help-models ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test --help-models) + ADD_TEST(test-help ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test --help) + ADD_TEST(test-help-models ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test --help-models) + IF(HAVE_TRACING) + ADD_TEST(test-tracing-help ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test --help-tracing) + ADD_TESH(graphicator --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_HOME_DIRECTORY}/tools/graphicator graphicator.tesh) + ENDIF() + # END TESH TESTS + + ### MC ### + IF(HAVE_MC) + ADD_TESH(tesh-mc-dwarf --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/dwarf --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/dwarf dwarf.tesh) + ADD_TESH(tesh-mc-dwarf-expression --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/dwarf_expression --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/dwarf_expression dwarf_expression.tesh) + + ADD_TESH_FACTORIES(mc-bugged1 "ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh) + ADD_TESH_FACTORIES(mc-bugged2 "ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh) + IF(CONTEXT_UCONTEXT AND PROCESSOR_x86_64) # liveness model-checking works only on 64bits (for now ...) + ADD_TESH(mc-bugged1-liveness-ucontext --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness.tesh) + ADD_TESH(mc-bugged1-liveness-visited-ucontext --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness_visited.tesh) + ENDIF() + ENDIF() + - # teshsuite/xbt - ADD_TEST(xbt-log-large ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_large_test.tesh) - ADD_TEST(xbt-log-parallel ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parallel_log_crashtest.tesh) + ### SIMIX ### + # BEGIN TESH TESTS + IF(HAVE_RAWCTX) + ADD_TESH(tesh-simix-factory-default --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/check_defaults --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/check_defaults factory_raw.tesh) + ELSEIF(CONTEXT_UCONTEXT) + ADD_TESH(tesh-simix-factory-default --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/check_defaults --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/check_defaults factory_ucontext.tesh) + ELSE() + ADD_TESH(tesh-simix-factory-default --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/check_defaults --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/check_defaults factory_thread.tesh) + ENDIF() + ADD_TESH(tesh-simix-factory-thread --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/check_defaults --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/check_defaults factory_thread.tesh) + IF(HAVE_RAWCTX) + ADD_TESH(tesh-simix-factory-raw --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/check_defaults --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/check_defaults factory_raw.tesh) + ENDIF() + IF(CONTEXT_UCONTEXT) + ADD_TESH(tesh-simix-factory-ucontext --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/check_defaults --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/check_defaults factory_ucontext.tesh) + ENDIF() + # END TESH TESTS + ADD_TESH_FACTORIES(stack-overflow "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/stack_overflow --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/stack_overflow stack_overflow.tesh) + ### + ### Declare that we know that some tests are broken + ### + IF(release) + IF(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Darwin") + # These tests are known to fail on Windows and Mac OS X + # (the expected error message is not shown). + SET_TESTS_PROPERTIES(stack-overflow-thread PROPERTIES WILL_FAIL true) + IF(CONTEXT_UCONTEXT) + SET_TESTS_PROPERTIES(stack-overflow-ucontext PROPERTIES WILL_FAIL true) + ENDIF() + IF(HAVE_RAWCTX) + SET_TESTS_PROPERTIES(stack-overflow-raw PROPERTIES WILL_FAIL true) + ENDIF() + ENDIF() + ENDIF() + + + ### SURF ### + # BEGIN TESH TESTS + ADD_TESH(tesh-surf-lmm --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/surf/lmm_usage --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/lmm_usage lmm_usage.tesh) + ADD_TESH(tesh-surf-maxmin --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/surf/maxmin_bench --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/maxmin_bench maxmin_bench.tesh) + ADD_TESH(tesh-surf-usage --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/surf/surf_usage --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/ surf_usage/surf_usage.tesh) + ADD_TESH(tesh-surf-trace --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/surf/trace_usage --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/ trace_usage/trace_usage.tesh) + # END TESH TESTS + + + ### XBT ### + # BEGIN TESH TESTS + ADD_TESH(tesh-xbt-log-large --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/log_large --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_large log_large_test.tesh) + ADD_TESH(tesh-xbt-log-parallel --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/parallel_log --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parallel_log parallel_log_crashtest.tesh) IF(HAVE_MMALLOC) IF(${ARCH_32_BITS}) - ADD_TEST(xbt-mmalloc-32 ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc_32.tesh) + ADD_TESH(tesh-xbt-mmalloc-32 --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/mmalloc --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc mmalloc_32.tesh) ELSE() - ADD_TEST(xbt-mmalloc-64 ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc_64.tesh) + ADD_TESH(tesh-xbt-mmalloc-64 --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/mmalloc --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc mmalloc_64.tesh) ENDIF() ENDIF() - ADD_TEST(xbt-parmap ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parmap_test.tesh) - - # BEGIN CONTEXTS FACTORY - if(HAVE_RAWCTX) - ADD_TEST(simix-factory-default ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_raw.tesh) - elseif(CONTEXT_UCONTEXT) - ADD_TEST(simix-factory-default ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_ucontext.tesh) - else() - ADD_TEST(simix-factory-default ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_thread.tesh) - endif() - ADD_TEST(simix-factory-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_thread.tesh) - if(HAVE_RAWCTX) - ADD_TEST(simix-factory-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_raw.tesh) - endif() - if(CONTEXT_UCONTEXT) - ADD_TEST(simix-factory-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_ucontext.tesh) - endif() - - ADD_TEST(tesh-msg-get-sender-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh) - if(HAVE_RAWCTX) - ADD_TEST(tesh-msg-get-sender-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh) - endif() - if(CONTEXT_UCONTEXT) - ADD_TEST(tesh-msg-get-sender-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh) - endif() - - ADD_TEST(tesh-msg-pid-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid.tesh) - if(HAVE_RAWCTX) - ADD_TEST(tesh-msg-pid-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid.tesh) - endif() - if(CONTEXT_UCONTEXT) - ADD_TEST(tesh-msg-pid-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid.tesh) - endif() - - ADD_TEST(tesh-msg-host-on-off-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off.tesh) - if(HAVE_RAWCTX) - ADD_TEST(tesh-msg-host-on-off-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off.tesh) - endif() - if(CONTEXT_UCONTEXT) - ADD_TEST(tesh-msg-host-on-off-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off.tesh) - endif() - - ADD_TEST(tesh-msg-task-destroy-cancel-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel.tesh) - if(HAVE_RAWCTX) - ADD_TEST(tesh-msg-task-destroy-cancel-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel.tesh) - endif() - if(CONTEXT_UCONTEXT) - ADD_TEST(tesh-msg-task-destroy-cancel-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel.tesh) - endif() - - ADD_TEST(tesh-msg-process-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process.tesh) - if(HAVE_RAWCTX) - ADD_TEST(tesh-msg-process-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process.tesh) - endif() - if(CONTEXT_UCONTEXT) - ADD_TEST(tesh-msg-process-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process.tesh) - endif() + ADD_TESH(tesh-xbt-parmap --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/parmap_test --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parmap_test parmap_test.tesh) + ADD_TESH(tesh-xbt-log --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/log_usage --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_usage log_usage.tesh) + ADD_TESH(tesh-xbt-graphxml --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/graphxml_usage --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/graphxml_usage graphxml_usage.tesh) + ADD_TESH(tesh-xbt-heap --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/heap_bench --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/heap_bench heap_bench.tesh) + #ADD_TESH(test-xbt-parmap --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/parmap_bench --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parmap_bench parmap_bench.tesh) + # END TESH TESTS + ## INTERFACES ## + ### MSG ### + # BEGIN TESH TESTS + ADD_TESH_FACTORIES(tesh-msg-get-sender "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/get_sender ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender/get_sender.tesh) + ADD_TESH_FACTORIES(tesh-msg-host-on-off "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/host_on_off ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off/host_on_off.tesh) + ADD_TESH_FACTORIES(tesh-msg-pid "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/pid ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid/pid.tesh) + ADD_TESH_FACTORIES(tesh-msg-process "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/process ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process/process.tesh) + ADD_TESH_FACTORIES(tesh-msg-process-join "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process_join --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/process_join ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process_join/process_join.tesh) + ADD_TESH_FACTORIES(tesh-msg-storage-basic "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/storage ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage/storage_basic.tesh) + ADD_TESH_FACTORIES(tesh-msg-task-destroy-cancel "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/task_destroy_cancel ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh) + ADD_TESH_FACTORIES(tesh-msg-trace "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/trace --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace/trace.tesh) + + ADD_TESH(msg-file --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/io/io.tesh) + ADD_TESH(msg-storage --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/io/storage.tesh) + ADD_TESH(msg-start-kill-time --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/start_kill_time/start_kill_time.tesh) + ADD_TESH(msg-chainsend --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chainsend --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/chainsend --cd ${CMAKE_HOME_DIRECTORY}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/chainsend/chainsend.tesh) + ADD_TESH_FACTORIES(msg-sendrecv-CLM03 "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh) + ADD_TESH_FACTORIES(msg-sendrecv-Vegas "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh) + ADD_TESH_FACTORIES(msg-sendrecv-Reno "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh) + ADD_TESH_FACTORIES(msg-suspend "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh) + ADD_TESH_FACTORIES(msg-pmm "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh) + ADD_TESH_FACTORIES(msg-masterslave-bypass "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh) + ADD_TESH_FACTORIES(msg-masterslave-kill "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_kill.tesh) + ADD_TESH_FACTORIES(msg-masterslave-multicore "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh) + ADD_TESH_FACTORIES(msg-masterslave-no-crosstraffic-mailbox "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh) + ADD_TESH_FACTORIES(msg-masterslave-no-crosstraffic "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh) + ADD_TESH_FACTORIES(msg-masterslave-no-crosstraffic-forwarder "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh) + ADD_TESH_FACTORIES(msg-masterslave-no-crosstraffic-failure "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh) + ADD_TESH_FACTORIES(msg-masterslave "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_crosstraffic.tesh) + ADD_TESH_FACTORIES(msg-masterslave-forwarder "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder_crosstraffic.tesh) + ADD_TESH_FACTORIES(msg-masterslave-failure "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure_crosstraffic.tesh) + ADD_TESH_FACTORIES(msg-masterslave-mailbox "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox_crosstraffic.tesh) + ADD_TESH_FACTORIES(msg-masterslave-cpu-ti "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti_crosstraffic.tesh) + ADD_TESH_FACTORIES(msg-masterslave-vivaldi "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh) + ADD_TESH_FACTORIES(msg-cloud-two-tasks-vm "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/two_tasks_vm.tesh) + ADD_TESH_FACTORIES(msg-cloud-simple-vm "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/simple_vm.tesh) + ADD_TESH_FACTORIES(msg-energy-pstates "thread" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e1/pstate.tesh) + ADD_TESH_FACTORIES(msg-energy-consumption "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e2/energy_consumption.tesh) + ADD_TESH_FACTORIES(msg-energy-concurrent-tasks "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e3/concurrent_tasks.tesh) + ADD_TESH_FACTORIES(msg-token-ring "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh) + ADD_TESH_FACTORIES(msg-migration "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh) + ADD_TESH_FACTORIES(msg-ptask "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh) + ADD_TESH_FACTORIES(msg-priority "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh) + ADD_TESH_FACTORIES(msg-properties "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh) + ADD_TESH_FACTORIES(msg-icomms "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh) + ADD_TESH_FACTORIES(msg-actions "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh) + ADD_TESH_FACTORIES(msg-chord-no-crosstraffic "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh) + ADD_TESH_FACTORIES(msg-chord-no-crosstraffic-parallel "thread;ucontext;raw" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh) + ADD_TESH_FACTORIES(msg-chord "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh) + ADD_TESH_FACTORIES(msg-chord-parallel "thread;ucontext;raw" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh) + ADD_TESH_FACTORIES(msg-bittorrent "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh) + ADD_TESH_FACTORIES(msg-bittorrent-parallel "thread;ucontext;raw" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh) + ADD_TESH_FACTORIES(msg-kademlia "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh) + ADD_TESH_FACTORIES(msg-kademlia-parallel "thread;ucontext;raw" --cfg contexts/nthreads:4 --cfg contexts/factory:thread ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh) + ADD_TESH_FACTORIES(msg-gtnets-crosstraffic "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh) + IF(HAVE_GTNETS) + ADD_TESH_FACTORIES(msg-gtnets-waxman "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh) + ADD_TESH_FACTORIES(msg-gtnets-dogbone "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh) + ADD_TESH_FACTORIES(msg-gtnets-onelink "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh) + ADD_TESH_FACTORIES(msg-gtnets-dogbone-lv08 "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh) + ADD_TESH_FACTORIES(msg-gtnets-onelink-lv08 "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh) + IF(HAVE_TRACING) + ADD_TESH(msg-tracing-gtnets-waxman --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-waxman.tesh) + ADD_TESH(msg-tracing-gtnets-dogbone --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-gtnets.tesh) + ADD_TESH(msg-tracing-gtnets-onelink --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-gtnets.tesh) + ADD_TESH(msg-tracing-gtnets-dogbone-lv08 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-lv08.tesh) + ADD_TESH(msg-tracing-gtnets-onelink-lv08 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-lv08.tesh) + ENDIF() + ENDIF() + IF(HAVE_NS3) + ADD_TESH_FACTORIES(msg-ns3 "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh) + ENDIF() + IF(HAVE_TRACING) + ADD_TESH(tracing-ms --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/ms.tesh) + ADD_TESH(tracing-trace-platform --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/trace_platform.tesh) + ADD_TESH(tracing-user-variables --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/user_variables.tesh) + ADD_TESH(tracing-link-user-variables --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/link_user_variables.tesh) + ADD_TESH(tracing-link-srcdst-user-variables --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/link_srcdst_user_variables.tesh) + ADD_TESH(tracing-categories --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/categories.tesh) + ADD_TESH(tracing-process-migration --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/procmig.tesh) + ENDIF() + ADD_TEST(msg-icomms-waitany ${CMAKE_BINARY_DIR}/examples/msg/icomms/peer3 ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/small_platform.xml ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/deployment_peer05.xml) + # END TESH TESTS + + + ### SIMDAG ### + # BEGIN TESH TESTS # these tests need the assertion mechanism # exclude them from memcheck, as they normally die, leaving lots of unfree'd objects IF(enable_debug AND NOT enable_memcheck) - ADD_TEST(tesh-parser-bogus-symmetric ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms bogus_two_hosts_asymetric.tesh) - ADD_TEST(tesh-parser-bogus-missing-gw ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms bogus_missing_gateway.tesh) - ADD_TEST(tesh-disk-attachment ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms bogus_disk_attachment.tesh) + ADD_TESH(tesh-parser-bogus-symmetric --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms bogus_two_hosts_asymetric.tesh) + ADD_TESH(tesh-parser-bogus-missing-gw --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms bogus_missing_gateway.tesh) + ADD_TESH(tesh-disk-attachment --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms bogus_disk_attachment.tesh) ENDIF() + ADD_TESH(tesh-simdag-bypass --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_bypass.tesh) + ADD_TESH(tesh-simdag-flatifier --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms flatifier.tesh) + ADD_TESH(tesh-simdag-link --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_link_test.tesh) + ADD_TESH(tesh-simdag-reinit-costs --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/test_reinit_costs.tesh) + ADD_TESH(tesh-simdag-parser --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh) + ADD_TESH(tesh-simdag-parser-sym-full --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_sym_full.tesh) + ADD_TESH(tesh-simdag-full-links --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms get_full_link.tesh) + ADD_TESH(tesh-simdag-basic0 --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic basic0.tesh) + ADD_TESH(tesh-simdag-basic1 --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic basic1.tesh) + ADD_TESH(tesh-simdag-basic2 --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic basic2.tesh) + ADD_TESH(tesh-simdag-basic3 --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic basic3.tesh) + ADD_TESH(tesh-simdag-basic4 --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic basic4.tesh) + ADD_TESH(tesh-simdag-basic5 --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic basic5.tesh) + ADD_TESH(tesh-simdag-basic6 --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic basic6.tesh) + ADD_TESH(tesh-simdag-incomplete --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/incomplete --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/incomplete incomplete.tesh) + ADD_TESH(tesh-simdag-p2p-1 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency1.tesh) + ADD_TESH(tesh-simdag-p2p-2 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency2.tesh) + ADD_TESH(tesh-simdag-p2p-3 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency3.tesh) + ADD_TESH(tesh-simdag-p2p-4 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency_bound.tesh) + ADD_TESH(tesh-simdag-mxn-1 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_all2all.tesh) + ADD_TESH(tesh-simdag-mxn-2 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_independent_comm.tesh) + ADD_TESH(tesh-simdag-mxn-3 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_scatter.tesh) + ADD_TESH(tesh-simdag-par-1 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_seq.tesh) + ADD_TESH(tesh-simdag-par-2 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_par.tesh) + ADD_TESH(tesh-simdag-availability --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/availability/availability_test.tesh) + ADD_TEST(tesh-simdag-full-links01 ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms/two_clusters.xml FULL_LINK) + ADD_TEST(tesh-simdag-full-links02 ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms/two_clusters_one_name.xml FULL_LINK) + ADD_TEST(tesh-simdag-one-link-g5k ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test ${CMAKE_HOME_DIRECTORY}/examples/platforms/g5k.xml ONE_LINK) + # END TESH TESTS - ADD_TEST(tesh-simdag-bypass ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_bypass.tesh) - ADD_TEST(tesh-simdag-flatifier ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms flatifier.tesh) - ADD_TEST(tesh-simdag-link ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_link_test.tesh) - - ADD_TEST(tesh-simdag-reinit-costs ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/test_reinit_costs.tesh) - ADD_TEST(tesh-simdag-parser ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh) - ADD_TEST(tesh-simdag-parser-sym-full ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_sym_full.tesh) - ADD_TEST(tesh-simdag-full-links ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms get_full_link.tesh) - ADD_TEST(tesh-simdag-basic0 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic0.tesh) - ADD_TEST(tesh-simdag-basic1 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic1.tesh) - ADD_TEST(tesh-simdag-basic2 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic2.tesh) - ADD_TEST(tesh-simdag-basic3 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic3.tesh) - ADD_TEST(tesh-simdag-basic4 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic4.tesh) - ADD_TEST(tesh-simdag-basic5 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic5.tesh) - ADD_TEST(tesh-simdag-basic6 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic6.tesh) - ADD_TEST(tesh-simdag-incomplete ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/incomplete.tesh) - ADD_TEST(tesh-simdag-p2p-1 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency1.tesh) - ADD_TEST(tesh-simdag-p2p-2 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency2.tesh) - ADD_TEST(tesh-simdag-p2p-3 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency3.tesh) - ADD_TEST(tesh-simdag-p2p-4 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency_bound.tesh) - ADD_TEST(tesh-simdag-mxn-1 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_all2all.tesh) - ADD_TEST(tesh-simdag-mxn-2 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_independent_comm.tesh) - ADD_TEST(tesh-simdag-mxn-3 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_scatter.tesh) - ADD_TEST(tesh-simdag-par-1 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_seq.tesh) - ADD_TEST(tesh-simdag-par-2 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_par.tesh) - ADD_TEST(tesh-simdag-availability ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/availability/availability_test.tesh) - - # MSG examples - ADD_TEST(msg-file ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/io/io.tesh) - ADD_TEST(msg-storage ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/io/storage.tesh) - ADD_TEST(msg-start-kill-time ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/start_kill_time/start_kill_time.tesh) - ADD_TEST(msg-chainsend ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chainsend --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/chainsend --cd ${CMAKE_HOME_DIRECTORY}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/chainsend/chainsend.tesh) - - ADD_TEST(msg-sendrecv-CLM03-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh) - ADD_TEST(msg-sendrecv-Vegas-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh) - ADD_TEST(msg-sendrecv-Reno-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh) - ADD_TEST(msg-suspend-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh) - ADD_TEST(msg-pmm-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh) - ADD_TEST(msg-masterslave-bypass-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh) - ADD_TEST(msg-masterslave-kill-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_kill.tesh) - ADD_TEST(msg-masterslave-multicore-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh) - - ADD_TEST(msg-masterslave-no-crosstraffic-mailbox-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-forwarder-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-failure-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh) - - ADD_TEST(msg-masterslave-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_crosstraffic.tesh) - ADD_TEST(msg-masterslave-forwarder-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder_crosstraffic.tesh) - ADD_TEST(msg-masterslave-failure-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure_crosstraffic.tesh) - ADD_TEST(msg-masterslave-mailbox-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox_crosstraffic.tesh) - ADD_TEST(msg-masterslave-cpu-ti-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti_crosstraffic.tesh) - - ADD_TEST(msg-masterslave-vivaldi-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh) - - ADD_TEST(msg-cloud-two-tasks-vm-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/two_tasks_vm.tesh) - - ADD_TEST(msg-cloud-simple-vm-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/simple_vm.tesh) - - if(CONTEXT_UCONTEXT) - ADD_TEST(msg-sendrecv-CLM03-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh) - ADD_TEST(msg-sendrecv-Vegas-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh) - ADD_TEST(msg-sendrecv-Reno-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh) - ADD_TEST(msg-suspend-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh) - ADD_TEST(msg-pmm-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh) - ADD_TEST(msg-masterslave-bypass-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh) - ADD_TEST(msg-masterslave-kill-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_kill.tesh) - ADD_TEST(msg-masterslave-multicore-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-mailbox-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-forwarder-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-failure-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh) - - ADD_TEST(msg-masterslave-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_crosstraffic.tesh) - ADD_TEST(msg-masterslave-forwarder-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder_crosstraffic.tesh) - ADD_TEST(msg-masterslave-failure-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure_crosstraffic.tesh) - ADD_TEST(msg-masterslave-mailbox-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox_crosstraffic.tesh) - ADD_TEST(msg-masterslave-cpu-ti-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti_crosstraffic.tesh) - - ADD_TEST(msg-masterslave-vivaldi-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh) - - ADD_TEST(msg-cloud-two-tasks-vm-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/two_tasks_vm.tesh) - ADD_TEST(msg-cloud-simple-vm-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/simple_vm.tesh) - endif() - - if(HAVE_RAWCTX) - ADD_TEST(msg-sendrecv-CLM03-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh) - ADD_TEST(msg-sendrecv-Vegas-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh) - ADD_TEST(msg-sendrecv-Reno-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh) - ADD_TEST(msg-suspend-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh) - ADD_TEST(msg-pmm-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh) - ADD_TEST(msg-masterslave-bypass-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh) - ADD_TEST(msg-masterslave-kill-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_kill.tesh) - ADD_TEST(msg-masterslave-multicore-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-mailbox-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-forwarder-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh) - ADD_TEST(msg-masterslave-no-crosstraffic-failure-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh) - - ADD_TEST(msg-masterslave-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_crosstraffic.tesh) - ADD_TEST(msg-masterslave-forwarder-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder_crosstraffic.tesh) - ADD_TEST(msg-masterslave-failure-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure_crosstraffic.tesh) - ADD_TEST(msg-masterslave-mailbox-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox_crosstraffic.tesh) - ADD_TEST(msg-masterslave-cpu-ti-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti_crosstraffic.tesh) - - ADD_TEST(msg-masterslave-vivaldi-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh) - - ADD_TEST(msg-cloud-two-tasks-vm-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/two_tasks_vm.tesh) - ADD_TEST(msg-cloud-simple-vm-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/simple_vm.tesh) - endif() - - ADD_TEST(msg-energy-pstates-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e1/pstate.tesh) - ADD_TEST(msg-energy-consumption-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e2/energy_consumption.tesh) - ADD_TEST(msg-energy-concurrent-tasks-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e3/concurrent_tasks.tesh) - - if(CONTEXT_UCONTEXT) - ADD_TEST(msg-energy-pstates-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e1/pstate.tesh) - ADD_TEST(msg-energy-consumption-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e2/energy_consumption.tesh) - ADD_TEST(msg-energy-concurrent-tasks-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e3/concurrent_tasks.tesh) - endif() - - if(HAVE_RAWCTX) - ADD_TEST(msg-energy-pstates-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e1/pstate.tesh) - ADD_TEST(msg-energy-consumption-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e2/energy_consumption.tesh) - ADD_TEST(msg-energy-concurrent-tasks-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e3/concurrent_tasks.tesh) - endif() - - ADD_TEST(msg-storage-basic-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage/storage_basic.tesh) - if(CONTEXT_UCONTEXT) - ADD_TEST(msg-storage-basic-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage/storage_basic.tesh) - endif() - if(HAVE_RAWCTX) - ADD_TEST(msg-storage-basic-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage/storage_basic.tesh) - endif() - - ADD_TEST(msg-token-ring-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh) - if(CONTEXT_UCONTEXT) - ADD_TEST(msg-token-ring-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh) - endif() - if(HAVE_RAWCTX) - ADD_TEST(msg-token-ring-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh) - endif() - - ADD_TEST(msg-migration-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh) - ADD_TEST(msg-ptask-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh) - ADD_TEST(msg-priority-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh) - ADD_TEST(msg-properties-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh) - ADD_TEST(msg-icomms-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh) - ADD_TEST(msg-actions-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh) - ADD_TEST(msg-trace-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg trace/trace.tesh) - ADD_TEST(msg-chord-no-crosstraffic-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh) - ADD_TEST(msg-chord-no-crosstraffic-thread-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh) - ADD_TEST(msg-chord-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh) - ADD_TEST(msg-chord-thread-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh) - ADD_TEST(msg-bittorrent-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh) - ADD_TEST(msg-bittorrent-thread-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:thread ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh) - ADD_TEST(msg-kademlia-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh) - ADD_TEST(msg-kademlia-thread-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:thread ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh) - - if(CONTEXT_UCONTEXT) - ADD_TEST(msg-migration-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh) - ADD_TEST(msg-ptask-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh) - ADD_TEST(msg-priority-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh) - ADD_TEST(msg-properties-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh) - ADD_TEST(msg-icomms-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh) - ADD_TEST(msg-actions-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh) - ADD_TEST(msg-trace-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg trace/trace.tesh) - ADD_TEST(msg-chord-no-crosstraffic-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh) - ADD_TEST(msg-chord-no-crosstraffic-ucontext-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh) - ADD_TEST(msg-chord-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh) - ADD_TEST(msg-chord-ucontext-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh) - ADD_TEST(msg-bittorrent-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh) - ADD_TEST(msg-bittorrent-ucontext-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh) - ADD_TEST(msg-kademlia-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh) - ADD_TEST(msg-kademlia-ucontext-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh) - - endif() - if(HAVE_RAWCTX) - ADD_TEST(msg-migration-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh) - ADD_TEST(msg-ptask-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh) - ADD_TEST(msg-priority-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh) - ADD_TEST(msg-actions-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh) - ADD_TEST(msg-icomms-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh) - ADD_TEST(msg-properties-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh) - ADD_TEST(msg-trace-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg trace/trace.tesh) - ADD_TEST(msg-chord-no-crosstraffic-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh) - ADD_TEST(msg-chord-no-crosstraffic-raw-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh) - ADD_TEST(msg-chord-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh) - ADD_TEST(msg-chord-raw-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh) - ADD_TEST(msg-bittorrent-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh) - ADD_TEST(msg-bittorrent-raw-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh) - ADD_TEST(msg-kademlia-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh) - ADD_TEST(msg-kademlia-raw-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh) - endif() - - # simdag examples - if(HAVE_GRAPHVIZ) - ADD_TEST(simdag-test-dotload ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dot --cd ${CMAKE_BINARY_DIR}/examples/simdag/dot ${CMAKE_HOME_DIRECTORY}/examples/simdag/dot/test_simdag_dotload.tesh) - endif() - ADD_TEST(simdag-test-simdag ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag.tesh) - ADD_TEST(simdag-test-simdag2 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag2.tesh) - ADD_TEST(simdag-test-seq-access ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_seq_access.tesh) - ADD_TEST(simdag-test-typed-tasks ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_typed_tasks.tesh) - ADD_TEST(simdag-test-fail ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_fail.tesh) - ADD_TEST(simdag-test-avail ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_avail.tesh) - ADD_TEST(simdag-test-comm-throttling ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_comm_throttling.tesh) - ADD_TEST(simdag-test-dax ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/dax --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax smalldax.tesh) - ADD_TEST(simdag-test-dax-cycle ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dax --cd ${CMAKE_BINARY_DIR}/examples/simdag/dax ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax/simple_dax_with_cycle.tesh) - ADD_TEST(simdag-test-prop ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh) - ADD_TEST(simdag-test-minmin-scheduling ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/scheduling --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling test_minmin.tesh) - ADD_TEST(simdag-test-io ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/simdag/io/io.tesh) - - ADD_TEST(msg-gtnets-crosstraffic-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh) - if(CONTEXT_UCONTEXT) - ADD_TEST(msg-gtnets-crosstraffic-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh) - endif() - if(HAVE_RAWCTX) - ADD_TEST(msg-gtnets-crosstraffic-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh) - endif() - - if(HAVE_GTNETS) - ADD_TEST(msg-gtnets-waxman-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh) - ADD_TEST(msg-gtnets-dogbone-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh) - ADD_TEST(msg-gtnets-onelink-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh) - ADD_TEST(msg-gtnets-dogbone-lv08-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh) - ADD_TEST(msg-gtnets-onelink-lv08-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh) - if(CONTEXT_UCONTEXT) - ADD_TEST(msg-gtnets-waxman-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh) - ADD_TEST(msg-gtnets-dogbone-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh) - ADD_TEST(msg-gtnets-onelink-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh) - ADD_TEST(msg-gtnets-dogbone-lv08-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh) - ADD_TEST(msg-gtnets-onelink-lv08-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh) - endif() - if(HAVE_RAWCTX) - ADD_TEST(msg-gtnets-waxman-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh) - ADD_TEST(msg-gtnets-dogbone-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh) - ADD_TEST(msg-gtnets-onelink-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh) - ADD_TEST(msg-gtnets-dogbone-lv08-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh) - ADD_TEST(msg-gtnets-onelink-lv08-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh) - endif() - - if(HAVE_TRACING) - ADD_TEST(msg-tracing-gtnets-waxman ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-waxman.tesh) - ADD_TEST(msg-tracing-gtnets-dogbone ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-gtnets.tesh) - ADD_TEST(msg-tracing-gtnets-onelink ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-gtnets.tesh) - ADD_TEST(msg-tracing-gtnets-dogbone-lv08 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-lv08.tesh) - ADD_TEST(msg-tracing-gtnets-onelink-lv08 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-lv08.tesh) - endif() - endif() - - if(HAVE_NS3) - ADD_TEST(msg-ns3-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh) - if(CONTEXT_UCONTEXT) - ADD_TEST(msg-ns3-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh) - endif() - if(HAVE_RAWCTX) - ADD_TEST(msg-ns3-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh) - endif() - endif() - + # BEGIN TESH TESTS + IF(HAVE_GRAPHVIZ) + ADD_TESH(simdag-dotload --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dot --cd ${CMAKE_BINARY_DIR}/examples/simdag/dot ${CMAKE_HOME_DIRECTORY}/examples/simdag/dot/test_simdag_dotload.tesh) + ENDIF() + ADD_TESH(simdag-simdag --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag.tesh) + ADD_TESH(simdag-simdag2 --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag2.tesh) + ADD_TESH(simdag-seq-access --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_seq_access.tesh) + ADD_TESH(simdag-typed-tasks --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_typed_tasks.tesh) + ADD_TESH(simdag-fail --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_fail.tesh) + ADD_TESH(simdag-avail --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_avail.tesh) + ADD_TESH(simdag-comm-throttling --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_comm_throttling.tesh) + ADD_TESH(simdag-dax --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/dax --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax smalldax.tesh) + ADD_TESH(simdag-dax-cycle --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dax --cd ${CMAKE_BINARY_DIR}/examples/simdag/dax ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax/simple_dax_with_cycle.tesh) + ADD_TESH(simdag-prop --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh) + ADD_TESH(simdag-minmin-scheduling --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/scheduling --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling test_minmin.tesh) + ADD_TESH(simdag-io --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/simdag/io/io.tesh) IF(HAVE_TRACING) - ADD_TEST(tracing-help ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test --help-tracing) - ADD_TEST(tracing-ms ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/ms.tesh) - ADD_TEST(tracing-simdag ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_tracing.tesh) - ADD_TEST(tracing-trace-platform ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/trace_platform.tesh) - ADD_TEST(tracing-user-variables ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/user_variables.tesh) - ADD_TEST(tracing-link-user-variables ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/link_user_variables.tesh) - ADD_TEST(tracing-link-srcdst-user-variables ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/link_srcdst_user_variables.tesh) - ADD_TEST(tracing-categories ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/categories.tesh) - ADD_TEST(tracing-process-migration ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/procmig.tesh) - ADD_TEST(graphicator ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_HOME_DIRECTORY}/tools/graphicator graphicator.tesh) + ADD_TESH(tracing-simdag --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_tracing.tesh) ENDIF() + # END TESH TESTS - # Lua examples - if(HAVE_LUA) - ADD_TEST(lua-duplicated-globals ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/state_cloner duplicated_globals.tesh) - ADD_TEST(lua-masterslave ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/masterslave master_slave.tesh) - ADD_TEST(lua-mult-matrix ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/multi_matrix mult_matrix.tesh) - ADD_TEST(lua-masterslave-bypass ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/console master_slave_bypass.tesh) - ADD_TEST(lua-chord ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/chord chord.tesh) - ADD_TEST(lua-bittorrent ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/bittorrent bittorrent.tesh) - ADD_TEST(lua-kademlia ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/kademlia kademlia.tesh) - set_tests_properties(lua-duplicated-globals PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") - set_tests_properties(lua-masterslave PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") - set_tests_properties(lua-mult-matrix PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") - set_tests_properties(lua-masterslave-bypass PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") - set_tests_properties(lua-chord PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") - set_tests_properties(lua-bittorrent PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") - set_tests_properties(lua-kademlia PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") - endif() - - if(enable_smpi) + + ### SMPI ### + IF(enable_smpi) + # BEGIN TESH TESTS # smpi examples - ADD_TEST(smpi-bcast-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast.tesh) - ADD_TEST(smpi-reduce-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce.tesh) - ADD_TEST(smpi-vector-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector.tesh) - ADD_TEST(smpi-hvector-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector.tesh) - ADD_TEST(smpi-indexed-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh) - ADD_TEST(smpi-struct-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh) - ADD_TEST(smpi-pt2pt-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh) - ADD_TEST(smpi-compute-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh) - + ADD_TESH_FACTORIES(tesh-smpi-bcast "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/bcast --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast bcast.tesh) + ADD_TESH_FACTORIES(tesh-smpi-reduce "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/reduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce reduce.tesh) + ADD_TESH_FACTORIES(tesh-smpi-vector "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/vector --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector vector.tesh) + ADD_TESH_FACTORIES(tesh-smpi-hvector "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/hvector --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector hvector.tesh) + ADD_TESH_FACTORIES(tesh-smpi-indexed "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/indexed --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed indexed.tesh) + ADD_TESH_FACTORIES(tesh-smpi-struct "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/struct --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct struct.tesh) + ADD_TESH_FACTORIES(tesh-smpi-pt2pt "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pingpong pt2pt.tesh) + ADD_TESH_FACTORIES(tesh-smpi-compute "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/compute --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute compute.tesh) + IF(NOT WIN32) + ADD_TESH_FACTORIES(tesh-smpi-shared "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/shared --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared shared.tesh) + ENDIF() # https://gforge.inria.fr/tracker/index.php?func=detail&aid=17132&group_id=12&atid=165 - ADD_TEST(smpi-bug-17132 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132 --cd ${CMAKE_BINARY_DIR}/teshsuite/bug-17132 ${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132/bug-17132.tesh) - ADD_TEST(smpi-bug-17132-surf-debug ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132 --cd ${CMAKE_BINARY_DIR}/teshsuite/bug-17132 ${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132/bug-17132-surf-debug.tesh) - - if (NOT WIN32) - ADD_TEST(smpi-shared-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared.tesh) - endif() - if(CONTEXT_UCONTEXT) - ADD_TEST(smpi-bcast-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast.tesh) - ADD_TEST(smpi-reduce-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce.tesh) - ADD_TEST(smpi-vector-ucontex ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector.tesh) - ADD_TEST(smpi-hvector-ucontex ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector.tesh) - ADD_TEST(smpi-indexed-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh) - ADD_TEST(smpi-struct-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh) - ADD_TEST(smpi-pt2pt-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh) - ADD_TEST(smpi-compute-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh) - if (NOT WIN32) - ADD_TEST(smpi-shared-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared.tesh) - endif() - endif() - if(HAVE_RAWCTX) - ADD_TEST(smpi-bcast-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast.tesh) - ADD_TEST(smpi-reduce-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce.tesh) - ADD_TEST(smpi-vector-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector.tesh) - ADD_TEST(smpi-hvector-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector.tesh) - ADD_TEST(smpi-indexed-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh) - ADD_TEST(smpi-struct-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh) - ADD_TEST(smpi-pt2pt-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh) - ADD_TEST(smpi-compute-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh) - if (NOT WIN32) - ADD_TEST(smpi-shared-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared.tesh) - endif() - endif() - - ADD_TEST(smpi-energy-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh) - if(SMPI_F2C) - ADD_TEST(smpi-energy-f77-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f77/energy.tesh) - endif() - if(SMPI_F90) - ADD_TEST(smpi-energy-f90-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f90/energy.tesh) - endif() - if(CONTEXT_UCONTEXT) - ADD_TEST(smpi-energy-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh) - if(SMPI_F2C) - ADD_TEST(smpi-energy-f77-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f77/energy.tesh) - endif() - if(SMPI_F90) - ADD_TEST(smpi-energy-f90-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f90/energy.tesh) - endif() - endif() - if(HAVE_RAWCTX) - ADD_TEST(smpi-energy-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh) - if(SMPI_F2C) - ADD_TEST(smpi-energy-f77-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f77/energy.tesh) - endif() - if(SMPI_F90) - ADD_TEST(smpi-energy-f90-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f90/energy.tesh) - endif() - endif() - - if(HAVE_TRACING) - ADD_TEST(smpi-tracing-ptp ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/tracing/smpi_traced.tesh) - ADD_TEST(smpi-replay ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/smpi_replay.tesh) - ADD_TEST(smpi-replay-ti-tracing ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/TI_output.tesh) - endif() - + ADD_TESH_FACTORIES(tesh-smpi-bug-17132 "thread" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132 --cd ${CMAKE_BINARY_DIR}/teshsuite/bug-17132 ${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132/bug-17132.tesh) + ADD_TESH_FACTORIES(tesh-smpi-bug-17132-surf-debug "thread" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132 --cd ${CMAKE_BINARY_DIR}/teshsuite/bug-17132 ${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132/bug-17132-surf-debug.tesh) + IF(HAVE_TRACING) + ADD_TESH(tesh-smpi-replay-ti-tracing --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pingpong TI_output.tesh) + ENDIF() FOREACH (GATHER_COLL default ompi mpich ompi_basic_linear ompi_linear_sync ompi_binomial) - ADD_TEST(smpi-gather-coll-${GATHER_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/gather:${GATHER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/gather_coll.tesh) + ADD_TESH(tesh-smpi-gather-coll-${GATHER_COLL} --cfg smpi/gather:${GATHER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/gather --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/gather gather_coll.tesh) ENDFOREACH() - FOREACH (ALLGATHER_COLL default 2dmesh 3dmesh bruck GB loosely_lr NTSLR NTSLR_NB pair rdb rhv ring SMP_NTS smp_simple spreading_simple ompi mpich ompi_neighborexchange) - ADD_TEST(smpi-allgather-coll-${ALLGATHER_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/allgather:${ALLGATHER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgather_coll.tesh) + ADD_TESH(tesh-smpi-allgather-coll-${ALLGATHER_COLL} --cfg smpi/allgather:${ALLGATHER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/allgather --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgather allgather_coll.tesh) ENDFOREACH() - FOREACH (ALLGATHERV_COLL default GB pair ring ompi mpich ompi_neighborexchange ompi_bruck mpich_rdb mpich_ring) - ADD_TEST(smpi-allgatherv-coll-${ALLGATHERV_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/allgatherv:${ALLGATHERV_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgatherv_coll.tesh) + ADD_TESH(tesh-smpi-allgatherv-coll-${ALLGATHERV_COLL} --cfg smpi/allgatherv:${ALLGATHERV_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/allgatherv --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgatherv allgatherv_coll.tesh) ENDFOREACH() - FOREACH (ALLREDUCE_COLL default lr rab1 rab2 rab_rdb rdb smp_binomial smp_binomial_pipeline smp_rdb smp_rsag smp_rsag_lr smp_rsag_rab redbcast ompi mpich ompi_ring_segmented) - ADD_TEST(smpi-allreduce-coll-${ALLREDUCE_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/allreduce:${ALLREDUCE_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allreduce_coll.tesh) + ADD_TESH(tesh-smpi-allreduce-coll-${ALLREDUCE_COLL} --cfg smpi/allreduce:${ALLREDUCE_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/allreduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allreduce allreduce_coll.tesh) ENDFOREACH() - FOREACH (ALLREDUCE_COLL_LARGE ompi_ring_segmented) - ADD_TEST(smpi-allreduce-coll-${ALLREDUCE_COLL_LARGE} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/allreduce:${ALLREDUCE_COLL_LARGE} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allreduce_coll_large.tesh) + ADD_TESH(tesh-smpi-allreduce-coll-large-${ALLREDUCE_COLL_LARGE} --cfg smpi/allreduce:${ALLREDUCE_COLL_LARGE} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/allreduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allreduce allreduce_coll_large.tesh) ENDFOREACH() - FOREACH (ALLTOALL_COLL 2dmesh 3dmesh pair pair_one_barrier pair_light_barrier pair_mpi_barrier rdb ring ring_light_barrier ring_mpi_barrier ring_one_barrier bruck basic_linear ompi mpich) - ADD_TEST(smpi-alltoall-coll-${ALLTOALL_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/alltoall:${ALLTOALL_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoall_coll.tesh) + ADD_TESH(tesh-smpi-alltoall-coll-${ALLTOALL_COLL} --cfg smpi/alltoall:${ALLTOALL_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/alltoall --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoall alltoall_coll.tesh) ENDFOREACH() - FOREACH (ALLTOALLV_COLL default pair pair_light_barrier pair_mpi_barrier pair_one_barrier ring ring_light_barrier ring_mpi_barrier ring_one_barrier bruck ompi mpich ompi_basic_linear) - ADD_TEST(smpi-alltoallv-coll-${ALLTOALLV_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/alltoallv:${ALLTOALLV_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoallv_coll.tesh) + ADD_TESH(tesh-smpi-alltoallv-coll-${ALLTOALLV_COLL} --cfg smpi/alltoallv:${ALLTOALLV_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/alltoallv --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoallv alltoallv_coll.tesh) ENDFOREACH() - FOREACH (BCAST_COLL default arrival_pattern_aware arrival_pattern_aware_wait arrival_scatter binomial_tree flattree flattree_pipeline NTSB NTSL NTSL_Isend scatter_LR_allgather scatter_rdb_allgather SMP_binary SMP_binomial SMP_linear ompi mpich ompi_split_bintree ompi_pipeline) - ADD_TEST(smpi-bcast-coll-${BCAST_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/bcast:${BCAST_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast_coll.tesh) + ADD_TESH(tesh-smpi-bcast-coll-${BCAST_COLL} --cfg smpi/bcast:${BCAST_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/bcast --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast bcast_coll.tesh) ENDFOREACH() - FOREACH (REDUCE_COLL default arrival_pattern_aware binomial flat_tree NTSL scatter_gather ompi mpich ompi_chain ompi_binary ompi_basic_linear ompi_binomial ompi_in_order_binary) - ADD_TEST(smpi-reduce-coll-${REDUCE_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/reduce:${REDUCE_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce_coll.tesh) + ADD_TESH(tesh-smpi-reduce-coll-${REDUCE_COLL} --cfg smpi/reduce:${REDUCE_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/reduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce reduce_coll.tesh) ENDFOREACH() - FOREACH (REDUCE_SCATTER_COLL default ompi mpich ompi_basic_recursivehalving ompi_ring mpich_noncomm mpich_pair mpich_rdb) - ADD_TEST(smpi-reduce-scatter-coll-${REDUCE_SCATTER_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/reduce_scatter:${REDUCE_SCATTER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce_scatter_coll.tesh) + ADD_TESH(tesh-smpi-reduce-scatter-coll-${REDUCE_SCATTER_COLL} --cfg smpi/reduce_scatter:${REDUCE_SCATTER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/reduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce reduce_scatter_coll.tesh) ENDFOREACH() - FOREACH (SCATTER_COLL default ompi mpich ompi_basic_linear ompi_binomial) - ADD_TEST(smpi-scatter-coll-${SCATTER_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/scatter:${SCATTER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/scatter_coll.tesh) + ADD_TESH(tesh-smpi-scatter-coll-${SCATTER_COLL} --cfg smpi/scatter:${SCATTER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/scatter --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/scatter scatter_coll.tesh) ENDFOREACH() - FOREACH (BARRIER_COLL default ompi mpich ompi_basic_linear ompi_tree ompi_bruck ompi_recursivedoubling ompi_doublering) - ADD_TEST(smpi-barrier-coll-${BARRIER_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/barrier:${BARRIER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/barrier_coll.tesh) + ADD_TESH(tesh-smpi-barrier-coll-${BARRIER_COLL} --cfg smpi/barrier:${BARRIER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/barrier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/barrier barrier_coll.tesh) ENDFOREACH() + # END TESH TESTS + IF(enable_smpi_MPICH3_testsuite) + ADD_TEST(test-smpi-mpich3-coll-thread ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatize_global_variables:yes) + ADD_TEST(test-smpi-mpich3-coll-ompi-thread ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/send_is_detached_thres:0 -execarg=--cfg=smpi/privatize_global_variables:yes) + ADD_TEST(test-smpi-mpich3-coll-mpich-thread ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatize_global_variables:yes) + SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-thread test-smpi-mpich3-coll-ompi-thread test-smpi-mpich3-coll-mpich-thread PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") + IF(CONTEXT_UCONTEXT) + ADD_TEST(test-smpi-mpich3-coll-ompi-ucontext ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/send_is_detached_thres:0 -execarg=--cfg=smpi/privatize_global_variables:yes) + SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-ompi-ucontext PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") + ENDIF() + IF(HAVE_RAWCTX) + ADD_TEST(test-smpi-mpich3-coll-mpich-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatize_global_variables:yes) + SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mpich-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") + ENDIF() + IF(HAVE_RAWCTX) + ADD_TEST(test-smpi-mpich3-attr-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/attr perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/attr -tests=testlist -execarg=--cfg=contexts/factory:raw) + ADD_TEST(test-smpi-mpich3-comm-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/comm perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/comm -tests=testlist -execarg=--cfg=contexts/factory:raw) + ADD_TEST(test-smpi-mpich3-init-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/init perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/init -tests=testlist -execarg=--cfg=contexts/factory:raw) + ADD_TEST(test-smpi-mpich3-datatype-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/datatype perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/datatype -tests=testlist -execarg=--cfg=contexts/factory:raw) + ADD_TEST(test-smpi-mpich3-group-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/group perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/group -tests=testlist -execarg=--cfg=contexts/factory:raw) + ADD_TEST(test-smpi-mpich3-pt2pt-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/pt2pt perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/pt2pt -tests=testlist -execarg=--cfg=contexts/factory:raw) + ADD_TEST(test-smpi-mpich3-topo-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/topo perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/topo -tests=testlist -execarg=--cfg=contexts/factory:raw) + SET_TESTS_PROPERTIES(test-smpi-mpich3-attr-raw test-smpi-mpich3-comm-raw test-smpi-mpich3-init-raw test-smpi-mpich3-datatype-raw test-smpi-mpich3-group-raw test-smpi-mpich3-pt2pt-raw test-smpi-mpich3-topo-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") + ENDIF() + IF(SMPI_F2C) + ADD_TEST(test-smpi-mpich3-thread-f77 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/stack_size:8000 -execarg=--cfg=smpi/privatize_global_variables:yes) + SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") + ENDIF() + IF(SMPI_F90) + ADD_TEST(test-smpi-mpich3-thread-f90 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -execarg=--cfg=smpi/privatize_global_variables:yes) + SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") + ENDIF() + ENDIF() + + # BEGIN TESH TESTS + ADD_TESH_FACTORIES(smpi-energy "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh) + IF(SMPI_F2C) + ADD_TESH_FACTORIES(smpi-energy-f77 "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f77/energy.tesh) + ENDIF() + IF(SMPI_F90) + ADD_TESH_FACTORIES(smpi-energy-f90 "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f90/energy.tesh) + ENDIF() + ADD_TESH_FACTORIES(smpi-msg-masterslave "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/smpi_msg_masterslave --cd ${CMAKE_BINARY_DIR}/examples/smpi/smpi_msg_masterslave ${CMAKE_HOME_DIRECTORY}/examples/smpi/smpi_msg_masterslave/msg_smpi.tesh) + IF(HAVE_TRACING) + ADD_TESH(smpi-tracing-ptp --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/tracing/smpi_traced.tesh) + ADD_TESH(smpi-replay --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/smpi_replay.tesh) + ENDIF() + # END TESH TESTS + ENDIF() - endif() + ## BINGINGS ## + ### LUA ### + # BEGIN TESH TESTS + IF(HAVE_LUA) + ADD_TESH(lua-duplicated-globals --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/state_cloner duplicated_globals.tesh) + ADD_TESH(lua-masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/masterslave master_slave.tesh) + ADD_TESH(lua-mult-matrix --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/multi_matrix mult_matrix.tesh) + ADD_TESH(lua-masterslave-bypass --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/console master_slave_bypass.tesh) + ADD_TESH(lua-chord --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/chord chord.tesh) + ADD_TESH(lua-bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/bittorrent bittorrent.tesh) + ADD_TESH(lua-kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/kademlia kademlia.tesh) + SET_TESTS_PROPERTIES(lua-duplicated-globals PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") + SET_TESTS_PROPERTIES(lua-masterslave PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") + SET_TESTS_PROPERTIES(lua-mult-matrix PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") + SET_TESTS_PROPERTIES(lua-masterslave-bypass PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") + SET_TESTS_PROPERTIES(lua-chord PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") + SET_TESTS_PROPERTIES(lua-bittorrent PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") + SET_TESTS_PROPERTIES(lua-kademlia PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so") + ENDIF() # END TESH TESTS - if(enable_smpi_MPICH3_testsuite) - ADD_TEST(smpi-mpich3-coll-thread ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatize_global_variables:yes) - ADD_TEST(smpi-mpich3-coll-ompi-thread ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/send_is_detached_thres:0 -execarg=--cfg=smpi/privatize_global_variables:yes) - ADD_TEST(smpi-mpich3-coll-mpich-thread ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatize_global_variables:yes) - set_tests_properties(smpi-mpich3-coll-thread smpi-mpich3-coll-ompi-thread smpi-mpich3-coll-mpich-thread PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") - if(CONTEXT_UCONTEXT) - ADD_TEST(smpi-mpich3-coll-ompi-ucontext ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/send_is_detached_thres:0 -execarg=--cfg=smpi/privatize_global_variables:yes) - set_tests_properties(smpi-mpich3-coll-ompi-ucontext PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") - endif() - if(HAVE_RAWCTX) - ADD_TEST(smpi-mpich3-coll-mpich-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatize_global_variables:yes) - set_tests_properties(smpi-mpich3-coll-mpich-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") - endif() - - if(HAVE_RAWCTX) - ADD_TEST(smpi-mpich3-attr-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/attr perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/attr -tests=testlist -execarg=--cfg=contexts/factory:raw) - ADD_TEST(smpi-mpich3-comm-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/comm perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/comm -tests=testlist -execarg=--cfg=contexts/factory:raw) - ADD_TEST(smpi-mpich3-init-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/init perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/init -tests=testlist -execarg=--cfg=contexts/factory:raw) - ADD_TEST(smpi-mpich3-datatype-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/datatype perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/datatype -tests=testlist -execarg=--cfg=contexts/factory:raw) - ADD_TEST(smpi-mpich3-group-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/group perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/group -tests=testlist -execarg=--cfg=contexts/factory:raw) - ADD_TEST(smpi-mpich3-pt2pt-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/pt2pt perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/pt2pt -tests=testlist -execarg=--cfg=contexts/factory:raw) - set_tests_properties(smpi-mpich3-attr-raw smpi-mpich3-comm-raw smpi-mpich3-init-raw smpi-mpich3-datatype-raw smpi-mpich3-group-raw smpi-mpich3-pt2pt-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") - endif() - - if(SMPI_F2C) - ADD_TEST(smpi-mpich3-thread-f77 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/stack_size:8000 -execarg=--cfg=smpi/privatize_global_variables:yes) - set_tests_properties(smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") - endif() - if(SMPI_F90) - ADD_TEST(smpi-mpich3-thread-f90 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -execarg=--cfg=smpi/privatize_global_variables:yes) - set_tests_properties(smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") - endif() - endif() - - # Java examples - if(enable_java) - if(WIN32) - set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/\;${SIMGRID_FULL_JAR}") - else() - set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/:${SIMGRID_FULL_JAR}") - endif() - ADD_TEST(java-async ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/async/async.tesh) - ADD_TEST(java-bittorrent ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/bittorrent/bittorrent.tesh) - ADD_TEST(java-bypass ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/master_slave_bypass/bypass.tesh) - ADD_TEST(java-chord ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/chord/chord.tesh) - ADD_TEST(java-cloud ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/cloud/cloud.tesh) - ADD_TEST(java-cloud-migration ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/cloud/migration/migration.tesh) - ADD_TEST(java-commTime ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/commTime/commtime.tesh) - ADD_TEST(java-kademlia ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/kademlia/kademlia.tesh) - ADD_TEST(java-kill ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/master_slave_kill/kill.tesh) - ADD_TEST(java-masterslave ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/masterslave/masterslave.tesh) - ADD_TEST(java-migration ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/migration/migration.tesh) - ADD_TEST(java-mutualExclusion ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/mutualExclusion/mutualexclusion.tesh) - ADD_TEST(java-pingPong ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/pingPong/pingpong.tesh) - ADD_TEST(java-priority ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/priority/priority.tesh) - ADD_TEST(java-reservation-surf-plugin ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/reservationSurfPlugin/reservation_surf_plugin.tesh) - ADD_TEST(java-startKillTime ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/startKillTime/startKillTime.tesh) - ADD_TEST(java-surf-plugin ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/surfPlugin/surf_plugin.tesh) - ADD_TEST(java-suspend ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/suspend/suspend.tesh) - if(HAVE_TRACING) - ADD_TEST(java-tracing ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/tracing/tracingPingPong.tesh) - endif() - endif() - - # Scala examples - if(enable_scala) - if(WIN32) - set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/scala/\;${SIMGRID_FULL_JAR}\;${SCALA_JARS}") - else() - set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/scala/:${SIMGRID_FULL_JAR}:${SCALA_JARS}") - endif() - - ADD_TEST(scala-bypass ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/master_slave_bypass/bypass.tesh) - ADD_TEST(scala-kill ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/master_slave_kill/kill.tesh) - ADD_TEST(scala-masterslave ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/masterslave/masterslave.tesh) - endif() - - ADD_TEST(stack-overflow-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/stack_overflow.tesh) - if(CONTEXT_UCONTEXT) - ADD_TEST(stack-overflow-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/stack_overflow.tesh) - endif() - if(HAVE_RAWCTX) - ADD_TEST(stack-overflow-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/stack_overflow.tesh) - endif() - - # examples/msg/mc - if(HAVE_MC) - if(CONTEXT_UCONTEXT) - ADD_TEST(mc-bugged1-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh) - ADD_TEST(mc-bugged2-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh) - if(PROCESSOR_x86_64) # liveness model-checking works only on 64bits (for now ...) - ADD_TEST(mc-bugged1-liveness-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness.tesh) - ADD_TEST(mc-bugged1-liveness-visited-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness_visited.tesh) - endif() - endif() - if(HAVE_RAWCTX) - ADD_TEST(mc-bugged1-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh) - ADD_TEST(mc-bugged2-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh) - endif() - endif() - ### - ### Declare that we know that some tests are broken - ### - if(release) - if(CMAKE_SYSTEM_NAME MATCHES "Darwin") - # These tests are known to fail on Mac OS X (the expected error message is - # not shown). - set_tests_properties(stack-overflow-thread PROPERTIES WILL_FAIL true) - if(CONTEXT_UCONTEXT) - set_tests_properties(stack-overflow-ucontext PROPERTIES WILL_FAIL true) - endif() - if(HAVE_RAWCTX) - set_tests_properties(stack-overflow-raw PROPERTIES WILL_FAIL true) - endif() - endif() - endif() - -endif() - -ADD_TEST(tesh-simdag-full-links01 ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms/two_clusters.xml FULL_LINK) -ADD_TEST(tesh-simdag-full-links02 ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms/two_clusters_one_name.xml FULL_LINK) -ADD_TEST(tesh-simdag-one-link-g5k ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test ${CMAKE_HOME_DIRECTORY}/examples/platforms/g5k.xml ONE_LINK) -ADD_TEST(msg-icomms-waitany ${CMAKE_BINARY_DIR}/examples/msg/icomms/peer3 ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/small_platform.xml ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/deployment_peer05.xml) - -# testsuite directory -add_test(test-xbt-log ${CMAKE_BINARY_DIR}/testsuite/xbt/log_usage) -add_test(test-xbt-graphxml ${CMAKE_BINARY_DIR}/testsuite/xbt/graphxml_usage ${CMAKE_HOME_DIRECTORY}/testsuite/xbt/graph.xml) -add_test(test-xbt-heap ${CMAKE_BINARY_DIR}/testsuite/xbt/heap_bench) - -add_test(test-surf-lmm ${CMAKE_BINARY_DIR}/testsuite/surf/lmm_usage) -add_test(test-surf-maxmin ${CMAKE_BINARY_DIR}/testsuite/surf/maxmin_bench) -add_test(test-surf-usage ${CMAKE_BINARY_DIR}/testsuite/surf/surf_usage --cfg=path:${CMAKE_HOME_DIRECTORY}/testsuite/surf/ platform.xml) -add_test(test-surf-usage2 ${CMAKE_BINARY_DIR}/testsuite/surf/surf_usage2 --cfg=path:${CMAKE_HOME_DIRECTORY}/testsuite/surf/ platform.xml) -add_test(test-surf-trace ${CMAKE_BINARY_DIR}/testsuite/surf/trace_usage --cfg=path:${CMAKE_HOME_DIRECTORY}/testsuite/surf/) - -if(HAVE_MC) - add_test(mc-dwarf ${CMAKE_BINARY_DIR}/testsuite/mc/dwarf) - add_test(mc-dwarf-expression ${CMAKE_BINARY_DIR}/testsuite/mc/dwarf-expression) -endif() - -add_test(testall ${CMAKE_BINARY_DIR}/src/testall) - -if(enable_auto_install) - add_test(simgrid_install make install) -endif() - -if(enable_memcheck) - include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/memcheck_tests.cmake) -endif() + ### JAVA ### + IF(enable_java) + IF(WIN32) + SET(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/\;${SIMGRID_FULL_JAR}") + ELSE() + SET(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/:${SIMGRID_FULL_JAR}") + ENDIF() + ADD_TESH(java-async --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/async/async.tesh) + ADD_TESH(java-bittorrent --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/bittorrent/bittorrent.tesh) + ADD_TESH(java-bypass --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/master_slave_bypass/bypass.tesh) + ADD_TESH(java-chord --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/chord/chord.tesh) + ADD_TESH(java-cloud --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/cloud/cloud.tesh) + ADD_TESH(java-cloud-migration --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/cloud/migration/migration.tesh) + ADD_TESH(java-commTime --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/commTime/commtime.tesh) + ADD_TESH(java-kademlia --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/kademlia/kademlia.tesh) + ADD_TESH(java-kill --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/master_slave_kill/kill.tesh) + ADD_TESH(java-masterslave --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/masterslave/masterslave.tesh) + ADD_TESH(java-migration --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/migration/migration.tesh) + ADD_TESH(java-mutualExclusion --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/mutualExclusion/mutualexclusion.tesh) + ADD_TESH(java-pingPong --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/pingPong/pingpong.tesh) + ADD_TESH(java-priority --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/priority/priority.tesh) + ADD_TESH(java-reservation-surf-plugin --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/reservationSurfPlugin/reservation_surf_plugin.tesh) + ADD_TESH(java-startKillTime --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/startKillTime/startKillTime.tesh) + ADD_TESH(java-surf-cpu-model --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/surfCpuModel/surf_cpu_model.tesh) + ADD_TESH(java-surf-plugin --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/surfPlugin/surf_plugin.tesh) + ADD_TESH(java-suspend --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/suspend/suspend.tesh) + IF(HAVE_TRACING) + ADD_TESH(java-tracing --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/tracing/tracingPingPong.tesh) + ENDIF() + ENDIF() + + + ### SCALA ### + IF(enable_scala) + IF(WIN32) + SET(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/scala/\;${SIMGRID_FULL_JAR}\;${SCALA_JARS}") + ELSE() + SET(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/scala/:${SIMGRID_FULL_JAR}:${SCALA_JARS}") + ENDIF() + ADD_TESH(scala-bypass --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/master_slave_bypass/bypass.tesh) + ADD_TESH(scala-kill --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/master_slave_kill/kill.tesh) + ADD_TESH(scala-masterslave --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/masterslave/masterslave.tesh) + ENDIF() + +ENDIF() + + ## OTHER ## +ADD_TEST(testall ${CMAKE_BINARY_DIR}/src/testall) + +IF(enable_auto_install) + ADD_TEST(simgrid_install make install) +ENDIF() + +IF(enable_memcheck) + INCLUDE(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/memcheck_tests.cmake) +ENDIF() diff --git a/buildtools/Cmake/CTestConfig.cmake b/buildtools/Cmake/CTestConfig.cmake index 7c961b1882..04854c2c57 100644 --- a/buildtools/Cmake/CTestConfig.cmake +++ b/buildtools/Cmake/CTestConfig.cmake @@ -51,7 +51,6 @@ if(enable_coverage) "/tools/" "/buildtools/" "/include/" - "/testsuite/" "/teshsuite/" "/src/bindings/" ) diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index ade885711c..9b9df891ae 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -84,9 +84,11 @@ if(enable_java) find_package(JNI REQUIRED) message("-- [Java] JNI found: ${JNI_FOUND}") message("-- [Java] JNI include dirs: ${JNI_INCLUDE_DIRS}") - find_package(SWIG REQUIRED) - include(UseSWIG) - message("-- [Java] Swig found: ${SWIG_FOUND}") + if(enable_maintainer_mode) + find_package(SWIG REQUIRED) + include(UseSWIG) + message("-- [Java] Swig found: ${SWIG_FOUND} (version ${SWIG_VERSION})") + endif() set(HAVE_Java 1) endif() if(enable_scala) @@ -425,14 +427,14 @@ endif() # AC_CHECK_MCSC(mcsc=yes, mcsc=no) set(mcsc_flags "") if(CMAKE_SYSTEM_NAME MATCHES "Darwin") - set(mcsc_flags "-D_XOPEN_SOURCE") + set(mcsc_flags -D_XOPEN_SOURCE) endif() if(WIN32) if(ARCH_32_BITS) - set(mcsc_flags "-D_XBT_WIN32 -D_I_X86_ -I${CMAKE_HOME_DIRECTORY}/src/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt") + set(mcsc_flags -D_XBT_WIN32 -D_I_X86_ -I${CMAKE_HOME_DIRECTORY}/src/include -I${CMAKE_HOME_DIRECTORY}/src/xbt) else() - set(mcsc_flags "-D_XBT_WIN32 -D_AMD64_ -I${CMAKE_HOME_DIRECTORY}/src/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt") + set(mcsc_flags -D_XBT_WIN32 -D_AMD64_ -I${CMAKE_HOME_DIRECTORY}/src/include -I${CMAKE_HOME_DIRECTORY}/src/xbt) endif() endif() @@ -446,7 +448,7 @@ ELSE() file(REMOVE ${CMAKE_BINARY_DIR}/conftestval) execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c ${mcsc_flags} -o testprog WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/ - OUTPUT_VARIABLE COMPILE_mcsc_VAR) + OUTPUT_VARIABLE COMPILE_mcsc_VAR ERROR_VARIABLE COMPILE_mcsc_VAR) if(NOT COMPILE_mcsc_VAR) message(STATUS "prog_AC_CHECK_MCSC.c is compilable") @@ -454,7 +456,7 @@ ELSE() WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/ OUTPUT_VARIABLE var_compil) else() - message(STATUS "prog_AC_CHECK_MCSC.c is not compilable") + message(STATUS "prog_AC_CHECK_MCSC.c is not compilable:\n${COMPILE_mcsc_VAR}") endif() file(REMOVE "${CMAKE_BINARY_DIR}/testprog*") @@ -571,7 +573,7 @@ if(HAVE_MAKECONTEXT OR WIN32) else() set(makecontext_CPPFLAGS "-DTEST_makecontext -D_AMD64_") endif() - set(makecontext_CPPFLAGS_2 "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/src/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt") + set(makecontext_CPPFLAGS_2 "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/src/include -I${CMAKE_HOME_DIRECTORY}/src/xbt") endif() file(REMOVE ${CMAKE_BINARY_DIR}/conftestval) @@ -681,7 +683,7 @@ int main(void) ) execute_process( - COMMAND ${CMAKE_C_COMPILER} "${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c" + COMMAND ${CMAKE_C_COMPILER} "${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c" WORKING_DIRECTORY ${CMAKE_BINARY_DIR} RESULT_VARIABLE COMPILE_VA_NULL_VAR OUTPUT_QUIET @@ -841,6 +843,7 @@ file(READ ${CMAKE_HOME_DIRECTORY}/src/smpi/smpitools.sh SMPITOOLS_SH) configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/mpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/mpif.h @ONLY) configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/smpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/smpif.h @ONLY) configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_BINARY_DIR}/bin/smpicc @ONLY) +configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicxx.in ${CMAKE_BINARY_DIR}/bin/smpicxx @ONLY) configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif2c.in ${CMAKE_BINARY_DIR}/bin/smpif2c @ONLY) configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpiff.in ${CMAKE_BINARY_DIR}/bin/smpiff @ONLY) configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif90.in ${CMAKE_BINARY_DIR}/bin/smpif90 @ONLY) @@ -862,6 +865,7 @@ set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_P set(libdir "${CMAKE_BINARY_DIR}/lib") configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc @ONLY) +configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicxx.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicxx @ONLY) configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif2c.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif2c @ONLY) configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpiff.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff @ONLY) configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif90.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90 @ONLY) @@ -871,11 +875,13 @@ set(top_builddir ${CMAKE_HOME_DIRECTORY}) if(NOT WIN32) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicc) + execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicxx) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif2c) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpiff) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif90) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpirun) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc) + execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicxx) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif2c) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff) execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90) @@ -897,6 +903,7 @@ set(generated_files_to_clean ${generated_headers} ${generated_headers_to_install} ${CMAKE_BINARY_DIR}/bin/smpicc + ${CMAKE_BINARY_DIR}/bin/smpicxx ${CMAKE_BINARY_DIR}/bin/smpif2c ${CMAKE_BINARY_DIR}/bin/smpiff ${CMAKE_BINARY_DIR}/bin/smpif90 @@ -908,10 +915,6 @@ set(generated_files_to_clean if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}") else() - configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/hostfile ${CMAKE_BINARY_DIR}/examples/smpi/hostfile COPYONLY) - configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform.xml ${CMAKE_BINARY_DIR}/examples/msg/small_platform.xml COPYONLY) - configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform_with_routers.xml ${CMAKE_BINARY_DIR}/examples/msg/small_platform_with_routers.xml COPYONLY) - configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/tracing/platform.xml ${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml COPYONLY) configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions0.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions0.txt COPYONLY) configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions1.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions1.txt COPYONLY) configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_allReduce.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allReduce.txt COPYONLY) @@ -928,10 +931,6 @@ else() set(generated_files_to_clean ${generated_files_to_clean} - ${CMAKE_BINARY_DIR}/examples/smpi/hostfile - ${CMAKE_BINARY_DIR}/examples/msg/small_platform.xml - ${CMAKE_BINARY_DIR}/examples/msg/small_platform_with_routers.xml - ${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions0.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions1.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allReduce.txt diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index 013c8fc526..ca5bb2d641 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -28,12 +28,12 @@ set(EXTRA_DIST src/simdag/private.h src/simix/simcalls.in src/simix/simcalls.py - src/simix/simcalls_generated_enum.h - src/simix/simcalls_generated_string.c - src/simix/simcalls_generated_res_getter_setter.h src/simix/simcalls_generated_args_getter_setter.h - src/simix/simcalls_generated_case.c src/simix/simcalls_generated_body.c + src/simix/simcalls_generated_case.c + src/simix/simcalls_generated_enum.h + src/simix/simcalls_generated_res_getter_setter.h + src/simix/simcalls_generated_string.c src/simix/smx_host_private.h src/simix/smx_io_private.h src/simix/smx_network_private.h @@ -42,52 +42,53 @@ set(EXTRA_DIST src/simix/smx_smurf_private.h src/simix/smx_synchro_private.h src/smpi/README + src/smpi/colls/coll_tuned_topo.h src/smpi/colls/colls.h src/smpi/colls/colls_private.h - src/smpi/colls/coll_tuned_topo.h src/smpi/private.h src/smpi/smpi_mpi_dt_private.h - src/surf/plugins/energy.hpp + src/surf/cpu_cas01.hpp src/surf/cpu_interface.hpp src/surf/cpu_ti.hpp - src/surf/cpu_cas01.hpp src/surf/gtnets/gtnets_interface.h src/surf/gtnets/gtnets_simulator.h src/surf/gtnets/gtnets_topology.h src/surf/maxmin_private.hpp - src/surf/network_interface.hpp + src/surf/network_cm02.hpp + src/surf/network_constant.hpp src/surf/network_gtnets.hpp + src/surf/network_interface.hpp src/surf/network_ns3.hpp - src/surf/network_cm02.hpp src/surf/network_smpi.hpp - src/surf/network_constant.hpp src/surf/ns3/my-point-to-point-helper.h src/surf/ns3/ns3_interface.h src/surf/ns3/ns3_simulator.h src/surf/ns3/red-queue.h src/surf/platf_generator_private.h + src/surf/plugins/energy.hpp src/surf/simgrid.dtd src/surf/simgrid_dtd.c src/surf/storage_interface.hpp src/surf/storage_n11.hpp src/surf/surf_interface.hpp src/surf/surf_private.h - src/surf/surf_routing_private.hpp src/surf/surf_routing.hpp src/surf/surf_routing_cluster.hpp + src/surf/surf_routing_cluster_fat_tree.hpp src/surf/surf_routing_cluster_torus.hpp src/surf/surf_routing_dijkstra.hpp src/surf/surf_routing_floyd.hpp src/surf/surf_routing_full.hpp src/surf/surf_routing_generic.hpp src/surf/surf_routing_none.hpp + src/surf/surf_routing_private.hpp src/surf/surf_routing_vivaldi.hpp src/surf/surfxml_parse.c src/surf/trace_mgr_private.h - src/surf/vm_workstation_interface.hpp src/surf/vm_workstation_hl13.hpp - src/surf/workstation_interface.hpp + src/surf/vm_workstation_interface.hpp src/surf/workstation_clm03.hpp + src/surf/workstation_interface.hpp src/surf/workstation_ptask_L07.hpp src/win32/config.h src/xbt/automaton/automaton_lexer.yy.c @@ -127,108 +128,111 @@ set(EXTRA_DIST ) set(SMPI_SRC - src/smpi/instr_smpi.c - src/smpi/smpi_base.c - src/smpi/smpi_bench.c - src/smpi/smpi_c99.c - src/smpi/smpi_coll.c - src/smpi/smpi_comm.c - src/smpi/smpi_dvfs.c - src/smpi/smpi_global.c - src/smpi/smpi_group.c - src/smpi/smpi_mpi.c - src/smpi/smpi_mpi_dt.c - src/smpi/smpi_pmpi.c - src/smpi/smpi_replay.c - src/smpi/colls/smpi_openmpi_selector.c - src/smpi/colls/smpi_mpich_selector.c - src/smpi/colls/colls_global.c src/smpi/colls/allgather-2dmesh.c src/smpi/colls/allgather-3dmesh.c - src/smpi/colls/allgather-bruck.c src/smpi/colls/allgather-GB.c - src/smpi/colls/allgather-loosely-lr.c - src/smpi/colls/allgather-NTSLR.c src/smpi/colls/allgather-NTSLR-NB.c + src/smpi/colls/allgather-NTSLR.c + src/smpi/colls/allgather-SMP-NTS.c + src/smpi/colls/allgather-bruck.c + src/smpi/colls/allgather-loosely-lr.c + src/smpi/colls/allgather-ompi-neighborexchange.c src/smpi/colls/allgather-pair.c src/smpi/colls/allgather-rdb.c src/smpi/colls/allgather-rhv.c src/smpi/colls/allgather-ring.c - src/smpi/colls/allgather-SMP-NTS.c src/smpi/colls/allgather-smp-simple.c src/smpi/colls/allgather-spreading-simple.c - src/smpi/colls/allgather-ompi-neighborexchange.c src/smpi/colls/allgatherv-GB.c - src/smpi/colls/allgatherv-pair.c - src/smpi/colls/allgatherv-ring.c - src/smpi/colls/allgatherv-ompi-neighborexchange.c - src/smpi/colls/allgatherv-ompi-bruck.c src/smpi/colls/allgatherv-mpich-rdb.c src/smpi/colls/allgatherv-mpich-ring.c + src/smpi/colls/allgatherv-ompi-bruck.c + src/smpi/colls/allgatherv-ompi-neighborexchange.c + src/smpi/colls/allgatherv-pair.c + src/smpi/colls/allgatherv-ring.c src/smpi/colls/allreduce-lr.c + src/smpi/colls/allreduce-ompi-ring-segmented.c + src/smpi/colls/allreduce-rab-rdb.c src/smpi/colls/allreduce-rab1.c src/smpi/colls/allreduce-rab2.c - src/smpi/colls/allreduce-rab-rdb.c src/smpi/colls/allreduce-rdb.c src/smpi/colls/allreduce-redbcast.c - src/smpi/colls/allreduce-smp-binomial.c src/smpi/colls/allreduce-smp-binomial-pipeline.c + src/smpi/colls/allreduce-smp-binomial.c src/smpi/colls/allreduce-smp-rdb.c - src/smpi/colls/allreduce-smp-rsag.c src/smpi/colls/allreduce-smp-rsag-lr.c src/smpi/colls/allreduce-smp-rsag-rab.c - src/smpi/colls/allreduce-ompi-ring-segmented.c + src/smpi/colls/allreduce-smp-rsag.c src/smpi/colls/alltoall-2dmesh.c src/smpi/colls/alltoall-3dmesh.c # src/smpi/colls/alltoall-bruck.c - src/smpi/colls/alltoall-pair.c src/smpi/colls/alltoall-pair-light-barrier.c src/smpi/colls/alltoall-pair-mpi-barrier.c src/smpi/colls/alltoall-pair-one-barrier.c + src/smpi/colls/alltoall-pair.c src/smpi/colls/alltoall-rdb.c - src/smpi/colls/alltoall-ring.c src/smpi/colls/alltoall-ring-light-barrier.c src/smpi/colls/alltoall-ring-mpi-barrier.c src/smpi/colls/alltoall-ring-one-barrier.c - src/smpi/colls/alltoallv-pair.c + src/smpi/colls/alltoall-ring.c + src/smpi/colls/alltoallv-bruck.c + src/smpi/colls/alltoallv-ompi-basic-linear.c src/smpi/colls/alltoallv-pair-light-barrier.c src/smpi/colls/alltoallv-pair-mpi-barrier.c src/smpi/colls/alltoallv-pair-one-barrier.c - src/smpi/colls/alltoallv-ring.c + src/smpi/colls/alltoallv-pair.c src/smpi/colls/alltoallv-ring-light-barrier.c src/smpi/colls/alltoallv-ring-mpi-barrier.c src/smpi/colls/alltoallv-ring-one-barrier.c - src/smpi/colls/alltoallv-bruck.c - src/smpi/colls/alltoallv-ompi-basic-linear.c - src/smpi/colls/bcast-arrival-pattern-aware.c + src/smpi/colls/alltoallv-ring.c + src/smpi/colls/barrier-ompi.c + src/smpi/colls/bcast-NTSB.c + src/smpi/colls/bcast-NTSL-Isend.c + src/smpi/colls/bcast-NTSL.c + src/smpi/colls/bcast-SMP-binary.c + src/smpi/colls/bcast-SMP-binomial.c + src/smpi/colls/bcast-SMP-linear.c src/smpi/colls/bcast-arrival-pattern-aware-wait.c + src/smpi/colls/bcast-arrival-pattern-aware.c src/smpi/colls/bcast-arrival-scatter.c src/smpi/colls/bcast-binomial-tree.c - src/smpi/colls/bcast-flattree.c src/smpi/colls/bcast-flattree-pipeline.c - src/smpi/colls/bcast-NTSB.c - src/smpi/colls/bcast-NTSL.c - src/smpi/colls/bcast-NTSL-Isend.c + src/smpi/colls/bcast-flattree.c + src/smpi/colls/bcast-ompi-pipeline.c + src/smpi/colls/bcast-ompi-split-bintree.c src/smpi/colls/bcast-scatter-LR-allgather.c src/smpi/colls/bcast-scatter-rdb-allgather.c - src/smpi/colls/bcast-SMP-binary.c - src/smpi/colls/bcast-SMP-binomial.c - src/smpi/colls/bcast-SMP-linear.c src/smpi/colls/coll_tuned_topo.c - src/smpi/colls/bcast-ompi-split-bintree.c - src/smpi/colls/bcast-ompi-pipeline.c + src/smpi/colls/colls_global.c + src/smpi/colls/gather-ompi.c + src/smpi/colls/reduce-NTSL.c src/smpi/colls/reduce-arrival-pattern-aware.c src/smpi/colls/reduce-binomial.c src/smpi/colls/reduce-flat-tree.c - src/smpi/colls/reduce-NTSL.c - src/smpi/colls/reduce-scatter-gather.c src/smpi/colls/reduce-ompi.c - src/smpi/colls/gather-ompi.c - src/smpi/colls/reduce_scatter-ompi.c + src/smpi/colls/reduce-scatter-gather.c src/smpi/colls/reduce_scatter-mpich.c - src/smpi/colls/smpi_automatic_selector.c + src/smpi/colls/reduce_scatter-ompi.c src/smpi/colls/scatter-ompi.c - src/smpi/colls/barrier-ompi.c + src/smpi/colls/smpi_automatic_selector.c + src/smpi/colls/smpi_mpich_selector.c + src/smpi/colls/smpi_openmpi_selector.c + src/smpi/instr_smpi.c + src/smpi/smpi_base.c + src/smpi/smpi_bench.c + src/smpi/smpi_c99.c + src/smpi/smpi_coll.c + src/smpi/smpi_comm.c + src/smpi/smpi_deployment.c + src/smpi/smpi_dvfs.c + src/smpi/smpi_global.c + src/smpi/smpi_group.c + src/smpi/smpi_mpi.c + src/smpi/smpi_mpi_dt.c + src/smpi/smpi_pmpi.c + src/smpi/smpi_replay.c + src/smpi/smpi_topo.c + src/surf/surf_routing_cluster_fat_tree.cpp ) if(SMPI_F2C) @@ -308,26 +312,26 @@ set(NS3_SRC ) set(SURF_SRC - src/surf/plugins/energy.cpp + src/surf/cpu_cas01.cpp src/surf/cpu_interface.cpp src/surf/cpu_ti.cpp - src/surf/cpu_cas01.cpp src/surf/fair_bottleneck.cpp src/surf/instr_routing.c src/surf/instr_surf.c src/surf/lagrange.cpp src/surf/maxmin.cpp - src/surf/network_interface.cpp src/surf/network_cm02.cpp - src/surf/network_smpi.cpp src/surf/network_constant.cpp + src/surf/network_interface.cpp + src/surf/network_smpi.cpp src/surf/platf_generator.c + src/surf/plugins/energy.cpp src/surf/random_mgr.c src/surf/sg_platf.c src/surf/storage_interface.cpp src/surf/storage_n11.cpp - src/surf/surf_interface.cpp src/surf/surf_c_bindings.cpp + src/surf/surf_interface.cpp src/surf/surf_routing.cpp src/surf/surf_routing_cluster.cpp src/surf/surf_routing_cluster_torus.cpp @@ -340,11 +344,11 @@ set(SURF_SRC src/surf/surfxml_parse.c src/surf/surfxml_parseplatf.c src/surf/trace_mgr.c - src/surf/workstation_interface.cpp + src/surf/vm_workstation_hl13.cpp + src/surf/vm_workstation_interface.cpp src/surf/workstation_clm03.cpp + src/surf/workstation_interface.cpp src/surf/workstation_ptask_L07.cpp - src/surf/vm_workstation_interface.cpp - src/surf/vm_workstation_hl13.cpp src/xbt/xbt_sg_stubs.c ) @@ -430,6 +434,42 @@ set(BINDINGS_SRC src/bindings/lua/simgrid_lua.h ) +set(JSURF_SWIG_SRC + src/bindings/java/surf.i +) + +set(JSURF_SWIG_SRC_EXTRA + src/bindings/java/surfdoc.i +) + +set(JSURF_JAVA_C_SRC + src/bindings/java/surf_swig.cpp + src/bindings/java/surf_swig.hpp +) + +set(JSURF_JAVA_GENERATED_SRC + src/bindings/java/org/simgrid/surf/Action.java + src/bindings/java/org/simgrid/surf/ActionList.java + src/bindings/java/org/simgrid/surf/ActionState.java + src/bindings/java/org/simgrid/surf/Cpu.java + src/bindings/java/org/simgrid/surf/CpuAction.java + src/bindings/java/org/simgrid/surf/CpuModel.java + src/bindings/java/org/simgrid/surf/LmmConstraint.java + src/bindings/java/org/simgrid/surf/LmmVariable.java + src/bindings/java/org/simgrid/surf/Model.java + src/bindings/java/org/simgrid/surf/NetworkAction.java + src/bindings/java/org/simgrid/surf/NetworkLink.java + src/bindings/java/org/simgrid/surf/Plugin.java + src/bindings/java/org/simgrid/surf/Resource.java + src/bindings/java/org/simgrid/surf/ResourceState.java + src/bindings/java/org/simgrid/surf/RoutingEdge.java + src/bindings/java/org/simgrid/surf/Surf.java + src/bindings/java/org/simgrid/surf/SurfJNI.java + src/bindings/java/org/simgrid/surf/TmgrTrace.java + src/bindings/java/org/simgrid/surf/TmgrTraceEvent.java + src/bindings/java/org/simgrid/surf/XbtDict.java +) + set(JMSG_C_SRC src/bindings/java/jmsg.c src/bindings/java/jmsg.h @@ -459,9 +499,14 @@ set(JMSG_C_SRC src/bindings/java/smx_context_java.h ) +set(JSURF_C_SRC + src/bindings/java/surfJAVA_wrap.cxx + src/bindings/java/surfJAVA_wrap.h + ${JSURF_JAVA_C_SRC} +) + set(JMSG_JAVA_SRC src/bindings/java/org/simgrid/NativeLib.java - src/bindings/java/org/simgrid/msg/As.java src/bindings/java/org/simgrid/msg/Comm.java src/bindings/java/org/simgrid/msg/File.java @@ -483,36 +528,7 @@ set(JMSG_JAVA_SRC src/bindings/java/org/simgrid/msg/TimeoutException.java src/bindings/java/org/simgrid/msg/TransferFailureException.java src/bindings/java/org/simgrid/msg/VM.java -) - -set(JSURF_SWIG_SRC - src/bindings/java/surf.i -) -set(JSURF_JAVA_C_SRC - src/bindings/java/surf_swig.cpp - src/bindings/java/surf_swig.hpp -) - -set(JSURF_JAVA_GENERATED_SRC - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/Surf.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/SurfJNI.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/Plugin.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/Model.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/Resource.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/Action.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/Cpu.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/CpuAction.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/NetworkLink.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/NetworkAction.java - - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/RoutingEdge.java - - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/ActionState.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/ResourceState.java - - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/LmmConstraint.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/LmmVariable.java - ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/XbtDict.java + ${JSURF_JAVA_GENERATED_SRC} ) set(JTRACE_C_SRC @@ -544,17 +560,17 @@ set(LUA_SRC ) set(TRACING_SRC + src/instr/instr_TI_trace.c src/instr/instr_config.c src/instr/instr_interface.c src/instr/instr_paje_containers.c - src/instr/instr_TI_trace.c - src/instr/instr_paje_trace.c - src/instr/instr_trace.c src/instr/instr_paje_header.c + src/instr/instr_paje_trace.c src/instr/instr_paje_types.c src/instr/instr_paje_values.c src/instr/instr_private.h src/instr/instr_resource_utilization.c + src/instr/instr_trace.c ) set(JEDULE_SRC @@ -572,30 +588,30 @@ set(MC_SRC src/mc/mc_checkpoint.c src/mc/mc_compare.c src/mc/mc_dpor.c - src/mc/mc_global.c src/mc/mc_dwarf.c - src/mc/mc_member.c src/mc/mc_dwarf_attrnames.h src/mc/mc_dwarf_expression.c src/mc/mc_dwarf_tagnames.h + src/mc/mc_global.c + src/mc/mc_hash.c src/mc/mc_liveness.c + src/mc/mc_member.c src/mc/mc_memory.c + src/mc/mc_pair.c src/mc/mc_private.h src/mc/mc_request.c + src/mc/mc_set.cpp src/mc/mc_state.c src/mc/memory_map.c - src/mc/mc_pair.c - src/mc/mc_hash.c - src/mc/mc_set.cpp ) set(headers_to_install - include/simgrid.h include/instr/instr.h include/msg/datatypes.h include/msg/msg.h include/simdag/datatypes.h include/simdag/simdag.h + include/simgrid.h include/simgrid/datatypes.h include/simgrid/modelchecker.h include/simgrid/platf.h @@ -810,8 +826,8 @@ set(DOC_SOURCES doc/doxygen/module-msg.doc doc/doxygen/module-sd.doc doc/doxygen/module-simix.doc - doc/doxygen/module-surf.doc doc/doxygen/module-smpi.doc + doc/doxygen/module-surf.doc doc/doxygen/module-trace.doc doc/doxygen/module-xbt.doc doc/doxygen/modules.doc @@ -822,6 +838,9 @@ set(DOC_SOURCES doc/doxygen/tracing.doc doc/doxygen/use.doc + doc/manpage/smpicc.1 + doc/manpage/smpirun.1 + doc/msg-tuto-src/deployment0.xml doc/msg-tuto-src/deployment1.xml doc/msg-tuto-src/deployment2.xml @@ -883,6 +902,7 @@ set(DOC_IMG set(bin_files ${bin_files} src/smpi/smpicc.in + src/smpi/smpicxx.in src/smpi/smpif2c.in src/smpi/smpiff.in src/smpi/smpif90.in @@ -924,6 +944,7 @@ set(EXAMPLES_CMAKEFILES_TXT examples/java/priority/CMakeLists.txt examples/java/reservationSurfPlugin/CMakeLists.txt examples/java/startKillTime/CMakeLists.txt + examples/java/surfCpuModel/CMakeLists.txt examples/java/surfPlugin/CMakeLists.txt examples/java/suspend/CMakeLists.txt examples/java/tracing/CMakeLists.txt @@ -970,6 +991,7 @@ set(EXAMPLES_CMAKEFILES_TXT examples/simdag/properties/CMakeLists.txt examples/simdag/scheduling/CMakeLists.txt examples/smpi/CMakeLists.txt + examples/smpi/smpi_msg_masterslave/CMakeLists.txt examples/smpi/MM/CMakeLists.txt examples/smpi/energy/CMakeLists.txt examples/smpi/energy/f77/CMakeLists.txt @@ -978,29 +1000,51 @@ set(EXAMPLES_CMAKEFILES_TXT ) set(TESHSUITE_CMAKEFILES_TXT + teshsuite/bug-17132/CMakeLists.txt + teshsuite/mc/dwarf/CMakeLists.txt + teshsuite/mc/dwarf_expression/CMakeLists.txt teshsuite/msg/CMakeLists.txt + teshsuite/msg/get_sender/CMakeLists.txt + teshsuite/msg/host_on_off/CMakeLists.txt + teshsuite/msg/pid/CMakeLists.txt + teshsuite/msg/process/CMakeLists.txt + teshsuite/msg/process_join/CMakeLists.txt teshsuite/msg/storage/CMakeLists.txt + teshsuite/msg/task_destroy_cancel/CMakeLists.txt teshsuite/msg/trace/CMakeLists.txt - teshsuite/bug-17132/CMakeLists.txt - teshsuite/simdag/CMakeLists.txt teshsuite/simdag/availability/CMakeLists.txt + teshsuite/simdag/basic/CMakeLists.txt + teshsuite/simdag/incomplete/CMakeLists.txt teshsuite/simdag/network/CMakeLists.txt teshsuite/simdag/network/mxn/CMakeLists.txt teshsuite/simdag/network/p2p/CMakeLists.txt teshsuite/simdag/partask/CMakeLists.txt teshsuite/simdag/platforms/CMakeLists.txt - teshsuite/simix/CMakeLists.txt + teshsuite/simix/check_defaults/CMakeLists.txt + teshsuite/simix/stack_overflow/CMakeLists.txt teshsuite/smpi/CMakeLists.txt + teshsuite/smpi/allgather/CMakeLists.txt + teshsuite/smpi/allgatherv/CMakeLists.txt + teshsuite/smpi/allreduce/CMakeLists.txt + teshsuite/smpi/alltoall/CMakeLists.txt + teshsuite/smpi/alltoallv/CMakeLists.txt + teshsuite/smpi/barrier/CMakeLists.txt + teshsuite/smpi/bcast/CMakeLists.txt + teshsuite/smpi/compute/CMakeLists.txt + teshsuite/smpi/gather/CMakeLists.txt + teshsuite/smpi/hvector/CMakeLists.txt + teshsuite/smpi/indexed/CMakeLists.txt + teshsuite/smpi/pingpong/CMakeLists.txt + teshsuite/smpi/reduce/CMakeLists.txt + teshsuite/smpi/scatter/CMakeLists.txt + teshsuite/smpi/shared/CMakeLists.txt + teshsuite/smpi/struct/CMakeLists.txt + teshsuite/smpi/vector/CMakeLists.txt teshsuite/smpi/mpich3-test/CMakeLists.txt teshsuite/smpi/mpich3-test/attr/CMakeLists.txt - teshsuite/smpi/mpich3-test/comm/CMakeLists.txt teshsuite/smpi/mpich3-test/coll/CMakeLists.txt + teshsuite/smpi/mpich3-test/comm/CMakeLists.txt teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt - teshsuite/smpi/mpich3-test/group/CMakeLists.txt - teshsuite/smpi/mpich3-test/topo/CMakeLists.txt - teshsuite/smpi/mpich3-test/init/CMakeLists.txt - teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt - teshsuite/smpi/mpich3-test/f77/util/CMakeLists.txt # teshsuite/smpi/mpich3-test/f77/attr/CMakeLists.txt teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt teshsuite/smpi/mpich3-test/f77/comm/CMakeLists.txt @@ -1008,12 +1052,29 @@ set(TESHSUITE_CMAKEFILES_TXT teshsuite/smpi/mpich3-test/f77/ext/CMakeLists.txt teshsuite/smpi/mpich3-test/f77/init/CMakeLists.txt teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt - teshsuite/smpi/mpich3-test/f90/util/CMakeLists.txt + teshsuite/smpi/mpich3-test/f77/util/CMakeLists.txt teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt teshsuite/smpi/mpich3-test/f90/init/CMakeLists.txt teshsuite/smpi/mpich3-test/f90/pt2pt/CMakeLists.txt - teshsuite/xbt/CMakeLists.txt + teshsuite/smpi/mpich3-test/f90/util/CMakeLists.txt + teshsuite/smpi/mpich3-test/group/CMakeLists.txt + teshsuite/smpi/mpich3-test/init/CMakeLists.txt + teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt + teshsuite/smpi/mpich3-test/topo/CMakeLists.txt + teshsuite/surf/CMakeLists.txt + teshsuite/surf/lmm_usage/CMakeLists.txt + teshsuite/surf/maxmin_bench/CMakeLists.txt + teshsuite/surf/surf_usage/CMakeLists.txt + teshsuite/surf/trace_usage/CMakeLists.txt + teshsuite/xbt/graphxml_usage/CMakeLists.txt + teshsuite/xbt/heap_bench/CMakeLists.txt + teshsuite/xbt/log_large/CMakeLists.txt + teshsuite/xbt/log_usage/CMakeLists.txt + teshsuite/xbt/mmalloc/CMakeLists.txt + teshsuite/xbt/parallel_log/CMakeLists.txt + teshsuite/xbt/parmap_bench/CMakeLists.txt + teshsuite/xbt/parmap_test/CMakeLists.txt ) set(TOOLS_CMAKEFILES_TXT @@ -1022,12 +1083,6 @@ set(TOOLS_CMAKEFILES_TXT tools/tesh/CMakeLists.txt ) -set(TESTSUITE_CMAKEFILES_TXT - testsuite/surf/CMakeLists.txt - testsuite/xbt/CMakeLists.txt - testsuite/mc/CMakeLists.txt - ) - set(CMAKE_SOURCE_FILES CMakeLists.txt buildtools/Cmake/AddTests.cmake @@ -1049,8 +1104,8 @@ set(CMAKE_SOURCE_FILES buildtools/Cmake/Modules/FindGTnets.cmake buildtools/Cmake/Modules/FindGraphviz.cmake buildtools/Cmake/Modules/FindLibSigc++.cmake - buildtools/Cmake/Modules/FindLibunwind.cmake buildtools/Cmake/Modules/FindLibdw.cmake + buildtools/Cmake/Modules/FindLibunwind.cmake buildtools/Cmake/Modules/FindLua51Simgrid.cmake buildtools/Cmake/Modules/FindNS3.cmake buildtools/Cmake/Modules/FindRngStream.cmake @@ -1065,7 +1120,6 @@ set(CMAKE_SOURCE_FILES buildtools/Cmake/Scripts/Makefile.default buildtools/Cmake/Scripts/SimGrid.packproj buildtools/Cmake/Scripts/generate_memcheck_tests.pl - buildtools/Cmake/Scripts/generate_new_tests.pl buildtools/Cmake/Scripts/java_bundle.sh buildtools/Cmake/Scripts/my_valgrind.pl buildtools/Cmake/Scripts/postinstall.sh @@ -1114,7 +1168,6 @@ set(PLATFORMS_EXAMPLES examples/platforms/generation_scripts/generate_g5k_platform.pl examples/platforms/generation_scripts/generate_g5k_platform_cabinets.pl examples/platforms/griffon.xml - examples/platforms/torus_cluster.xml examples/platforms/meta_cluster.xml examples/platforms/multicore_machine.xml examples/platforms/prop.xml @@ -1127,6 +1180,7 @@ set(PLATFORMS_EXAMPLES examples/platforms/syscoord/median_meridian.xml examples/platforms/syscoord/median_p2psim.syscoord examples/platforms/syscoord/median_p2psim.xml + examples/platforms/torus_cluster.xml examples/platforms/two_peers.xml examples/platforms/vivaldi.xml ) diff --git a/buildtools/Cmake/Distrib.cmake b/buildtools/Cmake/Distrib.cmake index 2bb482a98c..597fc9ee8e 100644 --- a/buildtools/Cmake/Distrib.cmake +++ b/buildtools/Cmake/Distrib.cmake @@ -20,7 +20,7 @@ if(NOT WIN32) COMMAND pod2man ${CMAKE_HOME_DIRECTORY}/tools/simgrid_update_xml.pl > ${MANPAGE_DIR}/simgrid_update_xml.1 COMMENT "Generating manpages" ) - install(FILES ${MANPAGE_DIR}/simgrid_update_xml.1 ${CMAKE_HOME_DIRECTORY}/tools/tesh/tesh.1 + install(FILES ${MANPAGE_DIR}/simgrid_update_xml.1 ${CMAKE_HOME_DIRECTORY}/tools/tesh/tesh.1 ${CMAKE_HOME_DIRECTORY}/doc/manpage/smpirun.1 ${CMAKE_HOME_DIRECTORY}/doc/manpage/smpicc.1 DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/man/man1) endif() @@ -29,6 +29,7 @@ endif() if(enable_smpi) install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/smpicc + ${CMAKE_BINARY_DIR}/bin/smpicxx ${CMAKE_BINARY_DIR}/bin/smpirun DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/) if(SMPI_F2C) @@ -69,7 +70,7 @@ add_custom_target(simgrid_update_xml ALL ) # libraries -install(TARGETS simgrid +install(TARGETS simgrid DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/) if(enable_lib_static AND NOT WIN32) @@ -138,6 +139,7 @@ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/lib/lua/5.1/simgrid* COMMAND ${CMAKE_COMMAND} -E echo "uninstall lib ok" COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpicc + COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpicxx COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpif2c COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpiff COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpif90 @@ -190,7 +192,8 @@ set(source_to_pack ${JMSG_C_SRC} ${JMSG_JAVA_SRC} ${JSURF_SWIG_SRC} - ${JSURF_JAVA_C_SRC} + ${JSURF_SWIG_SRC_EXTRA} + ${JSURF_C_SRC} ${LUA_SRC} ${MC_SRC} ${MSG_SRC} @@ -208,7 +211,6 @@ set(source_to_pack ${CMAKE_SOURCE_FILES} ${EXAMPLES_CMAKEFILES_TXT} ${TESHSUITE_CMAKEFILES_TXT} - ${TESTSUITE_CMAKEFILES_TXT} ${TOOLS_CMAKEFILES_TXT} ${DOC_FIGS} ${DOC_IMG} diff --git a/buildtools/Cmake/Flags.cmake b/buildtools/Cmake/Flags.cmake index 5e959e3602..675587b54c 100644 --- a/buildtools/Cmake/Flags.cmake +++ b/buildtools/Cmake/Flags.cmake @@ -36,7 +36,7 @@ if(enable_compile_optimizations) endif() else() # On non-windows, 4.6 is enough for that - if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5") + if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5" AND LINKER_VERSION STRGREATER "2.22") set(optCFLAGS "${optCFLAGS} -flto ") endif() endif() diff --git a/buildtools/Cmake/MakeExe.cmake b/buildtools/Cmake/MakeExe.cmake index b9445e4573..8c3a10751d 100644 --- a/buildtools/Cmake/MakeExe.cmake +++ b/buildtools/Cmake/MakeExe.cmake @@ -20,6 +20,7 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/pingPong) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/priority) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/reservationSurfPlugin) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/startKillTime) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/surfCpuModel) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/surfPlugin) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/suspend) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/tracing) @@ -72,18 +73,29 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/MM) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/smpi_msg_masterslave) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/energy) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f77) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f90) add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/xbt) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/mc/dwarf) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/mc/dwarf_expression) + add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process_join) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace) -add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/availability) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/incomplete) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p) @@ -92,9 +104,27 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132) -add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simix) - -add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simix/check_defaults) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simix/stack_overflow) + +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgather) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgatherv) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allreduce) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoall) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoallv) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/barrier) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/gather) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pingpong) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/scatter) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/attr) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll) @@ -119,11 +149,20 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/datatype add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/init) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/pt2pt) -add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt) - -add_subdirectory(${CMAKE_HOME_DIRECTORY}/testsuite/mc) -add_subdirectory(${CMAKE_HOME_DIRECTORY}/testsuite/surf) -add_subdirectory(${CMAKE_HOME_DIRECTORY}/testsuite/xbt) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/surf/) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/surf/lmm_usage) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/surf/maxmin_bench) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/surf/surf_usage) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/surf/trace_usage) + +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/graphxml_usage) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/heap_bench) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_large) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_usage) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parallel_log) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parmap_bench) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parmap_test) add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools) add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools/graphicator) diff --git a/buildtools/Cmake/MakeJava.cmake b/buildtools/Cmake/MakeJava.cmake index c8df82ab0d..1d1292ab11 100644 --- a/buildtools/Cmake/MakeJava.cmake +++ b/buildtools/Cmake/MakeJava.cmake @@ -33,7 +33,7 @@ if(WIN32) exec_program("java -d32 -version" OUTPUT_VARIABLE IS_32_BITS_JVM) STRING( FIND ${IS_32_BITS_JVM} "Error" POSITION ) - if(${POSITION} GREATER -1) + if(${POSITION} GREATER -1) message(FATAL_ERROR "Java JVM needs to be 32 bits to be able to run with Simgrid on Windows for now") endif() @@ -113,15 +113,39 @@ add_custom_command( ) add_custom_target(simgrid-java_jar ALL DEPENDS ${SIMGRID_JAR}_finalized) -set(CMAKE_SWIG_FLAGS "-package" "org.simgrid.surf") -set(CMAKE_SWIG_OUTDIR "${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/surf") -set(CMAKE_SWIG_OUTDIR "${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf") -set_source_files_properties(${JSURF_SWIG_SRC} PROPERTIES CPLUSPLUS 1) -#set_source_files_properties(${SURF_SWIG_FILE} PROPERTIES SWIG_FLAGS "-includeall") -include_directories(${JNI_INCLUDE_DIRS}) -swig_add_module(surf-java java ${JSURF_SWIG_SRC} ${JSURF_JAVA_C_SRC}) -swig_link_libraries(surf-java simgrid) +if(enable_maintainer_mode) + set(CMAKE_SWIG_FLAGS "-package" "org.simgrid.surf") + set(CMAKE_SWIG_OUTDIR "${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/surf") + + set_source_files_properties(${JSURF_SWIG_SRC} PROPERTIES CPLUSPLUS 1) + include_directories(${JNI_INCLUDE_DIRS}) + swig_add_module(surf-java java ${JSURF_SWIG_SRC} ${JSURF_JAVA_C_SRC}) + + add_custom_command(TARGET surf-java POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/src/bindings/java/surfJAVA_wrap.cxx" "${CMAKE_HOME_DIRECTORY}/src/bindings/java/surfJAVA_wrap.cxx" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/src/bindings/java/surfJAVA_wrap.h" "${CMAKE_HOME_DIRECTORY}/src/bindings/java/surfJAVA_wrap.h" + ) + + swig_link_libraries(surf-java simgrid) +else() + add_library(surf-java SHARED + ${JSURF_C_SRC}) + target_link_libraries(surf-java simgrid) + set_source_files_properties("${CMAKE_HOME_DIRECTORY}/src/bindings/java/surfJAVA_wrap.cxx" + PROPERTIES COMPILE_FLAGS "-fPIC -I\"${JAVA_INCLUDE_PATH}\" -I\"${JAVA_INCLUDE_PATH2}\"" + ) +endif() add_dependencies(simgrid-java surf-java) add_dependencies(simgrid-java_pre_jar surf-java) + +if(WIN32) + set_target_properties(surf-java PROPERTIES + LINK_FLAGS "-Wl,--subsystem,windows,--kill-at" + PREFIX "") + if(PEXPORTS_PATH) + add_custom_command(TARGET surf-java POST_BUILD + COMMAND ${PEXPORTS_PATH}/pexports.exe ${CMAKE_BINARY_DIR}/lib/surf-java.dll > ${CMAKE_BINARY_DIR}/lib/surf-java.def) + endif(PEXPORTS_PATH) +endif() diff --git a/buildtools/Cmake/MakeLibWin.cmake b/buildtools/Cmake/MakeLibWin.cmake index 3699a3a35f..49a0833039 100644 --- a/buildtools/Cmake/MakeLibWin.cmake +++ b/buildtools/Cmake/MakeLibWin.cmake @@ -31,11 +31,11 @@ set(SIMGRID_DEP "-lws2_32 -L${PATH_PTHREAD_LIB} -lm -lpthreadGC2") if(ARCH_32_BITS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i486") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -march=i486") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i486 -D_I_X86_") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -march=i486 -D_I_X86_") else() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -D_AMD64_") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -D_AMD64_") # message(FATAL_ERROR "Sorry, Simgrid fails with full 64bits for now! Please contact us.") endif() diff --git a/buildtools/Cmake/Modules/FindGFortran.cmake b/buildtools/Cmake/Modules/FindGFortran.cmake index f034577fc5..ff01f1769a 100644 --- a/buildtools/Cmake/Modules/FindGFortran.cmake +++ b/buildtools/Cmake/Modules/FindGFortran.cmake @@ -22,8 +22,8 @@ set(SMPI_F90 0) if(GFORTRAN_EXE) if(NOT SMPI_F2C) message("-- Fortran 90 support for smpi also needs f2c.") - elseif(HAVE_MC) - message("-- Fortran 90 support for smpi is currently not compatible with model checking.") + #elseif(HAVE_MC) + # message("-- Fortran 90 support for smpi is currently not compatible with model checking.") else() set(SMPI_F90 1) endif() diff --git a/buildtools/Cmake/Modules/FindValgrind.cmake b/buildtools/Cmake/Modules/FindValgrind.cmake index 5bee952e31..559f15ee94 100644 --- a/buildtools/Cmake/Modules/FindValgrind.cmake +++ b/buildtools/Cmake/Modules/FindValgrind.cmake @@ -15,13 +15,17 @@ if(VALGRIND_EXE) SET(MEMORYCHECK_COMMAND "${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/my_valgrind.pl") endif() +if(enable_memcheck_xml) + SET(VALGRIND_EXTRA_COMMAND_OPTIONS "--xml=yes --xml-file=memcheck_test_%p.memcheck --child-silent-after-fork=yes") +endif() + if(VALGRIND_EXE) exec_program("${VALGRIND_EXE} --version " OUTPUT_VARIABLE "VALGRIND_VERSION") string(REGEX MATCH "[0-9].[0-9].[0-9]" NEW_VALGRIND_VERSION "${VALGRIND_VERSION}") if(NEW_VALGRIND_VERSION) message(STATUS "Valgrind version: ${NEW_VALGRIND_VERSION}") exec_program("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/generate_memcheck_tests.pl ${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/AddTests.cmake > ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/memcheck_tests.cmake" OUTPUT_VARIABLE SHUTT) - set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --trace-children-skip=/usr/bin/*,/bin/* --leak-check=full --show-reachable=yes --track-origins=no --read-var-info=no --num-callers=20 --suppressions=${CMAKE_HOME_DIRECTORY}/tools/simgrid.supp") + set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --trace-children-skip=/usr/bin/*,/bin/* --leak-check=full --show-reachable=yes --track-origins=no --read-var-info=no --num-callers=20 --suppressions=${CMAKE_HOME_DIRECTORY}/tools/simgrid.supp ${VALGRIND_EXTRA_COMMAND_OPTIONS} ") message(STATUS "Valgrind options: ${MEMORYCHECK_COMMAND_OPTIONS}") else() set(enable_memcheck false) @@ -32,4 +36,4 @@ else() message(FATAL_ERROR "Command valgrind not found --> enable_memcheck autoset to false.") endif() -mark_as_advanced(VALGRIND_EXE) \ No newline at end of file +mark_as_advanced(VALGRIND_EXE) diff --git a/buildtools/Cmake/Option.cmake b/buildtools/Cmake/Option.cmake index 1c56b6eba5..d8325ea17a 100644 --- a/buildtools/Cmake/Option.cmake +++ b/buildtools/Cmake/Option.cmake @@ -28,7 +28,9 @@ option(enable_latency_bound_tracking "" off) option(enable_coverage "Enable coverage." off) mark_as_advanced(enable_coverage) option(enable_memcheck "Enable memcheck." off) +option(enable_memcheck_xml "Enable memcheck with xml output." off) mark_as_advanced(enable_memcheck) +mark_as_advanced(enable_memcheck_xml) option(enable_mallocators "Enable mallocators (disable only for debugging purpose)." on) option(enable_print_message "Enable print message during config." off) mark_as_advanced(enable_print_message) diff --git a/buildtools/Cmake/Scripts/generate_memcheck_tests.pl b/buildtools/Cmake/Scripts/generate_memcheck_tests.pl index 85dd3497e1..fc4fd61816 100755 --- a/buildtools/Cmake/Scripts/generate_memcheck_tests.pl +++ b/buildtools/Cmake/Scripts/generate_memcheck_tests.pl @@ -38,6 +38,7 @@ my ($path); my ($dump) = 0; my (%environ); my ($tesh_file); +my ($factories); my ($config_var); my ($name_test); my ($indent); @@ -50,23 +51,28 @@ while ( defined( $line = ) ) { } if ( $line =~ /END TESH TESTS/ ) { $dump = 0; - last; + next; } if ($dump) { $line =~ s/^ //; - if ( $line =~ /^\s*ADD_TEST\(\S+\s+\S*TESH\_COMMAND\}\s/ ) { + if ( $line =~ /^\s*(?:ADD_TEST\(\S+\s+\S*TESH\_COMMAND\}\s|ADD_TESH\(|ADD_TESH_FACTORIES)/ ) { undef %environ; $config_var = ""; + $factories = ""; $path = ""; $nb_test++; $tesh_file = ""; $name_test = ""; $indent = ""; - - if ( $line =~ /^(\s*)ADD_TEST\((\S+)/ ) { + if ( $line =~ /^(\s*)ADD_(?:TEST|TESH)\((\S+)/ ) { $indent = ($1); $name_test = ($2); } + if ( $line =~ /^(\s*)ADD_TESH_FACTORIES\((\S+)\s+\"(\S+)\"/ ) { + $indent = ($1); + $name_test = ($2); + $factories = ($3); + } while ( $line =~ /--cfg\s+(\S+)/g ) { $config_var = "--cfg=$1 $config_var"; } @@ -101,8 +107,6 @@ while ( defined( $line = ) ) { } my ($count) = 0; - my ($count_first) = 0; - my ($count_second) = 0; open TESH_FILE, $tesh_file or die "Unable to open tesh file: \"$tesh_file\". $!\n"; my ($input) = ""; my ($l); @@ -135,14 +139,32 @@ while ( defined( $line = ) ) { if ( $command =~ /^mkfile\s+(\S+)/) { my $file = $1; # don't ask me to explain why so many backslashes... - $input =~ s/\\/\\\\\\\\\\\\\\\\/g; - $input =~ s/\n/\\\\\\\\n/g; - $input =~ s/"/\\\\\\\\042/g; - $input =~ s/'/\\\\\\\\047/g; + $input =~ s/\\/\\\\\\\\/g; + $input =~ s/\n/\\\\n/g; + $input =~ s/"/\\\\042/g; + $input =~ s/'/\\\\047/g; $input =~ s/%/%%/g; $command = "sh -c \"printf '$input' > $file\""; } - print "${indent}ADD_TEST(memcheck-$name_test-$count $command --cd $path\/)\n"; + if ($factories) { + foreach my $factory (split(';', $factories)) { + print "${indent}ADD_TEST(NAME memcheck-$name_test-$factory-$count\n"; + print "${indent} WORKING_DIRECTORY $path\/\n"; + print "${indent} COMMAND $command --cfg=contexts/factory:$factory)\n"; + if ($count > 0) { + print "${indent}set_tests_properties(memcheck-$name_test-$factory-$count\n"; + print "${indent} PROPERTIES DEPENDS memcheck-$name_test-$factory-" . ($count - 1) . ")\n"; + } + } + } else { + print "${indent}ADD_TEST(NAME memcheck-$name_test-$count\n"; + print "${indent} WORKING_DIRECTORY $path\/\n"; + print "${indent} COMMAND $command)\n"; + if ($count > 0) { + print "${indent}set_tests_properties(memcheck-$name_test-$count\n"; + print "${indent} PROPERTIES DEPENDS memcheck-$name_test-" . ($count - 1) . ")\n"; + } + } $input = ""; #push @test_list, "memcheck-$name_test-$count"; $count++; @@ -153,14 +175,15 @@ while ( defined( $line = ) ) { } close(TESH_FILE); } - elsif ( $line =~ /^\s*set_tests_properties/ ) { - if ( $line =~ /set_tests_properties\(([\S]+)/ ) { + elsif ( $line =~ /^\s*SET_TESTS_PROPERTIES/ ) { + if ( $line =~ /SET_TESTS_PROPERTIES\(([\S]+)/ ) { my ($name_temp) = ($1); $line =~ s/$name_temp/memcheck-$name_temp-0/g; print $line. "\n"; } - } - else { + } elsif ( $line =~ /^(\s*)ADD_TEST\((.*)\)/ ) { + print "$1ADD_TEST(memcheck-$2)\n"; + } else { print $line. "\n"; } } diff --git a/buildtools/Cmake/Scripts/generate_new_tests.pl b/buildtools/Cmake/Scripts/generate_new_tests.pl deleted file mode 100755 index e3c807cd9b..0000000000 --- a/buildtools/Cmake/Scripts/generate_new_tests.pl +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl -w - -# Copyright (c) 2012, 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. - -use strict; - -# input file = AddTest.txt - -if($#ARGV!=0) { - die "Usage: generate_new_tests.pl AddTests.cmake\n"; -} - -open MAKETEST, $ARGV[0] or die "Unable to open $ARGV[1]. $!\n"; - -my($line); -my($path); -my($dump)=0; -my($setenv); -my($tesh_file); -my($config_var); -my($name_test); - -while(defined($line=)) -{ - chomp $line; - if($line =~ /BEGIN CONTEXTS FACTORY/) { - print "$line\n"; - $dump = 1; - next; - } - if($line =~ /HAVE_TRACING/) { - print "$line\n"; - $dump = !$dump; - next; - } - if($line =~ /HAVE_LUA/) { - print "$line\n"; - $dump = !$dump; - next; - } - if($line =~ /HAVE_RUBY/) { - print "$line\n"; - $dump = !$dump; - next; - } - if($dump) - { - if($line =~ /ADD_TEST.*\/bin\/tesh/) - { - $setenv = ""; - $config_var = ""; - $path = ""; - $tesh_file = ""; - $name_test = ""; - - if($line =~ /ADD_TEST\(([\S]+)/) - { - $name_test =($1); - } - if($line =~ /--cfg\s*\t*(\S*)/) - { - $config_var = "--cfg $1 $config_var"; - } - if($line =~ /--cd\s*(\S+)/) - { - $path="--cd $1"; - } - if($line =~ /--setenv\s*\t*(\S*)\=(\S*)/) - { - $setenv = "--setenv $1=$2 $setenv"; - } - if($line =~ /([\S]+)[)]$/) - { - $tesh_file =($1); - } - - print "ADD_TEST($name_test-raw \$\{CMAKE_BINARY_DIR\}/bin/tesh --cfg contexts/factory:raw $config_var $setenv $path $tesh_file)\n"; - print "ADD_TEST($name_test-thread \$\{CMAKE_BINARY_DIR\}/bin/tesh --cfg contexts/factory:thread $config_var $setenv $path $tesh_file)\n"; - print "ADD_TEST($name_test-ucontext \$\{CMAKE_BINARY_DIR\}/bin/tesh --cfg contexts/factory:ucontext $config_var $setenv $path $tesh_file)\n"; - } - elsif($line =~ /set_tests_properties\(([\S]+)/) - { - my($name_temp)=($1); - $line =~ s/$name_temp/$name_temp-raw $name_temp-thread $name_temp-ucontext/g; - print $line."\n"; - } - else - { - print "$line\n"; - } - - } - else - { - print "$line\n"; - } -} -close(MAKETEST); diff --git a/buildtools/Cmake/Scripts/tesh.pl b/buildtools/Cmake/Scripts/tesh.pl index 451b26a991..0b819b1841 100755 --- a/buildtools/Cmake/Scripts/tesh.pl +++ b/buildtools/Cmake/Scripts/tesh.pl @@ -33,6 +33,7 @@ my $tesh_name; my $error=0; my $exitcode=0; my @bg_cmds; +my (%environ); $path =~ s|[^/]*$||; push @INC,$path; @@ -40,6 +41,7 @@ push @INC,$path; use Getopt::Long qw(GetOptions); use strict; use Term::ANSIColor; +use Text::ParseWords; use IPC::Open3; use IO::File; @@ -51,13 +53,24 @@ else{ $ENV{"PRINTF_EXPONENT_DIGITS"} = "2"; } -#Add current directory to path -$ENV{PATH} = "$ENV{PATH}:."; - ## ## Command line option handling ## +sub var_subst { + my ($text, $name, $value) = @_; + if ($value) { + $text =~ s/\${$name(?::[=-][^}]*)?}/$value/g; + $text =~ s/\$$name(\W|$)/$value$1/g; + } + else { + $text =~ s/\${$name:=([^}]*)}/$1/g; + $text =~ s/\${$name}//g; + $text =~ s/\$$name(\W|$)/$1/g; + } + return $text; +} + # option handling helper subs sub cd_cmd { my $directory=$_[1]; @@ -89,20 +102,8 @@ sub setenv_cmd { die "[Tesh/CRITICAL] Malformed argument to setenv: expected 'name=value' but got '$_[1]'\n"; } - if($var =~ /bindir/){ - print "[Tesh/INFO] setenv $var=$ctn\n"; - $bindir = $ctn; - } - else - { - if($var =~ /srcdir/){ - $srcdir = $ctn; - } - else{ - $ENV{$var} = $ctn; - print "[Tesh/INFO] setenv $var=$ctn\n"; - } - } + print "[Tesh/INFO] setenv $var=$ctn\n"; + $environ{$var} = $ctn; } # Main option parsing sub @@ -220,25 +221,31 @@ sub exec_cmd { } # cleanup the command line - if($OS eq "WIN"){ - $cmd{'cmd'} =~ s/\${EXEEXT:=}/.exe/g; - $cmd{'cmd'} =~ s/\${EXEEXT}/.exe/g; - $cmd{'cmd'} =~ s/\$EXEEXT/.exe/g; - } - else{ - $cmd{'cmd'} =~ s/\${EXEEXT:=}//g; - } - $cmd{'cmd'} =~ s/\${bindir:=}/$bindir/g; - $cmd{'cmd'} =~ s/\${srcdir:=}/$srcdir/g; - $cmd{'cmd'} =~ s/\${bindir:=.}/$bindir/g; - $cmd{'cmd'} =~ s/\${srcdir:=.}/$srcdir/g; - $cmd{'cmd'} =~ s/\${bindir}/$bindir/g; - $cmd{'cmd'} =~ s/\${srcdir}/$srcdir/g; -# $cmd{'cmd'} =~ s|^\./||g; -# $cmd{'cmd'} =~ s|tesh|tesh.pl|g; - $cmd{'cmd'} =~ s/\(%i:%P@%h\)/\\\(%i:%P@%h\\\)/g; + if($OS eq "WIN") { + var_subst($cmd{'cmd'}, "EXEEXT", ".exe"); + } else { + var_subst($cmd{'cmd'}, "EXEEXT", ""); + } + + # substitute environ variables + foreach my $key (keys %environ) { + $cmd{'cmd'} = var_subst($cmd{'cmd'}, $key, $environ{$key}); + } + # substitute remaining variables, if any + while ($cmd{'cmd'} =~ /\${(\w+)(?::[=-][^}]*)?}/) { + $cmd{'cmd'} = var_subst($cmd{'cmd'}, $1, ""); + } + while ($cmd{'cmd'} =~ /\$(\w+)/) { + $cmd{'cmd'} = var_subst($cmd{'cmd'}, $1, ""); + } + + # add cfg options $cmd{'cmd'} .= " $opts{'cfg'}" if (defined($opts{'cfg'}) && length($opts{'cfg'})); + # final cleanup + $cmd{'cmd'} =~ s/^\s+//; + $cmd{'cmd'} =~ s/\s+$//; + print "[$tesh_name:$cmd{'line'}] $cmd{'cmd'}\n" ; ### @@ -248,7 +255,8 @@ sub exec_cmd { $cmd{'got'} = IO::File->new_tmpfile; $cmd{'got'}->autoflush(1); local *E = $cmd{'got'}; - $cmd{'pid'} = open3(\*CHILD_IN, ">&E", ">&E", $cmd{'cmd'} ); + $cmd{'pid'} = open3(\*CHILD_IN, ">&E", ">&E", + quotewords('\s+', 0, $cmd{'cmd'})); # push all provided input to executing child map { print CHILD_IN "$_\n"; } @{$cmd{'in'}}; diff --git a/buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c b/buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c index a20e1bdb14..1c39b5c0ab 100644 --- a/buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c +++ b/buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c @@ -8,7 +8,7 @@ #include #ifdef _XBT_WIN32 -#include "win32_ucontext.h" +#include "xbt/win32_ucontext.h" #include "win32_ucontext.c" #else #include diff --git a/buildtools/Cmake/test_prog/prog_stacksetup.c b/buildtools/Cmake/test_prog/prog_stacksetup.c index 35f08bccb0..8039927e60 100644 --- a/buildtools/Cmake/test_prog/prog_stacksetup.c +++ b/buildtools/Cmake/test_prog/prog_stacksetup.c @@ -9,7 +9,7 @@ #endif #ifdef _XBT_WIN32 -#include "win32_ucontext.h" +#include "xbt/win32_ucontext.h" #include "win32_ucontext.c" #endif @@ -24,7 +24,7 @@ #if defined(TEST_makecontext) #ifdef _XBT_WIN32 -#include "win32_ucontext.h" +#include "xbt/win32_ucontext.h" #else #include #endif diff --git a/buildtools/jenkins/run_DynamicAnalysis.sh b/buildtools/jenkins/run_DynamicAnalysis.sh new file mode 100755 index 0000000000..0d05047396 --- /dev/null +++ b/buildtools/jenkins/run_DynamicAnalysis.sh @@ -0,0 +1,51 @@ +#!/bin/sh +if [ -d $WORKSPACE/build ] +then + rm -rf $WORKSPACE/build +fi +if [ -d $WORKSPACE/install ] +then + rm -rf $WORKSPACE/install +fi +mkdir $WORKSPACE/build +mkdir $WORKSPACE/install + +if [ -d $WORKSPACE/memcheck ] +then + rm -rf $WORKSPACE/memcheck +fi +mkdir $WORKSPACE/memcheck + +cd $WORKSPACE/build + +cmake -Denable_lua=OFF -Denable_tracing=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON -Denable_lib_static=OFF -Denable_model-checking=OFF -Denable_latency_bound_tracking=OFF -Denable_gtnets=OFF -Denable_jedule=OFF -Denable_mallocators=OFF -Denable_memcheck_xml=ON $WORKSPACE +make + +ctest -D ExperimentalStart +ctest -D ExperimentalConfigure +ctest -D ExperimentalBuild +ctest -D ExperimentalMemCheck + +cd $WORKSPACE/build +if [ -f Testing/TAG ] ; then + find . -iname "*.memcheck" -exec mv {} $WORKSPACE/memcheck \; + mv Testing/`head -n 1 < Testing/TAG`/DynamicAnalysis.xml $WORKSPACE +fi + +make clean + +cmake -Denable_lua=OFF -Denable_tracing=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON -Denable_lib_static=OFF -Denable_model-checking=OFF -Denable_latency_bound_tracking=OFF -Denable_gtnets=OFF -Denable_jedule=OFF -Denable_mallocators=OFF -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_coverage=ON $WORKSPACE + +make +ctest -D ExperimentalStart +ctest -D ExperimentalConfigure +ctest -D ExperimentalBuild +ctest -D ExperimentalTest +ctest -D ExperimentalCoverage + +if [ -f Testing/TAG ] ; then + /usr/local/gcovr-3.1/scripts/gcovr -r .. --xml-pretty -o $WORKSPACE/xml_coverage.xml + xsltproc $WORKSPACE/buildtools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults_memcheck.xml + mv CTestResults_memcheck.xml $WORKSPACE +fi + diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 745392566f..302af7916f 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -782,8 +782,7 @@ EXCLUDE_SYMBOLS = EXAMPLE_PATH = ./ \ @top_srcdir@/src/surf/ \ @top_srcdir@/src/xbt/ \ - @top_srcdir@/examples \ - @top_srcdir@/testsuite + @top_srcdir@/examples # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp @@ -1580,7 +1579,11 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN \ DOXYGEN_SKIP_IT \ - XBT_PUBLIC= \ + XBT_PUBLIC(type)="extern type" \ + XBT_EXPORT_NO_IMPORT(type)=type \ + XBT_IMPORT_NO_EXPORT(type)=type \ + XBT_PUBLIC_DATA(type)="extern type" \ + XBT_PUBLIC_CLASS=class \ XBT_INLINE= \ HAVE_TRACING \ MSG_USE_DEPRECATED diff --git a/doc/doxygen/install.doc b/doc/doxygen/install.doc index 63aebcf2ac..b557898581 100644 --- a/doc/doxygen/install.doc +++ b/doc/doxygen/install.doc @@ -130,7 +130,7 @@ Note that compile-time options are very different from @ref options The default configuration should be ok for most usages, but if you need to change something, there is several ways to do so. First, you -can use environment variable. For example, you can change the used +can use environment variables. For example, you can change the used compilers by issuing these commands before launching cmake: @verbatim @@ -138,6 +138,9 @@ export CC=gcc-4.4 export CXX=g++-4.4 @endverbatim +Note that other variables are available, such as CFLAGS and CXXFLAGS to add +options for respectively the C compiler and the C++ compiler. + Another way to do so is to use the -D argument of cmake as follows. Note that the terminating dot is mandatory (see @ref install_cmake_outsrc to understand its meaning). diff --git a/doc/doxygen/options.doc b/doc/doxygen/options.doc index b70680d11c..edb44a13cd 100644 --- a/doc/doxygen/options.doc +++ b/doc/doxygen/options.doc @@ -529,9 +529,38 @@ to 1, \c smpirun will display this information when the simulation ends. \verbat Simulation time: 1e3 seconds. \endverbatim -\subsection options_model_smpi_detached Simulating MPI detached send +\subsection options_smpi_global Automatic privatization of global variables + +MPI executables are meant to be executed in separated processes, but SMPI is +executed in only one process. Global variables from executables will be placed +in the same memory zone and shared between processes, causing hard to find bugs. +To avoid this, several options are possible : + - Manual edition of the code, for example to add __thread keyword before data + declaration, which allows the resulting code to work with SMPI, but only + if the thread factory (see \ref options_virt_factory) is used, as global + variables are then placed in the TLS (thread local storage) segment. + - Source-to-source transformation, to add a level of indirection + to the global variables. SMPI does this for F77 codes compiled with smpiff, + and used to provide coccinelle scripts for C codes, which are not functional anymore. + - Compilation pass, to have the compiler automatically put the data in + an adapted zone. + - Runtime automatic switching of the data segments. SMPI stores a copy of + each global data segment for each process, and at each context switch replaces + the actual data with its copy from the right process. This mechanism uses mmap, + and is for now limited to systems supporting this functionnality (all Linux + and some BSD should be compatible). + Another limitation is that SMPI only accounts for global variables defined in + the executable. If the processes use external global variables from dynamic + libraries, they won't be switched correctly. To avoid this, using static + linking is advised (but not with the simgrid library, to avoid replicating + its own global variables). + + To use this runtime automatic switching, the variable \b smpi/privatize_global_variables + should be set to yes -(this configuration item is experimental and may change or disapear) + + +\subsection options_model_smpi_detached Simulating MPI detached send This threshold specifies the size in bytes under which the send will return immediately. This is different from the threshold detailed in \ref options_model_network_asyncsend diff --git a/doc/doxygen/platform.doc b/doc/doxygen/platform.doc index e06e2236eb..a4902d63dc 100644 --- a/doc/doxygen/platform.doc +++ b/doc/doxygen/platform.doc @@ -361,6 +361,20 @@ unset. availability. Similar to hosts attribute. \li state_file: Allow you to use a file as input for states. Similar to hosts attribute. +\li loopback_bw : bandwidth for loopback (if any). See link + section for syntax/details. If both loopback_* attributes are omitted, + no loopback link is created and all intra-node communication will + use the main network link of the node. Loopback link is a FATPIPE. +\li loopback_lat : latency for loopback (if any). See link + section for syntax/details. See loopback_bw for more info. +\li topology : network topology to use. For now SimGrid supports FLAT + (default, with or without backbone, as described before) or + TORUS + attributes for this tag. +\li topo_parameters : specific parameters to pass for the topology + defined in the topology tag. For torus networks, comma-separated list of + the number of nodes in each dimension of the torus. + the router name is defined as the resulting String in the following java line of code: diff --git a/doc/manpage/smpicc.1 b/doc/manpage/smpicc.1 new file mode 100644 index 0000000000..2a79ffe62c --- /dev/null +++ b/doc/manpage/smpicc.1 @@ -0,0 +1,17 @@ +.TH smpicc 1 +.SH NAME +smpicc \- SMPI C wrapper compiler +.SH SYNOPSIS +smpicc … +.SH DESCRIPTION +smpicc is just a wrapper around the compiler used to build simgrid, adding the right flags in order to use the simgrid library and SMPI, the MPI implementation within it. Any arguments filled to smpicc will be passed to the underlying compiler directly, of which the \fB\-\-version\fR argument should give the name and the version. Please refer to its documentation in case of trouble. +.SH ENVIRONMENT VARIABLES +All environment variables taken into account by the compiler will be used, but note that setting CC has no effect. +.SH AUTHORS +The SimGrid team (simgrid-devel@lists.gforge.inria.fr) +.SH COPYRIGHT AND LICENCE +Copyright (c) 2014. The SimGrid Team. All rights reserved. + +This program is free software; you may redistribute it and/or modify it under the terms of GNU LGPL (v2.1) license. +.SH SEE ALSO +.B smpirun\fR(1) diff --git a/doc/manpage/smpirun.1 b/doc/manpage/smpirun.1 new file mode 100644 index 0000000000..1cbee031bb --- /dev/null +++ b/doc/manpage/smpirun.1 @@ -0,0 +1,64 @@ +.TH smpirun 1 +.SH NAME +smpirun \- Allow the configuration and the execution of MPI programs with simgrid and SMPI +.SH SYNOPSIS +smpirun [\fIOPTIONS\fR]… \fB\-platform\fR \fB\-hostfile\fR program [\fIPROGRAM-OPTIONS\fR]… +.SH DESCRIPTION +smpirun provides an easy way to run programs linked to simgrid and using SMPI. It sets some default values, and generate a deployment file using the mandatory arguments \fB-platform\fR and \fB-hostfile\fR. +.TP +\fB\-platform\fR +XML file describing the platform on which we want to deploy the program +.TP +\fB\-hostfile\fR, \fB\-machinefile\fR +Hostfile listing all the machines in use +.SH OPTIONS +.SS Configuration options +The configuration of the simulation can be tweaked using \fB--cfg\fR=\fIparameter\fR:\fIvalue\fR. Refer to http://simgrid.gforge.inria.fr/simgrid/latest/doc/options.html to know what are the different possibilities. +.SS Other options +.TP +\fB\-help\fR +Print the usage and a résumé of the available options +.TP +\fB\-keep-temps\fR +Do not remove the generated files after execution. +.TP +\fB\-wrapper\fR +Use command to run the program (e.g. "valgrind"). +.TP +\fB\-map\fR +Display the machine on which each process rank is mapped. +.TP +\fB\-np\fR +Use that amount of processes. By default, there is the same number of processes as there are of hosts in the hostfile. +.TP +\fB\-trace\fR +Equivalent to \fB–cfg\fR=\fItracing\fR:\fIyes\fR \fB–cfg\fR=\fItracing/smpi\fR:\fIyes\fR, activate the trace mecanism if available. +.TP +\fB\-trace-ti\fR +Activate time independant tracing. +.TP +\fB\-trace-comment\fR +Put a comment on the top of the trace file. +.TP +\fB\-trace-comment-file\fR +Insert the content of the file at the head of the trace file as a comment. +.TP +\fB\-trace-grouped\fR +Group MPI processes by location. +.TP +\fB\-trace-resource\fR +Trace resource utilization. +.TP +\fB\-trace-viva\fR +Generate configuration for Viva's GraphView. +.TP +\fB\-trace-file\fR +Name of the tracefile +.SH AUTHORS +The SimGrid team (simgrid-devel@lists.gforge.inria.fr) +.SH COPYRIGHT AND LICENCE +Copyright (c) 2014. The SimGrid Team. All rights reserved. + +This program is free software; you may redistribute it and/or modify it under the terms of GNU LGPL (v2.1) license. +.SH SEE ALSO +.B smpicc\fR(1) diff --git a/examples/java/cloud/cloud.tesh b/examples/java/cloud/cloud.tesh index 1f3f49da0d..d23169910a 100644 --- a/examples/java/cloud/cloud.tesh +++ b/examples/java/cloud/cloud.tesh @@ -31,7 +31,7 @@ $ java -classpath ${classpath:=.} cloud/Cloud ${srcdir:=.}/platform.xml "--log=r > [1000.000000] (1:Master@Jacquelin) Migrate VM00fromIntelto Fernand > [1000.000000] (5:__pr_mig_tx:VM00(Intel-Provost)@Intel) mig-stage1: remaining_size 1073741824.000000 > [1147.021183] (5:__pr_mig_tx:VM00(Intel-Provost)@Intel) actual banwdidth 6.964983 (MB/s), threshold 219099.412193 -> [1147.021183] (5:__pr_mig_tx:VM00(Intel-Provost)@Intel) mig-stage 2:0 updated_size 0.000000 computed_during_stage1 0.000000 dp_rate 0.000000 dp_cap 1193046471.111111 +> [1147.021183] (5:__pr_mig_tx:VM00(Intel-Provost)@Intel) mig-stage 2:0 updated_size 0.000000 computed_during_stage1 0.000000 dp_rate 0.000000 dp_cap 966367641.600000 > [1147.021183] (5:__pr_mig_tx:VM00(Intel-Provost)@Intel) mig-stage2.0: remaining_size 0.000000 (< threshold 219099.412193) > [1147.021183] (5:__pr_mig_tx:VM00(Intel-Provost)@Intel) mig-stage3: remaining_size 0.000000 > [1149.029299] (0:@) migrate VM(VM00): set bound (137333000.000000) at Provost @@ -39,7 +39,7 @@ $ java -classpath ${classpath:=.} cloud/Cloud ${srcdir:=.}/platform.xml "--log=r > [1150.908953] (1:Master@Jacquelin) Migrate VM01fromProvostto Fernand > [1150.908953] (9:__pr_mig_tx:VM01(Provost-Provost)@Provost) mig-stage1: remaining_size 1073741824.000000 > [1153.065257] (9:__pr_mig_tx:VM01(Provost-Provost)@Provost) actual banwdidth 474.886827 (MB/s), threshold 14938647.898422 -> [1153.065257] (9:__pr_mig_tx:VM01(Provost-Provost)@Provost) mig-stage 2:0 updated_size 0.000000 computed_during_stage1 0.000000 dp_rate 0.000000 dp_cap 1193046471.111111 +> [1153.065257] (9:__pr_mig_tx:VM01(Provost-Provost)@Provost) mig-stage 2:0 updated_size 0.000000 computed_during_stage1 0.000000 dp_rate 0.000000 dp_cap 966367641.600000 > [1153.065257] (9:__pr_mig_tx:VM01(Provost-Provost)@Provost) mig-stage2.0: remaining_size 0.000000 (< threshold 14938647.898422) > [1153.065257] (9:__pr_mig_tx:VM01(Provost-Provost)@Provost) mig-stage3: remaining_size 0.000000 > [1153.065452] (0:@) migrate VM(VM01): set bound (137333000.000000) at Provost diff --git a/examples/java/cloud/migration/migration.tesh b/examples/java/cloud/migration/migration.tesh index c1337eeefb..5b710fe15b 100644 --- a/examples/java/cloud/migration/migration.tesh +++ b/examples/java/cloud/migration/migration.tesh @@ -24,31 +24,31 @@ $ java -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/cloud/migrat > [host0:cloud/migration/Test:(1) 0.000000] [jmsg/INFO] currentLoad:90/ramSize:2048/dpIntensity:70/remaining:8.095E11 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 0.000000] [msg_vm/INFO] mig-stage1: remaining_size 2147483648.000000 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 18.598067] [msg_vm/INFO] actual banwdidth 110.118973 (MB/s), threshold 3464043.375348 -> [host0:__pr_mig_tx:vm0(host0-host1):(16) 18.598067] [msg_vm/INFO] mig-stage 2:0 updated_size 1009084906.862392 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(16) 18.598067] [msg_vm/INFO] mig-stage 2:0 updated_size 1009084906.862392 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 18.598067] [msg_vm/INFO] mig-stage2.0: remaining_size 1009084906.862392 (> threshold 3464043.375348) > [host0:__pr_mig_tx:vm0(host0-host1):(16) 27.337835] [msg_vm/INFO] actual banwdidth 110.110284, threshold 3463770.024427 -> [host0:__pr_mig_tx:vm0(host0-host1):(16) 27.337835] [msg_vm/INFO] mig-stage 2:1 updated_size 474198119.178924 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(16) 27.337835] [msg_vm/INFO] mig-stage 2:1 updated_size 474198119.178924 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 27.337835] [msg_vm/INFO] mig-stage2.1: remaining_size 474198119.178924 (> threshold 3463770.024427) > [host0:__pr_mig_tx:vm0(host0-host1):(16) 31.445594] [msg_vm/INFO] actual banwdidth 110.091798, threshold 3463188.514958 -> [host0:__pr_mig_tx:vm0(host0-host1):(16) 31.445594] [msg_vm/INFO] mig-stage 2:2 updated_size 222876798.522755 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(16) 31.445594] [msg_vm/INFO] mig-stage 2:2 updated_size 222876798.522755 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 31.445594] [msg_vm/INFO] mig-stage2.2: remaining_size 222876798.522755 (> threshold 3463188.514958) > [host0:__pr_mig_tx:vm0(host0-host1):(16) 33.376962] [msg_vm/INFO] actual banwdidth 110.052494, threshold 3461952.124955 -> [host0:__pr_mig_tx:vm0(host0-host1):(16) 33.376962] [msg_vm/INFO] mig-stage 2:3 updated_size 104791237.544459 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(16) 33.376962] [msg_vm/INFO] mig-stage 2:3 updated_size 104791237.544459 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 33.376962] [msg_vm/INFO] mig-stage2.3: remaining_size 104791237.544459 (> threshold 3461952.124955) > [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.285733] [msg_vm/INFO] actual banwdidth 109.969020, threshold 3459326.250492 -> [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.285733] [msg_vm/INFO] mig-stage 2:4 updated_size 49307685.020391 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.285733] [msg_vm/INFO] mig-stage 2:4 updated_size 49307685.020391 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.285733] [msg_vm/INFO] mig-stage2.4: remaining_size 49307685.020391 (> threshold 3459326.250492) > [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.714029] [msg_vm/INFO] actual banwdidth 109.792154, threshold 3453762.521054 -> [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.714029] [msg_vm/INFO] mig-stage 2:5 updated_size 23238243.968121 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.714029] [msg_vm/INFO] mig-stage 2:5 updated_size 23238243.968121 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.714029] [msg_vm/INFO] mig-stage2.5: remaining_size 23238243.968121 (> threshold 3453762.521054) > [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.916568] [msg_vm/INFO] actual banwdidth 109.419289, threshold 3442033.220071 -> [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.916568] [msg_vm/INFO] mig-stage 2:6 updated_size 10989284.465950 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.916568] [msg_vm/INFO] mig-stage 2:6 updated_size 10989284.465950 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 34.916568] [msg_vm/INFO] mig-stage2.6: remaining_size 10989284.465950 (> threshold 3442033.220071) > [host0:__pr_mig_tx:vm0(host0-host1):(16) 35.013034] [msg_vm/INFO] actual banwdidth 108.641444, threshold 3417564.332268 -> [host0:__pr_mig_tx:vm0(host0-host1):(16) 35.013034] [msg_vm/INFO] mig-stage 2:7 updated_size 5234001.988682 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(16) 35.013034] [msg_vm/INFO] mig-stage 2:7 updated_size 5234001.988682 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 35.013034] [msg_vm/INFO] mig-stage2.7: remaining_size 5234001.988682 (> threshold 3417564.332268) > [host0:__pr_mig_tx:vm0(host0-host1):(16) 35.059660] [msg_vm/INFO] actual banwdidth 107.053869, threshold 3367623.544281 -> [host0:__pr_mig_tx:vm0(host0-host1):(16) 35.059660] [msg_vm/INFO] mig-stage 2:8 updated_size 2529831.013694 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(16) 35.059660] [msg_vm/INFO] mig-stage 2:8 updated_size 2529831.013694 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(16) 35.059660] [msg_vm/INFO] mig-stage2.8: remaining_size 2529831.013694 (< threshold 3367623.544281) > [host0:__pr_mig_tx:vm0(host0-host1):(16) 35.059660] [msg_vm/INFO] mig-stage3: remaining_size 2529831.013694 > [35.082869] [surf_vm_workstation/INFO] migrate VM(vm0): set bound (7285500000.000000) at host1 @@ -60,28 +60,28 @@ $ java -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/cloud/migrat > [host0:cloud/migration/Test:(1) 35.084170] [jmsg/INFO] currentLoad:90/ramSize:2048/dpIntensity:70/remaining:6.220564352570236E11 > [host1:__pr_mig_tx:vm0(host1-host0):(28) 35.084170] [msg_vm/INFO] mig-stage1: remaining_size 2147483648.000000 > [host1:__pr_mig_tx:vm0(host1-host0):(28) 53.682237] [msg_vm/INFO] actual banwdidth 110.118973 (MB/s), threshold 3464043.375348 -> [host1:__pr_mig_tx:vm0(host1-host0):(28) 53.682237] [msg_vm/INFO] mig-stage 2:0 updated_size 917349915.329448 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(28) 53.682237] [msg_vm/INFO] mig-stage 2:0 updated_size 917349915.329448 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(28) 53.682237] [msg_vm/INFO] mig-stage2.0: remaining_size 917349915.329448 (> threshold 3464043.375348) > [host1:__pr_mig_tx:vm0(host1-host0):(28) 61.627599] [msg_vm/INFO] actual banwdidth 110.108645, threshold 3463718.461873 -> [host1:__pr_mig_tx:vm0(host1-host0):(28) 61.627599] [msg_vm/INFO] mig-stage 2:1 updated_size 391905106.046906 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(28) 61.627599] [msg_vm/INFO] mig-stage 2:1 updated_size 391905106.046906 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(28) 61.627599] [msg_vm/INFO] mig-stage2.1: remaining_size 391905106.046906 (> threshold 3463718.461873) > [host1:__pr_mig_tx:vm0(host1-host0):(28) 65.022717] [msg_vm/INFO] actual banwdidth 110.084477, threshold 3462958.209981 -> [host1:__pr_mig_tx:vm0(host1-host0):(28) 65.022717] [msg_vm/INFO] mig-stage 2:2 updated_size 167464266.773127 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(28) 65.022717] [msg_vm/INFO] mig-stage 2:2 updated_size 167464266.773127 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(28) 65.022717] [msg_vm/INFO] mig-stage2.2: remaining_size 167464266.773127 (> threshold 3462958.209981) > [host1:__pr_mig_tx:vm0(host1-host0):(28) 66.474224] [msg_vm/INFO] actual banwdidth 110.027970, threshold 3461180.656939 -> [host1:__pr_mig_tx:vm0(host1-host0):(28) 66.474224] [msg_vm/INFO] mig-stage 2:3 updated_size 71595605.337913 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(28) 66.474224] [msg_vm/INFO] mig-stage 2:3 updated_size 71595605.337913 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(28) 66.474224] [msg_vm/INFO] mig-stage2.3: remaining_size 71595605.337913 (> threshold 3461180.656939) > [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.095529] [msg_vm/INFO] actual banwdidth 109.896074, threshold 3457031.577357 -> [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.095529] [msg_vm/INFO] mig-stage 2:4 updated_size 30645837.890704 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.095529] [msg_vm/INFO] mig-stage 2:4 updated_size 30645837.890704 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.095529] [msg_vm/INFO] mig-stage2.4: remaining_size 30645837.890704 (> threshold 3457031.577357) > [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.362216] [msg_vm/INFO] actual banwdidth 109.589442, threshold 3447385.759089 -> [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.362216] [msg_vm/INFO] mig-stage 2:5 updated_size 13154371.345477 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.362216] [msg_vm/INFO] mig-stage 2:5 updated_size 13154371.345477 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.362216] [msg_vm/INFO] mig-stage2.5: remaining_size 13154371.345477 (> threshold 3447385.759089) > [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.477431] [msg_vm/INFO] actual banwdidth 108.883138, threshold 3425167.371629 -> [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.477431] [msg_vm/INFO] mig-stage 2:6 updated_size 5682988.543846 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.477431] [msg_vm/INFO] mig-stage 2:6 updated_size 5682988.543846 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.477431] [msg_vm/INFO] mig-stage2.6: remaining_size 5682988.543846 (> threshold 3425167.371629) > [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.527946] [msg_vm/INFO] actual banwdidth 107.290377, threshold 3375063.431326 -> [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.527946] [msg_vm/INFO] mig-stage 2:7 updated_size 2491628.685811 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.527946] [msg_vm/INFO] mig-stage 2:7 updated_size 2491628.685811 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.527946] [msg_vm/INFO] mig-stage2.7: remaining_size 2491628.685811 (< threshold 3375063.431326) > [host1:__pr_mig_tx:vm0(host1-host0):(28) 67.527946] [msg_vm/INFO] mig-stage3: remaining_size 2491628.685811 > [67.550824] [surf_vm_workstation/INFO] migrate VM(vm0): set bound (7285500000.000000) at host0 @@ -97,31 +97,31 @@ $ java -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/cloud/migrat > [host0:cloud/migration/Test:(1) 67.551019] [jmsg/INFO] currentLoad:80/ramSize:2048/dpIntensity:70/remaining:4.6436485611595026E11 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 67.551019] [msg_vm/INFO] mig-stage1: remaining_size 2147483648.000000 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 86.149086] [msg_vm/INFO] actual banwdidth 110.118973 (MB/s), threshold 3464043.375348 -> [host0:__pr_mig_tx:vm0(host0-host1):(39) 86.149086] [msg_vm/INFO] mig-stage 2:0 updated_size 1009084906.862392 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(39) 86.149086] [msg_vm/INFO] mig-stage 2:0 updated_size 1009084906.862392 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 86.149086] [msg_vm/INFO] mig-stage2.0: remaining_size 1009084906.862392 (> threshold 3464043.375348) > [host0:__pr_mig_tx:vm0(host0-host1):(39) 94.888854] [msg_vm/INFO] actual banwdidth 110.110284, threshold 3463770.024427 -> [host0:__pr_mig_tx:vm0(host0-host1):(39) 94.888854] [msg_vm/INFO] mig-stage 2:1 updated_size 474198119.178924 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(39) 94.888854] [msg_vm/INFO] mig-stage 2:1 updated_size 474198119.178924 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 94.888854] [msg_vm/INFO] mig-stage2.1: remaining_size 474198119.178924 (> threshold 3463770.024427) > [host0:__pr_mig_tx:vm0(host0-host1):(39) 98.996613] [msg_vm/INFO] actual banwdidth 110.091798, threshold 3463188.514958 -> [host0:__pr_mig_tx:vm0(host0-host1):(39) 98.996613] [msg_vm/INFO] mig-stage 2:2 updated_size 222876798.522756 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(39) 98.996613] [msg_vm/INFO] mig-stage 2:2 updated_size 222876798.522756 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 98.996613] [msg_vm/INFO] mig-stage2.2: remaining_size 222876798.522756 (> threshold 3463188.514958) > [host0:__pr_mig_tx:vm0(host0-host1):(39) 100.927981] [msg_vm/INFO] actual banwdidth 110.052494, threshold 3461952.124955 -> [host0:__pr_mig_tx:vm0(host0-host1):(39) 100.927981] [msg_vm/INFO] mig-stage 2:3 updated_size 104791237.544460 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(39) 100.927981] [msg_vm/INFO] mig-stage 2:3 updated_size 104791237.544460 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 100.927981] [msg_vm/INFO] mig-stage2.3: remaining_size 104791237.544460 (> threshold 3461952.124955) > [host0:__pr_mig_tx:vm0(host0-host1):(39) 101.836752] [msg_vm/INFO] actual banwdidth 109.969020, threshold 3459326.250492 -> [host0:__pr_mig_tx:vm0(host0-host1):(39) 101.836752] [msg_vm/INFO] mig-stage 2:4 updated_size 49307685.020392 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(39) 101.836752] [msg_vm/INFO] mig-stage 2:4 updated_size 49307685.020392 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 101.836752] [msg_vm/INFO] mig-stage2.4: remaining_size 49307685.020392 (> threshold 3459326.250492) > [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.265048] [msg_vm/INFO] actual banwdidth 109.792154, threshold 3453762.521054 -> [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.265048] [msg_vm/INFO] mig-stage 2:5 updated_size 23238243.968121 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.265048] [msg_vm/INFO] mig-stage 2:5 updated_size 23238243.968121 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.265048] [msg_vm/INFO] mig-stage2.5: remaining_size 23238243.968121 (> threshold 3453762.521054) > [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.467587] [msg_vm/INFO] actual banwdidth 109.419289, threshold 3442033.220071 -> [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.467587] [msg_vm/INFO] mig-stage 2:6 updated_size 10989284.465950 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.467587] [msg_vm/INFO] mig-stage 2:6 updated_size 10989284.465950 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.467587] [msg_vm/INFO] mig-stage2.6: remaining_size 10989284.465950 (> threshold 3442033.220071) > [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.564053] [msg_vm/INFO] actual banwdidth 108.641444, threshold 3417564.332268 -> [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.564053] [msg_vm/INFO] mig-stage 2:7 updated_size 5234001.988682 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.564053] [msg_vm/INFO] mig-stage 2:7 updated_size 5234001.988682 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.564053] [msg_vm/INFO] mig-stage2.7: remaining_size 5234001.988682 (> threshold 3417564.332268) > [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.610680] [msg_vm/INFO] actual banwdidth 107.053869, threshold 3367623.544281 -> [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.610680] [msg_vm/INFO] mig-stage 2:8 updated_size 2529831.013694 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.610680] [msg_vm/INFO] mig-stage 2:8 updated_size 2529831.013694 computed_during_stage1 99363890485.508911 dp_rate 0.010155 dp_cap 1932735283.200000 > [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.610680] [msg_vm/INFO] mig-stage2.8: remaining_size 2529831.013694 (< threshold 3367623.544281) > [host0:__pr_mig_tx:vm0(host0-host1):(39) 102.610680] [msg_vm/INFO] mig-stage3: remaining_size 2529831.013694 > [102.633888] [surf_vm_workstation/INFO] migrate VM(vm0): set bound (6476000000.000000) at host1 @@ -133,28 +133,28 @@ $ java -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/cloud/migrat > [host0:cloud/migration/Test:(1) 102.635189] [jmsg/INFO] currentLoad:80/ramSize:2048/dpIntensity:70/remaining:2.7692129137297363E11 > [host1:__pr_mig_tx:vm0(host1-host0):(51) 102.635189] [msg_vm/INFO] mig-stage1: remaining_size 2147483648.000000 > [host1:__pr_mig_tx:vm0(host1-host0):(51) 121.233256] [msg_vm/INFO] actual banwdidth 110.118973 (MB/s), threshold 3464043.375348 -> [host1:__pr_mig_tx:vm0(host1-host0):(51) 121.233256] [msg_vm/INFO] mig-stage 2:0 updated_size 917349915.329448 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(51) 121.233256] [msg_vm/INFO] mig-stage 2:0 updated_size 917349915.329448 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(51) 121.233256] [msg_vm/INFO] mig-stage2.0: remaining_size 917349915.329448 (> threshold 3464043.375348) > [host1:__pr_mig_tx:vm0(host1-host0):(51) 129.178618] [msg_vm/INFO] actual banwdidth 110.108645, threshold 3463718.461873 -> [host1:__pr_mig_tx:vm0(host1-host0):(51) 129.178618] [msg_vm/INFO] mig-stage 2:1 updated_size 391905106.046906 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(51) 129.178618] [msg_vm/INFO] mig-stage 2:1 updated_size 391905106.046906 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(51) 129.178618] [msg_vm/INFO] mig-stage2.1: remaining_size 391905106.046906 (> threshold 3463718.461873) > [host1:__pr_mig_tx:vm0(host1-host0):(51) 132.573736] [msg_vm/INFO] actual banwdidth 110.084477, threshold 3462958.209981 -> [host1:__pr_mig_tx:vm0(host1-host0):(51) 132.573736] [msg_vm/INFO] mig-stage 2:2 updated_size 167464266.773128 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(51) 132.573736] [msg_vm/INFO] mig-stage 2:2 updated_size 167464266.773128 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(51) 132.573736] [msg_vm/INFO] mig-stage2.2: remaining_size 167464266.773128 (> threshold 3462958.209981) > [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.025243] [msg_vm/INFO] actual banwdidth 110.027970, threshold 3461180.656939 -> [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.025243] [msg_vm/INFO] mig-stage 2:3 updated_size 71595605.337913 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.025243] [msg_vm/INFO] mig-stage 2:3 updated_size 71595605.337913 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.025243] [msg_vm/INFO] mig-stage2.3: remaining_size 71595605.337913 (> threshold 3461180.656939) > [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.646548] [msg_vm/INFO] actual banwdidth 109.896074, threshold 3457031.577357 -> [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.646548] [msg_vm/INFO] mig-stage 2:4 updated_size 30645837.890704 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.646548] [msg_vm/INFO] mig-stage 2:4 updated_size 30645837.890704 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.646548] [msg_vm/INFO] mig-stage2.4: remaining_size 30645837.890704 (> threshold 3457031.577357) > [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.913235] [msg_vm/INFO] actual banwdidth 109.589442, threshold 3447385.759089 -> [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.913235] [msg_vm/INFO] mig-stage 2:5 updated_size 13154371.345477 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.913235] [msg_vm/INFO] mig-stage 2:5 updated_size 13154371.345477 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(51) 134.913235] [msg_vm/INFO] mig-stage2.5: remaining_size 13154371.345477 (> threshold 3447385.759089) > [host1:__pr_mig_tx:vm0(host1-host0):(51) 135.028450] [msg_vm/INFO] actual banwdidth 108.883138, threshold 3425167.371628 -> [host1:__pr_mig_tx:vm0(host1-host0):(51) 135.028450] [msg_vm/INFO] mig-stage 2:6 updated_size 5682988.543847 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(51) 135.028450] [msg_vm/INFO] mig-stage 2:6 updated_size 5682988.543847 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(51) 135.028450] [msg_vm/INFO] mig-stage2.6: remaining_size 5682988.543847 (> threshold 3425167.371628) > [host1:__pr_mig_tx:vm0(host1-host0):(51) 135.078965] [msg_vm/INFO] actual banwdidth 107.290377, threshold 3375063.431326 -> [host1:__pr_mig_tx:vm0(host1-host0):(51) 135.078965] [msg_vm/INFO] mig-stage 2:7 updated_size 2491628.685810 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 2386092942.222222 +> [host1:__pr_mig_tx:vm0(host1-host0):(51) 135.078965] [msg_vm/INFO] mig-stage 2:7 updated_size 2491628.685810 computed_during_stage1 90330809532.280823 dp_rate 0.010155 dp_cap 1932735283.200000 > [host1:__pr_mig_tx:vm0(host1-host0):(51) 135.078965] [msg_vm/INFO] mig-stage2.7: remaining_size 2491628.685810 (< threshold 3375063.431326) > [host1:__pr_mig_tx:vm0(host1-host0):(51) 135.078965] [msg_vm/INFO] mig-stage3: remaining_size 2491628.685810 > [135.101843] [surf_vm_workstation/INFO] migrate VM(vm0): set bound (6476000000.000000) at host0 diff --git a/examples/java/surfCpuModel/CMakeLists.txt b/examples/java/surfCpuModel/CMakeLists.txt new file mode 100644 index 0000000000..2af5240d05 --- /dev/null +++ b/examples/java/surfCpuModel/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 2.6) + +set(example java_surf_cpu_model) +set(sources + ${CMAKE_CURRENT_SOURCE_DIR}/TestCpuModel.java + ${CMAKE_CURRENT_SOURCE_DIR}/CpuConstantModel.java + ${CMAKE_CURRENT_SOURCE_DIR}/Sender.java + ${CMAKE_CURRENT_SOURCE_DIR}/Receiver.java + ) + +if(enable_java) + add_custom_command( + COMMENT "Building ${example}..." + OUTPUT ${example}_compiled + DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR} + COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} + -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources} + COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled + COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled + ) + add_custom_target(${example} ALL DEPENDS ${example}_compiled) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/surf_cpu_model.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/surfCpuModelPlatform.xml + ${CMAKE_CURRENT_SOURCE_DIR}/surfCpuModelDeployment.xml + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${sources} + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/examples/java/surfCpuModel/CpuConstantModel.java b/examples/java/surfCpuModel/CpuConstantModel.java new file mode 100644 index 0000000000..7f7d418e75 --- /dev/null +++ b/examples/java/surfCpuModel/CpuConstantModel.java @@ -0,0 +1,117 @@ +package surfCpuModel; + +import org.simgrid.surf.*; +import org.simgrid.msg.Msg; +import java.util.List; +import java.util.ArrayList; + +public class CpuConstantModel extends CpuModel { + + private List cpus = new ArrayList(); + + public CpuConstantModel() { + super("Cpu Constant"); + Msg.info("Initialize Cpu Constant Model"); + } + + public Cpu createResource(String name, double[] power_peak, int pstate, double power_scale, TmgrTrace power_trace, int core, ResourceState state_initial, TmgrTrace state_trace, XbtDict cpu_properties) { + Msg.info("New Cpu("+name+", "+power_peak[pstate]+", "+power_scale+")"); + + CpuConstant res = new CpuConstant(this, name, cpu_properties, core, power_peak[pstate], power_scale); + cpus.add(res); + Surf.setCpu(name, res); + return res; + } + + public double shareResources(double now) { + double res = -1; + for (int i=0; i actions = new ArrayList(); + + public CpuConstant(CpuConstantModel model, String name, XbtDict props, + int core, double powerPeak, double powerScale) { + super(model, name, props, core, powerPeak, powerScale); + } + + public void remove(CpuConstantAction action){ + actions.remove(action); + } + + public CpuAction execute(double size) { + CpuConstantAction res = new CpuConstantAction(getModel(), size, false, false, this); + Msg.info("Execute action of size "+size+" sleeping "+res.sleeping()); + actions.add(res); + return res; + } + + public CpuAction sleep(double duration) { + CpuConstantAction res = new CpuConstantAction(getModel(), duration, false, true, this); + Msg.info("Sleep action of duration "+duration+" sleeping "+res.sleeping()); + return res; + } + + public double share(double now){ + double res = -1; + for (int i=0; i + + + + + + + diff --git a/examples/java/surfCpuModel/surfCpuModelPlatform.xml b/examples/java/surfCpuModel/surfCpuModelPlatform.xml new file mode 100644 index 0000000000..155dd2d2aa --- /dev/null +++ b/examples/java/surfCpuModel/surfCpuModelPlatform.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/java/surfCpuModel/surf_cpu_model.tesh b/examples/java/surfCpuModel/surf_cpu_model.tesh new file mode 100644 index 0000000000..00a34eddc6 --- /dev/null +++ b/examples/java/surfCpuModel/surf_cpu_model.tesh @@ -0,0 +1,33 @@ +#! tesh + +$ java -classpath ${classpath:=.} surfCpuModel/TestCpuModel ${srcdir:=.}/surfCpuModel/surfCpuModelPlatform.xml ${srcdir:=.}/surfCpuModel/surfCpuModelDeployment.xml --cfg=workstation/model:compound +> [0.000000] [jmsg/INFO] Initialize Cpu Constant Model +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound' +> [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up. +> [0.000000] [jmsg/INFO] New Cpu(Jacquelin, 1.37333E8, 1.0) +> [0.000000] [jmsg/INFO] New Cpu(Boivin, 9.8095E7, 1.0) +> [0.000000] [jmsg/INFO] New Cpu(TeX, 6.8667E7, 1.0) +> [0.000000] [jmsg/INFO] UpdateActionState of 0 actions +> [0.000000] [jmsg/INFO] Cpu Loaded: Cpu Constant +> [Jacquelin:surfCpuModel.Sender:(1) 0.000000] [jmsg/INFO] helloo! +> [Boivin:surfCpuModel.Receiver:(2) 0.000000] [jmsg/INFO] helloo! +> [0.000000] [jmsg/INFO] Sleep action of duration -1.0 sleeping true +> [0.000000] [jmsg/INFO] Sleep action of duration -1.0 sleeping true +> [0.000000] [jmsg/INFO] ShareResources at time -1.0 +> [0.000000] [jmsg/INFO] ShareResources at time -1.0 +> [0.026020] [jmsg/INFO] UpdateActionState of 2 actions +> [0.026020] [jmsg/INFO] ShareResources at time -1.0 +> [0.026020] [jmsg/INFO] ShareResources at time -1.0 +> [0.026021] [jmsg/INFO] UpdateActionState of 2 actions +> [Jacquelin:surfCpuModel.Sender:(1) 0.026021] [jmsg/INFO] Send duration: 0.026021030927835052 +> [Jacquelin:surfCpuModel.Sender:(1) 0.026021] [jmsg/INFO] goodbye! +> [0.026021] [jmsg/INFO] Execute action of size 1.0E9 sleeping false +> [0.026021] [jmsg/INFO] Share action with new time 10.194199500484224 +> [0.026021] [jmsg/INFO] ShareResources at time 10.194199500484224 +> [0.026021] [jmsg/INFO] Share action with new time 10.194199500484224 +> [0.026021] [jmsg/INFO] ShareResources at time 10.194199500484224 +> [10.220221] [jmsg/INFO] UpdateActionState of 1 actions +> [10.220221] [jmsg/INFO] action remains 0.0 after delta of 10.194199500484224 +> [10.220221] [jmsg/INFO] action DONE +> [Boivin:surfCpuModel.Receiver:(2) 10.220221] [jmsg/INFO] goodbye! +> [10.220221] [jmsg/INFO] MSG_main finished; Cleaning up the simulation... diff --git a/examples/msg/actions/actions.c b/examples/msg/actions/actions.c index ef4434456c..af24651272 100644 --- a/examples/msg/actions/actions.c +++ b/examples/msg/actions/actions.c @@ -479,6 +479,9 @@ int main(int argc, char *argv[]) /* Check the given arguments */ MSG_init(&argc, argv); + /* Explicit initialization of the action module is required now*/ + MSG_action_init(); + if (argc < 3) { printf("Usage: %s platform_file deployment_file [action_files]\n", argv[0]); printf @@ -522,6 +525,9 @@ int main(int argc, char *argv[]) XBT_INFO("Simulation time %g", MSG_get_clock()); + /* Explicit finalization of the action module is required now*/ + MSG_action_exit(); + if (res == MSG_OK) return 0; else diff --git a/examples/msg/io/file.c b/examples/msg/io/file.c index fdc8a30ad2..6d7b63517f 100644 --- a/examples/msg/io/file.c +++ b/examples/msg/io/file.c @@ -34,31 +34,68 @@ int host(int argc, char *argv[]) { msg_file_t file = NULL; sg_size_t read,write; + msg_storage_t st; + const char* st_name; if(!strcmp(MSG_process_get_name(MSG_process_self()),"0")){ file = MSG_file_open(FILENAME1, NULL); MSG_file_dump(file); + st_name = "Disk4"; } else if(!strcmp(MSG_process_get_name(MSG_process_self()),"1")) { file = MSG_file_open(FILENAME2, NULL); + st_name = "Disk2"; } else if(!strcmp(MSG_process_get_name(MSG_process_self()),"2")){ file = MSG_file_open(FILENAME3, NULL); - } else if(!strcmp(MSG_process_get_name(MSG_process_self()),"3")) + st_name = "Disk3"; + } else if(!strcmp(MSG_process_get_name(MSG_process_self()),"3")){ file = MSG_file_open(FILENAME4, NULL); + st_name = "Disk1"; + } else xbt_die("FILENAME NOT DEFINED %s",MSG_process_get_name(MSG_process_self())); const char* filename = MSG_file_get_name(file); XBT_INFO("\tOpen file '%s'",filename); + st = MSG_storage_get_by_name(st_name); + + XBT_INFO("\tCapacity of the storage element '%s' is stored on: %llu / %llu", + filename, MSG_storage_get_used_size(st), MSG_storage_get_size(st)); + + /* Try to read for 10MB */ + read = MSG_file_read(file, 10000000); + XBT_INFO("\tHave read %llu from '%s'",read,filename); + + /* Write 100KB in file from the current position, i.e, end of file or 10MB */ + write = MSG_file_write(file, 100000); + XBT_INFO("\tHave written %llu in '%s'. Size now is: %llu",write,filename, + MSG_file_get_size(file)); + - read = MSG_file_read(file, 10000000); // Read for 10MB - XBT_INFO("\tHave read %llu on %s",read,filename); + XBT_INFO("\tCapacity of the storage element '%s' is stored on: %llu / %llu", + filename, MSG_storage_get_used_size(st), MSG_storage_get_size(st)); - write = MSG_file_write(file, 100000); // Write for 100KB - XBT_INFO("\tHave written %llu on %s",write,filename); + /* rewind to the beginning of the file */ + XBT_INFO("\tComing back to the beginning of the stream for file '%s'", + filename); + MSG_file_seek(file, 0, SEEK_SET); - read = MSG_file_read(file, 110000); // Read for 110KB - XBT_INFO("\tHave read %llu on %s (of size %llu)",read,filename, + /* Try to read 110KB */ + read = MSG_file_read(file, 110000); + XBT_INFO("\tHave read %llu from '%s' (of size %llu)",read,filename, MSG_file_get_size(file)); + /* rewind once again to the beginning of the file */ + XBT_INFO("\tComing back to the beginning of the stream for file '%s'", + filename); + MSG_file_seek(file, 0, SEEK_SET); + + /* Write 110KB in file from the current position, i.e, end of file or 10MB */ + write = MSG_file_write(file, 110000); + XBT_INFO("\tHave written %llu in '%s'. Size now is: %llu", write,filename, + MSG_file_get_size(file)); + + XBT_INFO("\tCapacity of the storage element '%s' is stored on: %llu / %llu", + filename, MSG_storage_get_used_size(st), MSG_storage_get_size(st)); + XBT_INFO("\tClose file '%s'",filename); MSG_file_close(file); diff --git a/examples/msg/io/io.tesh b/examples/msg/io/io.tesh index 9013c6e5fa..4afb302d99 100644 --- a/examples/msg/io/io.tesh +++ b/examples/msg/io/io.tesh @@ -13,23 +13,47 @@ $ ${bindir:=.}/io/file ${srcdir:=.}/examples/platforms/storage.xml "--log=root.f > Storage Type: 'single_SSD' > Content Type: 'txt_unix' > [ 0.000000] (1:0@denise) Open file '/home/doc/simgrid/examples/platforms/g5k.xml' -> [ 0.000040] (4:3@bob) Have read 4028 on /home/doc/simgrid/examples/platforms/nancy.xml -> [ 0.000085] (1:0@denise) Have read 17028 on /home/doc/simgrid/examples/platforms/g5k.xml -> [ 0.000226] (3:2@carl) Have read 22645 on /home/doc/simgrid/examples/platforms/g5k_cabinets.xml -> [ 0.000508] (2:1@alice) Have read 101663 on c:\Windows\setupact.log -> [ 0.001752] (1:0@denise) Have written 100000 on /home/doc/simgrid/examples/platforms/g5k.xml -> [ 0.002175] (2:1@alice) Have written 100000 on c:\Windows\setupact.log -> [ 0.002439] (1:0@denise) Have read 110000 on /home/doc/simgrid/examples/platforms/g5k.xml (of size 117026) -> [ 0.002439] (1:0@denise) Close file '/home/doc/simgrid/examples/platforms/g5k.xml' -> [ 0.002862] (2:1@alice) Have read 110000 on c:\Windows\setupact.log (of size 201662) -> [ 0.002862] (2:1@alice) Close file 'c:\Windows\setupact.log' -> [ 0.003374] (4:3@bob) Have written 100000 on /home/doc/simgrid/examples/platforms/nancy.xml -> [ 0.003560] (3:2@carl) Have written 100000 on /home/doc/simgrid/examples/platforms/g5k_cabinets.xml -> [ 0.004529] (4:3@bob) Have read 104023 on /home/doc/simgrid/examples/platforms/nancy.xml (of size 104023) -> [ 0.004529] (4:3@bob) Close file '/home/doc/simgrid/examples/platforms/nancy.xml' -> [ 0.004782] (3:2@carl) Have read 110000 on /home/doc/simgrid/examples/platforms/g5k_cabinets.xml (of size 122641) -> [ 0.004782] (3:2@carl) Close file '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' -> [ 0.004782] (0:@) Simulation time 0.00478201 +> [ 0.000000] (2:1@alice) Capacity of the storage element 'c:\Windows\setupact.log' is stored on: 2391537133 / 536870912000 +> [ 0.000000] (3:2@carl) Capacity of the storage element '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' is stored on: 36946053 / 536870912000 +> [ 0.000000] (4:3@bob) Capacity of the storage element '/home/doc/simgrid/examples/platforms/nancy.xml' is stored on: 36946053 / 536870912000 +> [ 0.000000] (1:0@denise) Capacity of the storage element '/home/doc/simgrid/examples/platforms/g5k.xml' is stored on: 13221994 / 536870912000 +> [ 0.000040] (4:3@bob) Have read 4028 from '/home/doc/simgrid/examples/platforms/nancy.xml' +> [ 0.000085] (1:0@denise) Have read 17028 from '/home/doc/simgrid/examples/platforms/g5k.xml' +> [ 0.000226] (3:2@carl) Have read 22645 from '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' +> [ 0.000508] (2:1@alice) Have read 101663 from 'c:\Windows\setupact.log' +> [ 0.001752] (1:0@denise) Have written 100000 in '/home/doc/simgrid/examples/platforms/g5k.xml'. Size now is: 117028 +> [ 0.001752] (1:0@denise) Capacity of the storage element '/home/doc/simgrid/examples/platforms/g5k.xml' is stored on: 13321994 / 536870912000 +> [ 0.001752] (1:0@denise) Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/g5k.xml' +> [ 0.002175] (2:1@alice) Have written 100000 in 'c:\Windows\setupact.log'. Size now is: 201663 +> [ 0.002175] (2:1@alice) Capacity of the storage element 'c:\Windows\setupact.log' is stored on: 2391637133 / 536870912000 +> [ 0.002175] (2:1@alice) Coming back to the beginning of the stream for file 'c:\Windows\setupact.log' +> [ 0.002439] (1:0@denise) Have read 110000 from '/home/doc/simgrid/examples/platforms/g5k.xml' (of size 117028) +> [ 0.002439] (1:0@denise) Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/g5k.xml' +> [ 0.002862] (2:1@alice) Have read 110000 from 'c:\Windows\setupact.log' (of size 201663) +> [ 0.002862] (2:1@alice) Coming back to the beginning of the stream for file 'c:\Windows\setupact.log' +> [ 0.003374] (4:3@bob) Have written 100000 in '/home/doc/simgrid/examples/platforms/nancy.xml'. Size now is: 104028 +> [ 0.003374] (4:3@bob) Capacity of the storage element '/home/doc/simgrid/examples/platforms/nancy.xml' is stored on: 37046053 / 536870912000 +> [ 0.003374] (4:3@bob) Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/nancy.xml' +> [ 0.003560] (3:2@carl) Have written 100000 in '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml'. Size now is: 122645 +> [ 0.003560] (3:2@carl) Capacity of the storage element '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' is stored on: 37046053 / 536870912000 +> [ 0.003560] (3:2@carl) Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' +> [ 0.004529] (4:3@bob) Have read 104028 from '/home/doc/simgrid/examples/platforms/nancy.xml' (of size 104028) +> [ 0.004529] (4:3@bob) Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/nancy.xml' +> [ 0.004782] (3:2@carl) Have read 110000 from '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' (of size 122645) +> [ 0.004782] (3:2@carl) Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' +> [ 0.006106] (1:0@denise) Have written 110000 in '/home/doc/simgrid/examples/platforms/g5k.xml'. Size now is: 110000 +> [ 0.006106] (1:0@denise) Capacity of the storage element '/home/doc/simgrid/examples/platforms/g5k.xml' is stored on: 13314966 / 536870912000 +> [ 0.006106] (1:0@denise) Close file '/home/doc/simgrid/examples/platforms/g5k.xml' +> [ 0.006529] (2:1@alice) Have written 110000 in 'c:\Windows\setupact.log'. Size now is: 110000 +> [ 0.006529] (2:1@alice) Capacity of the storage element 'c:\Windows\setupact.log' is stored on: 2391545470 / 536870912000 +> [ 0.006529] (2:1@alice) Close file 'c:\Windows\setupact.log' +> [ 0.011863] (4:3@bob) Have written 110000 in '/home/doc/simgrid/examples/platforms/nancy.xml'. Size now is: 110000 +> [ 0.011863] (4:3@bob) Capacity of the storage element '/home/doc/simgrid/examples/platforms/nancy.xml' is stored on: 37052025 / 536870912000 +> [ 0.011863] (4:3@bob) Close file '/home/doc/simgrid/examples/platforms/nancy.xml' +> [ 0.012115] (3:2@carl) Have written 110000 in '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml'. Size now is: 110000 +> [ 0.012115] (3:2@carl) Capacity of the storage element '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' is stored on: 37033408 / 536870912000 +> [ 0.012115] (3:2@carl) Close file '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' +> [ 0.012115] (0:@) Simulation time 0.0121153 $ ${bindir:=.}/io/file_unlink ${srcdir:=.}/examples/platforms/storage.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Number of host '4' diff --git a/examples/msg/io/storage.c b/examples/msg/io/storage.c index afe189730a..05f14d1094 100644 --- a/examples/msg/io/storage.c +++ b/examples/msg/io/storage.c @@ -33,7 +33,7 @@ static int host(int argc, char *argv[]){ xbt_dict_cursor_t cursor = NULL; char* mount_name; char* storage_name; - msg_storage_t storage; + msg_storage_t storage = NULL; // Retrieve all mount points of current host xbt_dict_t storage_list = MSG_host_get_mounted_storage_list(MSG_host_self()); @@ -44,8 +44,8 @@ static int host(int argc, char *argv[]){ storage = MSG_storage_get_by_name(storage_name); // Retrieve disk's information - sg_size_t free_size = MSG_storage_get_free_size(mount_name); - sg_size_t used_size = MSG_storage_get_used_size(mount_name); + sg_size_t free_size = MSG_storage_get_free_size(storage); + sg_size_t used_size = MSG_storage_get_used_size(storage); sg_size_t size = MSG_storage_get_size(storage); XBT_INFO("Total size: %llu bytes", size); @@ -67,12 +67,13 @@ static int host(int argc, char *argv[]){ MSG_file_dump(file); // check that sizes have changed - XBT_INFO("Free size: %llu bytes", MSG_storage_get_free_size("/home")); - XBT_INFO("Used size: %llu bytes", MSG_storage_get_used_size("/home")); + XBT_INFO("Free size: %llu bytes", MSG_storage_get_free_size(storage)); + XBT_INFO("Used size: %llu bytes", MSG_storage_get_used_size(storage)); // Now retrieve the size of created file and read it completely file_size = MSG_file_get_size(file); + MSG_file_seek(file, 0, SEEK_SET); read = MSG_file_read(file, file_size); XBT_INFO("Read %llu bytes on %s", read, file_name); diff --git a/examples/msg/tracing/CMakeLists.txt b/examples/msg/tracing/CMakeLists.txt index 215a084f54..1da4a813f9 100644 --- a/examples/msg/tracing/CMakeLists.txt +++ b/examples/msg/tracing/CMakeLists.txt @@ -46,6 +46,8 @@ set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/deployment.xml ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml + ${CMAKE_CURRENT_SOURCE_DIR}/platform-as.xml + ${CMAKE_CURRENT_SOURCE_DIR}/platform-config.xml ${CMAKE_CURRENT_SOURCE_DIR}/procmig-deploy.xml PARENT_SCOPE ) diff --git a/examples/msg/tracing/ms.tesh b/examples/msg/tracing/ms.tesh index dfa83e1bbd..f8b79deef1 100644 --- a/examples/msg/tracing/ms.tesh +++ b/examples/msg/tracing/ms.tesh @@ -17,6 +17,23 @@ $ $SG_TEST_EXENV ${bindir:=.}/tracing/ms$EXEEXT --cfg=tracing:yes --cfg=tracing/ > [4.214759] [msg_test/INFO] Declared marks: > [4.214759] [msg_test/INFO] msmark +p Tracing master/slave application with xml config +$ $SG_TEST_EXENV ${bindir:=.}/tracing/ms$EXEEXT ${srcdir:=.}/tracing/platform-config.xml ${srcdir:=.}/tracing/deployment.xml +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/buffer' to 'yes' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/categorized' to 'tracing/ms.cat.plist' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'tracing/ms.trace' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/uncategorized' to 'tracing/ms.uncat.plist' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes' +> [4.214759] [msg_test/INFO] Declared tracing categories: +> [4.214759] [msg_test/INFO] request +> [4.214759] [msg_test/INFO] finalize +> [4.214759] [msg_test/INFO] report +> [4.214759] [msg_test/INFO] compute +> [4.214759] [msg_test/INFO] Declared marks: +> [4.214759] [msg_test/INFO] msmark + p Not tracing master/slave application $ $SG_TEST_EXENV ${bindir:=.}/tracing/ms$EXEEXT ${srcdir:=.}/tracing/platform.xml ${srcdir:=.}/tracing/deployment.xml @@ -41,7 +58,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/tracing/ms$EXEEXT --cfg=tracing:yes --cfg=tracing/ $ $SG_TEST_EXENV cat tracing/ms.uncat.plist > node = ("HOST","LINK"); > edge = ("0-LINK13-LINK13","0-LINK13-HOST1","0-HOST1-LINK13"); -> +> > host = { > type = "square"; > size = "power"; @@ -56,7 +73,7 @@ $ $SG_TEST_EXENV cat tracing/ms.uncat.plist $ $SG_TEST_EXENV cat tracing/ms.cat.plist > node = ("HOST","LINK"); > edge = ("0-LINK13-LINK13","0-LINK13-HOST1","0-HOST1-LINK13"); -> +> > host = { > type = "square"; > size = "power"; diff --git a/examples/msg/tracing/platform-as.xml b/examples/msg/tracing/platform-as.xml new file mode 100644 index 0000000000..8d0ad50277 --- /dev/null +++ b/examples/msg/tracing/platform-as.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/msg/tracing/platform-config.xml b/examples/msg/tracing/platform-config.xml new file mode 100644 index 0000000000..a8aead1c0e --- /dev/null +++ b/examples/msg/tracing/platform-config.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/examples/msg/tracing/platform.xml b/examples/msg/tracing/platform.xml index 552c92f55c..d9ae3c85e7 100644 --- a/examples/msg/tracing/platform.xml +++ b/examples/msg/tracing/platform.xml @@ -1,51 +1,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + diff --git a/examples/smpi/energy/energy.tesh b/examples/smpi/energy/energy.tesh index f8b74fddb6..37603c6d25 100644 --- a/examples/smpi/energy/energy.tesh +++ b/examples/smpi/energy/energy.tesh @@ -1,6 +1,6 @@ p Test smpi bindings for dvfs functions (C example) $ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/platform.xml --cfg=smpi/cpu_threshold:-1 ${bindir:=.}/se --cfg=plugin:Energy --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/examples/smpi/energy/f77/energy.tesh b/examples/smpi/energy/f77/energy.tesh index 9173c490ef..1f4b353a5e 100644 --- a/examples/smpi/energy/f77/energy.tesh +++ b/examples/smpi/energy/f77/energy.tesh @@ -1,7 +1,7 @@ p Test smpi bindings for dvfs functions (Fortran 77 example) ! output sort 1 $ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/platform.xml --cfg=smpi/cpu_threshold:-1 ${bindir:=.}/f77/sef --cfg=plugin:Energy --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/examples/smpi/energy/f90/energy.tesh b/examples/smpi/energy/f90/energy.tesh index 799dffd98f..e78dff5b4e 100644 --- a/examples/smpi/energy/f90/energy.tesh +++ b/examples/smpi/energy/f90/energy.tesh @@ -1,7 +1,7 @@ p Test smpi bindings for dvfs functions (Fortran 90 example) ! output sort 1 $ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/platform.xml --cfg=smpi/cpu_threshold:-1 ${bindir:=.}/f90/sef90 --cfg=plugin:Energy --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/examples/smpi/mc/bugged1_liveness.c b/examples/smpi/mc/bugged1_liveness.c index cc784eb8e6..7305370368 100644 --- a/examples/smpi/mc/bugged1_liveness.c +++ b/examples/smpi/mc/bugged1_liveness.c @@ -10,6 +10,9 @@ /* LTL property checked : G(r->F(cs)); (r=request of CS, cs=CS ok) */ /******************************************************************************/ +/* Run : + /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml --cfg=model-check:1 --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send_is_detached_thres:0 --cfg=contexts/stack_size:128 --cfg=model-check/visited:100000 --cfg=model-check/max_depth:100000 ./bugged1_liveness */ + #include #include #include @@ -62,7 +65,7 @@ int main(int argc, char **argv){ printf("CS already used.\n"); xbt_dynar_push(requests, &recv_buff); }else{ - if(recv_buff != 1){ + if(recv_buff != size - 1){ printf("CS idle. Grant immediatly.\n"); MPI_Send(&rank, 1, MPI_INT, recv_buff, GRANT_TAG, MPI_COMM_WORLD); CS_used = 1; @@ -72,7 +75,7 @@ int main(int argc, char **argv){ if(!xbt_dynar_is_empty(requests)){ printf("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests)); xbt_dynar_shift(requests, &recv_buff); - if(recv_buff != 1){ + if(recv_buff != size - 1){ MPI_Send(&rank, 1, MPI_INT, recv_buff, GRANT_TAG, MPI_COMM_WORLD); CS_used = 1; }else{ @@ -89,18 +92,18 @@ int main(int argc, char **argv){ while(1){ printf("%d asks the request.\n", rank); MPI_Send(&rank, 1, MPI_INT, 0, REQUEST_TAG, MPI_COMM_WORLD); - if(rank == 1){ + if(rank == size - 1){ r = 1; cs = 0; } MPI_Recv(&recv_buff, 1, MPI_INT, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &status); - if(status.MPI_TAG == GRANT_TAG && rank == 1){ + if(status.MPI_TAG == GRANT_TAG && rank == size - 1){ cs = 1; r = 0; } printf("%d got the answer. Release it.\n", rank); MPI_Send(&rank, 1, MPI_INT, 0, RELEASE_TAG, MPI_COMM_WORLD); - if(rank == 1){ + if(rank == size - 1){ r = 0; cs = 0; } diff --git a/examples/smpi/replay/actions_with_isend.txt b/examples/smpi/replay/actions_with_isend.txt index 3e1f455d95..fd5ea51fed 100644 --- a/examples/smpi/replay/actions_with_isend.txt +++ b/examples/smpi/replay/actions_with_isend.txt @@ -2,17 +2,23 @@ 1 init 2 init +0 compute 1e9 0 send 1 1e6 0 compute 1e9 0 recv 2 1e6 1 Irecv 0 1e6 -1 compute 1e9 +1 compute 5e8 +1 test +1 compute 5e8 1 wait 1 send 2 1e6 +2 compute 2e9 2 Irecv 1 1e6 -2 compute 5e8 +2 compute 2.5e8 +2 test +2 compute 2.5e8 2 wait 2 Isend 0 1e6 2 compute 5e8 diff --git a/examples/smpi/replay/smpi_replay.tesh b/examples/smpi/replay/smpi_replay.tesh index 048b46c61f..480018a895 100644 --- a/examples/smpi/replay/smpi_replay.tesh +++ b/examples/smpi/replay/smpi_replay.tesh @@ -9,7 +9,7 @@ $ mkfile replay/one_trace ! timeout 60 $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -40,7 +40,7 @@ p The same with tracing activated $ mkfile replay/one_trace $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=no_loc --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -216,12 +216,13 @@ $ tail -n +3 ./simgrid.trace > 12 19.695603 2 1 8 > 12 19.698548 2 2 8 > 12 19.699584 2 3 8 -> 13 19.703022 2 2 -> 7 19.703022 1 2 -> 13 19.703536 2 3 -> 7 19.703536 1 3 -> 13 19.703536 2 1 -> 7 19.703536 1 1 +> 13 19.699584 2 3 +> 7 19.699584 1 3 +> 13 19.699584 2 1 +> 7 19.699584 1 1 +> 13 19.699584 2 2 +> 7 19.699584 1 2 + $ rm -f ./simgrid.trace @@ -233,7 +234,7 @@ p Another test of trace replay with SMPI (one trace per process) $ mkfile ./split_traces_tesh $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 2 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay ./split_traces_tesh --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -257,7 +258,7 @@ p Test of barrier replay with SMPI (one trace for all processes) $ mkfile replay/one_trace $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -281,25 +282,30 @@ p Test of Isend replay with SMPI (one trace for all processes) $ mkfile replay/one_trace $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) > [Jupiter:1:(0) 0.000000] [smpi_replay/VERBOSE] 1 Irecv 0 1e6 0.000000 -> [Fafard:2:(0) 0.000000] [smpi_replay/VERBOSE] 2 Irecv 1 1e6 0.000000 -> [Tremblay:0:(0) 0.164463] [smpi_replay/VERBOSE] 0 send 1 1e6 0.164463 -> [Fafard:2:(0) 6.553424] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424 -> [Tremblay:0:(0) 10.358662] [smpi_replay/VERBOSE] 0 compute 1e9 10.194200 -> [Jupiter:1:(0) 13.106847] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847 +> [Jupiter:1:(0) 6.553424] [smpi_replay/VERBOSE] 1 compute 5e8 6.553424 +> [Jupiter:1:(0) 6.553424] [smpi_replay/VERBOSE] 1 test 0.000000 +> [Tremblay:0:(0) 10.194200] [smpi_replay/VERBOSE] 0 compute 1e9 10.194200 +> [Tremblay:0:(0) 10.358662] [smpi_replay/VERBOSE] 0 send 1 1e6 0.164463 +> [Jupiter:1:(0) 13.106847] [smpi_replay/VERBOSE] 1 compute 5e8 6.553424 > [Jupiter:1:(0) 13.106847] [smpi_replay/VERBOSE] 1 wait 0.000000 -> [Fafard:2:(0) 13.294318] [smpi_replay/VERBOSE] 2 wait 6.740894 -> [Jupiter:1:(0) 13.294318] [smpi_replay/VERBOSE] 1 send 2 1e6 0.187471 -> [Fafard:2:(0) 13.294318] [smpi_replay/VERBOSE] 2 Isend 0 1e6 0.000000 -> [Tremblay:0:(0) 13.447633] [smpi_replay/VERBOSE] 0 recv 2 1e6 3.088971 -> [Fafard:2:(0) 19.847741] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424 -> [Fafard:2:(0) 19.847741] [smpi_replay/INFO] Simulation time 19.847741 +> [Tremblay:0:(0) 20.552862] [smpi_replay/VERBOSE] 0 compute 1e9 10.194200 +> [Fafard:2:(0) 26.213694] [smpi_replay/VERBOSE] 2 compute 2e9 26.213694 +> [Fafard:2:(0) 26.213694] [smpi_replay/VERBOSE] 2 Irecv 1 1e6 0.000000 +> [Jupiter:1:(0) 26.401165] [smpi_replay/VERBOSE] 1 send 2 1e6 13.294318 +> [Fafard:2:(0) 29.490406] [smpi_replay/VERBOSE] 2 compute 2.5e8 3.276712 +> [Fafard:2:(0) 29.490406] [smpi_replay/VERBOSE] 2 test 0.000000 +> [Fafard:2:(0) 32.767118] [smpi_replay/VERBOSE] 2 compute 2.5e8 3.276712 +> [Fafard:2:(0) 32.767118] [smpi_replay/VERBOSE] 2 Isend 0 1e6 0.000000 +> [Tremblay:0:(0) 32.920433] [smpi_replay/VERBOSE] 0 recv 2 1e6 12.367571 +> [Fafard:2:(0) 39.320541] [smpi_replay/VERBOSE] 2 compute 5e8 6.553424 +> [Fafard:2:(0) 39.320541] [smpi_replay/INFO] Simulation time 39.320541 $ rm -f replay/one_trace @@ -310,7 +316,7 @@ p Test of Isend replay with SMPI (one trace for all processes) $ mkfile replay/one_trace $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -332,7 +338,7 @@ p Test of AllToAll replay with SMPI (one trace for all processes) $ mkfile replay/one_trace $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -351,7 +357,7 @@ p Test of AllToAllv replay with SMPI (one trace for all processes) $ mkfile replay/one_trace $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -370,7 +376,7 @@ p Test of AllGatherv replay with SMPI (one trace for all processes) $ mkfile replay/one_trace $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -389,7 +395,7 @@ p Test of waitall replay with SMPI (one trace for all processes) $ mkfile replay/one_trace $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/examples/smpi/smpi_msg_masterslave/CMakeLists.txt b/examples/smpi/smpi_msg_masterslave/CMakeLists.txt new file mode 100644 index 0000000000..5d03cf60a9 --- /dev/null +++ b/examples/smpi/smpi_msg_masterslave/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + + add_executable(masterslave_mailbox_smpi masterslave_mailbox_smpi.c) + target_link_libraries(masterslave_mailbox_smpi simgrid) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/msg_smpi.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/deployment_masterslave_mailbox_smpi.xml + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/masterslave_mailbox_smpi.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/examples/smpi/smpi_msg_masterslave/deployment_masterslave_mailbox_smpi.xml b/examples/smpi/smpi_msg_masterslave/deployment_masterslave_mailbox_smpi.xml new file mode 100644 index 0000000000..0dc4672ccf --- /dev/null +++ b/examples/smpi/smpi_msg_masterslave/deployment_masterslave_mailbox_smpi.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c b/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c new file mode 100644 index 0000000000..f36ee995a1 --- /dev/null +++ b/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c @@ -0,0 +1,187 @@ +/* Copyright (c) 2010-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. */ + +#include +#include "msg/msg.h" /* Yeah! If you want to use msg, you need to include msg/msg.h */ +#include "xbt/sysdep.h" /* calloc, printf */ +#include "mpi.h" +/* Create a log channel to have nice outputs. */ +#include "xbt/log.h" +#include "xbt/asserts.h" +#include "smpi/private.h" +XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, + "Messages specific for this msg example"); + +int master(int argc, char *argv[]); +int slave(int argc, char *argv[]); +int master_mpi(int argc, char *argv[]); +int alltoall_mpi(int argc, char *argv[]); + +/** Emitter function */ +int master(int argc, char *argv[]) +{ + long number_of_tasks = atol(argv[1]); + double task_comp_size = atof(argv[2]); + double task_comm_size = atof(argv[3]); + long slaves_count = atol(argv[4]); + + int i; + + XBT_INFO("Got %ld slaves and %ld tasks to process", slaves_count, + number_of_tasks); + + for (i = 0; i < number_of_tasks; i++) { + char mailbox[256]; + char sprintf_buffer[256]; + msg_task_t task = NULL; + + sprintf(mailbox, "slave-%ld", i % slaves_count); + sprintf(sprintf_buffer, "Task_%d", i); + task = + MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, + NULL); + if (number_of_tasks < 10000 || i % 10000 == 0) + XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", task->name, + number_of_tasks, mailbox); + + MSG_task_send(task, mailbox); + } + + XBT_INFO + ("All tasks have been dispatched. Let's tell everybody the computation is over."); + for (i = 0; i < slaves_count; i++) { + char mailbox[80]; + + sprintf(mailbox, "slave-%ld", i % slaves_count); + msg_task_t finalize = MSG_task_create("finalize", 0, 0, 0); + MSG_task_send(finalize, mailbox); + } + +// XBT_INFO("Goodbye now!"); + return 0; +} /* end_of_master */ + + +int master_mpi(int argc, char *argv[]) +{ + MPI_Init(&argc, &argv); + + int rank; + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + XBT_INFO("here for rank %d", rank); + int test[1000]={rank}; + if(rank==0) + MPI_Send(&test, 1000, + MPI_INT, 1, 1, MPI_COMM_WORLD); + else + MPI_Recv(&test, 1000, + MPI_INT, 0, 1, MPI_COMM_WORLD, MPI_STATUSES_IGNORE); + + XBT_INFO("After comm %d", rank); + MPI_Finalize(); + + XBT_INFO("After finalize %d %d", rank, test[0]); + return 0; +} /* end_of_master */ + + + +int alltoall_mpi(int argc, char *argv[]) +{ + MPI_Init(&argc, &argv); + + int rank, size; + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_size(MPI_COMM_WORLD, &size); + XBT_INFO("alltoall for rank %d", rank); + int* out=malloc(1000*size*sizeof(int)); + int* in=malloc(1000*size*sizeof(int)); + MPI_Alltoall(out, 1000, MPI_INT,in, 1000, MPI_INT, MPI_COMM_WORLD); + + XBT_INFO("after alltoall %d", rank); + free(out); + free(in); + MPI_Finalize(); + return 0; +} /* end_of_master */ + + +/** Receiver function */ +int slave(int argc, char *argv[]) +{ + msg_task_t task = NULL; + _XBT_GNUC_UNUSED int res; + int id = -1; + char mailbox[80]; + _XBT_GNUC_UNUSED int read; + + read = sscanf(argv[1], "%d", &id); + xbt_assert(read, "Invalid argument %s\n", argv[1]); + + sprintf(mailbox, "slave-%d", id); + + while (1) { + res = MSG_task_receive(&(task), mailbox); + xbt_assert(res == MSG_OK, "MSG_task_get failed"); + +// XBT_INFO("Received \"%s\"", MSG_task_get_name(task)); + if (!strcmp(MSG_task_get_name(task), "finalize")) { + MSG_task_destroy(task); + break; + } +// XBT_INFO("Processing \"%s\"", MSG_task_get_name(task)); + MSG_task_execute(task); +// XBT_INFO("\"%s\" done", MSG_task_get_name(task)); + MSG_task_destroy(task); + task = NULL; + } + XBT_INFO("I'm done. See you!"); + + return 0; +} /* end_of_slave */ + +/** Main function */ +int main(int argc, char *argv[]) +{ + msg_error_t res; + const char *platform_file; + const char *application_file; + + MSG_init(&argc, argv); + + if (argc < 3) { + printf("Usage: %s platform_file deployment_file\n", argv[0]); + printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); + exit(1); + } + platform_file = argv[1]; + application_file = argv[2]; + + /* MSG_config("workstation/model","KCCFLN05"); */ + { /* Simulation setting */ + MSG_create_environment(platform_file); + } + { /* Application deployment */ + MSG_function_register("master", master); + MSG_function_register("slave", slave); + // launch two MPI applications as well, one using master_mpi function as main on 2 nodes + SMPI_app_instance_register("master_mpi", master_mpi,2); + // the second performing an alltoall on 4 nodes + SMPI_app_instance_register("alltoall_mpi", alltoall_mpi,4); + MSG_launch_application(application_file); + SMPI_init(); + } + res = MSG_main(); + + XBT_INFO("Simulation time %g", MSG_get_clock()); + + + SMPI_finalize(); + if (res == MSG_OK) + return 0; + else + return 1; +} /* end_of_main */ diff --git a/examples/smpi/smpi_msg_masterslave/msg_smpi.tesh b/examples/smpi/smpi_msg_masterslave/msg_smpi.tesh new file mode 100644 index 0000000000..541c76f66b --- /dev/null +++ b/examples/smpi/smpi_msg_masterslave/msg_smpi.tesh @@ -0,0 +1,42 @@ +p Test the use of SMPI+MSG in the same file, as well as several different SMPI instances at the same time +$ ./masterslave_mailbox_smpi ${srcdir:=.}/../../msg/small_platform_with_routers.xml ${srcdir:=.}/deployment_masterslave_mailbox_smpi.xml --log=smpi.:info +> [0.000000] [smpi_kernel/INFO] You did not set the power of the host running the simulation. The timings will certainly not be accurate. Use the option "--cfg=smpi/running_power:" to set its value.Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information. +> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 1 slaves and 20 tasks to process +> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" (of 20) to mailbox "slave-0" +> [Ginette:master_mpi:(3) 0.000000] [msg_test/INFO] here for rank 0 +> [Bourassa:master_mpi:(4) 0.000000] [msg_test/INFO] here for rank 1 +> [Ginette:alltoall_mpi:(5) 0.000000] [msg_test/INFO] alltoall for rank 0 +> [Bourassa:alltoall_mpi:(6) 0.000000] [msg_test/INFO] alltoall for rank 1 +> [Jupiter:alltoall_mpi:(7) 0.000000] [msg_test/INFO] alltoall for rank 2 +> [Fafard:alltoall_mpi:(8) 0.000000] [msg_test/INFO] alltoall for rank 3 +> [Ginette:master_mpi:(3) 0.000000] [msg_test/INFO] After comm 0 +> [Tremblay:master:(1) 0.002265] [msg_test/INFO] Sending "Task_1" (of 20) to mailbox "slave-0" +> [Bourassa:master_mpi:(4) 0.016868] [msg_test/INFO] After comm 1 +> [Bourassa:master_mpi:(4) 0.016868] [msg_test/INFO] After finalize 1 0 +> [Ginette:master_mpi:(3) 0.016868] [msg_test/INFO] After finalize 0 0 +> [Ginette:alltoall_mpi:(5) 0.098642] [msg_test/INFO] after alltoall 0 +> [Fafard:alltoall_mpi:(8) 0.099069] [msg_test/INFO] after alltoall 3 +> [Bourassa:alltoall_mpi:(6) 0.127526] [msg_test/INFO] after alltoall 1 +> [Jupiter:alltoall_mpi:(7) 0.127802] [msg_test/INFO] after alltoall 2 +> [Tremblay:master:(1) 0.514241] [msg_test/INFO] Sending "Task_2" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 1.026216] [msg_test/INFO] Sending "Task_3" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 1.538191] [msg_test/INFO] Sending "Task_4" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 2.050166] [msg_test/INFO] Sending "Task_5" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 2.562142] [msg_test/INFO] Sending "Task_6" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 3.074117] [msg_test/INFO] Sending "Task_7" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 3.586092] [msg_test/INFO] Sending "Task_8" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 4.098067] [msg_test/INFO] Sending "Task_9" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 4.610043] [msg_test/INFO] Sending "Task_10" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 5.122018] [msg_test/INFO] Sending "Task_11" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 5.633993] [msg_test/INFO] Sending "Task_12" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 6.145968] [msg_test/INFO] Sending "Task_13" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 6.657944] [msg_test/INFO] Sending "Task_14" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 7.169919] [msg_test/INFO] Sending "Task_15" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 7.681894] [msg_test/INFO] Sending "Task_16" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 8.193869] [msg_test/INFO] Sending "Task_17" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 8.705845] [msg_test/INFO] Sending "Task_18" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 9.217820] [msg_test/INFO] Sending "Task_19" (of 20) to mailbox "slave-0" +> [Tremblay:master:(1) 9.729795] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. +> [Tremblay:slave:(2) 10.239700] [msg_test/INFO] I'm done. See you! +> [10.239700] [msg_test/INFO] Simulation time 10.2397 + diff --git a/examples/smpi/tracing/smpi_traced.tesh b/examples/smpi/tracing/smpi_traced.tesh index 70a45c4c8e..db51fbb4bd 100644 --- a/examples/smpi/tracing/smpi_traced.tesh +++ b/examples/smpi/tracing/smpi_traced.tesh @@ -3,53 +3,53 @@ # Go for the first test p Test instrumentation of SMPI -$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_traced --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'smpi_traced.trace' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) p Another SMPI test -$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_traced_simple --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'smpi_traced.trace' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) p Testing without trace parameters -$ ../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +$ ../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_traced_simple --log=smpi_kernel.thres:warning +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) p Testing grouped tracing -$ ../../smpi_script/bin/smpirun -trace -trace-grouped -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -trace -trace-grouped -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_traced_simple --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'smpi_traced.trace' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/group' to 'yes' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) p Testing generation of viva configuration files -$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-viva -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml --cfg=smpi/cpu_threshold:-1 -np 3 ./smpi_traced_simple --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-viva -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/cpu_threshold:-1 -np 3 ./smpi_traced_simple --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'smpi_traced.trace' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' @@ -57,17 +57,17 @@ $ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-viva -trace-file s > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/categorized' to 'smpi_cat.plist' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/uncategorized' to 'smpi_uncat.plist' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) -> [0.011914] [instr_config/INFO] No categories declared, ignoring generation of viva graph configuration +> [0.007962] [instr_config/INFO] No categories declared, ignoring generation of viva graph configuration p Testing with parameters but without activating them with the safe switch (-trace) -$ ../../smpi_script/bin/smpirun -trace-resource -trace-viva -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +$ ../../smpi_script/bin/smpirun -trace-resource -trace-viva -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./smpi_traced_simple --log=smpi_kernel.thres:warning +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/include/msg/msg.h b/include/msg/msg.h index 880010040d..341afa20d8 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -75,6 +75,7 @@ XBT_PUBLIC(unsigned long int) MSG_get_sent_msg(void); /************************** Environment ***********************************/ XBT_PUBLIC(msg_as_t) MSG_environment_get_routing_root(void); XBT_PUBLIC(const char *) MSG_environment_as_get_name(msg_as_t as); +XBT_PUBLIC(msg_as_t) MSG_environment_as_get_by_name(const char * name); XBT_PUBLIC(xbt_dict_t) MSG_environment_as_get_routing_sons(msg_as_t as); XBT_PUBLIC(const char *) MSG_environment_as_get_property_value(msg_as_t as, const char *name); XBT_PUBLIC(const char *) MSG_environment_as_get_model(msg_as_t as); @@ -101,8 +102,8 @@ XBT_PUBLIC(msg_error_t) MSG_file_rmove(msg_file_t fd, msg_host_t host, const cha /************************** Storage handling ***********************************/ XBT_PUBLIC(msg_host_t) MSG_get_storage_by_name(const char *name); XBT_PUBLIC(const char *) MSG_storage_get_name(msg_storage_t storage); -XBT_PUBLIC(sg_size_t) MSG_storage_get_free_size(const char* name); -XBT_PUBLIC(sg_size_t) MSG_storage_get_used_size(const char* name); +XBT_PUBLIC(sg_size_t) MSG_storage_get_free_size(msg_storage_t storage); +XBT_PUBLIC(sg_size_t) MSG_storage_get_used_size(msg_storage_t storage); XBT_PUBLIC(msg_storage_t) MSG_storage_get_by_name(const char *name); XBT_PUBLIC(xbt_dict_t) MSG_storage_get_properties(msg_storage_t storage); XBT_PUBLIC(void) MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn); @@ -180,7 +181,6 @@ XBT_PUBLIC(msg_process_t) MSG_process_create_with_environment(const char properties); XBT_PUBLIC(void) MSG_process_kill(msg_process_t process); XBT_PUBLIC(int) MSG_process_killall(int reset_PIDs); - XBT_PUBLIC(msg_error_t) MSG_process_migrate(msg_process_t process, msg_host_t host); XBT_PUBLIC(void *) MSG_process_get_data(msg_process_t process); @@ -209,7 +209,7 @@ XBT_PUBLIC(const char *) MSG_process_get_property_value(msg_process_t XBT_PUBLIC(msg_error_t) MSG_process_suspend(msg_process_t process); XBT_PUBLIC(msg_error_t) MSG_process_resume(msg_process_t process); XBT_PUBLIC(int) MSG_process_is_suspended(msg_process_t process); -XBT_PUBLIC(void) MSG_process_on_exit(int_f_pvoid_t fun, void *data); +XBT_PUBLIC(void) MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void *data); XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_restart); XBT_PUBLIC(msg_process_t) MSG_process_restart(msg_process_t process); @@ -250,6 +250,7 @@ XBT_PUBLIC(void) MSG_task_set_priority(msg_task_t task, double priority); XBT_PUBLIC(void) MSG_task_set_bound(msg_task_t task, double bound); XBT_PUBLIC(void) MSG_task_set_affinity(msg_task_t task, msg_host_t host, unsigned long mask); +XBT_PUBLIC(msg_error_t) MSG_process_join(msg_process_t process, double timeout); XBT_PUBLIC(msg_error_t) MSG_process_sleep(double nb_sec); XBT_PUBLIC(double) MSG_task_get_compute_duration(msg_task_t task); @@ -353,6 +354,8 @@ XBT_PUBLIC(void) MSG_mailbox_set_async(const char *alias); /************************** Action handling **********************************/ XBT_PUBLIC(msg_error_t) MSG_action_trace_run(char *path); +XBT_PUBLIC(void) MSG_action_init(void); +XBT_PUBLIC(void) MSG_action_exit(void); #ifdef MSG_USE_DEPRECATED @@ -414,6 +417,17 @@ XBT_PUBLIC(void) MSG_sem_get_capacity(msg_sem_t sem); XBT_PUBLIC(void) MSG_sem_destroy(msg_sem_t sem); XBT_PUBLIC(int) MSG_sem_would_block(msg_sem_t sem); +/** @brief Opaque type representing a barrier identifier + * @ingroup msg_synchro + * @hideinitializer + */ + +#define MSG_BARRIER_SERIAL_PROCESS -1 +typedef struct s_xbt_bar *msg_bar_t; +XBT_PUBLIC(msg_bar_t) MSG_barrier_init( unsigned int count); +XBT_PUBLIC(void) MSG_barrier_destroy(msg_bar_t bar); +XBT_PUBLIC(int) MSG_barrier_wait(msg_bar_t bar); + /** @brief Opaque type describing a Virtual Machine. * @ingroup msg_VMs * diff --git a/include/simgrid/platf.h b/include/simgrid/platf.h index 4031d13d73..4399096299 100644 --- a/include/simgrid/platf.h +++ b/include/simgrid/platf.h @@ -45,6 +45,7 @@ typedef enum { } e_surf_process_on_failure_t; typedef enum { + SURF_CLUSTER_FAT_TREE=2, SURF_CLUSTER_FLAT = 1, SURF_CLUSTER_TORUS = 0 } e_surf_cluster_topology_t; @@ -331,6 +332,7 @@ typedef struct s_sg_platf_gpu_cbarg { #define SG_PLATF_GPU_INITIALIZER {NULL} + /* ***************************************** */ XBT_PUBLIC(void) sg_platf_begin(void); // Start a new platform diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 6299fd91fc..2b0b20007f 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -87,6 +87,10 @@ typedef struct s_smx_action *smx_action_t; /* FIXME: replace by specialized acti \see m_process_management @{ */ typedef struct s_smx_process *smx_process_t; +typedef enum { + SMX_EXIT_SUCCESS = 0, + SMX_EXIT_FAILURE = 1 +} smx_process_exit_status_t; /** @} */ @@ -227,7 +231,7 @@ XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t func XBT_PUBLIC(void) SIMIX_function_register_process_kill(void_pfn_smxprocess_t_smxprocess_t function); /* Simulation execution */ -XBT_PUBLIC(void) SIMIX_run(void); +XBT_PUBLIC(void) SIMIX_run(void); XBT_PUBLIC(double) SIMIX_get_clock(void); /* Timer functions FIXME: should these be public? */ @@ -274,7 +278,7 @@ XBT_PUBLIC(smx_context_t) SIMIX_process_get_context(smx_process_t); XBT_PUBLIC(void) SIMIX_process_set_context(smx_process_t p,smx_context_t c); XBT_PUBLIC(int) SIMIX_process_has_pending_comms(smx_process_t process); XBT_PUBLIC(void) SIMIX_process_on_exit_runall(smx_process_t process); -XBT_PUBLIC(void) SIMIX_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data); +XBT_PUBLIC(void) SIMIX_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void *data); /****************************** Communication *********************************/ XBT_PUBLIC(void) SIMIX_comm_set_copy_data_callback(void (*callback) (smx_action_t, void*, size_t)); @@ -388,9 +392,10 @@ XBT_PUBLIC(int) simcall_process_get_PPID(smx_process_t process); XBT_PUBLIC(int) simcall_process_is_suspended(smx_process_t process); XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_process_t host); XBT_PUBLIC(void) simcall_process_set_kill_time(smx_process_t process, double kill_time); -XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data); +XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void *data); XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int auto_restart); XBT_PUBLIC(smx_process_t) simcall_process_restart(smx_process_t process); +XBT_PUBLIC(void) simcall_process_join(smx_process_t process, double timeout); /* Sleep control */ XBT_PUBLIC(e_smx_state_t) simcall_process_sleep(double duration); @@ -413,6 +418,7 @@ XBT_PUBLIC(void) simcall_comm_send(smx_rdv_t rdv, double task_size, double rate, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double timeout); XBT_PUBLIC(smx_action_t) simcall_comm_isend(smx_rdv_t rdv, double task_size, @@ -420,16 +426,19 @@ XBT_PUBLIC(smx_action_t) simcall_comm_isend(smx_rdv_t rdv, double task_size, size_t src_buff_size, int (*match_fun)(void *, void *, smx_action_t), void (*clean_fun)(void *), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, int detached); XBT_PUBLIC(void) simcall_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size, int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double timeout, double rate); XBT_PUBLIC(smx_action_t) simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size, int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double rate); XBT_PUBLIC(smx_action_t) simcall_comm_iprobe(smx_rdv_t rdv, int src, int tag, @@ -499,8 +508,8 @@ XBT_PUBLIC(sg_size_t) simcall_file_tell(smx_file_t fd); XBT_PUBLIC(int) simcall_file_seek(smx_file_t fd, sg_size_t offset, int origin); XBT_PUBLIC(int) simcall_file_move(smx_file_t fd, const char* fullpath); /***************************** Storage **********************************/ -XBT_PUBLIC(sg_size_t) simcall_storage_get_free_size (const char* name); -XBT_PUBLIC(sg_size_t) simcall_storage_get_used_size (const char* name); +XBT_PUBLIC(sg_size_t) simcall_storage_get_free_size (smx_storage_t storage); +XBT_PUBLIC(sg_size_t) simcall_storage_get_used_size (smx_storage_t storage); XBT_PUBLIC(xbt_dict_t) simcall_storage_get_properties(smx_storage_t storage); XBT_PUBLIC(void*) SIMIX_storage_get_data(smx_storage_t storage); XBT_PUBLIC(void) SIMIX_storage_set_data(smx_storage_t storage, void *data); diff --git a/include/smpi/mpi.h b/include/smpi/mpi.h index 4224e7ffbc..482fa7eba8 100644 --- a/include/smpi/mpi.h +++ b/include/smpi/mpi.h @@ -10,7 +10,6 @@ #define SEED 221238 #define sleep(x) smpi_sleep(x) -#define gettimeofday(x, y) smpi_gettimeofday(x) #include #include @@ -18,6 +17,8 @@ #include #include +#define gettimeofday(x, y) smpi_gettimeofday(x, NULL) + #ifdef HAVE_MC #undef assert #define assert(x) MC_assert(x) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index 5fd5a7c651..f9ebc00b78 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -7,6 +7,7 @@ #ifndef SMPI_H #define SMPI_H +#include #include #include #include @@ -64,6 +65,9 @@ SG_BEGIN_DECL() #define MPI_ERR_PENDING 14 #define MPI_ERR_BUFFER 15 #define MPI_ERR_NAME 16 +#define MPI_ERR_DIMS 17 +#define MPI_ERR_TOPOLOGY 18 +#define MPI_ERR_NO_MEM 19 #define MPI_ERRCODES_IGNORE (int *)0 #define MPI_IDENT 0 #define MPI_SIMILAR 1 @@ -99,6 +103,11 @@ SG_BEGIN_DECL() #define MPI_INTEGER8 MPI_DATATYPE_NULL #define MPI_COMPLEX MPI_DATATYPE_NULL #define MPI_DOUBLE_COMPLEX MPI_DATATYPE_NULL +#define MPI_2DOUBLE_PRECISION MPI_DATATYPE_NULL +#define MPI_REAL MPI_DATATYPE_NULL +#define MPI_LOGICAL MPI_DATATYPE_NULL +#define MPI_DOUBLE_PRECISION MPI_DATATYPE_NULL +#define MPI_INTEGER MPI_DATATYPE_NULL #define MPI_DISTRIBUTE_BLOCK 0 #define MPI_DISTRIBUTE_NONE 1 @@ -153,6 +162,15 @@ typedef enum MPIR_Topo_type { typedef ptrdiff_t MPI_Aint; typedef long long MPI_Offset; +// To compile code that declare MPI_File variables +struct s_empty { +#if !defined(__GNUC__) || defined(__STRICT_ANSI__) + char empty; +#endif +}; +typedef struct s_empty *MPI_File; + + struct s_smpi_mpi_datatype; typedef struct s_smpi_mpi_datatype *MPI_Datatype; @@ -233,6 +251,9 @@ XBT_PUBLIC_DATA( MPI_Op ) MPI_BAND; XBT_PUBLIC_DATA( MPI_Op ) MPI_BOR; XBT_PUBLIC_DATA( MPI_Op ) MPI_BXOR; +struct s_smpi_mpi_topology; +typedef struct s_smpi_mpi_topology *MPI_Topology; + struct s_smpi_mpi_group; typedef struct s_smpi_mpi_group *MPI_Group; @@ -688,8 +709,9 @@ XBT_PUBLIC(int) smpi_get_host_nb_pstates(void); XBT_PUBLIC(void) smpi_set_host_power_peak_at(int pstate_index); XBT_PUBLIC(double) smpi_get_host_consumed_energy(void); +XBT_PUBLIC(int) smpi_usleep(useconds_t usecs); XBT_PUBLIC(unsigned int) smpi_sleep(unsigned int secs); -XBT_PUBLIC(int) smpi_gettimeofday(struct timeval *tv); +XBT_PUBLIC(int) smpi_gettimeofday(struct timeval *tv, void* tz); XBT_PUBLIC(unsigned long long) smpi_rastro_resolution (void); XBT_PUBLIC(unsigned long long) smpi_rastro_timestamp (void); XBT_PUBLIC(void) smpi_sample_1(int global, const char *file, int line, @@ -736,5 +758,12 @@ XBT_PUBLIC(void) smpi_replay_init(int *argc, char***argv); XBT_PUBLIC(void) smpi_action_trace_run(char *); XBT_PUBLIC(int) smpi_replay_finalize(void); +XBT_PUBLIC(void) SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_processes); +XBT_PUBLIC(void) SMPI_init(void); +XBT_PUBLIC(void) SMPI_finalize(void); + + + + SG_END_DECL() #endif diff --git a/include/surf/simgrid_dtd.h b/include/surf/simgrid_dtd.h index 4066bb35bc..234928fac0 100644 --- a/include/surf/simgrid_dtd.h +++ b/include/surf/simgrid_dtd.h @@ -108,598 +108,598 @@ XBT_PUBLIC(void) STag_surfxml_model___prop(void); XBT_PUBLIC(void) ETag_surfxml_model___prop(void); /* XML application data. */ +typedef int AT_surfxml_storage___type_content; +#define AU_surfxml_storage___type_content NULL +typedef int AT_surfxml_host___link_id; +#define AU_surfxml_host___link_id NULL +typedef int AT_surfxml_cabinet_bw; +#define AU_surfxml_cabinet_bw NULL +typedef enum { AU_surfxml_host_state, A_surfxml_host_state_ON,A_surfxml_host_state_OFF } AT_surfxml_host_state; +typedef enum { AU_surfxml_random_generator, A_surfxml_random_generator_DRAND48,A_surfxml_random_generator_RAND,A_surfxml_random_generator_RNGSTREAM,A_surfxml_random_generator_NONE } AT_surfxml_random_generator; +typedef int AT_surfxml_cluster_bb___bw; +#define AU_surfxml_cluster_bb___bw NULL +typedef enum { AU_surfxml_AS_routing, A_surfxml_AS_routing_Full,A_surfxml_AS_routing_Floyd,A_surfxml_AS_routing_Dijkstra,A_surfxml_AS_routing_DijkstraCache,A_surfxml_AS_routing_None,A_surfxml_AS_routing_Vivaldi,A_surfxml_AS_routing_Cluster,A_surfxml_AS_routing_Cluster___torus } AT_surfxml_AS_routing; +typedef int AT_surfxml_cluster_prefix; +#define AU_surfxml_cluster_prefix NULL +typedef int AT_surfxml_host_availability___file; +#define AU_surfxml_host_availability___file NULL +typedef int AT_surfxml_router_coordinates; +#define AU_surfxml_router_coordinates NULL +typedef int AT_surfxml_random_max; +#define AU_surfxml_random_max NULL +typedef int AT_surfxml_cluster_suffix; +#define AU_surfxml_cluster_suffix NULL +typedef int AT_surfxml_cluster_id; +#define AU_surfxml_cluster_id NULL +typedef int AT_surfxml_cluster_power; +#define AU_surfxml_cluster_power NULL +typedef int AT_surfxml_trace___connect_element; +#define AU_surfxml_trace___connect_element NULL +typedef int AT_surfxml_cluster_loopback___bw; +#define AU_surfxml_cluster_loopback___bw NULL +typedef int AT_surfxml_bypassRoute_dst; +#define AU_surfxml_bypassRoute_dst NULL +typedef int AT_surfxml_cluster_availability___file; +#define AU_surfxml_cluster_availability___file NULL typedef int AT_surfxml_mount_name; #define AU_surfxml_mount_name NULL -typedef enum { AU_surfxml_random_generator, A_surfxml_random_generator_DRAND48,A_surfxml_random_generator_RAND,A_surfxml_random_generator_RNGSTREAM,A_surfxml_random_generator_NONE } AT_surfxml_random_generator; +typedef int AT_surfxml_host_pstate; +#define AU_surfxml_host_pstate NULL +typedef int AT_surfxml_ASroute_dst; +#define AU_surfxml_ASroute_dst NULL +typedef int AT_surfxml_storage___type_content___type; +#define AU_surfxml_storage___type_content___type NULL +typedef int AT_surfxml_cluster_topo___parameters; +#define AU_surfxml_cluster_topo___parameters NULL +typedef int AT_surfxml_storage_id; +#define AU_surfxml_storage_id NULL +typedef int AT_surfxml_cluster_core; +#define AU_surfxml_cluster_core NULL +typedef int AT_surfxml_AS_id; +#define AU_surfxml_AS_id NULL +typedef int AT_surfxml_peer_lat; +#define AU_surfxml_peer_lat NULL +typedef int AT_surfxml_config_id; +#define AU_surfxml_config_id NULL typedef int AT_surfxml_ASroute_gw___dst; #define AU_surfxml_ASroute_gw___dst NULL -typedef int AT_surfxml_trace___connect_element; -#define AU_surfxml_trace___connect_element NULL +typedef int AT_surfxml_process_function; +#define AU_surfxml_process_function NULL +typedef int AT_surfxml_link___ctn_id; +#define AU_surfxml_link___ctn_id NULL +typedef int AT_surfxml_trace___connect_trace; +#define AU_surfxml_trace___connect_trace NULL +typedef int AT_surfxml_route_dst; +#define AU_surfxml_route_dst NULL +typedef int AT_surfxml_random_std___deviation; +#define AU_surfxml_random_std___deviation NULL +typedef int AT_surfxml_process_start___time; +#define AU_surfxml_process_start___time NULL +typedef int AT_surfxml_cluster_lat; +#define AU_surfxml_cluster_lat NULL +typedef int AT_surfxml_storage___type_id; +#define AU_surfxml_storage___type_id NULL +typedef int AT_surfxml_trace_id; +#define AU_surfxml_trace_id NULL +typedef int AT_surfxml_gpu_name; +#define AU_surfxml_gpu_name NULL +typedef enum { AU_surfxml_cluster_topology, A_surfxml_cluster_topology_FLAT,A_surfxml_cluster_topology_TORUS } AT_surfxml_cluster_topology; +typedef int AT_surfxml_cabinet_suffix; +#define AU_surfxml_cabinet_suffix NULL +typedef int AT_surfxml_peer_coordinates; +#define AU_surfxml_peer_coordinates NULL +typedef int AT_surfxml_cluster_state___file; +#define AU_surfxml_cluster_state___file NULL +typedef int AT_surfxml_bypassASroute_gw___dst; +#define AU_surfxml_bypassASroute_gw___dst NULL +typedef int AT_surfxml_storage_content___type; +#define AU_surfxml_storage_content___type NULL +typedef int AT_surfxml_process_host; +#define AU_surfxml_process_host NULL +typedef enum { AU_surfxml_ASroute_symmetrical, A_surfxml_ASroute_symmetrical_YES,A_surfxml_ASroute_symmetrical_NO } AT_surfxml_ASroute_symmetrical; +typedef int AT_surfxml_trace_periodicity; +#define AU_surfxml_trace_periodicity NULL +typedef int AT_surfxml_include_file; +#define AU_surfxml_include_file NULL +typedef int AT_surfxml_peer_bw___out; +#define AU_surfxml_peer_bw___out NULL +typedef int AT_surfxml_storage_attach; +#define AU_surfxml_storage_attach NULL +typedef int AT_surfxml_peer_power; +#define AU_surfxml_peer_power NULL +typedef int AT_surfxml_route_src; +#define AU_surfxml_route_src NULL +typedef int AT_surfxml_link_bandwidth___file; +#define AU_surfxml_link_bandwidth___file NULL +typedef int AT_surfxml_mount_storageId; +#define AU_surfxml_mount_storageId NULL +typedef int AT_surfxml_bypassASroute_dst; +#define AU_surfxml_bypassASroute_dst NULL +typedef int AT_surfxml_cabinet_power; +#define AU_surfxml_cabinet_power NULL +typedef int AT_surfxml_trace_file; +#define AU_surfxml_trace_file NULL +typedef enum { AU_surfxml_trace___connect_kind, A_surfxml_trace___connect_kind_HOST___AVAIL,A_surfxml_trace___connect_kind_POWER,A_surfxml_trace___connect_kind_LINK___AVAIL,A_surfxml_trace___connect_kind_BANDWIDTH,A_surfxml_trace___connect_kind_LATENCY } AT_surfxml_trace___connect_kind; +typedef int AT_surfxml_prop_value; +#define AU_surfxml_prop_value NULL +typedef enum { AU_surfxml_link___ctn_direction, A_surfxml_link___ctn_direction_UP,A_surfxml_link___ctn_direction_DOWN,A_surfxml_link___ctn_direction_NONE } AT_surfxml_link___ctn_direction; +typedef int AT_surfxml_random_radical; +#define AU_surfxml_random_radical NULL +typedef int AT_surfxml_host_coordinates; +#define AU_surfxml_host_coordinates NULL typedef int AT_surfxml_prop_id; #define AU_surfxml_prop_id NULL -typedef int AT_surfxml_host___link_up; -#define AU_surfxml_host___link_up NULL typedef int AT_surfxml_host_id; #define AU_surfxml_host_id NULL -typedef enum { AU_surfxml_ASroute_symmetrical, A_surfxml_ASroute_symmetrical_YES,A_surfxml_ASroute_symmetrical_NO } AT_surfxml_ASroute_symmetrical; -typedef int AT_surfxml_peer_lat; -#define AU_surfxml_peer_lat NULL +typedef int AT_surfxml_host_availability; +#define AU_surfxml_host_availability NULL +typedef int AT_surfxml_storage___type_size; +#define AU_surfxml_storage___type_size NULL +typedef int AT_surfxml_cabinet_prefix; +#define AU_surfxml_cabinet_prefix NULL +typedef int AT_surfxml_host___link_up; +#define AU_surfxml_host___link_up NULL +typedef int AT_surfxml_cluster_limiter___link; +#define AU_surfxml_cluster_limiter___link NULL +typedef int AT_surfxml_peer_bw___in; +#define AU_surfxml_peer_bw___in NULL +typedef int AT_surfxml_link_bandwidth; +#define AU_surfxml_link_bandwidth NULL +typedef int AT_surfxml_random_seed; +#define AU_surfxml_random_seed NULL +typedef int AT_surfxml_cluster_bw; +#define AU_surfxml_cluster_bw NULL +typedef int AT_surfxml_cabinet_lat; +#define AU_surfxml_cabinet_lat NULL +typedef int AT_surfxml_bypassASroute_src; +#define AU_surfxml_bypassASroute_src NULL +typedef int AT_surfxml_random_min; +#define AU_surfxml_random_min NULL +typedef int AT_surfxml_cabinet_id; +#define AU_surfxml_cabinet_id NULL +typedef int AT_surfxml_bypassASroute_gw___src; +#define AU_surfxml_bypassASroute_gw___src NULL typedef enum { AU_surfxml_process_on___failure, A_surfxml_process_on___failure_DIE,A_surfxml_process_on___failure_RESTART } AT_surfxml_process_on___failure; -typedef int AT_surfxml_link_latency___file; -#define AU_surfxml_link_latency___file NULL +typedef int AT_surfxml_platform_version; +#define AU_surfxml_platform_version NULL +typedef enum { AU_surfxml_cluster_bb___sharing___policy, A_surfxml_cluster_bb___sharing___policy_SHARED,A_surfxml_cluster_bb___sharing___policy_FATPIPE } AT_surfxml_cluster_bb___sharing___policy; +typedef int AT_surfxml_backbone_id; +#define AU_surfxml_backbone_id NULL +typedef int AT_surfxml_model___prop_id; +#define AU_surfxml_model___prop_id NULL +typedef enum { AU_surfxml_cluster_sharing___policy, A_surfxml_cluster_sharing___policy_SHARED,A_surfxml_cluster_sharing___policy_FULLDUPLEX,A_surfxml_cluster_sharing___policy_FATPIPE } AT_surfxml_cluster_sharing___policy; +typedef int AT_surfxml_cluster_router___id; +#define AU_surfxml_cluster_router___id NULL +typedef int AT_surfxml_cluster_loopback___lat; +#define AU_surfxml_cluster_loopback___lat NULL +typedef int AT_surfxml_cluster_radical; +#define AU_surfxml_cluster_radical NULL +typedef int AT_surfxml_mstorage_name; +#define AU_surfxml_mstorage_name NULL +typedef int AT_surfxml_peer_id; +#define AU_surfxml_peer_id NULL typedef int AT_surfxml_peer_availability___file; #define AU_surfxml_peer_availability___file NULL +typedef enum { AU_surfxml_link_state, A_surfxml_link_state_ON,A_surfxml_link_state_OFF } AT_surfxml_link_state; +typedef int AT_surfxml_mstorage_typeId; +#define AU_surfxml_mstorage_typeId NULL +typedef int AT_surfxml_storage_typeId; +#define AU_surfxml_storage_typeId NULL +typedef int AT_surfxml_random_mean; +#define AU_surfxml_random_mean NULL +typedef int AT_surfxml_backbone_bandwidth; +#define AU_surfxml_backbone_bandwidth NULL +typedef int AT_surfxml_cabinet_radical; +#define AU_surfxml_cabinet_radical NULL +typedef int AT_surfxml_argument_value; +#define AU_surfxml_argument_value NULL typedef int AT_surfxml_model___prop_value; #define AU_surfxml_model___prop_value NULL -typedef enum { AU_surfxml_link___ctn_direction, A_surfxml_link___ctn_direction_UP,A_surfxml_link___ctn_direction_DOWN,A_surfxml_link___ctn_direction_NONE } AT_surfxml_link___ctn_direction; -typedef enum { AU_surfxml_host_state, A_surfxml_host_state_ON,A_surfxml_host_state_OFF } AT_surfxml_host_state; -typedef int AT_surfxml_AS_id; -#define AU_surfxml_AS_id NULL +typedef int AT_surfxml_host___link_down; +#define AU_surfxml_host___link_down NULL typedef int AT_surfxml_host_power; #define AU_surfxml_host_power NULL -typedef int AT_surfxml_cabinet_suffix; -#define AU_surfxml_cabinet_suffix NULL -typedef int AT_surfxml_gpu_name; -#define AU_surfxml_gpu_name NULL +typedef int AT_surfxml_process_kill___time; +#define AU_surfxml_process_kill___time NULL +typedef int AT_surfxml_bypassRoute_src; +#define AU_surfxml_bypassRoute_src NULL +typedef enum { AU_surfxml_route_symmetrical, A_surfxml_route_symmetrical_YES,A_surfxml_route_symmetrical_NO } AT_surfxml_route_symmetrical; +typedef int AT_surfxml_storage___type_model; +#define AU_surfxml_storage___type_model NULL +typedef int AT_surfxml_cluster_bb___lat; +#define AU_surfxml_cluster_bb___lat NULL +typedef int AT_surfxml_link_latency; +#define AU_surfxml_link_latency NULL typedef int AT_surfxml_router_id; #define AU_surfxml_router_id NULL -typedef int AT_surfxml_storage___type_id; -#define AU_surfxml_storage___type_id NULL -typedef int AT_surfxml_process_start___time; -#define AU_surfxml_process_start___time NULL -typedef int AT_surfxml_cabinet_bw; -#define AU_surfxml_cabinet_bw NULL -typedef int AT_surfxml_cluster_suffix; -#define AU_surfxml_cluster_suffix NULL -typedef int AT_surfxml_bypassASroute_dst; -#define AU_surfxml_bypassASroute_dst NULL -typedef int AT_surfxml_host___link_id; -#define AU_surfxml_host___link_id NULL -typedef int AT_surfxml_model___prop_id; -#define AU_surfxml_model___prop_id NULL +typedef int AT_surfxml_link_latency___file; +#define AU_surfxml_link_latency___file NULL +typedef int AT_surfxml_host_state___file; +#define AU_surfxml_host_state___file NULL +typedef int AT_surfxml_link_id; +#define AU_surfxml_link_id NULL +typedef int AT_surfxml_peer_state___file; +#define AU_surfxml_peer_state___file NULL +typedef int AT_surfxml_ASroute_gw___src; +#define AU_surfxml_ASroute_gw___src NULL +typedef int AT_surfxml_random_id; +#define AU_surfxml_random_id NULL +typedef int AT_surfxml_backbone_latency; +#define AU_surfxml_backbone_latency NULL +typedef int AT_surfxml_link_state___file; +#define AU_surfxml_link_state___file NULL typedef int AT_surfxml_ASroute_src; #define AU_surfxml_ASroute_src NULL -typedef int AT_surfxml_cluster_prefix; -#define AU_surfxml_cluster_prefix NULL -typedef int AT_surfxml_cabinet_prefix; -#define AU_surfxml_cabinet_prefix NULL -typedef int AT_surfxml_trace_file; -#define AU_surfxml_trace_file NULL typedef enum { AU_surfxml_link_sharing___policy, A_surfxml_link_sharing___policy_SHARED,A_surfxml_link_sharing___policy_FATPIPE,A_surfxml_link_sharing___policy_FULLDUPLEX } AT_surfxml_link_sharing___policy; -typedef int AT_surfxml_storage_typeId; -#define AU_surfxml_storage_typeId NULL -typedef int AT_surfxml_random_min; -#define AU_surfxml_random_min NULL -typedef int AT_surfxml_link___ctn_id; -#define AU_surfxml_link___ctn_id NULL -typedef int AT_surfxml_peer_bw___out; -#define AU_surfxml_peer_bw___out NULL -typedef int AT_surfxml_cluster_availability___file; -#define AU_surfxml_cluster_availability___file NULL typedef int AT_surfxml_storage_content; #define AU_surfxml_storage_content NULL -typedef int AT_surfxml_process_kill___time; -#define AU_surfxml_process_kill___time NULL -typedef int AT_surfxml_cluster_bb___bw; -#define AU_surfxml_cluster_bb___bw NULL -typedef int AT_surfxml_host_pstate; -#define AU_surfxml_host_pstate NULL -typedef int AT_surfxml_argument_value; -#define AU_surfxml_argument_value NULL -typedef enum { AU_surfxml_link_state, A_surfxml_link_state_ON,A_surfxml_link_state_OFF } AT_surfxml_link_state; -typedef int AT_surfxml_cluster_loopback___bw; -#define AU_surfxml_cluster_loopback___bw NULL -typedef int AT_surfxml_ASroute_gw___src; -#define AU_surfxml_ASroute_gw___src NULL -typedef enum { AU_surfxml_AS_routing, A_surfxml_AS_routing_Full,A_surfxml_AS_routing_Floyd,A_surfxml_AS_routing_Dijkstra,A_surfxml_AS_routing_DijkstraCache,A_surfxml_AS_routing_None,A_surfxml_AS_routing_Vivaldi,A_surfxml_AS_routing_Cluster,A_surfxml_AS_routing_Cluster___torus } AT_surfxml_AS_routing; -typedef int AT_surfxml_link_bandwidth; -#define AU_surfxml_link_bandwidth NULL -typedef int AT_surfxml_cluster_id; -#define AU_surfxml_cluster_id NULL -typedef int AT_surfxml_peer_bw___in; -#define AU_surfxml_peer_bw___in NULL -typedef int AT_surfxml_random_mean; -#define AU_surfxml_random_mean NULL -typedef int AT_surfxml_storage___type_size; -#define AU_surfxml_storage___type_size NULL -typedef int AT_surfxml_storage_attach; -#define AU_surfxml_storage_attach NULL -typedef int AT_surfxml_cluster_bb___lat; -#define AU_surfxml_cluster_bb___lat NULL -typedef int AT_surfxml_link_latency; -#define AU_surfxml_link_latency NULL -typedef int AT_surfxml_backbone_bandwidth; -#define AU_surfxml_backbone_bandwidth NULL -typedef int AT_surfxml_backbone_id; -#define AU_surfxml_backbone_id NULL -typedef enum { AU_surfxml_trace___connect_kind, A_surfxml_trace___connect_kind_HOST___AVAIL,A_surfxml_trace___connect_kind_POWER,A_surfxml_trace___connect_kind_LINK___AVAIL,A_surfxml_trace___connect_kind_BANDWIDTH,A_surfxml_trace___connect_kind_LATENCY } AT_surfxml_trace___connect_kind; -typedef int AT_surfxml_cabinet_lat; -#define AU_surfxml_cabinet_lat NULL -typedef int AT_surfxml_random_seed; -#define AU_surfxml_random_seed NULL -typedef int AT_surfxml_cluster_state___file; -#define AU_surfxml_cluster_state___file NULL -typedef int AT_surfxml_link_bandwidth___file; -#define AU_surfxml_link_bandwidth___file NULL -typedef int AT_surfxml_storage___type_content; -#define AU_surfxml_storage___type_content NULL -typedef enum { AU_surfxml_route_symmetrical, A_surfxml_route_symmetrical_YES,A_surfxml_route_symmetrical_NO } AT_surfxml_route_symmetrical; -typedef int AT_surfxml_random_id; -#define AU_surfxml_random_id NULL -typedef int AT_surfxml_mstorage_name; -#define AU_surfxml_mstorage_name NULL -typedef int AT_surfxml_random_max; -#define AU_surfxml_random_max NULL -typedef int AT_surfxml_link_id; -#define AU_surfxml_link_id NULL -typedef enum { AU_surfxml_cluster_topology, A_surfxml_cluster_topology_FLAT,A_surfxml_cluster_topology_TORUS } AT_surfxml_cluster_topology; -typedef int AT_surfxml_process_host; -#define AU_surfxml_process_host NULL -typedef int AT_surfxml_cabinet_id; -#define AU_surfxml_cabinet_id NULL -typedef int AT_surfxml_host_availability___file; -#define AU_surfxml_host_availability___file NULL -typedef int AT_surfxml_cluster_lat; -#define AU_surfxml_cluster_lat NULL -typedef int AT_surfxml_router_coordinates; -#define AU_surfxml_router_coordinates NULL -typedef int AT_surfxml_trace_periodicity; -#define AU_surfxml_trace_periodicity NULL -typedef enum { AU_surfxml_cluster_bb___sharing___policy, A_surfxml_cluster_bb___sharing___policy_SHARED,A_surfxml_cluster_bb___sharing___policy_FATPIPE } AT_surfxml_cluster_bb___sharing___policy; -typedef int AT_surfxml_peer_state___file; -#define AU_surfxml_peer_state___file NULL -typedef int AT_surfxml_peer_coordinates; -#define AU_surfxml_peer_coordinates NULL -typedef int AT_surfxml_bypassASroute_src; -#define AU_surfxml_bypassASroute_src NULL -typedef int AT_surfxml_prop_value; -#define AU_surfxml_prop_value NULL -typedef int AT_surfxml_mstorage_typeId; -#define AU_surfxml_mstorage_typeId NULL -typedef int AT_surfxml_ASroute_dst; -#define AU_surfxml_ASroute_dst NULL -typedef int AT_surfxml_link_state___file; -#define AU_surfxml_link_state___file NULL -typedef int AT_surfxml_random_radical; -#define AU_surfxml_random_radical NULL -typedef int AT_surfxml_mount_storageId; -#define AU_surfxml_mount_storageId NULL -typedef int AT_surfxml_bypassASroute_gw___src; -#define AU_surfxml_bypassASroute_gw___src NULL -typedef int AT_surfxml_trace___connect_trace; -#define AU_surfxml_trace___connect_trace NULL -typedef int AT_surfxml_cluster_power; -#define AU_surfxml_cluster_power NULL -typedef int AT_surfxml_cluster_topo___parameters; -#define AU_surfxml_cluster_topo___parameters NULL -typedef int AT_surfxml_process_function; -#define AU_surfxml_process_function NULL -typedef int AT_surfxml_peer_id; -#define AU_surfxml_peer_id NULL -typedef int AT_surfxml_cabinet_radical; -#define AU_surfxml_cabinet_radical NULL -typedef int AT_surfxml_cluster_loopback___lat; -#define AU_surfxml_cluster_loopback___lat NULL -typedef int AT_surfxml_storage_content___type; -#define AU_surfxml_storage_content___type NULL -typedef int AT_surfxml_cluster_router___id; -#define AU_surfxml_cluster_router___id NULL -typedef enum { AU_surfxml_cluster_sharing___policy, A_surfxml_cluster_sharing___policy_SHARED,A_surfxml_cluster_sharing___policy_FULLDUPLEX,A_surfxml_cluster_sharing___policy_FATPIPE } AT_surfxml_cluster_sharing___policy; -typedef int AT_surfxml_bypassRoute_dst; -#define AU_surfxml_bypassRoute_dst NULL -typedef int AT_surfxml_cabinet_power; -#define AU_surfxml_cabinet_power NULL typedef int AT_surfxml_host_core; #define AU_surfxml_host_core NULL -typedef int AT_surfxml_host_availability; -#define AU_surfxml_host_availability NULL -typedef int AT_surfxml_storage___type_model; -#define AU_surfxml_storage___type_model NULL -typedef int AT_surfxml_bypassRoute_src; -#define AU_surfxml_bypassRoute_src NULL -typedef int AT_surfxml_backbone_latency; -#define AU_surfxml_backbone_latency NULL -typedef int AT_surfxml_route_src; -#define AU_surfxml_route_src NULL -typedef int AT_surfxml_storage_id; -#define AU_surfxml_storage_id NULL -typedef int AT_surfxml_storage___type_content___type; -#define AU_surfxml_storage___type_content___type NULL -typedef int AT_surfxml_host_coordinates; -#define AU_surfxml_host_coordinates NULL -typedef int AT_surfxml_trace_id; -#define AU_surfxml_trace_id NULL -typedef int AT_surfxml_peer_power; -#define AU_surfxml_peer_power NULL -typedef int AT_surfxml_cluster_radical; -#define AU_surfxml_cluster_radical NULL -typedef int AT_surfxml_config_id; -#define AU_surfxml_config_id NULL -typedef int AT_surfxml_bypassASroute_gw___dst; -#define AU_surfxml_bypassASroute_gw___dst NULL -typedef int AT_surfxml_host___link_down; -#define AU_surfxml_host___link_down NULL -typedef int AT_surfxml_include_file; -#define AU_surfxml_include_file NULL -typedef int AT_surfxml_random_std___deviation; -#define AU_surfxml_random_std___deviation NULL -typedef int AT_surfxml_cluster_core; -#define AU_surfxml_cluster_core NULL -typedef int AT_surfxml_cluster_limiter___link; -#define AU_surfxml_cluster_limiter___link NULL -typedef int AT_surfxml_host_state___file; -#define AU_surfxml_host_state___file NULL -typedef int AT_surfxml_route_dst; -#define AU_surfxml_route_dst NULL -typedef int AT_surfxml_cluster_bw; -#define AU_surfxml_cluster_bw NULL -typedef int AT_surfxml_platform_version; -#define AU_surfxml_platform_version NULL /* FleXML-provided data. */ XBT_PUBLIC_DATA(int) surfxml_pcdata_ix; XBT_PUBLIC_DATA(char *) surfxml_bufferstack; #define surfxml_pcdata (surfxml_bufferstack + surfxml_pcdata_ix) -XBT_PUBLIC_DATA(AT_surfxml_mount_name) AX_surfxml_mount_name; -#define A_surfxml_mount_name (surfxml_bufferstack + AX_surfxml_mount_name) -XBT_PUBLIC_DATA(short int) surfxml_mount_name_isset; +XBT_PUBLIC_DATA(AT_surfxml_storage___type_content) AX_surfxml_storage___type_content; +#define A_surfxml_storage___type_content (surfxml_bufferstack + AX_surfxml_storage___type_content) +XBT_PUBLIC_DATA(short int) surfxml_storage___type_content_isset; +XBT_PUBLIC_DATA(AT_surfxml_host___link_id) AX_surfxml_host___link_id; +#define A_surfxml_host___link_id (surfxml_bufferstack + AX_surfxml_host___link_id) +XBT_PUBLIC_DATA(short int) surfxml_host___link_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_cabinet_bw) AX_surfxml_cabinet_bw; +#define A_surfxml_cabinet_bw (surfxml_bufferstack + AX_surfxml_cabinet_bw) +XBT_PUBLIC_DATA(short int) surfxml_cabinet_bw_isset; +XBT_PUBLIC_DATA(AT_surfxml_host_state) AX_surfxml_host_state; +#define A_surfxml_host_state AX_surfxml_host_state +XBT_PUBLIC_DATA(short int) surfxml_host_state_isset; XBT_PUBLIC_DATA(AT_surfxml_random_generator) AX_surfxml_random_generator; #define A_surfxml_random_generator AX_surfxml_random_generator XBT_PUBLIC_DATA(short int) surfxml_random_generator_isset; -XBT_PUBLIC_DATA(AT_surfxml_ASroute_gw___dst) AX_surfxml_ASroute_gw___dst; -#define A_surfxml_ASroute_gw___dst (surfxml_bufferstack + AX_surfxml_ASroute_gw___dst) -XBT_PUBLIC_DATA(short int) surfxml_ASroute_gw___dst_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_bb___bw) AX_surfxml_cluster_bb___bw; +#define A_surfxml_cluster_bb___bw (surfxml_bufferstack + AX_surfxml_cluster_bb___bw) +XBT_PUBLIC_DATA(short int) surfxml_cluster_bb___bw_isset; +XBT_PUBLIC_DATA(AT_surfxml_AS_routing) AX_surfxml_AS_routing; +#define A_surfxml_AS_routing AX_surfxml_AS_routing +XBT_PUBLIC_DATA(short int) surfxml_AS_routing_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_prefix) AX_surfxml_cluster_prefix; +#define A_surfxml_cluster_prefix (surfxml_bufferstack + AX_surfxml_cluster_prefix) +XBT_PUBLIC_DATA(short int) surfxml_cluster_prefix_isset; +XBT_PUBLIC_DATA(AT_surfxml_host_availability___file) AX_surfxml_host_availability___file; +#define A_surfxml_host_availability___file (surfxml_bufferstack + AX_surfxml_host_availability___file) +XBT_PUBLIC_DATA(short int) surfxml_host_availability___file_isset; +XBT_PUBLIC_DATA(AT_surfxml_router_coordinates) AX_surfxml_router_coordinates; +#define A_surfxml_router_coordinates (surfxml_bufferstack + AX_surfxml_router_coordinates) +XBT_PUBLIC_DATA(short int) surfxml_router_coordinates_isset; +XBT_PUBLIC_DATA(AT_surfxml_random_max) AX_surfxml_random_max; +#define A_surfxml_random_max (surfxml_bufferstack + AX_surfxml_random_max) +XBT_PUBLIC_DATA(short int) surfxml_random_max_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_suffix) AX_surfxml_cluster_suffix; +#define A_surfxml_cluster_suffix (surfxml_bufferstack + AX_surfxml_cluster_suffix) +XBT_PUBLIC_DATA(short int) surfxml_cluster_suffix_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_id) AX_surfxml_cluster_id; +#define A_surfxml_cluster_id (surfxml_bufferstack + AX_surfxml_cluster_id) +XBT_PUBLIC_DATA(short int) surfxml_cluster_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_power) AX_surfxml_cluster_power; +#define A_surfxml_cluster_power (surfxml_bufferstack + AX_surfxml_cluster_power) +XBT_PUBLIC_DATA(short int) surfxml_cluster_power_isset; XBT_PUBLIC_DATA(AT_surfxml_trace___connect_element) AX_surfxml_trace___connect_element; #define A_surfxml_trace___connect_element (surfxml_bufferstack + AX_surfxml_trace___connect_element) XBT_PUBLIC_DATA(short int) surfxml_trace___connect_element_isset; -XBT_PUBLIC_DATA(AT_surfxml_prop_id) AX_surfxml_prop_id; -#define A_surfxml_prop_id (surfxml_bufferstack + AX_surfxml_prop_id) -XBT_PUBLIC_DATA(short int) surfxml_prop_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_host___link_up) AX_surfxml_host___link_up; -#define A_surfxml_host___link_up (surfxml_bufferstack + AX_surfxml_host___link_up) -XBT_PUBLIC_DATA(short int) surfxml_host___link_up_isset; -XBT_PUBLIC_DATA(AT_surfxml_host_id) AX_surfxml_host_id; -#define A_surfxml_host_id (surfxml_bufferstack + AX_surfxml_host_id) -XBT_PUBLIC_DATA(short int) surfxml_host_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_ASroute_symmetrical) AX_surfxml_ASroute_symmetrical; -#define A_surfxml_ASroute_symmetrical AX_surfxml_ASroute_symmetrical -XBT_PUBLIC_DATA(short int) surfxml_ASroute_symmetrical_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_loopback___bw) AX_surfxml_cluster_loopback___bw; +#define A_surfxml_cluster_loopback___bw (surfxml_bufferstack + AX_surfxml_cluster_loopback___bw) +XBT_PUBLIC_DATA(short int) surfxml_cluster_loopback___bw_isset; +XBT_PUBLIC_DATA(AT_surfxml_bypassRoute_dst) AX_surfxml_bypassRoute_dst; +#define A_surfxml_bypassRoute_dst (surfxml_bufferstack + AX_surfxml_bypassRoute_dst) +XBT_PUBLIC_DATA(short int) surfxml_bypassRoute_dst_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_availability___file) AX_surfxml_cluster_availability___file; +#define A_surfxml_cluster_availability___file (surfxml_bufferstack + AX_surfxml_cluster_availability___file) +XBT_PUBLIC_DATA(short int) surfxml_cluster_availability___file_isset; +XBT_PUBLIC_DATA(AT_surfxml_mount_name) AX_surfxml_mount_name; +#define A_surfxml_mount_name (surfxml_bufferstack + AX_surfxml_mount_name) +XBT_PUBLIC_DATA(short int) surfxml_mount_name_isset; +XBT_PUBLIC_DATA(AT_surfxml_host_pstate) AX_surfxml_host_pstate; +#define A_surfxml_host_pstate (surfxml_bufferstack + AX_surfxml_host_pstate) +XBT_PUBLIC_DATA(short int) surfxml_host_pstate_isset; +XBT_PUBLIC_DATA(AT_surfxml_ASroute_dst) AX_surfxml_ASroute_dst; +#define A_surfxml_ASroute_dst (surfxml_bufferstack + AX_surfxml_ASroute_dst) +XBT_PUBLIC_DATA(short int) surfxml_ASroute_dst_isset; +XBT_PUBLIC_DATA(AT_surfxml_storage___type_content___type) AX_surfxml_storage___type_content___type; +#define A_surfxml_storage___type_content___type (surfxml_bufferstack + AX_surfxml_storage___type_content___type) +XBT_PUBLIC_DATA(short int) surfxml_storage___type_content___type_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_topo___parameters) AX_surfxml_cluster_topo___parameters; +#define A_surfxml_cluster_topo___parameters (surfxml_bufferstack + AX_surfxml_cluster_topo___parameters) +XBT_PUBLIC_DATA(short int) surfxml_cluster_topo___parameters_isset; +XBT_PUBLIC_DATA(AT_surfxml_storage_id) AX_surfxml_storage_id; +#define A_surfxml_storage_id (surfxml_bufferstack + AX_surfxml_storage_id) +XBT_PUBLIC_DATA(short int) surfxml_storage_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_core) AX_surfxml_cluster_core; +#define A_surfxml_cluster_core (surfxml_bufferstack + AX_surfxml_cluster_core) +XBT_PUBLIC_DATA(short int) surfxml_cluster_core_isset; +XBT_PUBLIC_DATA(AT_surfxml_AS_id) AX_surfxml_AS_id; +#define A_surfxml_AS_id (surfxml_bufferstack + AX_surfxml_AS_id) +XBT_PUBLIC_DATA(short int) surfxml_AS_id_isset; XBT_PUBLIC_DATA(AT_surfxml_peer_lat) AX_surfxml_peer_lat; #define A_surfxml_peer_lat (surfxml_bufferstack + AX_surfxml_peer_lat) XBT_PUBLIC_DATA(short int) surfxml_peer_lat_isset; -XBT_PUBLIC_DATA(AT_surfxml_process_on___failure) AX_surfxml_process_on___failure; -#define A_surfxml_process_on___failure AX_surfxml_process_on___failure -XBT_PUBLIC_DATA(short int) surfxml_process_on___failure_isset; -XBT_PUBLIC_DATA(AT_surfxml_link_latency___file) AX_surfxml_link_latency___file; -#define A_surfxml_link_latency___file (surfxml_bufferstack + AX_surfxml_link_latency___file) -XBT_PUBLIC_DATA(short int) surfxml_link_latency___file_isset; -XBT_PUBLIC_DATA(AT_surfxml_peer_availability___file) AX_surfxml_peer_availability___file; -#define A_surfxml_peer_availability___file (surfxml_bufferstack + AX_surfxml_peer_availability___file) -XBT_PUBLIC_DATA(short int) surfxml_peer_availability___file_isset; -XBT_PUBLIC_DATA(AT_surfxml_model___prop_value) AX_surfxml_model___prop_value; -#define A_surfxml_model___prop_value (surfxml_bufferstack + AX_surfxml_model___prop_value) -XBT_PUBLIC_DATA(short int) surfxml_model___prop_value_isset; -XBT_PUBLIC_DATA(AT_surfxml_link___ctn_direction) AX_surfxml_link___ctn_direction; -#define A_surfxml_link___ctn_direction AX_surfxml_link___ctn_direction -XBT_PUBLIC_DATA(short int) surfxml_link___ctn_direction_isset; -XBT_PUBLIC_DATA(AT_surfxml_host_state) AX_surfxml_host_state; -#define A_surfxml_host_state AX_surfxml_host_state -XBT_PUBLIC_DATA(short int) surfxml_host_state_isset; -XBT_PUBLIC_DATA(AT_surfxml_AS_id) AX_surfxml_AS_id; -#define A_surfxml_AS_id (surfxml_bufferstack + AX_surfxml_AS_id) -XBT_PUBLIC_DATA(short int) surfxml_AS_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_host_power) AX_surfxml_host_power; -#define A_surfxml_host_power (surfxml_bufferstack + AX_surfxml_host_power) -XBT_PUBLIC_DATA(short int) surfxml_host_power_isset; -XBT_PUBLIC_DATA(AT_surfxml_cabinet_suffix) AX_surfxml_cabinet_suffix; -#define A_surfxml_cabinet_suffix (surfxml_bufferstack + AX_surfxml_cabinet_suffix) -XBT_PUBLIC_DATA(short int) surfxml_cabinet_suffix_isset; -XBT_PUBLIC_DATA(AT_surfxml_gpu_name) AX_surfxml_gpu_name; -#define A_surfxml_gpu_name (surfxml_bufferstack + AX_surfxml_gpu_name) -XBT_PUBLIC_DATA(short int) surfxml_gpu_name_isset; -XBT_PUBLIC_DATA(AT_surfxml_router_id) AX_surfxml_router_id; -#define A_surfxml_router_id (surfxml_bufferstack + AX_surfxml_router_id) -XBT_PUBLIC_DATA(short int) surfxml_router_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_storage___type_id) AX_surfxml_storage___type_id; -#define A_surfxml_storage___type_id (surfxml_bufferstack + AX_surfxml_storage___type_id) -XBT_PUBLIC_DATA(short int) surfxml_storage___type_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_config_id) AX_surfxml_config_id; +#define A_surfxml_config_id (surfxml_bufferstack + AX_surfxml_config_id) +XBT_PUBLIC_DATA(short int) surfxml_config_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_ASroute_gw___dst) AX_surfxml_ASroute_gw___dst; +#define A_surfxml_ASroute_gw___dst (surfxml_bufferstack + AX_surfxml_ASroute_gw___dst) +XBT_PUBLIC_DATA(short int) surfxml_ASroute_gw___dst_isset; +XBT_PUBLIC_DATA(AT_surfxml_process_function) AX_surfxml_process_function; +#define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function) +XBT_PUBLIC_DATA(short int) surfxml_process_function_isset; +XBT_PUBLIC_DATA(AT_surfxml_link___ctn_id) AX_surfxml_link___ctn_id; +#define A_surfxml_link___ctn_id (surfxml_bufferstack + AX_surfxml_link___ctn_id) +XBT_PUBLIC_DATA(short int) surfxml_link___ctn_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_trace___connect_trace) AX_surfxml_trace___connect_trace; +#define A_surfxml_trace___connect_trace (surfxml_bufferstack + AX_surfxml_trace___connect_trace) +XBT_PUBLIC_DATA(short int) surfxml_trace___connect_trace_isset; +XBT_PUBLIC_DATA(AT_surfxml_route_dst) AX_surfxml_route_dst; +#define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst) +XBT_PUBLIC_DATA(short int) surfxml_route_dst_isset; +XBT_PUBLIC_DATA(AT_surfxml_random_std___deviation) AX_surfxml_random_std___deviation; +#define A_surfxml_random_std___deviation (surfxml_bufferstack + AX_surfxml_random_std___deviation) +XBT_PUBLIC_DATA(short int) surfxml_random_std___deviation_isset; XBT_PUBLIC_DATA(AT_surfxml_process_start___time) AX_surfxml_process_start___time; #define A_surfxml_process_start___time (surfxml_bufferstack + AX_surfxml_process_start___time) XBT_PUBLIC_DATA(short int) surfxml_process_start___time_isset; -XBT_PUBLIC_DATA(AT_surfxml_cabinet_bw) AX_surfxml_cabinet_bw; -#define A_surfxml_cabinet_bw (surfxml_bufferstack + AX_surfxml_cabinet_bw) -XBT_PUBLIC_DATA(short int) surfxml_cabinet_bw_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_suffix) AX_surfxml_cluster_suffix; -#define A_surfxml_cluster_suffix (surfxml_bufferstack + AX_surfxml_cluster_suffix) -XBT_PUBLIC_DATA(short int) surfxml_cluster_suffix_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_lat) AX_surfxml_cluster_lat; +#define A_surfxml_cluster_lat (surfxml_bufferstack + AX_surfxml_cluster_lat) +XBT_PUBLIC_DATA(short int) surfxml_cluster_lat_isset; +XBT_PUBLIC_DATA(AT_surfxml_storage___type_id) AX_surfxml_storage___type_id; +#define A_surfxml_storage___type_id (surfxml_bufferstack + AX_surfxml_storage___type_id) +XBT_PUBLIC_DATA(short int) surfxml_storage___type_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_trace_id) AX_surfxml_trace_id; +#define A_surfxml_trace_id (surfxml_bufferstack + AX_surfxml_trace_id) +XBT_PUBLIC_DATA(short int) surfxml_trace_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_gpu_name) AX_surfxml_gpu_name; +#define A_surfxml_gpu_name (surfxml_bufferstack + AX_surfxml_gpu_name) +XBT_PUBLIC_DATA(short int) surfxml_gpu_name_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_topology) AX_surfxml_cluster_topology; +#define A_surfxml_cluster_topology AX_surfxml_cluster_topology +XBT_PUBLIC_DATA(short int) surfxml_cluster_topology_isset; +XBT_PUBLIC_DATA(AT_surfxml_cabinet_suffix) AX_surfxml_cabinet_suffix; +#define A_surfxml_cabinet_suffix (surfxml_bufferstack + AX_surfxml_cabinet_suffix) +XBT_PUBLIC_DATA(short int) surfxml_cabinet_suffix_isset; +XBT_PUBLIC_DATA(AT_surfxml_peer_coordinates) AX_surfxml_peer_coordinates; +#define A_surfxml_peer_coordinates (surfxml_bufferstack + AX_surfxml_peer_coordinates) +XBT_PUBLIC_DATA(short int) surfxml_peer_coordinates_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_state___file) AX_surfxml_cluster_state___file; +#define A_surfxml_cluster_state___file (surfxml_bufferstack + AX_surfxml_cluster_state___file) +XBT_PUBLIC_DATA(short int) surfxml_cluster_state___file_isset; +XBT_PUBLIC_DATA(AT_surfxml_bypassASroute_gw___dst) AX_surfxml_bypassASroute_gw___dst; +#define A_surfxml_bypassASroute_gw___dst (surfxml_bufferstack + AX_surfxml_bypassASroute_gw___dst) +XBT_PUBLIC_DATA(short int) surfxml_bypassASroute_gw___dst_isset; +XBT_PUBLIC_DATA(AT_surfxml_storage_content___type) AX_surfxml_storage_content___type; +#define A_surfxml_storage_content___type (surfxml_bufferstack + AX_surfxml_storage_content___type) +XBT_PUBLIC_DATA(short int) surfxml_storage_content___type_isset; +XBT_PUBLIC_DATA(AT_surfxml_process_host) AX_surfxml_process_host; +#define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host) +XBT_PUBLIC_DATA(short int) surfxml_process_host_isset; +XBT_PUBLIC_DATA(AT_surfxml_ASroute_symmetrical) AX_surfxml_ASroute_symmetrical; +#define A_surfxml_ASroute_symmetrical AX_surfxml_ASroute_symmetrical +XBT_PUBLIC_DATA(short int) surfxml_ASroute_symmetrical_isset; +XBT_PUBLIC_DATA(AT_surfxml_trace_periodicity) AX_surfxml_trace_periodicity; +#define A_surfxml_trace_periodicity (surfxml_bufferstack + AX_surfxml_trace_periodicity) +XBT_PUBLIC_DATA(short int) surfxml_trace_periodicity_isset; +XBT_PUBLIC_DATA(AT_surfxml_include_file) AX_surfxml_include_file; +#define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file) +XBT_PUBLIC_DATA(short int) surfxml_include_file_isset; +XBT_PUBLIC_DATA(AT_surfxml_peer_bw___out) AX_surfxml_peer_bw___out; +#define A_surfxml_peer_bw___out (surfxml_bufferstack + AX_surfxml_peer_bw___out) +XBT_PUBLIC_DATA(short int) surfxml_peer_bw___out_isset; +XBT_PUBLIC_DATA(AT_surfxml_storage_attach) AX_surfxml_storage_attach; +#define A_surfxml_storage_attach (surfxml_bufferstack + AX_surfxml_storage_attach) +XBT_PUBLIC_DATA(short int) surfxml_storage_attach_isset; +XBT_PUBLIC_DATA(AT_surfxml_peer_power) AX_surfxml_peer_power; +#define A_surfxml_peer_power (surfxml_bufferstack + AX_surfxml_peer_power) +XBT_PUBLIC_DATA(short int) surfxml_peer_power_isset; +XBT_PUBLIC_DATA(AT_surfxml_route_src) AX_surfxml_route_src; +#define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src) +XBT_PUBLIC_DATA(short int) surfxml_route_src_isset; +XBT_PUBLIC_DATA(AT_surfxml_link_bandwidth___file) AX_surfxml_link_bandwidth___file; +#define A_surfxml_link_bandwidth___file (surfxml_bufferstack + AX_surfxml_link_bandwidth___file) +XBT_PUBLIC_DATA(short int) surfxml_link_bandwidth___file_isset; +XBT_PUBLIC_DATA(AT_surfxml_mount_storageId) AX_surfxml_mount_storageId; +#define A_surfxml_mount_storageId (surfxml_bufferstack + AX_surfxml_mount_storageId) +XBT_PUBLIC_DATA(short int) surfxml_mount_storageId_isset; XBT_PUBLIC_DATA(AT_surfxml_bypassASroute_dst) AX_surfxml_bypassASroute_dst; #define A_surfxml_bypassASroute_dst (surfxml_bufferstack + AX_surfxml_bypassASroute_dst) XBT_PUBLIC_DATA(short int) surfxml_bypassASroute_dst_isset; -XBT_PUBLIC_DATA(AT_surfxml_host___link_id) AX_surfxml_host___link_id; -#define A_surfxml_host___link_id (surfxml_bufferstack + AX_surfxml_host___link_id) -XBT_PUBLIC_DATA(short int) surfxml_host___link_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_model___prop_id) AX_surfxml_model___prop_id; -#define A_surfxml_model___prop_id (surfxml_bufferstack + AX_surfxml_model___prop_id) -XBT_PUBLIC_DATA(short int) surfxml_model___prop_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_ASroute_src) AX_surfxml_ASroute_src; -#define A_surfxml_ASroute_src (surfxml_bufferstack + AX_surfxml_ASroute_src) -XBT_PUBLIC_DATA(short int) surfxml_ASroute_src_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_prefix) AX_surfxml_cluster_prefix; -#define A_surfxml_cluster_prefix (surfxml_bufferstack + AX_surfxml_cluster_prefix) -XBT_PUBLIC_DATA(short int) surfxml_cluster_prefix_isset; -XBT_PUBLIC_DATA(AT_surfxml_cabinet_prefix) AX_surfxml_cabinet_prefix; -#define A_surfxml_cabinet_prefix (surfxml_bufferstack + AX_surfxml_cabinet_prefix) -XBT_PUBLIC_DATA(short int) surfxml_cabinet_prefix_isset; +XBT_PUBLIC_DATA(AT_surfxml_cabinet_power) AX_surfxml_cabinet_power; +#define A_surfxml_cabinet_power (surfxml_bufferstack + AX_surfxml_cabinet_power) +XBT_PUBLIC_DATA(short int) surfxml_cabinet_power_isset; XBT_PUBLIC_DATA(AT_surfxml_trace_file) AX_surfxml_trace_file; #define A_surfxml_trace_file (surfxml_bufferstack + AX_surfxml_trace_file) XBT_PUBLIC_DATA(short int) surfxml_trace_file_isset; -XBT_PUBLIC_DATA(AT_surfxml_link_sharing___policy) AX_surfxml_link_sharing___policy; -#define A_surfxml_link_sharing___policy AX_surfxml_link_sharing___policy -XBT_PUBLIC_DATA(short int) surfxml_link_sharing___policy_isset; -XBT_PUBLIC_DATA(AT_surfxml_storage_typeId) AX_surfxml_storage_typeId; -#define A_surfxml_storage_typeId (surfxml_bufferstack + AX_surfxml_storage_typeId) -XBT_PUBLIC_DATA(short int) surfxml_storage_typeId_isset; +XBT_PUBLIC_DATA(AT_surfxml_trace___connect_kind) AX_surfxml_trace___connect_kind; +#define A_surfxml_trace___connect_kind AX_surfxml_trace___connect_kind +XBT_PUBLIC_DATA(short int) surfxml_trace___connect_kind_isset; +XBT_PUBLIC_DATA(AT_surfxml_prop_value) AX_surfxml_prop_value; +#define A_surfxml_prop_value (surfxml_bufferstack + AX_surfxml_prop_value) +XBT_PUBLIC_DATA(short int) surfxml_prop_value_isset; +XBT_PUBLIC_DATA(AT_surfxml_link___ctn_direction) AX_surfxml_link___ctn_direction; +#define A_surfxml_link___ctn_direction AX_surfxml_link___ctn_direction +XBT_PUBLIC_DATA(short int) surfxml_link___ctn_direction_isset; +XBT_PUBLIC_DATA(AT_surfxml_random_radical) AX_surfxml_random_radical; +#define A_surfxml_random_radical (surfxml_bufferstack + AX_surfxml_random_radical) +XBT_PUBLIC_DATA(short int) surfxml_random_radical_isset; +XBT_PUBLIC_DATA(AT_surfxml_host_coordinates) AX_surfxml_host_coordinates; +#define A_surfxml_host_coordinates (surfxml_bufferstack + AX_surfxml_host_coordinates) +XBT_PUBLIC_DATA(short int) surfxml_host_coordinates_isset; +XBT_PUBLIC_DATA(AT_surfxml_prop_id) AX_surfxml_prop_id; +#define A_surfxml_prop_id (surfxml_bufferstack + AX_surfxml_prop_id) +XBT_PUBLIC_DATA(short int) surfxml_prop_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_host_id) AX_surfxml_host_id; +#define A_surfxml_host_id (surfxml_bufferstack + AX_surfxml_host_id) +XBT_PUBLIC_DATA(short int) surfxml_host_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_host_availability) AX_surfxml_host_availability; +#define A_surfxml_host_availability (surfxml_bufferstack + AX_surfxml_host_availability) +XBT_PUBLIC_DATA(short int) surfxml_host_availability_isset; +XBT_PUBLIC_DATA(AT_surfxml_storage___type_size) AX_surfxml_storage___type_size; +#define A_surfxml_storage___type_size (surfxml_bufferstack + AX_surfxml_storage___type_size) +XBT_PUBLIC_DATA(short int) surfxml_storage___type_size_isset; +XBT_PUBLIC_DATA(AT_surfxml_cabinet_prefix) AX_surfxml_cabinet_prefix; +#define A_surfxml_cabinet_prefix (surfxml_bufferstack + AX_surfxml_cabinet_prefix) +XBT_PUBLIC_DATA(short int) surfxml_cabinet_prefix_isset; +XBT_PUBLIC_DATA(AT_surfxml_host___link_up) AX_surfxml_host___link_up; +#define A_surfxml_host___link_up (surfxml_bufferstack + AX_surfxml_host___link_up) +XBT_PUBLIC_DATA(short int) surfxml_host___link_up_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_limiter___link) AX_surfxml_cluster_limiter___link; +#define A_surfxml_cluster_limiter___link (surfxml_bufferstack + AX_surfxml_cluster_limiter___link) +XBT_PUBLIC_DATA(short int) surfxml_cluster_limiter___link_isset; +XBT_PUBLIC_DATA(AT_surfxml_peer_bw___in) AX_surfxml_peer_bw___in; +#define A_surfxml_peer_bw___in (surfxml_bufferstack + AX_surfxml_peer_bw___in) +XBT_PUBLIC_DATA(short int) surfxml_peer_bw___in_isset; +XBT_PUBLIC_DATA(AT_surfxml_link_bandwidth) AX_surfxml_link_bandwidth; +#define A_surfxml_link_bandwidth (surfxml_bufferstack + AX_surfxml_link_bandwidth) +XBT_PUBLIC_DATA(short int) surfxml_link_bandwidth_isset; +XBT_PUBLIC_DATA(AT_surfxml_random_seed) AX_surfxml_random_seed; +#define A_surfxml_random_seed (surfxml_bufferstack + AX_surfxml_random_seed) +XBT_PUBLIC_DATA(short int) surfxml_random_seed_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_bw) AX_surfxml_cluster_bw; +#define A_surfxml_cluster_bw (surfxml_bufferstack + AX_surfxml_cluster_bw) +XBT_PUBLIC_DATA(short int) surfxml_cluster_bw_isset; +XBT_PUBLIC_DATA(AT_surfxml_cabinet_lat) AX_surfxml_cabinet_lat; +#define A_surfxml_cabinet_lat (surfxml_bufferstack + AX_surfxml_cabinet_lat) +XBT_PUBLIC_DATA(short int) surfxml_cabinet_lat_isset; +XBT_PUBLIC_DATA(AT_surfxml_bypassASroute_src) AX_surfxml_bypassASroute_src; +#define A_surfxml_bypassASroute_src (surfxml_bufferstack + AX_surfxml_bypassASroute_src) +XBT_PUBLIC_DATA(short int) surfxml_bypassASroute_src_isset; XBT_PUBLIC_DATA(AT_surfxml_random_min) AX_surfxml_random_min; #define A_surfxml_random_min (surfxml_bufferstack + AX_surfxml_random_min) XBT_PUBLIC_DATA(short int) surfxml_random_min_isset; -XBT_PUBLIC_DATA(AT_surfxml_link___ctn_id) AX_surfxml_link___ctn_id; -#define A_surfxml_link___ctn_id (surfxml_bufferstack + AX_surfxml_link___ctn_id) -XBT_PUBLIC_DATA(short int) surfxml_link___ctn_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_peer_bw___out) AX_surfxml_peer_bw___out; -#define A_surfxml_peer_bw___out (surfxml_bufferstack + AX_surfxml_peer_bw___out) -XBT_PUBLIC_DATA(short int) surfxml_peer_bw___out_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_availability___file) AX_surfxml_cluster_availability___file; -#define A_surfxml_cluster_availability___file (surfxml_bufferstack + AX_surfxml_cluster_availability___file) -XBT_PUBLIC_DATA(short int) surfxml_cluster_availability___file_isset; -XBT_PUBLIC_DATA(AT_surfxml_storage_content) AX_surfxml_storage_content; -#define A_surfxml_storage_content (surfxml_bufferstack + AX_surfxml_storage_content) -XBT_PUBLIC_DATA(short int) surfxml_storage_content_isset; -XBT_PUBLIC_DATA(AT_surfxml_process_kill___time) AX_surfxml_process_kill___time; -#define A_surfxml_process_kill___time (surfxml_bufferstack + AX_surfxml_process_kill___time) -XBT_PUBLIC_DATA(short int) surfxml_process_kill___time_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_bb___bw) AX_surfxml_cluster_bb___bw; -#define A_surfxml_cluster_bb___bw (surfxml_bufferstack + AX_surfxml_cluster_bb___bw) -XBT_PUBLIC_DATA(short int) surfxml_cluster_bb___bw_isset; -XBT_PUBLIC_DATA(AT_surfxml_host_pstate) AX_surfxml_host_pstate; -#define A_surfxml_host_pstate (surfxml_bufferstack + AX_surfxml_host_pstate) -XBT_PUBLIC_DATA(short int) surfxml_host_pstate_isset; -XBT_PUBLIC_DATA(AT_surfxml_argument_value) AX_surfxml_argument_value; -#define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value) -XBT_PUBLIC_DATA(short int) surfxml_argument_value_isset; +XBT_PUBLIC_DATA(AT_surfxml_cabinet_id) AX_surfxml_cabinet_id; +#define A_surfxml_cabinet_id (surfxml_bufferstack + AX_surfxml_cabinet_id) +XBT_PUBLIC_DATA(short int) surfxml_cabinet_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_bypassASroute_gw___src) AX_surfxml_bypassASroute_gw___src; +#define A_surfxml_bypassASroute_gw___src (surfxml_bufferstack + AX_surfxml_bypassASroute_gw___src) +XBT_PUBLIC_DATA(short int) surfxml_bypassASroute_gw___src_isset; +XBT_PUBLIC_DATA(AT_surfxml_process_on___failure) AX_surfxml_process_on___failure; +#define A_surfxml_process_on___failure AX_surfxml_process_on___failure +XBT_PUBLIC_DATA(short int) surfxml_process_on___failure_isset; +XBT_PUBLIC_DATA(AT_surfxml_platform_version) AX_surfxml_platform_version; +#define A_surfxml_platform_version (surfxml_bufferstack + AX_surfxml_platform_version) +XBT_PUBLIC_DATA(short int) surfxml_platform_version_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_bb___sharing___policy) AX_surfxml_cluster_bb___sharing___policy; +#define A_surfxml_cluster_bb___sharing___policy AX_surfxml_cluster_bb___sharing___policy +XBT_PUBLIC_DATA(short int) surfxml_cluster_bb___sharing___policy_isset; +XBT_PUBLIC_DATA(AT_surfxml_backbone_id) AX_surfxml_backbone_id; +#define A_surfxml_backbone_id (surfxml_bufferstack + AX_surfxml_backbone_id) +XBT_PUBLIC_DATA(short int) surfxml_backbone_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_model___prop_id) AX_surfxml_model___prop_id; +#define A_surfxml_model___prop_id (surfxml_bufferstack + AX_surfxml_model___prop_id) +XBT_PUBLIC_DATA(short int) surfxml_model___prop_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_sharing___policy) AX_surfxml_cluster_sharing___policy; +#define A_surfxml_cluster_sharing___policy AX_surfxml_cluster_sharing___policy +XBT_PUBLIC_DATA(short int) surfxml_cluster_sharing___policy_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_router___id) AX_surfxml_cluster_router___id; +#define A_surfxml_cluster_router___id (surfxml_bufferstack + AX_surfxml_cluster_router___id) +XBT_PUBLIC_DATA(short int) surfxml_cluster_router___id_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_loopback___lat) AX_surfxml_cluster_loopback___lat; +#define A_surfxml_cluster_loopback___lat (surfxml_bufferstack + AX_surfxml_cluster_loopback___lat) +XBT_PUBLIC_DATA(short int) surfxml_cluster_loopback___lat_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_radical) AX_surfxml_cluster_radical; +#define A_surfxml_cluster_radical (surfxml_bufferstack + AX_surfxml_cluster_radical) +XBT_PUBLIC_DATA(short int) surfxml_cluster_radical_isset; +XBT_PUBLIC_DATA(AT_surfxml_mstorage_name) AX_surfxml_mstorage_name; +#define A_surfxml_mstorage_name (surfxml_bufferstack + AX_surfxml_mstorage_name) +XBT_PUBLIC_DATA(short int) surfxml_mstorage_name_isset; +XBT_PUBLIC_DATA(AT_surfxml_peer_id) AX_surfxml_peer_id; +#define A_surfxml_peer_id (surfxml_bufferstack + AX_surfxml_peer_id) +XBT_PUBLIC_DATA(short int) surfxml_peer_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_peer_availability___file) AX_surfxml_peer_availability___file; +#define A_surfxml_peer_availability___file (surfxml_bufferstack + AX_surfxml_peer_availability___file) +XBT_PUBLIC_DATA(short int) surfxml_peer_availability___file_isset; XBT_PUBLIC_DATA(AT_surfxml_link_state) AX_surfxml_link_state; #define A_surfxml_link_state AX_surfxml_link_state -XBT_PUBLIC_DATA(short int) surfxml_link_state_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_loopback___bw) AX_surfxml_cluster_loopback___bw; -#define A_surfxml_cluster_loopback___bw (surfxml_bufferstack + AX_surfxml_cluster_loopback___bw) -XBT_PUBLIC_DATA(short int) surfxml_cluster_loopback___bw_isset; -XBT_PUBLIC_DATA(AT_surfxml_ASroute_gw___src) AX_surfxml_ASroute_gw___src; -#define A_surfxml_ASroute_gw___src (surfxml_bufferstack + AX_surfxml_ASroute_gw___src) -XBT_PUBLIC_DATA(short int) surfxml_ASroute_gw___src_isset; -XBT_PUBLIC_DATA(AT_surfxml_AS_routing) AX_surfxml_AS_routing; -#define A_surfxml_AS_routing AX_surfxml_AS_routing -XBT_PUBLIC_DATA(short int) surfxml_AS_routing_isset; -XBT_PUBLIC_DATA(AT_surfxml_link_bandwidth) AX_surfxml_link_bandwidth; -#define A_surfxml_link_bandwidth (surfxml_bufferstack + AX_surfxml_link_bandwidth) -XBT_PUBLIC_DATA(short int) surfxml_link_bandwidth_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_id) AX_surfxml_cluster_id; -#define A_surfxml_cluster_id (surfxml_bufferstack + AX_surfxml_cluster_id) -XBT_PUBLIC_DATA(short int) surfxml_cluster_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_peer_bw___in) AX_surfxml_peer_bw___in; -#define A_surfxml_peer_bw___in (surfxml_bufferstack + AX_surfxml_peer_bw___in) -XBT_PUBLIC_DATA(short int) surfxml_peer_bw___in_isset; +XBT_PUBLIC_DATA(short int) surfxml_link_state_isset; +XBT_PUBLIC_DATA(AT_surfxml_mstorage_typeId) AX_surfxml_mstorage_typeId; +#define A_surfxml_mstorage_typeId (surfxml_bufferstack + AX_surfxml_mstorage_typeId) +XBT_PUBLIC_DATA(short int) surfxml_mstorage_typeId_isset; +XBT_PUBLIC_DATA(AT_surfxml_storage_typeId) AX_surfxml_storage_typeId; +#define A_surfxml_storage_typeId (surfxml_bufferstack + AX_surfxml_storage_typeId) +XBT_PUBLIC_DATA(short int) surfxml_storage_typeId_isset; XBT_PUBLIC_DATA(AT_surfxml_random_mean) AX_surfxml_random_mean; #define A_surfxml_random_mean (surfxml_bufferstack + AX_surfxml_random_mean) XBT_PUBLIC_DATA(short int) surfxml_random_mean_isset; -XBT_PUBLIC_DATA(AT_surfxml_storage___type_size) AX_surfxml_storage___type_size; -#define A_surfxml_storage___type_size (surfxml_bufferstack + AX_surfxml_storage___type_size) -XBT_PUBLIC_DATA(short int) surfxml_storage___type_size_isset; -XBT_PUBLIC_DATA(AT_surfxml_storage_attach) AX_surfxml_storage_attach; -#define A_surfxml_storage_attach (surfxml_bufferstack + AX_surfxml_storage_attach) -XBT_PUBLIC_DATA(short int) surfxml_storage_attach_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_bb___lat) AX_surfxml_cluster_bb___lat; -#define A_surfxml_cluster_bb___lat (surfxml_bufferstack + AX_surfxml_cluster_bb___lat) -XBT_PUBLIC_DATA(short int) surfxml_cluster_bb___lat_isset; -XBT_PUBLIC_DATA(AT_surfxml_link_latency) AX_surfxml_link_latency; -#define A_surfxml_link_latency (surfxml_bufferstack + AX_surfxml_link_latency) -XBT_PUBLIC_DATA(short int) surfxml_link_latency_isset; XBT_PUBLIC_DATA(AT_surfxml_backbone_bandwidth) AX_surfxml_backbone_bandwidth; #define A_surfxml_backbone_bandwidth (surfxml_bufferstack + AX_surfxml_backbone_bandwidth) XBT_PUBLIC_DATA(short int) surfxml_backbone_bandwidth_isset; -XBT_PUBLIC_DATA(AT_surfxml_backbone_id) AX_surfxml_backbone_id; -#define A_surfxml_backbone_id (surfxml_bufferstack + AX_surfxml_backbone_id) -XBT_PUBLIC_DATA(short int) surfxml_backbone_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_trace___connect_kind) AX_surfxml_trace___connect_kind; -#define A_surfxml_trace___connect_kind AX_surfxml_trace___connect_kind -XBT_PUBLIC_DATA(short int) surfxml_trace___connect_kind_isset; -XBT_PUBLIC_DATA(AT_surfxml_cabinet_lat) AX_surfxml_cabinet_lat; -#define A_surfxml_cabinet_lat (surfxml_bufferstack + AX_surfxml_cabinet_lat) -XBT_PUBLIC_DATA(short int) surfxml_cabinet_lat_isset; -XBT_PUBLIC_DATA(AT_surfxml_random_seed) AX_surfxml_random_seed; -#define A_surfxml_random_seed (surfxml_bufferstack + AX_surfxml_random_seed) -XBT_PUBLIC_DATA(short int) surfxml_random_seed_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_state___file) AX_surfxml_cluster_state___file; -#define A_surfxml_cluster_state___file (surfxml_bufferstack + AX_surfxml_cluster_state___file) -XBT_PUBLIC_DATA(short int) surfxml_cluster_state___file_isset; -XBT_PUBLIC_DATA(AT_surfxml_link_bandwidth___file) AX_surfxml_link_bandwidth___file; -#define A_surfxml_link_bandwidth___file (surfxml_bufferstack + AX_surfxml_link_bandwidth___file) -XBT_PUBLIC_DATA(short int) surfxml_link_bandwidth___file_isset; -XBT_PUBLIC_DATA(AT_surfxml_storage___type_content) AX_surfxml_storage___type_content; -#define A_surfxml_storage___type_content (surfxml_bufferstack + AX_surfxml_storage___type_content) -XBT_PUBLIC_DATA(short int) surfxml_storage___type_content_isset; +XBT_PUBLIC_DATA(AT_surfxml_cabinet_radical) AX_surfxml_cabinet_radical; +#define A_surfxml_cabinet_radical (surfxml_bufferstack + AX_surfxml_cabinet_radical) +XBT_PUBLIC_DATA(short int) surfxml_cabinet_radical_isset; +XBT_PUBLIC_DATA(AT_surfxml_argument_value) AX_surfxml_argument_value; +#define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value) +XBT_PUBLIC_DATA(short int) surfxml_argument_value_isset; +XBT_PUBLIC_DATA(AT_surfxml_model___prop_value) AX_surfxml_model___prop_value; +#define A_surfxml_model___prop_value (surfxml_bufferstack + AX_surfxml_model___prop_value) +XBT_PUBLIC_DATA(short int) surfxml_model___prop_value_isset; +XBT_PUBLIC_DATA(AT_surfxml_host___link_down) AX_surfxml_host___link_down; +#define A_surfxml_host___link_down (surfxml_bufferstack + AX_surfxml_host___link_down) +XBT_PUBLIC_DATA(short int) surfxml_host___link_down_isset; +XBT_PUBLIC_DATA(AT_surfxml_host_power) AX_surfxml_host_power; +#define A_surfxml_host_power (surfxml_bufferstack + AX_surfxml_host_power) +XBT_PUBLIC_DATA(short int) surfxml_host_power_isset; +XBT_PUBLIC_DATA(AT_surfxml_process_kill___time) AX_surfxml_process_kill___time; +#define A_surfxml_process_kill___time (surfxml_bufferstack + AX_surfxml_process_kill___time) +XBT_PUBLIC_DATA(short int) surfxml_process_kill___time_isset; +XBT_PUBLIC_DATA(AT_surfxml_bypassRoute_src) AX_surfxml_bypassRoute_src; +#define A_surfxml_bypassRoute_src (surfxml_bufferstack + AX_surfxml_bypassRoute_src) +XBT_PUBLIC_DATA(short int) surfxml_bypassRoute_src_isset; XBT_PUBLIC_DATA(AT_surfxml_route_symmetrical) AX_surfxml_route_symmetrical; #define A_surfxml_route_symmetrical AX_surfxml_route_symmetrical XBT_PUBLIC_DATA(short int) surfxml_route_symmetrical_isset; -XBT_PUBLIC_DATA(AT_surfxml_random_id) AX_surfxml_random_id; -#define A_surfxml_random_id (surfxml_bufferstack + AX_surfxml_random_id) -XBT_PUBLIC_DATA(short int) surfxml_random_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_mstorage_name) AX_surfxml_mstorage_name; -#define A_surfxml_mstorage_name (surfxml_bufferstack + AX_surfxml_mstorage_name) -XBT_PUBLIC_DATA(short int) surfxml_mstorage_name_isset; -XBT_PUBLIC_DATA(AT_surfxml_random_max) AX_surfxml_random_max; -#define A_surfxml_random_max (surfxml_bufferstack + AX_surfxml_random_max) -XBT_PUBLIC_DATA(short int) surfxml_random_max_isset; +XBT_PUBLIC_DATA(AT_surfxml_storage___type_model) AX_surfxml_storage___type_model; +#define A_surfxml_storage___type_model (surfxml_bufferstack + AX_surfxml_storage___type_model) +XBT_PUBLIC_DATA(short int) surfxml_storage___type_model_isset; +XBT_PUBLIC_DATA(AT_surfxml_cluster_bb___lat) AX_surfxml_cluster_bb___lat; +#define A_surfxml_cluster_bb___lat (surfxml_bufferstack + AX_surfxml_cluster_bb___lat) +XBT_PUBLIC_DATA(short int) surfxml_cluster_bb___lat_isset; +XBT_PUBLIC_DATA(AT_surfxml_link_latency) AX_surfxml_link_latency; +#define A_surfxml_link_latency (surfxml_bufferstack + AX_surfxml_link_latency) +XBT_PUBLIC_DATA(short int) surfxml_link_latency_isset; +XBT_PUBLIC_DATA(AT_surfxml_router_id) AX_surfxml_router_id; +#define A_surfxml_router_id (surfxml_bufferstack + AX_surfxml_router_id) +XBT_PUBLIC_DATA(short int) surfxml_router_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_link_latency___file) AX_surfxml_link_latency___file; +#define A_surfxml_link_latency___file (surfxml_bufferstack + AX_surfxml_link_latency___file) +XBT_PUBLIC_DATA(short int) surfxml_link_latency___file_isset; +XBT_PUBLIC_DATA(AT_surfxml_host_state___file) AX_surfxml_host_state___file; +#define A_surfxml_host_state___file (surfxml_bufferstack + AX_surfxml_host_state___file) +XBT_PUBLIC_DATA(short int) surfxml_host_state___file_isset; XBT_PUBLIC_DATA(AT_surfxml_link_id) AX_surfxml_link_id; #define A_surfxml_link_id (surfxml_bufferstack + AX_surfxml_link_id) XBT_PUBLIC_DATA(short int) surfxml_link_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_topology) AX_surfxml_cluster_topology; -#define A_surfxml_cluster_topology AX_surfxml_cluster_topology -XBT_PUBLIC_DATA(short int) surfxml_cluster_topology_isset; -XBT_PUBLIC_DATA(AT_surfxml_process_host) AX_surfxml_process_host; -#define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host) -XBT_PUBLIC_DATA(short int) surfxml_process_host_isset; -XBT_PUBLIC_DATA(AT_surfxml_cabinet_id) AX_surfxml_cabinet_id; -#define A_surfxml_cabinet_id (surfxml_bufferstack + AX_surfxml_cabinet_id) -XBT_PUBLIC_DATA(short int) surfxml_cabinet_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_host_availability___file) AX_surfxml_host_availability___file; -#define A_surfxml_host_availability___file (surfxml_bufferstack + AX_surfxml_host_availability___file) -XBT_PUBLIC_DATA(short int) surfxml_host_availability___file_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_lat) AX_surfxml_cluster_lat; -#define A_surfxml_cluster_lat (surfxml_bufferstack + AX_surfxml_cluster_lat) -XBT_PUBLIC_DATA(short int) surfxml_cluster_lat_isset; -XBT_PUBLIC_DATA(AT_surfxml_router_coordinates) AX_surfxml_router_coordinates; -#define A_surfxml_router_coordinates (surfxml_bufferstack + AX_surfxml_router_coordinates) -XBT_PUBLIC_DATA(short int) surfxml_router_coordinates_isset; -XBT_PUBLIC_DATA(AT_surfxml_trace_periodicity) AX_surfxml_trace_periodicity; -#define A_surfxml_trace_periodicity (surfxml_bufferstack + AX_surfxml_trace_periodicity) -XBT_PUBLIC_DATA(short int) surfxml_trace_periodicity_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_bb___sharing___policy) AX_surfxml_cluster_bb___sharing___policy; -#define A_surfxml_cluster_bb___sharing___policy AX_surfxml_cluster_bb___sharing___policy -XBT_PUBLIC_DATA(short int) surfxml_cluster_bb___sharing___policy_isset; XBT_PUBLIC_DATA(AT_surfxml_peer_state___file) AX_surfxml_peer_state___file; #define A_surfxml_peer_state___file (surfxml_bufferstack + AX_surfxml_peer_state___file) XBT_PUBLIC_DATA(short int) surfxml_peer_state___file_isset; -XBT_PUBLIC_DATA(AT_surfxml_peer_coordinates) AX_surfxml_peer_coordinates; -#define A_surfxml_peer_coordinates (surfxml_bufferstack + AX_surfxml_peer_coordinates) -XBT_PUBLIC_DATA(short int) surfxml_peer_coordinates_isset; -XBT_PUBLIC_DATA(AT_surfxml_bypassASroute_src) AX_surfxml_bypassASroute_src; -#define A_surfxml_bypassASroute_src (surfxml_bufferstack + AX_surfxml_bypassASroute_src) -XBT_PUBLIC_DATA(short int) surfxml_bypassASroute_src_isset; -XBT_PUBLIC_DATA(AT_surfxml_prop_value) AX_surfxml_prop_value; -#define A_surfxml_prop_value (surfxml_bufferstack + AX_surfxml_prop_value) -XBT_PUBLIC_DATA(short int) surfxml_prop_value_isset; -XBT_PUBLIC_DATA(AT_surfxml_mstorage_typeId) AX_surfxml_mstorage_typeId; -#define A_surfxml_mstorage_typeId (surfxml_bufferstack + AX_surfxml_mstorage_typeId) -XBT_PUBLIC_DATA(short int) surfxml_mstorage_typeId_isset; -XBT_PUBLIC_DATA(AT_surfxml_ASroute_dst) AX_surfxml_ASroute_dst; -#define A_surfxml_ASroute_dst (surfxml_bufferstack + AX_surfxml_ASroute_dst) -XBT_PUBLIC_DATA(short int) surfxml_ASroute_dst_isset; +XBT_PUBLIC_DATA(AT_surfxml_ASroute_gw___src) AX_surfxml_ASroute_gw___src; +#define A_surfxml_ASroute_gw___src (surfxml_bufferstack + AX_surfxml_ASroute_gw___src) +XBT_PUBLIC_DATA(short int) surfxml_ASroute_gw___src_isset; +XBT_PUBLIC_DATA(AT_surfxml_random_id) AX_surfxml_random_id; +#define A_surfxml_random_id (surfxml_bufferstack + AX_surfxml_random_id) +XBT_PUBLIC_DATA(short int) surfxml_random_id_isset; +XBT_PUBLIC_DATA(AT_surfxml_backbone_latency) AX_surfxml_backbone_latency; +#define A_surfxml_backbone_latency (surfxml_bufferstack + AX_surfxml_backbone_latency) +XBT_PUBLIC_DATA(short int) surfxml_backbone_latency_isset; XBT_PUBLIC_DATA(AT_surfxml_link_state___file) AX_surfxml_link_state___file; #define A_surfxml_link_state___file (surfxml_bufferstack + AX_surfxml_link_state___file) XBT_PUBLIC_DATA(short int) surfxml_link_state___file_isset; -XBT_PUBLIC_DATA(AT_surfxml_random_radical) AX_surfxml_random_radical; -#define A_surfxml_random_radical (surfxml_bufferstack + AX_surfxml_random_radical) -XBT_PUBLIC_DATA(short int) surfxml_random_radical_isset; -XBT_PUBLIC_DATA(AT_surfxml_mount_storageId) AX_surfxml_mount_storageId; -#define A_surfxml_mount_storageId (surfxml_bufferstack + AX_surfxml_mount_storageId) -XBT_PUBLIC_DATA(short int) surfxml_mount_storageId_isset; -XBT_PUBLIC_DATA(AT_surfxml_bypassASroute_gw___src) AX_surfxml_bypassASroute_gw___src; -#define A_surfxml_bypassASroute_gw___src (surfxml_bufferstack + AX_surfxml_bypassASroute_gw___src) -XBT_PUBLIC_DATA(short int) surfxml_bypassASroute_gw___src_isset; -XBT_PUBLIC_DATA(AT_surfxml_trace___connect_trace) AX_surfxml_trace___connect_trace; -#define A_surfxml_trace___connect_trace (surfxml_bufferstack + AX_surfxml_trace___connect_trace) -XBT_PUBLIC_DATA(short int) surfxml_trace___connect_trace_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_power) AX_surfxml_cluster_power; -#define A_surfxml_cluster_power (surfxml_bufferstack + AX_surfxml_cluster_power) -XBT_PUBLIC_DATA(short int) surfxml_cluster_power_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_topo___parameters) AX_surfxml_cluster_topo___parameters; -#define A_surfxml_cluster_topo___parameters (surfxml_bufferstack + AX_surfxml_cluster_topo___parameters) -XBT_PUBLIC_DATA(short int) surfxml_cluster_topo___parameters_isset; -XBT_PUBLIC_DATA(AT_surfxml_process_function) AX_surfxml_process_function; -#define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function) -XBT_PUBLIC_DATA(short int) surfxml_process_function_isset; -XBT_PUBLIC_DATA(AT_surfxml_peer_id) AX_surfxml_peer_id; -#define A_surfxml_peer_id (surfxml_bufferstack + AX_surfxml_peer_id) -XBT_PUBLIC_DATA(short int) surfxml_peer_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_cabinet_radical) AX_surfxml_cabinet_radical; -#define A_surfxml_cabinet_radical (surfxml_bufferstack + AX_surfxml_cabinet_radical) -XBT_PUBLIC_DATA(short int) surfxml_cabinet_radical_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_loopback___lat) AX_surfxml_cluster_loopback___lat; -#define A_surfxml_cluster_loopback___lat (surfxml_bufferstack + AX_surfxml_cluster_loopback___lat) -XBT_PUBLIC_DATA(short int) surfxml_cluster_loopback___lat_isset; -XBT_PUBLIC_DATA(AT_surfxml_storage_content___type) AX_surfxml_storage_content___type; -#define A_surfxml_storage_content___type (surfxml_bufferstack + AX_surfxml_storage_content___type) -XBT_PUBLIC_DATA(short int) surfxml_storage_content___type_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_router___id) AX_surfxml_cluster_router___id; -#define A_surfxml_cluster_router___id (surfxml_bufferstack + AX_surfxml_cluster_router___id) -XBT_PUBLIC_DATA(short int) surfxml_cluster_router___id_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_sharing___policy) AX_surfxml_cluster_sharing___policy; -#define A_surfxml_cluster_sharing___policy AX_surfxml_cluster_sharing___policy -XBT_PUBLIC_DATA(short int) surfxml_cluster_sharing___policy_isset; -XBT_PUBLIC_DATA(AT_surfxml_bypassRoute_dst) AX_surfxml_bypassRoute_dst; -#define A_surfxml_bypassRoute_dst (surfxml_bufferstack + AX_surfxml_bypassRoute_dst) -XBT_PUBLIC_DATA(short int) surfxml_bypassRoute_dst_isset; -XBT_PUBLIC_DATA(AT_surfxml_cabinet_power) AX_surfxml_cabinet_power; -#define A_surfxml_cabinet_power (surfxml_bufferstack + AX_surfxml_cabinet_power) -XBT_PUBLIC_DATA(short int) surfxml_cabinet_power_isset; +XBT_PUBLIC_DATA(AT_surfxml_ASroute_src) AX_surfxml_ASroute_src; +#define A_surfxml_ASroute_src (surfxml_bufferstack + AX_surfxml_ASroute_src) +XBT_PUBLIC_DATA(short int) surfxml_ASroute_src_isset; +XBT_PUBLIC_DATA(AT_surfxml_link_sharing___policy) AX_surfxml_link_sharing___policy; +#define A_surfxml_link_sharing___policy AX_surfxml_link_sharing___policy +XBT_PUBLIC_DATA(short int) surfxml_link_sharing___policy_isset; +XBT_PUBLIC_DATA(AT_surfxml_storage_content) AX_surfxml_storage_content; +#define A_surfxml_storage_content (surfxml_bufferstack + AX_surfxml_storage_content) +XBT_PUBLIC_DATA(short int) surfxml_storage_content_isset; XBT_PUBLIC_DATA(AT_surfxml_host_core) AX_surfxml_host_core; #define A_surfxml_host_core (surfxml_bufferstack + AX_surfxml_host_core) XBT_PUBLIC_DATA(short int) surfxml_host_core_isset; -XBT_PUBLIC_DATA(AT_surfxml_host_availability) AX_surfxml_host_availability; -#define A_surfxml_host_availability (surfxml_bufferstack + AX_surfxml_host_availability) -XBT_PUBLIC_DATA(short int) surfxml_host_availability_isset; -XBT_PUBLIC_DATA(AT_surfxml_storage___type_model) AX_surfxml_storage___type_model; -#define A_surfxml_storage___type_model (surfxml_bufferstack + AX_surfxml_storage___type_model) -XBT_PUBLIC_DATA(short int) surfxml_storage___type_model_isset; -XBT_PUBLIC_DATA(AT_surfxml_bypassRoute_src) AX_surfxml_bypassRoute_src; -#define A_surfxml_bypassRoute_src (surfxml_bufferstack + AX_surfxml_bypassRoute_src) -XBT_PUBLIC_DATA(short int) surfxml_bypassRoute_src_isset; -XBT_PUBLIC_DATA(AT_surfxml_backbone_latency) AX_surfxml_backbone_latency; -#define A_surfxml_backbone_latency (surfxml_bufferstack + AX_surfxml_backbone_latency) -XBT_PUBLIC_DATA(short int) surfxml_backbone_latency_isset; -XBT_PUBLIC_DATA(AT_surfxml_route_src) AX_surfxml_route_src; -#define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src) -XBT_PUBLIC_DATA(short int) surfxml_route_src_isset; -XBT_PUBLIC_DATA(AT_surfxml_storage_id) AX_surfxml_storage_id; -#define A_surfxml_storage_id (surfxml_bufferstack + AX_surfxml_storage_id) -XBT_PUBLIC_DATA(short int) surfxml_storage_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_storage___type_content___type) AX_surfxml_storage___type_content___type; -#define A_surfxml_storage___type_content___type (surfxml_bufferstack + AX_surfxml_storage___type_content___type) -XBT_PUBLIC_DATA(short int) surfxml_storage___type_content___type_isset; -XBT_PUBLIC_DATA(AT_surfxml_host_coordinates) AX_surfxml_host_coordinates; -#define A_surfxml_host_coordinates (surfxml_bufferstack + AX_surfxml_host_coordinates) -XBT_PUBLIC_DATA(short int) surfxml_host_coordinates_isset; -XBT_PUBLIC_DATA(AT_surfxml_trace_id) AX_surfxml_trace_id; -#define A_surfxml_trace_id (surfxml_bufferstack + AX_surfxml_trace_id) -XBT_PUBLIC_DATA(short int) surfxml_trace_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_peer_power) AX_surfxml_peer_power; -#define A_surfxml_peer_power (surfxml_bufferstack + AX_surfxml_peer_power) -XBT_PUBLIC_DATA(short int) surfxml_peer_power_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_radical) AX_surfxml_cluster_radical; -#define A_surfxml_cluster_radical (surfxml_bufferstack + AX_surfxml_cluster_radical) -XBT_PUBLIC_DATA(short int) surfxml_cluster_radical_isset; -XBT_PUBLIC_DATA(AT_surfxml_config_id) AX_surfxml_config_id; -#define A_surfxml_config_id (surfxml_bufferstack + AX_surfxml_config_id) -XBT_PUBLIC_DATA(short int) surfxml_config_id_isset; -XBT_PUBLIC_DATA(AT_surfxml_bypassASroute_gw___dst) AX_surfxml_bypassASroute_gw___dst; -#define A_surfxml_bypassASroute_gw___dst (surfxml_bufferstack + AX_surfxml_bypassASroute_gw___dst) -XBT_PUBLIC_DATA(short int) surfxml_bypassASroute_gw___dst_isset; -XBT_PUBLIC_DATA(AT_surfxml_host___link_down) AX_surfxml_host___link_down; -#define A_surfxml_host___link_down (surfxml_bufferstack + AX_surfxml_host___link_down) -XBT_PUBLIC_DATA(short int) surfxml_host___link_down_isset; -XBT_PUBLIC_DATA(AT_surfxml_include_file) AX_surfxml_include_file; -#define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file) -XBT_PUBLIC_DATA(short int) surfxml_include_file_isset; -XBT_PUBLIC_DATA(AT_surfxml_random_std___deviation) AX_surfxml_random_std___deviation; -#define A_surfxml_random_std___deviation (surfxml_bufferstack + AX_surfxml_random_std___deviation) -XBT_PUBLIC_DATA(short int) surfxml_random_std___deviation_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_core) AX_surfxml_cluster_core; -#define A_surfxml_cluster_core (surfxml_bufferstack + AX_surfxml_cluster_core) -XBT_PUBLIC_DATA(short int) surfxml_cluster_core_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_limiter___link) AX_surfxml_cluster_limiter___link; -#define A_surfxml_cluster_limiter___link (surfxml_bufferstack + AX_surfxml_cluster_limiter___link) -XBT_PUBLIC_DATA(short int) surfxml_cluster_limiter___link_isset; -XBT_PUBLIC_DATA(AT_surfxml_host_state___file) AX_surfxml_host_state___file; -#define A_surfxml_host_state___file (surfxml_bufferstack + AX_surfxml_host_state___file) -XBT_PUBLIC_DATA(short int) surfxml_host_state___file_isset; -XBT_PUBLIC_DATA(AT_surfxml_route_dst) AX_surfxml_route_dst; -#define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst) -XBT_PUBLIC_DATA(short int) surfxml_route_dst_isset; -XBT_PUBLIC_DATA(AT_surfxml_cluster_bw) AX_surfxml_cluster_bw; -#define A_surfxml_cluster_bw (surfxml_bufferstack + AX_surfxml_cluster_bw) -XBT_PUBLIC_DATA(short int) surfxml_cluster_bw_isset; -XBT_PUBLIC_DATA(AT_surfxml_platform_version) AX_surfxml_platform_version; -#define A_surfxml_platform_version (surfxml_bufferstack + AX_surfxml_platform_version) -XBT_PUBLIC_DATA(short int) surfxml_platform_version_isset; /* XML application utilities. */ XBT_PUBLIC(int) surfxml_element_context(int); diff --git a/include/surf/surfxml_parse.h b/include/surf/surfxml_parse.h index 8431616dfd..de4fe2634f 100644 --- a/include/surf/surfxml_parse.h +++ b/include/surf/surfxml_parse.h @@ -13,6 +13,12 @@ #include "xbt/dict.h" #include "surf/simgrid_dtd.h" + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + SG_BEGIN_DECL() XBT_PUBLIC(void) surf_parse_open(const char *file); @@ -34,7 +40,7 @@ XBT_PUBLIC(int) surf_parse_lex(void); XBT_PUBLIC(int) surf_parse_get_lineno(void); XBT_PUBLIC(FILE *) surf_parse_get_in(void); XBT_PUBLIC(FILE *) surf_parse_get_out(void); -XBT_PUBLIC(int) surf_parse_get_leng(void); +XBT_PUBLIC(yy_size_t) surf_parse_get_leng(void); XBT_PUBLIC(char *) surf_parse_get_text(void); XBT_PUBLIC(void) surf_parse_set_lineno(int line_number); XBT_PUBLIC(void) surf_parse_set_in(FILE * in_str); diff --git a/include/xbt/graphxml.h b/include/xbt/graphxml.h index 6c925086b6..fe4e654081 100644 --- a/include/xbt/graphxml.h +++ b/include/xbt/graphxml.h @@ -56,70 +56,70 @@ XBT_PUBLIC(void) STag_graphxml_edge(void); XBT_PUBLIC(void) ETag_graphxml_edge(void); /* XML application data. */ -typedef int AT_graphxml_node_name; -#define AU_graphxml_node_name NULL +typedef int AT_graphxml_node_position___x; +#define AU_graphxml_node_position___x NULL +typedef int AT_graphxml_node_data; +#define AU_graphxml_node_data NULL typedef int AT_graphxml_edge_source; #define AU_graphxml_edge_source NULL typedef int AT_graphxml_node_position___y; #define AU_graphxml_node_position___y NULL -typedef int AT_graphxml_node_position___x; -#define AU_graphxml_node_position___x NULL -typedef int AT_graphxml_edge_data; -#define AU_graphxml_edge_data NULL -typedef int AT_graphxml_edge_target; -#define AU_graphxml_edge_target NULL typedef enum { AU_graphxml_graph_isDirected, A_graphxml_graph_isDirected_true,A_graphxml_graph_isDirected_false } AT_graphxml_graph_isDirected; -typedef int AT_graphxml_node_label; -#define AU_graphxml_node_label NULL -typedef int AT_graphxml_node_data; -#define AU_graphxml_node_data NULL typedef int AT_graphxml_edge_label; #define AU_graphxml_edge_label NULL typedef int AT_graphxml_edge_length; #define AU_graphxml_edge_length NULL +typedef int AT_graphxml_node_name; +#define AU_graphxml_node_name NULL typedef int AT_graphxml_edge_name; #define AU_graphxml_edge_name NULL +typedef int AT_graphxml_edge_data; +#define AU_graphxml_edge_data NULL +typedef int AT_graphxml_edge_target; +#define AU_graphxml_edge_target NULL +typedef int AT_graphxml_node_label; +#define AU_graphxml_node_label NULL /* FleXML-provided data. */ XBT_PUBLIC_DATA(int) graphxml_pcdata_ix; XBT_PUBLIC_DATA(char *) graphxml_bufferstack; #define graphxml_pcdata (graphxml_bufferstack + graphxml_pcdata_ix) -XBT_PUBLIC_DATA(AT_graphxml_node_name) AX_graphxml_node_name; -#define A_graphxml_node_name (graphxml_bufferstack + AX_graphxml_node_name) -XBT_PUBLIC_DATA(short int) graphxml_node_name_isset; +XBT_PUBLIC_DATA(AT_graphxml_node_position___x) AX_graphxml_node_position___x; +#define A_graphxml_node_position___x (graphxml_bufferstack + AX_graphxml_node_position___x) +XBT_PUBLIC_DATA(short int) graphxml_node_position___x_isset; +XBT_PUBLIC_DATA(AT_graphxml_node_data) AX_graphxml_node_data; +#define A_graphxml_node_data (graphxml_bufferstack + AX_graphxml_node_data) +XBT_PUBLIC_DATA(short int) graphxml_node_data_isset; XBT_PUBLIC_DATA(AT_graphxml_edge_source) AX_graphxml_edge_source; #define A_graphxml_edge_source (graphxml_bufferstack + AX_graphxml_edge_source) XBT_PUBLIC_DATA(short int) graphxml_edge_source_isset; XBT_PUBLIC_DATA(AT_graphxml_node_position___y) AX_graphxml_node_position___y; #define A_graphxml_node_position___y (graphxml_bufferstack + AX_graphxml_node_position___y) XBT_PUBLIC_DATA(short int) graphxml_node_position___y_isset; -XBT_PUBLIC_DATA(AT_graphxml_node_position___x) AX_graphxml_node_position___x; -#define A_graphxml_node_position___x (graphxml_bufferstack + AX_graphxml_node_position___x) -XBT_PUBLIC_DATA(short int) graphxml_node_position___x_isset; -XBT_PUBLIC_DATA(AT_graphxml_edge_data) AX_graphxml_edge_data; -#define A_graphxml_edge_data (graphxml_bufferstack + AX_graphxml_edge_data) -XBT_PUBLIC_DATA(short int) graphxml_edge_data_isset; -XBT_PUBLIC_DATA(AT_graphxml_edge_target) AX_graphxml_edge_target; -#define A_graphxml_edge_target (graphxml_bufferstack + AX_graphxml_edge_target) -XBT_PUBLIC_DATA(short int) graphxml_edge_target_isset; XBT_PUBLIC_DATA(AT_graphxml_graph_isDirected) AX_graphxml_graph_isDirected; #define A_graphxml_graph_isDirected AX_graphxml_graph_isDirected XBT_PUBLIC_DATA(short int) graphxml_graph_isDirected_isset; -XBT_PUBLIC_DATA(AT_graphxml_node_label) AX_graphxml_node_label; -#define A_graphxml_node_label (graphxml_bufferstack + AX_graphxml_node_label) -XBT_PUBLIC_DATA(short int) graphxml_node_label_isset; -XBT_PUBLIC_DATA(AT_graphxml_node_data) AX_graphxml_node_data; -#define A_graphxml_node_data (graphxml_bufferstack + AX_graphxml_node_data) -XBT_PUBLIC_DATA(short int) graphxml_node_data_isset; XBT_PUBLIC_DATA(AT_graphxml_edge_label) AX_graphxml_edge_label; #define A_graphxml_edge_label (graphxml_bufferstack + AX_graphxml_edge_label) XBT_PUBLIC_DATA(short int) graphxml_edge_label_isset; XBT_PUBLIC_DATA(AT_graphxml_edge_length) AX_graphxml_edge_length; #define A_graphxml_edge_length (graphxml_bufferstack + AX_graphxml_edge_length) XBT_PUBLIC_DATA(short int) graphxml_edge_length_isset; +XBT_PUBLIC_DATA(AT_graphxml_node_name) AX_graphxml_node_name; +#define A_graphxml_node_name (graphxml_bufferstack + AX_graphxml_node_name) +XBT_PUBLIC_DATA(short int) graphxml_node_name_isset; XBT_PUBLIC_DATA(AT_graphxml_edge_name) AX_graphxml_edge_name; #define A_graphxml_edge_name (graphxml_bufferstack + AX_graphxml_edge_name) XBT_PUBLIC_DATA(short int) graphxml_edge_name_isset; +XBT_PUBLIC_DATA(AT_graphxml_edge_data) AX_graphxml_edge_data; +#define A_graphxml_edge_data (graphxml_bufferstack + AX_graphxml_edge_data) +XBT_PUBLIC_DATA(short int) graphxml_edge_data_isset; +XBT_PUBLIC_DATA(AT_graphxml_edge_target) AX_graphxml_edge_target; +#define A_graphxml_edge_target (graphxml_bufferstack + AX_graphxml_edge_target) +XBT_PUBLIC_DATA(short int) graphxml_edge_target_isset; +XBT_PUBLIC_DATA(AT_graphxml_node_label) AX_graphxml_node_label; +#define A_graphxml_node_label (graphxml_bufferstack + AX_graphxml_node_label) +XBT_PUBLIC_DATA(short int) graphxml_node_label_isset; /* XML application utilities. */ XBT_PUBLIC(int) graphxml_element_context(int); diff --git a/include/xbt/graphxml_parse.h b/include/xbt/graphxml_parse.h index c10c02922f..3811bc3e56 100644 --- a/include/xbt/graphxml_parse.h +++ b/include/xbt/graphxml_parse.h @@ -12,6 +12,11 @@ #include "xbt/graphxml.h" #include "simgrid_config.h" +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + /* Entry-point of the graphxml parser. */ extern int_f_void_t xbt_graph_parse; @@ -34,7 +39,7 @@ XBT_PUBLIC(int) xbt_graph_parse_lex(void); XBT_PUBLIC(int) xbt_graph_parse_get_lineno(void); XBT_PUBLIC(FILE *) xbt_graph_parse_get_in(void); XBT_PUBLIC(FILE *) xbt_graph_parse_get_out(void); -XBT_PUBLIC(int) xbt_graph_parse_get_leng(void); +XBT_PUBLIC(yy_size_t) xbt_graph_parse_get_leng(void); XBT_PUBLIC(char *) xbt_graph_parse_get_text(void); XBT_PUBLIC(void) xbt_graph_parse_set_lineno(int line_number); XBT_PUBLIC(void) xbt_graph_parse_set_in(FILE * in_str); diff --git a/include/xbt/log.h b/include/xbt/log.h index c33d0ff2c1..6589249b24 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -91,7 +91,7 @@ typedef enum { #define _XBT_LOG_CONCAT(x, y) x ## y #define _XBT_LOG_CONCAT2(x, y) _XBT_LOG_CONCAT(x, y) /* Apparently, constructor priorities are not supported by gcc on Macs */ -#if __GNUC__ && __APPLE__ +#if defined(__GNUC__) && defined(__APPLE__) # define _XBT_LOGV_CTOR_ATTRIBUTE #else # define _XBT_LOGV_CTOR_ATTRIBUTE _XBT_GNUC_CONSTRUCTOR(600) diff --git a/include/xbt/synchro_core.h b/include/xbt/synchro_core.h index c41c26c648..d4274884c7 100644 --- a/include/xbt/synchro_core.h +++ b/include/xbt/synchro_core.h @@ -106,6 +106,13 @@ XBT_PUBLIC(void) xbt_cond_broadcast(xbt_cond_t cond); /** @brief Destroys the given mutex variable */ XBT_PUBLIC(void) xbt_cond_destroy(xbt_cond_t cond); + +#define XBT_BARRIER_SERIAL_PROCESS -1 +typedef struct s_xbt_bar_ *xbt_bar_t; +XBT_PUBLIC(xbt_bar_t) xbt_barrier_init( unsigned int count); +XBT_PUBLIC(void) xbt_barrier_destroy(xbt_bar_t bar); +XBT_PUBLIC(int) xbt_barrier_wait(xbt_bar_t bar); + /** @} */ SG_END_DECL() diff --git a/include/xbt/sysdep.h b/include/xbt/sysdep.h index 390ef24a7d..4b901a3592 100644 --- a/include/xbt/sysdep.h +++ b/include/xbt/sysdep.h @@ -31,17 +31,7 @@ SG_BEGIN_DECL() * @{ */ /** @brief Kill the program in silence */ -#ifdef COVERAGE -/* Call __gcov_flush on abort when compiling with coverage options. */ -#define xbt_abort() \ - do { \ - extern void __gcov_flush(void); \ - __gcov_flush(); \ - abort(); \ - } while (0) -#else -#define xbt_abort() abort() -#endif +XBT_PUBLIC(void) xbt_abort(void) _XBT_GNUC_NORETURN; /** * @brief Kill the program with an error message diff --git a/src/bindings/java/jmsg_process.c b/src/bindings/java/jmsg_process.c index ed259b7440..7bb72ea46a 100644 --- a/src/bindings/java/jmsg_process.c +++ b/src/bindings/java/jmsg_process.c @@ -405,12 +405,5 @@ Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , jobject jprocess, jdoubl JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) { - /* The next test on SimGrid version is to ensure that this still compiles with SG 3.8 while the C function were added in SG 3.9 only. - * This kind of pimple becomes mandatory when you get so slow to release the java version that it begins evolving further after the C release date. - */ -#if SIMGRID_VERSION >= 30900 return (jint) MSG_process_get_number(); -#else - return (jint) -1; -#endif } diff --git a/src/bindings/java/org/simgrid/NativeLib.java b/src/bindings/java/org/simgrid/NativeLib.java index cf024b60dc..18e593a14d 100644 --- a/src/bindings/java/org/simgrid/NativeLib.java +++ b/src/bindings/java/org/simgrid/NativeLib.java @@ -18,16 +18,17 @@ public final class NativeLib { String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch"); - if (os.toLowerCase().startsWith("^win")) - os = "Windows"; - else if (os.contains("OS X")) - os = "Darwin"; - if (arch.matches("^i[3-6]86$")) arch = "x86"; else if (arch.equalsIgnoreCase("amd64")) arch = "x86_64"; + if (os.toLowerCase().startsWith("win")){ + os = "Windows"; + arch = "x86"; + }else if (os.contains("OS X")) + os = "Darwin"; + os = os.replace(' ', '_'); arch = arch.replace(' ', '_'); diff --git a/src/bindings/java/org/simgrid/surf/Action.java b/src/bindings/java/org/simgrid/surf/Action.java new file mode 100644 index 0000000000..911a8d3188 --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/Action.java @@ -0,0 +1,151 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +/** + * An action created by a Resource (e.g., a communication, an execution) + * @see Model + * @see Resource + */ +public class Action { + private long swigCPtr; + protected boolean swigCMemOwn; + + protected Action(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(Action obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_Action(swigCPtr); + } + swigCPtr = 0; + } + } + + protected static long[] cArrayUnwrap(Action[] arrayWrapper) { + long[] cArray = new long[arrayWrapper.length]; + for (int i=0; i= 0 && swigValues[swigValue].swigValue == swigValue) + return swigValues[swigValue]; + for (int i = 0; i < swigValues.length; i++) + if (swigValues[i].swigValue == swigValue) + return swigValues[i]; + throw new IllegalArgumentException("No enum " + ActionState.class + " with value " + swigValue); + } + + private ActionState(String swigName) { + this.swigName = swigName; + this.swigValue = swigNext++; + } + + private ActionState(String swigName, int swigValue) { + this.swigName = swigName; + this.swigValue = swigValue; + swigNext = swigValue+1; + } + + private ActionState(String swigName, ActionState swigEnum) { + this.swigName = swigName; + this.swigValue = swigEnum.swigValue; + swigNext = this.swigValue+1; + } + + private static ActionState[] swigValues = { SURF_ACTION_READY, SURF_ACTION_RUNNING, SURF_ACTION_FAILED, SURF_ACTION_DONE, SURF_ACTION_TO_FREE, SURF_ACTION_NOT_IN_THE_SYSTEM }; + private static int swigNext = 0; + private final int swigValue; + private final String swigName; +} + diff --git a/src/bindings/java/org/simgrid/surf/Cpu.java b/src/bindings/java/org/simgrid/surf/Cpu.java new file mode 100644 index 0000000000..61a2d5460d --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/Cpu.java @@ -0,0 +1,177 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +/** + * A generic resource for the cpu component + * @see CpuModel + * @see CpuAction + */ +public class Cpu extends Resource { + private long swigCPtr; + + protected Cpu(long cPtr, boolean cMemoryOwn) { + super(SurfJNI.Cpu_SWIGUpcast(cPtr), cMemoryOwn); + swigCPtr = cPtr; + } + + protected static long getCPtr(Cpu obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_Cpu(swigCPtr); + } + swigCPtr = 0; + } + super.delete(); + } + + protected void swigDirectorDisconnect() { + swigCMemOwn = false; + delete(); + } + + public void swigReleaseOwnership() { + swigCMemOwn = false; + SurfJNI.Cpu_change_ownership(this, swigCPtr, false); + } + + public void swigTakeOwnership() { + swigCMemOwn = true; + SurfJNI.Cpu_change_ownership(this, swigCPtr, true); + } + + + /** + * A cpu constructor (using LMM) + * @param model + * @param name + * @param props + * @param constraint + * @param core + * @param powerPeak + * @param powerScale + */ + public Cpu(Model model, String name, XbtDict props, LmmConstraint constraint, int core, double powerPeak, double powerScale) { + this(SurfJNI.new_Cpu__SWIG_0(Model.getCPtr(model), model, name, XbtDict.getCPtr(props), props, LmmConstraint.getCPtr(constraint), constraint, core, powerPeak, powerScale), true); + SurfJNI.Cpu_director_connect(this, swigCPtr, swigCMemOwn, true); + } + + + /** + * A cpu constructor + * @param model + * @param name + * @param props + * @param core + * @param powerPeak + * @param powerScale + */ + public Cpu(Model model, String name, XbtDict props, int core, double powerPeak, double powerScale) { + this(SurfJNI.new_Cpu__SWIG_1(Model.getCPtr(model), model, name, XbtDict.getCPtr(props), props, core, powerPeak, powerScale), true); + SurfJNI.Cpu_director_connect(this, swigCPtr, swigCMemOwn, true); + } + + + /** + * @return The current power peak + */ + public double getCurrentPowerPeak() { + return (getClass() == Cpu.class) ? SurfJNI.Cpu_getCurrentPowerPeak(swigCPtr, this) : SurfJNI.Cpu_getCurrentPowerPeakSwigExplicitCpu(swigCPtr, this); + } + + + /** + * Execute some quantity of computation + * @param size The processing amount (in flop) needed to process + * @return A cpu action representing code execution + */ + public CpuAction execute(double size) { + long cPtr = SurfJNI.Cpu_execute(swigCPtr, this, size); + return (CpuAction)Surf.getCpuDirector(cPtr); +} + + + /** + * Make a process sleep for duration + * @param duration The number of seconds to sleep + * @return A cpu action representing sleeping + */ + public CpuAction sleep(double duration) { + long cPtr = SurfJNI.Cpu_sleep(swigCPtr, this, duration); + return (CpuAction)Surf.getCpuDirector(cPtr); +} + + + /** + * @return The number of cores on the cpu + */ + public int getCore() { + return (getClass() == Cpu.class) ? SurfJNI.Cpu_getCore(swigCPtr, this) : SurfJNI.Cpu_getCoreSwigExplicitCpu(swigCPtr, this); + } + + + /** + * TODO + * @param load + */ + public double getSpeed(double load) { + return (getClass() == Cpu.class) ? SurfJNI.Cpu_getSpeed(swigCPtr, this, load) : SurfJNI.Cpu_getSpeedSwigExplicitCpu(swigCPtr, this, load); + } + + + /** + * TODO + */ + public double getAvailableSpeed() { + return (getClass() == Cpu.class) ? SurfJNI.Cpu_getAvailableSpeed(swigCPtr, this) : SurfJNI.Cpu_getAvailableSpeedSwigExplicitCpu(swigCPtr, this); + } + + + /** + * @param pstate_index index of power peak to get + * @return Power peak at index + */ + public double getPowerPeakAt(int pstate_index) { + return SurfJNI.Cpu_getPowerPeakAt(swigCPtr, this, pstate_index); + } + + + /** + * @return Number of power peak + */ + public int getNbPstates() { + return SurfJNI.Cpu_getNbPstates(swigCPtr, this); + } + + + /** + * @param pstate_index index of power peak to set + */ + public void setPowerPeakAt(int pstate_index) { + SurfJNI.Cpu_setPowerPeakAt(swigCPtr, this, pstate_index); + } + + + /** + * @param state The new state of the cpu + */ + public void setState(ResourceState state) { + SurfJNI.Cpu_setState(swigCPtr, this, state.swigValue()); + } + +} diff --git a/src/bindings/java/org/simgrid/surf/CpuAction.java b/src/bindings/java/org/simgrid/surf/CpuAction.java new file mode 100644 index 0000000000..50f0fd6055 --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/CpuAction.java @@ -0,0 +1,79 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +/** + * An cpu action created by a Cpu + * @see CpuModel + * @see Cpu + */ +public class CpuAction extends Action { + private long swigCPtr; + + protected CpuAction(long cPtr, boolean cMemoryOwn) { + super(SurfJNI.CpuAction_SWIGUpcast(cPtr), cMemoryOwn); + swigCPtr = cPtr; + } + + protected static long getCPtr(CpuAction obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_CpuAction(swigCPtr); + } + swigCPtr = 0; + } + super.delete(); + } + + protected void swigDirectorDisconnect() { + swigCMemOwn = false; + delete(); + } + + public void swigReleaseOwnership() { + swigCMemOwn = false; + SurfJNI.CpuAction_change_ownership(this, swigCPtr, false); + } + + public void swigTakeOwnership() { + swigCMemOwn = true; + SurfJNI.CpuAction_change_ownership(this, swigCPtr, true); + } + + + /** + * CpuAction constructor + * @param model The model associated + * @param cost The cost of the action (e.g., flops, bytes) + * @param failed If the action has failed + */ + public CpuAction(Model model, double cost, boolean failed) { + this(SurfJNI.new_CpuAction(Model.getCPtr(model), model, cost, failed), true); + SurfJNI.CpuAction_director_connect(this, swigCPtr, swigCMemOwn, true); + } + + + /** + * @return The associated cpu + */ + public Cpu getCpu() { + long cPtr = SurfJNI.CpuAction_getCpu(swigCPtr, this); + return (Cpu)Surf.getCpuDirector(cPtr); +} + +} diff --git a/src/bindings/java/org/simgrid/surf/CpuModel.java b/src/bindings/java/org/simgrid/surf/CpuModel.java new file mode 100644 index 0000000000..466308afbf --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/CpuModel.java @@ -0,0 +1,93 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +/** + * The generic model for the Cpu component + * @see Cpu + * @see CpuAction + */ +public class CpuModel extends Model { + private long swigCPtr; + + protected CpuModel(long cPtr, boolean cMemoryOwn) { + super(SurfJNI.CpuModel_SWIGUpcast(cPtr), cMemoryOwn); + swigCPtr = cPtr; + } + + protected static long getCPtr(CpuModel obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_CpuModel(swigCPtr); + } + swigCPtr = 0; + } + super.delete(); + } + + protected void swigDirectorDisconnect() { + swigCMemOwn = false; + delete(); + } + + public void swigReleaseOwnership() { + swigCMemOwn = false; + SurfJNI.CpuModel_change_ownership(this, swigCPtr, false); + } + + public void swigTakeOwnership() { + swigCMemOwn = true; + SurfJNI.CpuModel_change_ownership(this, swigCPtr, true); + } + + + /** + * CpuModel constructon + * @param name The name of the cpumodel + */ + public CpuModel(String name) { + this(SurfJNI.new_CpuModel(name), true); + SurfJNI.CpuModel_director_connect(this, swigCPtr, swigCMemOwn, true); + } + + + /** + * Create a new Cpu + * + * @param name + * @param power_peak + * @param pstate + * @param power_scale + * @param power_trace + * @param core + * @param state_initial + * @param state_trace + * @param cpu_properties + * @return The new Cpu + * @see Cpu + */ + public Cpu createResource(String name, double[] power_peak, int pstate, double power_scale, TmgrTrace power_trace, int core, ResourceState state_initial, TmgrTrace state_trace, XbtDict cpu_properties) { + long cPtr = SurfJNI.CpuModel_createResource(swigCPtr, this, name, power_peak, pstate, power_scale, TmgrTrace.getCPtr(power_trace), power_trace, core, state_initial.swigValue(), TmgrTrace.getCPtr(state_trace), state_trace, XbtDict.getCPtr(cpu_properties), cpu_properties); + return (Cpu)Surf.getCpuDirector(cPtr); +} + + public void addTraces() { + SurfJNI.CpuModel_addTraces(swigCPtr, this); + } + +} diff --git a/src/bindings/java/org/simgrid/surf/LmmConstraint.java b/src/bindings/java/org/simgrid/surf/LmmConstraint.java new file mode 100644 index 0000000000..775c379cef --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/LmmConstraint.java @@ -0,0 +1,46 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +public class LmmConstraint { + private long swigCPtr; + protected boolean swigCMemOwn; + + protected LmmConstraint(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(LmmConstraint obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_LmmConstraint(swigCPtr); + } + swigCPtr = 0; + } + } + + public double getUsage() { + return SurfJNI.LmmConstraint_getUsage(swigCPtr, this); + } + + public LmmConstraint() { + this(SurfJNI.new_LmmConstraint(), true); + } + +} diff --git a/src/bindings/java/org/simgrid/surf/LmmVariable.java b/src/bindings/java/org/simgrid/surf/LmmVariable.java new file mode 100644 index 0000000000..7e9e372296 --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/LmmVariable.java @@ -0,0 +1,46 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +public class LmmVariable { + private long swigCPtr; + protected boolean swigCMemOwn; + + protected LmmVariable(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(LmmVariable obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_LmmVariable(swigCPtr); + } + swigCPtr = 0; + } + } + + public double getValue() { + return SurfJNI.LmmVariable_getValue(swigCPtr, this); + } + + public LmmVariable() { + this(SurfJNI.new_LmmVariable(), true); + } + +} diff --git a/src/bindings/java/org/simgrid/surf/Model.java b/src/bindings/java/org/simgrid/surf/Model.java new file mode 100644 index 0000000000..f1caaa3cbc --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/Model.java @@ -0,0 +1,110 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +/** + * A component (e.g., Cpu, Network, Storage, ...) is composed of three classes: + *
    + *
  • Model: It handle the interactions between resoucses and actions
  • + *
  • Resource: A resource used by the model (e.g., a cpu, a network link)
  • + *
  • Action: An action generated by the resources (e.g., execution, communication)
  • + *
+ * @see Resource + * @see Action + */ +public class Model { + private long swigCPtr; + protected boolean swigCMemOwn; + + protected Model(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(Model obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_Model(swigCPtr); + } + swigCPtr = 0; + } + } + + + /** + * Model constructor + * @param name The name of the model + */ + public Model(String name) { + this(SurfJNI.new_Model(name), true); + } + + + /** + * @return The name of the model + */ + public String getName() { + return SurfJNI.Model_getName(swigCPtr, this); + } + + + /** + * Share the resources between the actions + * @param now the current time + * @return the date of the next action of the model will finish + */ + public double shareResources(double now) { + return SurfJNI.Model_shareResources(swigCPtr, this, now); + } + + public double shareResourcesLazy(double now) { + return SurfJNI.Model_shareResourcesLazy(swigCPtr, this, now); + } + + public double shareResourcesFull(double now) { + return SurfJNI.Model_shareResourcesFull(swigCPtr, this, now); + } + + + /** + * Update time of actions and eventually their states + * @param now the new current time + * @param delta the delta between previous and new current time + */ + public void updateActionsState(double now, double delta) { + SurfJNI.Model_updateActionsState(swigCPtr, this, now, delta); + } + + public void updateActionsStateLazy(double now, double delta) { + SurfJNI.Model_updateActionsStateLazy(swigCPtr, this, now, delta); + } + + public void updateActionsStateFull(double now, double delta) { + SurfJNI.Model_updateActionsStateFull(swigCPtr, this, now, delta); + } + + + /** + * Get the List of running Actions + */ + public ActionList getRunningActionSet() { + long cPtr = SurfJNI.Model_getRunningActionSet(swigCPtr, this); + return (cPtr == 0) ? null : new ActionList(cPtr, false); + } + +} diff --git a/src/bindings/java/org/simgrid/surf/NetworkAction.java b/src/bindings/java/org/simgrid/surf/NetworkAction.java new file mode 100644 index 0000000000..c1b758dc68 --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/NetworkAction.java @@ -0,0 +1,50 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +/** + * An network action created by network model + * @see NetworkLink + */ +public class NetworkAction extends Action { + private long swigCPtr; + + protected NetworkAction(long cPtr, boolean cMemoryOwn) { + super(SurfJNI.NetworkAction_SWIGUpcast(cPtr), cMemoryOwn); + swigCPtr = cPtr; + } + + protected static long getCPtr(NetworkAction obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_NetworkAction(swigCPtr); + } + swigCPtr = 0; + } + super.delete(); + } + + + /** + * @return The latency of the action + */ + public double getLatency() { + return SurfJNI.NetworkAction_getLatency(swigCPtr, this); + } + +} diff --git a/src/bindings/java/org/simgrid/surf/NetworkLink.java b/src/bindings/java/org/simgrid/surf/NetworkLink.java new file mode 100644 index 0000000000..a787a8bd4f --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/NetworkLink.java @@ -0,0 +1,107 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +/** + * A generic resource for the network component + */ +public class NetworkLink extends Resource { + private long swigCPtr; + + protected NetworkLink(long cPtr, boolean cMemoryOwn) { + super(SurfJNI.NetworkLink_SWIGUpcast(cPtr), cMemoryOwn); + swigCPtr = cPtr; + } + + protected static long getCPtr(NetworkLink obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_NetworkLink(swigCPtr); + } + swigCPtr = 0; + } + super.delete(); + } + + protected static long[] cArrayUnwrap(NetworkLink[] arrayWrapper) { + long[] cArray = new long[arrayWrapper.length]; + for (int i=0; i= 0 && swigValues[swigValue].swigValue == swigValue) + return swigValues[swigValue]; + for (int i = 0; i < swigValues.length; i++) + if (swigValues[i].swigValue == swigValue) + return swigValues[i]; + throw new IllegalArgumentException("No enum " + ResourceState.class + " with value " + swigValue); + } + + private ResourceState(String swigName) { + this.swigName = swigName; + this.swigValue = swigNext++; + } + + private ResourceState(String swigName, int swigValue) { + this.swigName = swigName; + this.swigValue = swigValue; + swigNext = swigValue+1; + } + + private ResourceState(String swigName, ResourceState swigEnum) { + this.swigName = swigName; + this.swigValue = swigEnum.swigValue; + swigNext = this.swigValue+1; + } + + private static ResourceState[] swigValues = { SURF_RESOURCE_ON, SURF_RESOURCE_OFF }; + private static int swigNext = 0; + private final int swigValue; + private final String swigName; +} + diff --git a/src/bindings/java/org/simgrid/surf/RoutingEdge.java b/src/bindings/java/org/simgrid/surf/RoutingEdge.java new file mode 100644 index 0000000000..36b117a511 --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/RoutingEdge.java @@ -0,0 +1,42 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +public class RoutingEdge { + private long swigCPtr; + protected boolean swigCMemOwn; + + protected RoutingEdge(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(RoutingEdge obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_RoutingEdge(swigCPtr); + } + swigCPtr = 0; + } + } + + public String getName() { + return SurfJNI.RoutingEdge_getName(swigCPtr, this); + } + +} diff --git a/src/bindings/java/org/simgrid/surf/Surf.java b/src/bindings/java/org/simgrid/surf/Surf.java new file mode 100644 index 0000000000..b4ef317ae5 --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/Surf.java @@ -0,0 +1,57 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +public class Surf { + public static Object getAction(long jarg1) { + return SurfJNI.getAction(jarg1); + } + + public static Object getCpuModelDirector(long jarg1) { + return SurfJNI.getCpuModelDirector(jarg1); + } + + public static Object getCpuDirector(long jarg1) { + return SurfJNI.getCpuDirector(jarg1); + } + + public static Object getCpuActionDirector(long jarg1) { + return SurfJNI.getCpuActionDirector(jarg1); + } + + + /** + * @return The current simulated time + */ + public static double getClock() { + return SurfJNI.getClock(); + } + + public static void clean() { + SurfJNI.clean(); + } + + public static CpuModel getCpuModel() { + long cPtr = SurfJNI.getCpuModel(); + return (CpuModel)Surf.getCpuModelDirector(cPtr); +} + + public static void setCpuModel(CpuModel cpuModel) { + SurfJNI.setCpuModel(CpuModel.getCPtr(cpuModel), cpuModel); + } + + public static void setCpu(String name, Cpu cpu) { + SurfJNI.setCpu(name, Cpu.getCPtr(cpu), cpu); + } + + public static NetworkLink[] getRoute(String srcName, String dstName) { + return NetworkLink.cArrayWrap(SurfJNI.getRoute(srcName, dstName), false); +} + +} diff --git a/src/bindings/java/org/simgrid/surf/SurfJNI.java b/src/bindings/java/org/simgrid/surf/SurfJNI.java new file mode 100644 index 0000000000..040ca882d3 --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/SurfJNI.java @@ -0,0 +1,267 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +import org.simgrid.NativeLib; + +public class SurfJNI { + + static { + NativeLib.nativeInit("surf-java"); + Runtime.getRuntime().addShutdownHook( + new Thread() { + public void run() { + Thread.currentThread().setName( "Destroyer" ); + Surf.clean(); + } + } + ); + } + + public final static native long[] ActionList_getArray(long jarg1, ActionList jarg1_); + public final static native long new_ActionList(); + public final static native void delete_ActionList(long jarg1); + public final static native Object getAction(long jarg1); + public final static native Object getCpuModelDirector(long jarg1); + public final static native Object getCpuDirector(long jarg1); + public final static native Object getCpuActionDirector(long jarg1); + public final static native double getClock(); + public final static native void clean(); + public final static native long getCpuModel(); + public final static native void setCpuModel(long jarg1, CpuModel jarg1_); + public final static native void setCpu(String jarg1, long jarg2, Cpu jarg2_); + public final static native long[] getRoute(String jarg1, String jarg2); + public final static native void delete_Plugin(long jarg1); + public final static native void Plugin_activateCpuCreatedCallback(long jarg1, Plugin jarg1_); + public final static native void Plugin_cpuCreatedCallback(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_); + public final static native void Plugin_cpuCreatedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_); + public final static native void Plugin_activateCpuDestructedCallback(long jarg1, Plugin jarg1_); + public final static native void Plugin_cpuDestructedCallback(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_); + public final static native void Plugin_cpuDestructedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_); + public final static native void Plugin_activateCpuStateChangedCallback(long jarg1, Plugin jarg1_); + public final static native void Plugin_cpuStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_, int jarg3, int jarg4); + public final static native void Plugin_cpuStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_, int jarg3, int jarg4); + public final static native void Plugin_activateCpuActionStateChangedCallback(long jarg1, Plugin jarg1_); + public final static native void Plugin_cpuActionStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, CpuAction jarg2_, int jarg3, int jarg4); + public final static native void Plugin_cpuActionStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, CpuAction jarg2_, int jarg3, int jarg4); + public final static native void Plugin_activateNetworkLinkCreatedCallback(long jarg1, Plugin jarg1_); + public final static native void Plugin_networkLinkCreatedCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_); + public final static native void Plugin_networkLinkCreatedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_); + public final static native void Plugin_activateNetworkLinkDestructedCallback(long jarg1, Plugin jarg1_); + public final static native void Plugin_networkLinkDestructedCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_); + public final static native void Plugin_networkLinkDestructedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_); + public final static native void Plugin_activateNetworkLinkStateChangedCallback(long jarg1, Plugin jarg1_); + public final static native void Plugin_networkLinkStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_, int jarg3, int jarg4); + public final static native void Plugin_networkLinkStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_, int jarg3, int jarg4); + public final static native void Plugin_activateNetworkActionStateChangedCallback(long jarg1, Plugin jarg1_); + public final static native void Plugin_networkActionStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, int jarg3, int jarg4); + public final static native void Plugin_networkActionStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, int jarg3, int jarg4); + public final static native void Plugin_activateNetworkCommunicateCallback(long jarg1, Plugin jarg1_); + public final static native void Plugin_networkCommunicateCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, long jarg3, RoutingEdge jarg3_, long jarg4, RoutingEdge jarg4_, double jarg5, double jarg6); + public final static native void Plugin_networkCommunicateCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, long jarg3, RoutingEdge jarg3_, long jarg4, RoutingEdge jarg4_, double jarg5, double jarg6); + public final static native long new_Plugin(); + public final static native void Plugin_director_connect(Plugin obj, long cptr, boolean mem_own, boolean weak_global); + public final static native void Plugin_change_ownership(Plugin obj, long cptr, boolean take_or_release); + public final static native void delete_TmgrTrace(long jarg1); + public final static native long TmgrTraceEvent_getIdx(long jarg1, TmgrTraceEvent jarg1_); + public final static native void delete_TmgrTraceEvent(long jarg1); + public final static native long new_Model(String jarg1); + public final static native String Model_getName(long jarg1, Model jarg1_); + public final static native double Model_shareResources(long jarg1, Model jarg1_, double jarg2); + public final static native double Model_shareResourcesLazy(long jarg1, Model jarg1_, double jarg2); + public final static native double Model_shareResourcesFull(long jarg1, Model jarg1_, double jarg2); + public final static native void Model_updateActionsState(long jarg1, Model jarg1_, double jarg2, double jarg3); + public final static native void Model_updateActionsStateLazy(long jarg1, Model jarg1_, double jarg2, double jarg3); + public final static native void Model_updateActionsStateFull(long jarg1, Model jarg1_, double jarg2, double jarg3); + public final static native long Model_getRunningActionSet(long jarg1, Model jarg1_); + public final static native void delete_Model(long jarg1); + public final static native long new_CpuModel(String jarg1); + public final static native void delete_CpuModel(long jarg1); + public final static native long CpuModel_createResource(long jarg1, CpuModel jarg1_, String jarg2, double[] jarg3, int jarg4, double jarg5, long jarg6, TmgrTrace jarg6_, int jarg7, int jarg8, long jarg9, TmgrTrace jarg9_, long jarg10, XbtDict jarg10_); + public final static native void CpuModel_addTraces(long jarg1, CpuModel jarg1_); + public final static native void CpuModel_director_connect(CpuModel obj, long cptr, boolean mem_own, boolean weak_global); + public final static native void CpuModel_change_ownership(CpuModel obj, long cptr, boolean take_or_release); + public final static native String Resource_getName(long jarg1, Resource jarg1_); + public final static native boolean Resource_isUsed(long jarg1, Resource jarg1_); + public final static native long Resource_getModel(long jarg1, Resource jarg1_); + public final static native int Resource_getState(long jarg1, Resource jarg1_); + public final static native long Resource_getConstraint(long jarg1, Resource jarg1_); + public final static native long Resource_getProperties(long jarg1, Resource jarg1_); + public final static native void Resource_updateState(long jarg1, Resource jarg1_, long jarg2, TmgrTraceEvent jarg2_, double jarg3, double jarg4); + public final static native void delete_Resource(long jarg1); + public final static native long new_Cpu__SWIG_0(long jarg1, Model jarg1_, String jarg2, long jarg3, XbtDict jarg3_, long jarg4, LmmConstraint jarg4_, int jarg5, double jarg6, double jarg7); + public final static native long new_Cpu__SWIG_1(long jarg1, Model jarg1_, String jarg2, long jarg3, XbtDict jarg3_, int jarg4, double jarg5, double jarg6); + public final static native void delete_Cpu(long jarg1); + public final static native double Cpu_getCurrentPowerPeak(long jarg1, Cpu jarg1_); + public final static native double Cpu_getCurrentPowerPeakSwigExplicitCpu(long jarg1, Cpu jarg1_); + public final static native long Cpu_execute(long jarg1, Cpu jarg1_, double jarg2); + public final static native long Cpu_sleep(long jarg1, Cpu jarg1_, double jarg2); + public final static native int Cpu_getCore(long jarg1, Cpu jarg1_); + public final static native int Cpu_getCoreSwigExplicitCpu(long jarg1, Cpu jarg1_); + public final static native double Cpu_getSpeed(long jarg1, Cpu jarg1_, double jarg2); + public final static native double Cpu_getSpeedSwigExplicitCpu(long jarg1, Cpu jarg1_, double jarg2); + public final static native double Cpu_getAvailableSpeed(long jarg1, Cpu jarg1_); + public final static native double Cpu_getAvailableSpeedSwigExplicitCpu(long jarg1, Cpu jarg1_); + public final static native double Cpu_getPowerPeakAt(long jarg1, Cpu jarg1_, int jarg2); + public final static native int Cpu_getNbPstates(long jarg1, Cpu jarg1_); + public final static native void Cpu_setPowerPeakAt(long jarg1, Cpu jarg1_, int jarg2); + public final static native void Cpu_setState(long jarg1, Cpu jarg1_, int jarg2); + public final static native void Cpu_director_connect(Cpu obj, long cptr, boolean mem_own, boolean weak_global); + public final static native void Cpu_change_ownership(Cpu obj, long cptr, boolean take_or_release); + public final static native void delete_NetworkLink(long jarg1); + public final static native double NetworkLink_getBandwidth(long jarg1, NetworkLink jarg1_); + public final static native void NetworkLink_updateBandwidth__SWIG_0(long jarg1, NetworkLink jarg1_, double jarg2, double jarg3); + public final static native void NetworkLink_updateBandwidth__SWIG_1(long jarg1, NetworkLink jarg1_, double jarg2); + public final static native double NetworkLink_getLatency(long jarg1, NetworkLink jarg1_); + public final static native void NetworkLink_updateLatency__SWIG_0(long jarg1, NetworkLink jarg1_, double jarg2, double jarg3); + public final static native void NetworkLink_updateLatency__SWIG_1(long jarg1, NetworkLink jarg1_, double jarg2); + public final static native long new_Action(long jarg1, Model jarg1_, double jarg2, boolean jarg3); + public final static native void delete_Action(long jarg1); + public final static native long Action_getModel(long jarg1, Action jarg1_); + public final static native long Action_getVariable(long jarg1, Action jarg1_); + public final static native int Action_getState(long jarg1, Action jarg1_); + public final static native boolean Action_isSuspended(long jarg1, Action jarg1_); + public final static native double Action_getBound(long jarg1, Action jarg1_); + public final static native void Action_setBound(long jarg1, Action jarg1_, double jarg2); + public final static native void Action_updateRemains(long jarg1, Action jarg1_, double jarg2); + public final static native double Action_getRemains(long jarg1, Action jarg1_); + public final static native void Action_setPriority(long jarg1, Action jarg1_, double jarg2); + public final static native void Action_setState(long jarg1, Action jarg1_, int jarg2); + public final static native long new_CpuAction(long jarg1, Model jarg1_, double jarg2, boolean jarg3); + public final static native long CpuAction_getCpu(long jarg1, CpuAction jarg1_); + public final static native void delete_CpuAction(long jarg1); + public final static native void CpuAction_director_connect(CpuAction obj, long cptr, boolean mem_own, boolean weak_global); + public final static native void CpuAction_change_ownership(CpuAction obj, long cptr, boolean take_or_release); + public final static native double NetworkAction_getLatency(long jarg1, NetworkAction jarg1_); + public final static native void delete_NetworkAction(long jarg1); + public final static native String RoutingEdge_getName(long jarg1, RoutingEdge jarg1_); + public final static native void delete_RoutingEdge(long jarg1); + public final static native double LmmConstraint_getUsage(long jarg1, LmmConstraint jarg1_); + public final static native long new_LmmConstraint(); + public final static native void delete_LmmConstraint(long jarg1); + public final static native double LmmVariable_getValue(long jarg1, LmmVariable jarg1_); + public final static native long new_LmmVariable(); + public final static native void delete_LmmVariable(long jarg1); + public final static native String XbtDict_getValue(long jarg1, XbtDict jarg1_, String jarg2); + public final static native long new_XbtDict(); + public final static native void delete_XbtDict(long jarg1); + public final static native int SURF_ACTION_READY_get(); + public final static native int SURF_RESOURCE_ON_get(); + public final static native int SURF_RESOURCE_OFF_get(); + public final static native long CpuModel_SWIGUpcast(long jarg1); + public final static native long Cpu_SWIGUpcast(long jarg1); + public final static native long NetworkLink_SWIGUpcast(long jarg1); + public final static native long CpuAction_SWIGUpcast(long jarg1); + public final static native long NetworkAction_SWIGUpcast(long jarg1); + + public static void SwigDirector_Plugin_cpuCreatedCallback(Plugin self, long cpu) { + self.cpuCreatedCallback((cpu == 0) ? null : new Cpu(cpu, false)); + } + public static void SwigDirector_Plugin_cpuDestructedCallback(Plugin self, long cpu) { + self.cpuDestructedCallback((cpu == 0) ? null : new Cpu(cpu, false)); + } + public static void SwigDirector_Plugin_cpuStateChangedCallback(Plugin self, long cpu, int arg1, int arg2) { + self.cpuStateChangedCallback((cpu == 0) ? null : new Cpu(cpu, false), ResourceState.swigToEnum(arg1), ResourceState.swigToEnum(arg2)); + } + public static void SwigDirector_Plugin_cpuActionStateChangedCallback(Plugin self, long action, int arg1, int arg2) { + self.cpuActionStateChangedCallback((action == 0) ? null : new CpuAction(action, false), ActionState.swigToEnum(arg1), ActionState.swigToEnum(arg2)); + } + public static void SwigDirector_Plugin_networkLinkCreatedCallback(Plugin self, long link) { + self.networkLinkCreatedCallback((link == 0) ? null : new NetworkLink(link, false)); + } + public static void SwigDirector_Plugin_networkLinkDestructedCallback(Plugin self, long link) { + self.networkLinkDestructedCallback((link == 0) ? null : new NetworkLink(link, false)); + } + public static void SwigDirector_Plugin_networkLinkStateChangedCallback(Plugin self, long link, int arg1, int arg2) { + self.networkLinkStateChangedCallback((link == 0) ? null : new NetworkLink(link, false), ResourceState.swigToEnum(arg1), ResourceState.swigToEnum(arg2)); + } + public static void SwigDirector_Plugin_networkActionStateChangedCallback(Plugin self, long action, int old, int cur) { + self.networkActionStateChangedCallback((action == 0) ? null : new NetworkAction(action, false), ActionState.swigToEnum(old), ActionState.swigToEnum(cur)); + } + public static void SwigDirector_Plugin_networkCommunicateCallback(Plugin self, long action, long src, long dst, double size, double rate) { + self.networkCommunicateCallback((action == 0) ? null : new NetworkAction(action, false), (src == 0) ? null : new RoutingEdge(src, false), (dst == 0) ? null : new RoutingEdge(dst, false), size, rate); + } + public static double SwigDirector_CpuModel_shareResources(CpuModel self, double now) { + return self.shareResources(now); + } + public static double SwigDirector_CpuModel_shareResourcesLazy(CpuModel self, double now) { + return self.shareResourcesLazy(now); + } + public static double SwigDirector_CpuModel_shareResourcesFull(CpuModel self, double now) { + return self.shareResourcesFull(now); + } + public static void SwigDirector_CpuModel_updateActionsState(CpuModel self, double now, double delta) { + self.updateActionsState(now, delta); + } + public static void SwigDirector_CpuModel_updateActionsStateLazy(CpuModel self, double now, double delta) { + self.updateActionsStateLazy(now, delta); + } + public static void SwigDirector_CpuModel_updateActionsStateFull(CpuModel self, double now, double delta) { + self.updateActionsStateFull(now, delta); + } + public static long SwigDirector_CpuModel_getRunningActionSet(CpuModel self) { + return ActionList.getCPtr(self.getRunningActionSet()); + } + public static long SwigDirector_CpuModel_createResource(CpuModel self, String name, double[] power_peak, int pstate, double power_scale, long power_trace, int core, int state_initial, long state_trace, long cpu_properties) { + return Cpu.getCPtr(self.createResource(name, power_peak, pstate, power_scale, (power_trace == 0) ? null : new TmgrTrace(power_trace, false), core, ResourceState.swigToEnum(state_initial), (state_trace == 0) ? null : new TmgrTrace(state_trace, false), (cpu_properties == 0) ? null : new XbtDict(cpu_properties, false))); + } + public static void SwigDirector_CpuModel_addTraces(CpuModel self) { + self.addTraces(); + } + public static boolean SwigDirector_Cpu_isUsed(Cpu self) { + return self.isUsed(); + } + public static int SwigDirector_Cpu_getState(Cpu self) { + return (self.getState()).swigValue(); + } + public static void SwigDirector_Cpu_updateState(Cpu self, long event_type, double value, double date) { + self.updateState((event_type == 0) ? null : new TmgrTraceEvent(event_type, false), value, date); + } + public static double SwigDirector_Cpu_getCurrentPowerPeak(Cpu self) { + return self.getCurrentPowerPeak(); + } + public static long SwigDirector_Cpu_execute(Cpu self, double size) { + return CpuAction.getCPtr(self.execute(size)); + } + public static long SwigDirector_Cpu_sleep(Cpu self, double duration) { + return CpuAction.getCPtr(self.sleep(duration)); + } + public static int SwigDirector_Cpu_getCore(Cpu self) { + return self.getCore(); + } + public static double SwigDirector_Cpu_getSpeed(Cpu self, double load) { + return self.getSpeed(load); + } + public static double SwigDirector_Cpu_getAvailableSpeed(Cpu self) { + return self.getAvailableSpeed(); + } + public static double SwigDirector_Cpu_getPowerPeakAt(Cpu self, int pstate_index) { + return self.getPowerPeakAt(pstate_index); + } + public static int SwigDirector_Cpu_getNbPstates(Cpu self) { + return self.getNbPstates(); + } + public static void SwigDirector_Cpu_setPowerPeakAt(Cpu self, int pstate_index) { + self.setPowerPeakAt(pstate_index); + } + public static double SwigDirector_CpuAction_getRemains(CpuAction self) { + return self.getRemains(); + } + public static void SwigDirector_CpuAction_setPriority(CpuAction self, double priority) { + self.setPriority(priority); + } + public static void SwigDirector_CpuAction_setState(CpuAction self, int state) { + self.setState(ActionState.swigToEnum(state)); + } + + private final static native void swig_module_init(); + static { + swig_module_init(); + } +} diff --git a/src/bindings/java/org/simgrid/surf/TmgrTrace.java b/src/bindings/java/org/simgrid/surf/TmgrTrace.java new file mode 100644 index 0000000000..1c7555fa45 --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/TmgrTrace.java @@ -0,0 +1,38 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +public class TmgrTrace { + private long swigCPtr; + protected boolean swigCMemOwn; + + protected TmgrTrace(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(TmgrTrace obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_TmgrTrace(swigCPtr); + } + swigCPtr = 0; + } + } + +} diff --git a/src/bindings/java/org/simgrid/surf/TmgrTraceEvent.java b/src/bindings/java/org/simgrid/surf/TmgrTraceEvent.java new file mode 100644 index 0000000000..d3f1f7e7a8 --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/TmgrTraceEvent.java @@ -0,0 +1,42 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +public class TmgrTraceEvent { + private long swigCPtr; + protected boolean swigCMemOwn; + + protected TmgrTraceEvent(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(TmgrTraceEvent obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_TmgrTraceEvent(swigCPtr); + } + swigCPtr = 0; + } + } + + public long getIdx() { + return SurfJNI.TmgrTraceEvent_getIdx(swigCPtr, this); + } + +} diff --git a/src/bindings/java/org/simgrid/surf/XbtDict.java b/src/bindings/java/org/simgrid/surf/XbtDict.java new file mode 100644 index 0000000000..dbbc370a72 --- /dev/null +++ b/src/bindings/java/org/simgrid/surf/XbtDict.java @@ -0,0 +1,46 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.simgrid.surf; + +public class XbtDict { + private long swigCPtr; + protected boolean swigCMemOwn; + + protected XbtDict(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(XbtDict obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + SurfJNI.delete_XbtDict(swigCPtr); + } + swigCPtr = 0; + } + } + + public String getValue(String key) { + return SurfJNI.XbtDict_getValue(swigCPtr, this, key); + } + + public XbtDict() { + this(SurfJNI.new_XbtDict(), true); + } + +} diff --git a/src/bindings/java/surf.i b/src/bindings/java/surf.i index 1553e77060..70006b3936 100644 --- a/src/bindings/java/surf.i +++ b/src/bindings/java/surf.i @@ -8,6 +8,8 @@ %module(directors="1") Surf %include "arrays_java.i" +%include "std_string.i" +%include "surfdoc.i" %pragma(java) jniclassimports=%{ import org.simgrid.NativeLib; @@ -27,19 +29,118 @@ import org.simgrid.NativeLib; %} %{ +#include "src/surf/surf_interface.hpp" #include "src/surf/cpu_interface.hpp" #include "src/surf/network_interface.hpp" +#include "src/surf/trace_mgr_private.h" #include "src/bindings/java/surf_swig.hpp" #include "src/xbt/dict_private.h" + typedef struct lmm_constraint *lmm_constraint_t; +typedef xbt_dynar_t DoubleDynar; +%} + +%wrapper %{ +#ifdef __cplusplus +extern "C" { +#endif + +JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_getAction(JNIEnv *env, jclass cls, jlong jarg1) { + Action * action = (Action *)jarg1; + jobject res; + CpuAction *cpu_action = dynamic_cast(action); + if (cpu_action) { + SwigDirector_CpuAction *dir_cpu_action = dynamic_cast(cpu_action); + if (dir_cpu_action) { + res = dir_cpu_action->swig_get_self(env);\ + } else { + jclass clss = env->FindClass("org/simgrid/surf/CpuAction");\ + jmethodID constru = env->GetMethodID(clss, "", "()V");\ + res = env->NewObject(clss, constru);\ + res = env->NewGlobalRef(res);\ + } + } else { + jclass clss = env->FindClass("org/simgrid/surf/Action");\ + jmethodID constru = env->GetMethodID(clss, "", "()V");\ + res = env->NewObject(clss, constru);\ + res = env->NewGlobalRef(res);\ + } + return res; +} + +#define GETDIRECTOR(NAME) \ +JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_get## NAME ## Director(JNIEnv *env, jclass cls, jlong jarg1)\ +{\ + NAME * arg1 = (NAME*)jarg1;\ + SwigDirector_ ##NAME *director = dynamic_cast(arg1);\ + jobject res;\ + if (director) {\ + res = director->swig_get_self(env);\ + } else {\ + jclass clss = env->FindClass("org/simgrid/surf/NAME");\ + jmethodID constru = env->GetMethodID(clss, "", "()V");\ + res = env->NewObject(clss, constru);\ + res = env->NewGlobalRef(res);\ + }\ + return res;\ +} + +GETDIRECTOR(CpuModel) +GETDIRECTOR(Cpu) +GETDIRECTOR(CpuAction) + +#ifdef __cplusplus +} +#endif + %} +%typemap(freearg) char* name { +} + +/* Handle xbt_dynar_t of NetworkLink */ +JAVA_ARRAYSOFCLASSES(Action); +%apply Action[] {ActionArrayPtr}; +%typemap(jstype) ActionArrayPtr "Action[]" +%typemap(javain) ActionArrayPtr "Action.cArrayUnwrap($javainput)" +%typemap(javaout) ActionArrayPtr { + long[] cArray = $jnicall; + Action[] arrayWrapper = new Action[cArray.length]; + for (int i=0; ibegin()), itend($1->end()); it != itend ; ++it) { + l++; + } + $result = jenv->NewLongArray(l); + jlong *elts = jenv->GetLongArrayElements($result, NULL); + l = 0; + for(ActionList::iterator it($1->begin()), itend($1->end()); it != itend ; ++it) { + elts[l++] = (jlong)static_cast(&*it); + } + jenv->ReleaseLongArrayElements($result, elts, 0); +} + +class ActionList { +public: + //void push_front(Action &action); + //void push_back(Action &action); +%extend { + ActionArrayPtr getArray(){ + return $self; + } +} +}; + /* Handle xbt_dynar_t of NetworkLink */ JAVA_ARRAYSOFCLASSES(NetworkLink); %apply NetworkLink[] {NetworkLinkDynar}; %typemap(jstype) NetworkLinkDynar "NetworkLink[]" %typemap(javain) NetworkLinkDynar "NetworkLink.cArrayUnwrap($javainput)" - %typemap(javaout) NetworkLinkDynar { return NetworkLink.cArrayWrap($jnicall, $owner); } @@ -56,15 +157,109 @@ JAVA_ARRAYSOFCLASSES(NetworkLink); xbt_dynar_free(&$1); } +%nodefault DoubleDynar; +%typemap(jni) DoubleDynar "jdoubleArray" +%rename(DoubleDynar) Double[]; +%typemap(jtype) DoubleDynar "double[]" +%typemap(jstype) DoubleDynar "double[]" +%typemap(out) DoubleDynar { + long l = xbt_dynar_length($1); + $result = jenv->NewDoubleArray(l); + double *lout = (double *)xbt_dynar_to_array($1); + jenv->SetDoubleArrayRegion($result, 0, l, (const jdouble*)lout); + free(lout); +} +%typemap(javadirectorin) DoubleDynar "$jniinput" +%typemap(directorin,descriptor="[D") DoubleDynar %{ + long l = xbt_dynar_length($1); + $input = jenv->NewDoubleArray(l); + double *lout = (double *)xbt_dynar_to_array($1); + jenv->SetDoubleArrayRegion($input, 0, l, (const jdouble*)lout); + free(lout); +%} +%typemap(javain) DoubleDynar "$javainput" +%typemap(javaout) DoubleDynar {return $jnicall} + /* Allow to subclass Plugin and send java object to C++ code */ %feature("director") Plugin; +%native(getAction) jobject getAction(jlong jarg1); +%native(getCpuModelDirector) jobject getCpuModelDirector(jlong jarg1); +%typemap(javaout) CpuModel * { + long cPtr = $jnicall; + return (CpuModel)Surf.getCpuModelDirector(cPtr); +} +%native(getCpuDirector) jobject getCpuDirector(jlong jarg1); +%typemap(javaout) Cpu * { + long cPtr = $jnicall; + return (Cpu)Surf.getCpuDirector(cPtr); +} +%native(getCpuActionDirector) jobject getCpuActionDirector(jlong jarg1); +%typemap(javaout) CpuAction * { + long cPtr = $jnicall; + return (CpuAction)Surf.getCpuDirector(cPtr); +} + %include "src/bindings/java/surf_swig.hpp" +%rename tmgr_trace TmgrTrace; +%nodefaultctor tmgr_trace; +struct tmgr_trace { + //enum e_trace_type type; + /*union { + struct { + xbt_dynar_t event_list; + } s_list; + struct { + probabilist_event_generator_t event_generator[2]; + int is_state_trace; + int next_event; + } s_probabilist; + };*/ + %extend { + } +}; + +%rename tmgr_trace_event TmgrTraceEvent; +%nodefaultctor tmgr_trace_event; +struct tmgr_trace_event { + //tmgr_trace_t trace; + //unsigned int idx; + //void *model; + //int free_me; + %extend { + unsigned int getIdx() {return 0;}//$self->idx;} + } +}; + %nodefaultctor Model; class Model { public: + Model(const char *name); const char *getName(); + virtual double shareResources(double now); + virtual double shareResourcesLazy(double now); + virtual double shareResourcesFull(double now); + + virtual void updateActionsState(double now, double delta); + virtual void updateActionsStateLazy(double now, double delta); + virtual void updateActionsStateFull(double now, double delta); + + virtual ActionList *getRunningActionSet(); +}; + +%feature("director") CpuModel; +class CpuModel : public Model { +public: + CpuModel(const char *name); + virtual ~CpuModel(); + virtual Cpu *createResource(const char *name, DoubleDynar power_peak, + int pstate, double power_scale, + tmgr_trace *power_trace, int core, + e_surf_resource_state_t state_initial, + tmgr_trace *state_trace, + s_xbt_dict *cpu_properties)=0; + virtual void addTraces()=0; }; class Resource { @@ -72,15 +267,32 @@ public: Resource(); const char *getName(); virtual bool isUsed()=0; + Model *getModel(); + + virtual e_surf_resource_state_t getState(); lmm_constraint *getConstraint(); s_xbt_dict *getProperties(); + virtual void updateState(tmgr_trace_event *event_type, double value, double date)=0; }; +%feature("director") Cpu; class Cpu : public Resource { public: - Cpu(); - ~Cpu(); - double getCurrentPowerPeak(); + Cpu(Model *model, const char *name, s_xbt_dict *props, + lmm_constraint *constraint, int core, double powerPeak, double powerScale); + Cpu(Model *model, const char *name, s_xbt_dict *props, + int core, double powerPeak, double powerScale); + virtual ~Cpu(); + virtual double getCurrentPowerPeak(); + virtual CpuAction *execute(double size)=0; + virtual CpuAction *sleep(double duration)=0; + virtual int getCore(); + virtual double getSpeed(double load); + virtual double getAvailableSpeed(); + virtual double getPowerPeakAt(int pstate_index)=0; + virtual int getNbPstates()=0; + virtual void setPowerPeakAt(int pstate_index)=0; + void setState(e_surf_resource_state_t state); }; class NetworkLink : public Resource { @@ -96,15 +308,25 @@ public: %nodefaultctor Action; class Action { public: + Action(Model *model, double cost, bool failed); + virtual ~Action(); Model *getModel(); lmm_variable *getVariable(); + e_surf_action_state_t getState(); + bool isSuspended(); double getBound(); void setBound(double bound); + void updateRemains(double delta); + virtual double getRemains(); + virtual void setPriority(double priority); + virtual void setState(e_surf_action_state_t state); }; %nodefaultctor CpuAction; +%feature("director") CpuAction; class CpuAction : public Action { public: +CpuAction(Model *model, double cost, bool failed); %extend { Cpu *getCpu() {return getActionCpu($self);} } @@ -118,6 +340,7 @@ public: } }; + %nodefaultctor RoutingEdge; class RoutingEdge { public: diff --git a/src/bindings/java/surfJAVA_wrap.cxx b/src/bindings/java/surfJAVA_wrap.cxx new file mode 100644 index 0000000000..ee52a22e1a --- /dev/null +++ b/src/bindings/java/surfJAVA_wrap.cxx @@ -0,0 +1,4207 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGJAVA +#define SWIG_DIRECTORS + + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +}; + +template T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + + +/* Fix for jlong on some versions of gcc on Windows */ +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) + typedef long long __int64; +#endif + +/* Fix for jlong on 64-bit x86 Solaris */ +#if defined(__x86_64) +# ifdef _LP64 +# undef _LP64 +# endif +#endif + +#include +#include +#include + + +/* Support for throwing Java exceptions */ +typedef enum { + SWIG_JavaOutOfMemoryError = 1, + SWIG_JavaIOException, + SWIG_JavaRuntimeException, + SWIG_JavaIndexOutOfBoundsException, + SWIG_JavaArithmeticException, + SWIG_JavaIllegalArgumentException, + SWIG_JavaNullPointerException, + SWIG_JavaDirectorPureVirtual, + SWIG_JavaUnknownError +} SWIG_JavaExceptionCodes; + +typedef struct { + SWIG_JavaExceptionCodes code; + const char *java_exception; +} SWIG_JavaExceptions_t; + + +static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) { + jclass excep; + static const SWIG_JavaExceptions_t java_exceptions[] = { + { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" }, + { SWIG_JavaIOException, "java/io/IOException" }, + { SWIG_JavaRuntimeException, "java/lang/RuntimeException" }, + { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" }, + { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" }, + { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" }, + { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, + { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, + { SWIG_JavaUnknownError, "java/lang/UnknownError" }, + { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } + }; + const SWIG_JavaExceptions_t *except_ptr = java_exceptions; + + while (except_ptr->code != code && except_ptr->code) + except_ptr++; + + jenv->ExceptionClear(); + excep = jenv->FindClass(except_ptr->java_exception); + if (excep) + jenv->ThrowNew(excep, msg); +} + + +/* Contract support */ + +#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else + +/* ----------------------------------------------------------------------------- + * director.swg + * + * This file contains support for director classes that proxy + * method calls from C++ to Java extensions. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus + +#if defined(DEBUG_DIRECTOR_OWNED) +#include +#endif + +namespace Swig { + /* Java object wrapper */ + class JObjectWrapper { + public: + JObjectWrapper() : jthis_(NULL), weak_global_(true) { + } + + ~JObjectWrapper() { + jthis_ = NULL; + weak_global_ = true; + } + + bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global) { + if (!jthis_) { + weak_global_ = weak_global || !mem_own; // hold as weak global if explicitly requested or not owned + if (jobj) + jthis_ = weak_global_ ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj); +#if defined(DEBUG_DIRECTOR_OWNED) + std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl; +#endif + return true; + } else { +#if defined(DEBUG_DIRECTOR_OWNED) + std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl; +#endif + return false; + } + } + + jobject get(JNIEnv *jenv) const { +#if defined(DEBUG_DIRECTOR_OWNED) + std::cout << "JObjectWrapper::get("; + if (jthis_) + std::cout << jthis_; + else + std::cout << "null"; + std::cout << ") -> return new local ref" << std::endl; +#endif + return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_); + } + + void release(JNIEnv *jenv) { +#if defined(DEBUG_DIRECTOR_OWNED) + std::cout << "JObjectWrapper::release(" << jthis_ << "): " << (weak_global_ ? "weak global ref" : "global ref") << std::endl; +#endif + if (jthis_) { + if (weak_global_) { + if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE) + jenv->DeleteWeakGlobalRef((jweak)jthis_); + } else + jenv->DeleteGlobalRef(jthis_); + } + + jthis_ = NULL; + weak_global_ = true; + } + + /* Only call peek if you know what you are doing wrt to weak/global references */ + jobject peek() { + return jthis_; + } + + /* Java proxy releases ownership of C++ object, C++ object is now + responsible for destruction (creates NewGlobalRef to pin Java + proxy) */ + void java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { + if (take_or_release) { /* Java takes ownership of C++ object's lifetime. */ + if (!weak_global_) { + jenv->DeleteGlobalRef(jthis_); + jthis_ = jenv->NewWeakGlobalRef(jself); + weak_global_ = true; + } + } else { /* Java releases ownership of C++ object's lifetime */ + if (weak_global_) { + jenv->DeleteWeakGlobalRef((jweak)jthis_); + jthis_ = jenv->NewGlobalRef(jself); + weak_global_ = false; + } + } + } + + private: + /* pointer to Java object */ + jobject jthis_; + /* Local or global reference flag */ + bool weak_global_; + }; + + /* director base class */ + class Director { + /* pointer to Java virtual machine */ + JavaVM *swig_jvm_; + + protected: +#if defined (_MSC_VER) && (_MSC_VER<1300) + class JNIEnvWrapper; + friend class JNIEnvWrapper; +#endif + /* Utility class for managing the JNI environment */ + class JNIEnvWrapper { + const Director *director_; + JNIEnv *jenv_; + int env_status; + public: + JNIEnvWrapper(const Director *director) : director_(director), jenv_(0), env_status(0) { +#if defined(__ANDROID__) + JNIEnv **jenv = &jenv_; +#else + void **jenv = (void **)&jenv_; +#endif + env_status = director_->swig_jvm_->GetEnv((void **)&jenv_, JNI_VERSION_1_2); +#if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON) + // Attach a daemon thread to the JVM. Useful when the JVM should not wait for + // the thread to exit upon shutdown. Only for jdk-1.4 and later. + director_->swig_jvm_->AttachCurrentThreadAsDaemon(jenv, NULL); +#else + director_->swig_jvm_->AttachCurrentThread(jenv, NULL); +#endif + } + ~JNIEnvWrapper() { +#if !defined(SWIG_JAVA_NO_DETACH_CURRENT_THREAD) + // Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call. + // However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak. + if (env_status == JNI_EDETACHED) + director_->swig_jvm_->DetachCurrentThread(); +#endif + } + JNIEnv *getJNIEnv() const { + return jenv_; + } + }; + + /* Java object wrapper */ + JObjectWrapper swig_self_; + + /* Disconnect director from Java object */ + void swig_disconnect_director_self(const char *disconn_method) { + JNIEnvWrapper jnienv(this) ; + JNIEnv *jenv = jnienv.getJNIEnv() ; + jobject jobj = swig_self_.get(jenv); +#if defined(DEBUG_DIRECTOR_OWNED) + std::cout << "Swig::Director::disconnect_director_self(" << jobj << ")" << std::endl; +#endif + if (jobj && jenv->IsSameObject(jobj, NULL) == JNI_FALSE) { + jmethodID disconn_meth = jenv->GetMethodID(jenv->GetObjectClass(jobj), disconn_method, "()V"); + if (disconn_meth) { +#if defined(DEBUG_DIRECTOR_OWNED) + std::cout << "Swig::Director::disconnect_director_self upcall to " << disconn_method << std::endl; +#endif + jenv->CallVoidMethod(jobj, disconn_meth); + } + } + jenv->DeleteLocalRef(jobj); + } + + public: + Director(JNIEnv *jenv) : swig_jvm_((JavaVM *) NULL), swig_self_() { + /* Acquire the Java VM pointer */ + jenv->GetJavaVM(&swig_jvm_); + } + + virtual ~Director() { + JNIEnvWrapper jnienv(this) ; + JNIEnv *jenv = jnienv.getJNIEnv() ; + swig_self_.release(jenv); + } + + bool swig_set_self(JNIEnv *jenv, jobject jself, bool mem_own, bool weak_global) { + return swig_self_.set(jenv, jself, mem_own, weak_global); + } + + jobject swig_get_self(JNIEnv *jenv) const { + return swig_self_.get(jenv); + } + + // Change C++ object's ownership, relative to Java + void swig_java_change_ownership(JNIEnv *jenv, jobject jself, bool take_or_release) { + swig_self_.java_change_ownership(jenv, jself, take_or_release); + } + }; +} + +#endif /* __cplusplus */ + + +namespace Swig { + namespace { + jclass jclass_SurfJNI = NULL; + jmethodID director_methids[33]; + } +} + +#if defined(SWIG_NOINCLUDE) || defined(SWIG_NOARRAYS) + + +static int SWIG_JavaArrayInBool (JNIEnv *jenv, jboolean **jarr, bool **carr, jbooleanArray input); +static void SWIG_JavaArrayArgoutBool (JNIEnv *jenv, jboolean *jarr, bool *carr, jbooleanArray input); +static jbooleanArray SWIG_JavaArrayOutBool (JNIEnv *jenv, bool *result, jsize sz); + + +static int SWIG_JavaArrayInSchar (JNIEnv *jenv, jbyte **jarr, signed char **carr, jbyteArray input); +static void SWIG_JavaArrayArgoutSchar (JNIEnv *jenv, jbyte *jarr, signed char *carr, jbyteArray input); +static jbyteArray SWIG_JavaArrayOutSchar (JNIEnv *jenv, signed char *result, jsize sz); + + +static int SWIG_JavaArrayInUchar (JNIEnv *jenv, jshort **jarr, unsigned char **carr, jshortArray input); +static void SWIG_JavaArrayArgoutUchar (JNIEnv *jenv, jshort *jarr, unsigned char *carr, jshortArray input); +static jshortArray SWIG_JavaArrayOutUchar (JNIEnv *jenv, unsigned char *result, jsize sz); + + +static int SWIG_JavaArrayInShort (JNIEnv *jenv, jshort **jarr, short **carr, jshortArray input); +static void SWIG_JavaArrayArgoutShort (JNIEnv *jenv, jshort *jarr, short *carr, jshortArray input); +static jshortArray SWIG_JavaArrayOutShort (JNIEnv *jenv, short *result, jsize sz); + + +static int SWIG_JavaArrayInUshort (JNIEnv *jenv, jint **jarr, unsigned short **carr, jintArray input); +static void SWIG_JavaArrayArgoutUshort (JNIEnv *jenv, jint *jarr, unsigned short *carr, jintArray input); +static jintArray SWIG_JavaArrayOutUshort (JNIEnv *jenv, unsigned short *result, jsize sz); + + +static int SWIG_JavaArrayInInt (JNIEnv *jenv, jint **jarr, int **carr, jintArray input); +static void SWIG_JavaArrayArgoutInt (JNIEnv *jenv, jint *jarr, int *carr, jintArray input); +static jintArray SWIG_JavaArrayOutInt (JNIEnv *jenv, int *result, jsize sz); + + +static int SWIG_JavaArrayInUint (JNIEnv *jenv, jlong **jarr, unsigned int **carr, jlongArray input); +static void SWIG_JavaArrayArgoutUint (JNIEnv *jenv, jlong *jarr, unsigned int *carr, jlongArray input); +static jlongArray SWIG_JavaArrayOutUint (JNIEnv *jenv, unsigned int *result, jsize sz); + + +static int SWIG_JavaArrayInLong (JNIEnv *jenv, jint **jarr, long **carr, jintArray input); +static void SWIG_JavaArrayArgoutLong (JNIEnv *jenv, jint *jarr, long *carr, jintArray input); +static jintArray SWIG_JavaArrayOutLong (JNIEnv *jenv, long *result, jsize sz); + + +static int SWIG_JavaArrayInUlong (JNIEnv *jenv, jlong **jarr, unsigned long **carr, jlongArray input); +static void SWIG_JavaArrayArgoutUlong (JNIEnv *jenv, jlong *jarr, unsigned long *carr, jlongArray input); +static jlongArray SWIG_JavaArrayOutUlong (JNIEnv *jenv, unsigned long *result, jsize sz); + + +static int SWIG_JavaArrayInLonglong (JNIEnv *jenv, jlong **jarr, jlong **carr, jlongArray input); +static void SWIG_JavaArrayArgoutLonglong (JNIEnv *jenv, jlong *jarr, jlong *carr, jlongArray input); +static jlongArray SWIG_JavaArrayOutLonglong (JNIEnv *jenv, jlong *result, jsize sz); + + +static int SWIG_JavaArrayInFloat (JNIEnv *jenv, jfloat **jarr, float **carr, jfloatArray input); +static void SWIG_JavaArrayArgoutFloat (JNIEnv *jenv, jfloat *jarr, float *carr, jfloatArray input); +static jfloatArray SWIG_JavaArrayOutFloat (JNIEnv *jenv, float *result, jsize sz); + + +static int SWIG_JavaArrayInDouble (JNIEnv *jenv, jdouble **jarr, double **carr, jdoubleArray input); +static void SWIG_JavaArrayArgoutDouble (JNIEnv *jenv, jdouble *jarr, double *carr, jdoubleArray input); +static jdoubleArray SWIG_JavaArrayOutDouble (JNIEnv *jenv, double *result, jsize sz); + + +#else + + +/* bool[] support */ +static int SWIG_JavaArrayInBool (JNIEnv *jenv, jboolean **jarr, bool **carr, jbooleanArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetBooleanArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new bool[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseBooleanArrayElements(input, jarr, 0); +} + +static jbooleanArray SWIG_JavaArrayOutBool (JNIEnv *jenv, bool *result, jsize sz) { + jboolean *arr; + int i; + jbooleanArray jresult = jenv->NewBooleanArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetBooleanArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseBooleanArrayElements(jresult, arr, 0); + return jresult; +} + + +/* signed char[] support */ +static int SWIG_JavaArrayInSchar (JNIEnv *jenv, jbyte **jarr, signed char **carr, jbyteArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetByteArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new signed char[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseByteArrayElements(input, jarr, 0); +} + +static jbyteArray SWIG_JavaArrayOutSchar (JNIEnv *jenv, signed char *result, jsize sz) { + jbyte *arr; + int i; + jbyteArray jresult = jenv->NewByteArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetByteArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseByteArrayElements(jresult, arr, 0); + return jresult; +} + + +/* unsigned char[] support */ +static int SWIG_JavaArrayInUchar (JNIEnv *jenv, jshort **jarr, unsigned char **carr, jshortArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetShortArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new unsigned char[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseShortArrayElements(input, jarr, 0); +} + +static jshortArray SWIG_JavaArrayOutUchar (JNIEnv *jenv, unsigned char *result, jsize sz) { + jshort *arr; + int i; + jshortArray jresult = jenv->NewShortArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetShortArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseShortArrayElements(jresult, arr, 0); + return jresult; +} + + +/* short[] support */ +static int SWIG_JavaArrayInShort (JNIEnv *jenv, jshort **jarr, short **carr, jshortArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetShortArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new short[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseShortArrayElements(input, jarr, 0); +} + +static jshortArray SWIG_JavaArrayOutShort (JNIEnv *jenv, short *result, jsize sz) { + jshort *arr; + int i; + jshortArray jresult = jenv->NewShortArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetShortArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseShortArrayElements(jresult, arr, 0); + return jresult; +} + + +/* unsigned short[] support */ +static int SWIG_JavaArrayInUshort (JNIEnv *jenv, jint **jarr, unsigned short **carr, jintArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetIntArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new unsigned short[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseIntArrayElements(input, jarr, 0); +} + +static jintArray SWIG_JavaArrayOutUshort (JNIEnv *jenv, unsigned short *result, jsize sz) { + jint *arr; + int i; + jintArray jresult = jenv->NewIntArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetIntArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseIntArrayElements(jresult, arr, 0); + return jresult; +} + + +/* int[] support */ +static int SWIG_JavaArrayInInt (JNIEnv *jenv, jint **jarr, int **carr, jintArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetIntArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new int[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseIntArrayElements(input, jarr, 0); +} + +static jintArray SWIG_JavaArrayOutInt (JNIEnv *jenv, int *result, jsize sz) { + jint *arr; + int i; + jintArray jresult = jenv->NewIntArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetIntArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseIntArrayElements(jresult, arr, 0); + return jresult; +} + + +/* unsigned int[] support */ +static int SWIG_JavaArrayInUint (JNIEnv *jenv, jlong **jarr, unsigned int **carr, jlongArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetLongArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new unsigned int[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseLongArrayElements(input, jarr, 0); +} + +static jlongArray SWIG_JavaArrayOutUint (JNIEnv *jenv, unsigned int *result, jsize sz) { + jlong *arr; + int i; + jlongArray jresult = jenv->NewLongArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetLongArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseLongArrayElements(jresult, arr, 0); + return jresult; +} + + +/* long[] support */ +static int SWIG_JavaArrayInLong (JNIEnv *jenv, jint **jarr, long **carr, jintArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetIntArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new long[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseIntArrayElements(input, jarr, 0); +} + +static jintArray SWIG_JavaArrayOutLong (JNIEnv *jenv, long *result, jsize sz) { + jint *arr; + int i; + jintArray jresult = jenv->NewIntArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetIntArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseIntArrayElements(jresult, arr, 0); + return jresult; +} + + +/* unsigned long[] support */ +static int SWIG_JavaArrayInUlong (JNIEnv *jenv, jlong **jarr, unsigned long **carr, jlongArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetLongArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new unsigned long[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseLongArrayElements(input, jarr, 0); +} + +static jlongArray SWIG_JavaArrayOutUlong (JNIEnv *jenv, unsigned long *result, jsize sz) { + jlong *arr; + int i; + jlongArray jresult = jenv->NewLongArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetLongArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseLongArrayElements(jresult, arr, 0); + return jresult; +} + + +/* jlong[] support */ +static int SWIG_JavaArrayInLonglong (JNIEnv *jenv, jlong **jarr, jlong **carr, jlongArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetLongArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new jlong[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseLongArrayElements(input, jarr, 0); +} + +static jlongArray SWIG_JavaArrayOutLonglong (JNIEnv *jenv, jlong *result, jsize sz) { + jlong *arr; + int i; + jlongArray jresult = jenv->NewLongArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetLongArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseLongArrayElements(jresult, arr, 0); + return jresult; +} + + +/* float[] support */ +static int SWIG_JavaArrayInFloat (JNIEnv *jenv, jfloat **jarr, float **carr, jfloatArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetFloatArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new float[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseFloatArrayElements(input, jarr, 0); +} + +static jfloatArray SWIG_JavaArrayOutFloat (JNIEnv *jenv, float *result, jsize sz) { + jfloat *arr; + int i; + jfloatArray jresult = jenv->NewFloatArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetFloatArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseFloatArrayElements(jresult, arr, 0); + return jresult; +} + + +/* double[] support */ +static int SWIG_JavaArrayInDouble (JNIEnv *jenv, jdouble **jarr, double **carr, jdoubleArray input) { + int i; + jsize sz; + if (!input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null array"); + return 0; + } + sz = jenv->GetArrayLength(input); + *jarr = jenv->GetDoubleArrayElements(input, 0); + if (!*jarr) + return 0; + *carr = new double[sz]; + if (!*carr) { + SWIG_JavaThrowException(jenv, SWIG_JavaOutOfMemoryError, "array memory allocation failed"); + return 0; + } + for (i=0; iGetArrayLength(input); + for (i=0; iReleaseDoubleArrayElements(input, jarr, 0); +} + +static jdoubleArray SWIG_JavaArrayOutDouble (JNIEnv *jenv, double *result, jsize sz) { + jdouble *arr; + int i; + jdoubleArray jresult = jenv->NewDoubleArray(sz); + if (!jresult) + return NULL; + arr = jenv->GetDoubleArrayElements(jresult, 0); + if (!arr) + return NULL; + for (i=0; iReleaseDoubleArrayElements(jresult, arr, 0); + return jresult; +} + + +#endif + + +#include + + +#include "src/surf/surf_interface.hpp" +#include "src/surf/cpu_interface.hpp" +#include "src/surf/network_interface.hpp" +#include "src/surf/trace_mgr_private.h" +#include "src/bindings/java/surf_swig.hpp" +#include "src/xbt/dict_private.h" + +typedef struct lmm_constraint *lmm_constraint_t; +typedef xbt_dynar_t DoubleDynar; + +SWIGINTERN ActionArrayPtr ActionList_getArray(ActionList *self){ + return self; + } +SWIGINTERN unsigned int tmgr_trace_event_getIdx(tmgr_trace_event *self){return 0;} +SWIGINTERN Cpu *CpuAction_getCpu(CpuAction *self){return getActionCpu(self);} +SWIGINTERN double NetworkAction_getLatency(NetworkAction *self){return self->m_latency;} +SWIGINTERN double lmm_constraint_getUsage(lmm_constraint *self){return lmm_constraint_get_usage(self);} +SWIGINTERN double lmm_variable_getValue(lmm_variable *self){return lmm_variable_getvalue(self);} +SWIGINTERN char *s_xbt_dict_getValue(s_xbt_dict *self,char *key){return (char*)xbt_dict_get_or_null(self, key);} + + +/* --------------------------------------------------- + * C++ director class methods + * --------------------------------------------------- */ + +#include "surfJAVA_wrap.h" + +SwigDirector_Plugin::SwigDirector_Plugin(JNIEnv *jenv) : Plugin(), Swig::Director(jenv) { +} + +SwigDirector_Plugin::~SwigDirector_Plugin() { + swig_disconnect_director_self("swigDirectorDisconnect"); +} + + +void SwigDirector_Plugin::cpuCreatedCallback(Cpu *cpu) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jcpu = 0 ; + + if (!swig_override[0]) { + Plugin::cpuCreatedCallback(cpu); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *((Cpu **)&jcpu) = (Cpu *) cpu; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[0], swigjobj, jcpu); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_Plugin::cpuDestructedCallback(Cpu *cpu) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jcpu = 0 ; + + if (!swig_override[1]) { + Plugin::cpuDestructedCallback(cpu); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *((Cpu **)&jcpu) = (Cpu *) cpu; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[1], swigjobj, jcpu); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_Plugin::cpuStateChangedCallback(Cpu *cpu, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jcpu = 0 ; + jint jarg1 ; + jint jarg2 ; + + if (!swig_override[2]) { + Plugin::cpuStateChangedCallback(cpu,arg1,arg2); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *((Cpu **)&jcpu) = (Cpu *) cpu; + jarg1 = (jint) arg1; + jarg2 = (jint) arg2; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[2], swigjobj, jcpu, jarg1, jarg2); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_Plugin::cpuActionStateChangedCallback(CpuAction *action, e_surf_action_state_t arg1, e_surf_action_state_t arg2) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jaction = 0 ; + jint jarg1 ; + jint jarg2 ; + + if (!swig_override[3]) { + Plugin::cpuActionStateChangedCallback(action,arg1,arg2); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *((CpuAction **)&jaction) = (CpuAction *) action; + jarg1 = (jint) arg1; + jarg2 = (jint) arg2; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[3], swigjobj, jaction, jarg1, jarg2); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_Plugin::networkLinkCreatedCallback(NetworkLink *link) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jlink = 0 ; + + if (!swig_override[4]) { + Plugin::networkLinkCreatedCallback(link); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *((NetworkLink **)&jlink) = (NetworkLink *) link; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[4], swigjobj, jlink); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_Plugin::networkLinkDestructedCallback(NetworkLink *link) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jlink = 0 ; + + if (!swig_override[5]) { + Plugin::networkLinkDestructedCallback(link); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *((NetworkLink **)&jlink) = (NetworkLink *) link; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[5], swigjobj, jlink); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_Plugin::networkLinkStateChangedCallback(NetworkLink *link, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jlink = 0 ; + jint jarg1 ; + jint jarg2 ; + + if (!swig_override[6]) { + Plugin::networkLinkStateChangedCallback(link,arg1,arg2); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *((NetworkLink **)&jlink) = (NetworkLink *) link; + jarg1 = (jint) arg1; + jarg2 = (jint) arg2; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[6], swigjobj, jlink, jarg1, jarg2); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_Plugin::networkActionStateChangedCallback(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jaction = 0 ; + jint jold ; + jint jcur ; + + if (!swig_override[7]) { + Plugin::networkActionStateChangedCallback(action,old,cur); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *((NetworkAction **)&jaction) = (NetworkAction *) action; + jold = (jint) old; + jcur = (jint) cur; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[7], swigjobj, jaction, jold, jcur); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_Plugin::networkCommunicateCallback(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jaction = 0 ; + jlong jsrc = 0 ; + jlong jdst = 0 ; + jdouble jsize ; + jdouble jrate ; + + if (!swig_override[8]) { + Plugin::networkCommunicateCallback(action,src,dst,size,rate); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *((NetworkAction **)&jaction) = (NetworkAction *) action; + *((RoutingEdge **)&jsrc) = (RoutingEdge *) src; + *((RoutingEdge **)&jdst) = (RoutingEdge *) dst; + jsize = (jdouble) size; + jrate = (jdouble) rate; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[8], swigjobj, jaction, jsrc, jdst, jsize, jrate); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_Plugin::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) { + static struct { + const char *mname; + const char *mdesc; + jmethodID base_methid; + } methods[] = { + { + "cpuCreatedCallback", "(Lorg/simgrid/surf/Cpu;)V", NULL + }, + { + "cpuDestructedCallback", "(Lorg/simgrid/surf/Cpu;)V", NULL + }, + { + "cpuStateChangedCallback", "(Lorg/simgrid/surf/Cpu;Lorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/ResourceState;)V", NULL + }, + { + "cpuActionStateChangedCallback", "(Lorg/simgrid/surf/CpuAction;Lorg/simgrid/surf/ActionState;Lorg/simgrid/surf/ActionState;)V", NULL + }, + { + "networkLinkCreatedCallback", "(Lorg/simgrid/surf/NetworkLink;)V", NULL + }, + { + "networkLinkDestructedCallback", "(Lorg/simgrid/surf/NetworkLink;)V", NULL + }, + { + "networkLinkStateChangedCallback", "(Lorg/simgrid/surf/NetworkLink;Lorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/ResourceState;)V", NULL + }, + { + "networkActionStateChangedCallback", "(Lorg/simgrid/surf/NetworkAction;Lorg/simgrid/surf/ActionState;Lorg/simgrid/surf/ActionState;)V", NULL + }, + { + "networkCommunicateCallback", "(Lorg/simgrid/surf/NetworkAction;Lorg/simgrid/surf/RoutingEdge;Lorg/simgrid/surf/RoutingEdge;DD)V", NULL + } + }; + + static jclass baseclass = 0 ; + + if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) { + if (!baseclass) { + baseclass = jenv->FindClass("org/simgrid/surf/Plugin"); + if (!baseclass) return; + baseclass = (jclass) jenv->NewGlobalRef(baseclass); + } + bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true); + for (int i = 0; i < 9; ++i) { + if (!methods[i].base_methid) { + methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc); + if (!methods[i].base_methid) return; + } + swig_override[i] = false; + if (derived) { + jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc); + swig_override[i] = (methid != methods[i].base_methid); + jenv->ExceptionClear(); + } + } + } +} + + +SwigDirector_CpuModel::SwigDirector_CpuModel(JNIEnv *jenv, char const *name) : CpuModel(name), Swig::Director(jenv) { +} + +double SwigDirector_CpuModel::shareResources(double now) { + double c_result = SwigValueInit< double >() ; + jdouble jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jdouble jnow ; + + if (!swig_override[0]) { + return Model::shareResources(now); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jnow = (jdouble) now; + jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[9], swigjobj, jnow); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (double)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +double SwigDirector_CpuModel::shareResourcesLazy(double now) { + double c_result = SwigValueInit< double >() ; + jdouble jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jdouble jnow ; + + if (!swig_override[1]) { + return Model::shareResourcesLazy(now); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jnow = (jdouble) now; + jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[10], swigjobj, jnow); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (double)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +double SwigDirector_CpuModel::shareResourcesFull(double now) { + double c_result = SwigValueInit< double >() ; + jdouble jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jdouble jnow ; + + if (!swig_override[2]) { + return Model::shareResourcesFull(now); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jnow = (jdouble) now; + jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[11], swigjobj, jnow); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (double)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +void SwigDirector_CpuModel::updateActionsState(double now, double delta) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jdouble jnow ; + jdouble jdelta ; + + if (!swig_override[3]) { + Model::updateActionsState(now,delta); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jnow = (jdouble) now; + jdelta = (jdouble) delta; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[12], swigjobj, jnow, jdelta); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_CpuModel::updateActionsStateLazy(double now, double delta) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jdouble jnow ; + jdouble jdelta ; + + if (!swig_override[4]) { + Model::updateActionsStateLazy(now,delta); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jnow = (jdouble) now; + jdelta = (jdouble) delta; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[13], swigjobj, jnow, jdelta); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_CpuModel::updateActionsStateFull(double now, double delta) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jdouble jnow ; + jdouble jdelta ; + + if (!swig_override[5]) { + Model::updateActionsStateFull(now,delta); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jnow = (jdouble) now; + jdelta = (jdouble) delta; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[14], swigjobj, jnow, jdelta); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +ActionList *SwigDirector_CpuModel::getRunningActionSet() { + ActionList *c_result = 0 ; + jlong jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + + if (!swig_override[6]) { + return Model::getRunningActionSet(); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[15], swigjobj); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = *(ActionList **)&jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +SwigDirector_CpuModel::~SwigDirector_CpuModel() { + swig_disconnect_director_self("swigDirectorDisconnect"); +} + + +Cpu *SwigDirector_CpuModel::createResource(char const *name, DoubleDynar power_peak, int pstate, double power_scale, tmgr_trace *power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace *state_trace, s_xbt_dict *cpu_properties) { + Cpu *c_result = 0 ; + jlong jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jstring jname = 0 ; + jdoubleArray jpower_peak ; + jint jpstate ; + jdouble jpower_scale ; + jlong jpower_trace = 0 ; + jint jcore ; + jint jstate_initial ; + jlong jstate_trace = 0 ; + jlong jcpu_properties = 0 ; + + if (!swig_override[7]) { + SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method CpuModel::createResource."); + return c_result; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jname = 0; + if (name) { + jname = jenv->NewStringUTF((const char *)name); + if (!jname) return c_result; + } + + long l = xbt_dynar_length(power_peak); + jpower_peak = jenv->NewDoubleArray(l); + double *lout = (double *)xbt_dynar_to_array(power_peak); + jenv->SetDoubleArrayRegion(jpower_peak, 0, l, (const jdouble*)lout); + free(lout); + + jpstate = (jint) pstate; + jpower_scale = (jdouble) power_scale; + *((tmgr_trace **)&jpower_trace) = (tmgr_trace *) power_trace; + jcore = (jint) core; + jstate_initial = (jint) state_initial; + *((tmgr_trace **)&jstate_trace) = (tmgr_trace *) state_trace; + *((s_xbt_dict **)&jcpu_properties) = (s_xbt_dict *) cpu_properties; + jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[16], swigjobj, jname, jpower_peak, jpstate, jpower_scale, jpower_trace, jcore, jstate_initial, jstate_trace, jcpu_properties); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = *(Cpu **)&jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +void SwigDirector_CpuModel::addTraces() { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + + if (!swig_override[8]) { + SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method CpuModel::addTraces."); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[17], swigjobj); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_CpuModel::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) { + static struct { + const char *mname; + const char *mdesc; + jmethodID base_methid; + } methods[] = { + { + "shareResources", "(D)D", NULL + }, + { + "shareResourcesLazy", "(D)D", NULL + }, + { + "shareResourcesFull", "(D)D", NULL + }, + { + "updateActionsState", "(DD)V", NULL + }, + { + "updateActionsStateLazy", "(DD)V", NULL + }, + { + "updateActionsStateFull", "(DD)V", NULL + }, + { + "getRunningActionSet", "()Lorg/simgrid/surf/ActionList;", NULL + }, + { + "createResource", "(Ljava/lang/String;[DIDLorg/simgrid/surf/TmgrTrace;ILorg/simgrid/surf/ResourceState;Lorg/simgrid/surf/TmgrTrace;Lorg/simgrid/surf/XbtDict;)Lorg/simgrid/surf/Cpu;", NULL + }, + { + "addTraces", "()V", NULL + } + }; + + static jclass baseclass = 0 ; + + if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) { + if (!baseclass) { + baseclass = jenv->FindClass("org/simgrid/surf/CpuModel"); + if (!baseclass) return; + baseclass = (jclass) jenv->NewGlobalRef(baseclass); + } + bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true); + for (int i = 0; i < 9; ++i) { + if (!methods[i].base_methid) { + methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc); + if (!methods[i].base_methid) return; + } + swig_override[i] = false; + if (derived) { + jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc); + swig_override[i] = (methid != methods[i].base_methid); + jenv->ExceptionClear(); + } + } + } +} + + +SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, Model *model, char const *name, s_xbt_dict *props, lmm_constraint *constraint, int core, double powerPeak, double powerScale) : Cpu(model, name, props, constraint, core, powerPeak, powerScale), Swig::Director(jenv) { +} + +SwigDirector_Cpu::SwigDirector_Cpu(JNIEnv *jenv, Model *model, char const *name, s_xbt_dict *props, int core, double powerPeak, double powerScale) : Cpu(model, name, props, core, powerPeak, powerScale), Swig::Director(jenv) { +} + +bool SwigDirector_Cpu::isUsed() { + bool c_result = SwigValueInit< bool >() ; + jboolean jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + + if (!swig_override[0]) { + SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::isUsed."); + return c_result; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_SurfJNI, Swig::director_methids[18], swigjobj); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = jresult ? true : false; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +e_surf_resource_state_t SwigDirector_Cpu::getState() { + e_surf_resource_state_t c_result = SwigValueInit< e_surf_resource_state_t >() ; + jint jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + + if (!swig_override[1]) { + return Resource::getState(); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[19], swigjobj); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (e_surf_resource_state_t)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +void SwigDirector_Cpu::updateState(tmgr_trace_event *event_type, double value, double date) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jevent_type = 0 ; + jdouble jvalue ; + jdouble jdate ; + + if (!swig_override[2]) { + SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::updateState."); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *((tmgr_trace_event **)&jevent_type) = (tmgr_trace_event *) event_type; + jvalue = (jdouble) value; + jdate = (jdouble) date; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[20], swigjobj, jevent_type, jvalue, jdate); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +SwigDirector_Cpu::~SwigDirector_Cpu() { + swig_disconnect_director_self("swigDirectorDisconnect"); +} + + +double SwigDirector_Cpu::getCurrentPowerPeak() { + double c_result = SwigValueInit< double >() ; + jdouble jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + + if (!swig_override[3]) { + return Cpu::getCurrentPowerPeak(); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[21], swigjobj); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (double)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +CpuAction *SwigDirector_Cpu::execute(double size) { + CpuAction *c_result = 0 ; + jlong jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jdouble jsize ; + + if (!swig_override[4]) { + SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::execute."); + return c_result; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jsize = (jdouble) size; + jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[22], swigjobj, jsize); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = *(CpuAction **)&jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +CpuAction *SwigDirector_Cpu::sleep(double duration) { + CpuAction *c_result = 0 ; + jlong jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jdouble jduration ; + + if (!swig_override[5]) { + SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::sleep."); + return c_result; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jduration = (jdouble) duration; + jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_SurfJNI, Swig::director_methids[23], swigjobj, jduration); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = *(CpuAction **)&jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +int SwigDirector_Cpu::getCore() { + int c_result = SwigValueInit< int >() ; + jint jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + + if (!swig_override[6]) { + return Cpu::getCore(); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[24], swigjobj); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (int)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +double SwigDirector_Cpu::getSpeed(double load) { + double c_result = SwigValueInit< double >() ; + jdouble jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jdouble jload ; + + if (!swig_override[7]) { + return Cpu::getSpeed(load); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jload = (jdouble) load; + jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[25], swigjobj, jload); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (double)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +double SwigDirector_Cpu::getAvailableSpeed() { + double c_result = SwigValueInit< double >() ; + jdouble jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + + if (!swig_override[8]) { + return Cpu::getAvailableSpeed(); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[26], swigjobj); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (double)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +double SwigDirector_Cpu::getPowerPeakAt(int pstate_index) { + double c_result = SwigValueInit< double >() ; + jdouble jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jint jpstate_index ; + + if (!swig_override[9]) { + SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::getPowerPeakAt."); + return c_result; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jpstate_index = (jint) pstate_index; + jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[27], swigjobj, jpstate_index); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (double)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +int SwigDirector_Cpu::getNbPstates() { + int c_result = SwigValueInit< int >() ; + jint jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + + if (!swig_override[10]) { + SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::getNbPstates."); + return c_result; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_SurfJNI, Swig::director_methids[28], swigjobj); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (int)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +void SwigDirector_Cpu::setPowerPeakAt(int pstate_index) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jint jpstate_index ; + + if (!swig_override[11]) { + SWIG_JavaThrowException(JNIEnvWrapper(this).getJNIEnv(), SWIG_JavaDirectorPureVirtual, "Attempted to invoke pure virtual method Cpu::setPowerPeakAt."); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jpstate_index = (jint) pstate_index; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[29], swigjobj, jpstate_index); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_Cpu::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) { + static struct { + const char *mname; + const char *mdesc; + jmethodID base_methid; + } methods[] = { + { + "isUsed", "()Z", NULL + }, + { + "getState", "()Lorg/simgrid/surf/ResourceState;", NULL + }, + { + "updateState", "(Lorg/simgrid/surf/TmgrTraceEvent;DD)V", NULL + }, + { + "getCurrentPowerPeak", "()D", NULL + }, + { + "execute", "(D)Lorg/simgrid/surf/CpuAction;", NULL + }, + { + "sleep", "(D)Lorg/simgrid/surf/CpuAction;", NULL + }, + { + "getCore", "()I", NULL + }, + { + "getSpeed", "(D)D", NULL + }, + { + "getAvailableSpeed", "()D", NULL + }, + { + "getPowerPeakAt", "(I)D", NULL + }, + { + "getNbPstates", "()I", NULL + }, + { + "setPowerPeakAt", "(I)V", NULL + } + }; + + static jclass baseclass = 0 ; + + if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) { + if (!baseclass) { + baseclass = jenv->FindClass("org/simgrid/surf/Cpu"); + if (!baseclass) return; + baseclass = (jclass) jenv->NewGlobalRef(baseclass); + } + bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true); + for (int i = 0; i < 12; ++i) { + if (!methods[i].base_methid) { + methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc); + if (!methods[i].base_methid) return; + } + swig_override[i] = false; + if (derived) { + jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc); + swig_override[i] = (methid != methods[i].base_methid); + jenv->ExceptionClear(); + } + } + } +} + + +SwigDirector_CpuAction::SwigDirector_CpuAction(JNIEnv *jenv, Model *model, double cost, bool failed) : CpuAction(model, cost, failed), Swig::Director(jenv) { +} + +SwigDirector_CpuAction::~SwigDirector_CpuAction() { + swig_disconnect_director_self("swigDirectorDisconnect"); +} + + +double SwigDirector_CpuAction::getRemains() { + double c_result = SwigValueInit< double >() ; + jdouble jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + + if (!swig_override[0]) { + return Action::getRemains(); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jresult = (jdouble) jenv->CallStaticDoubleMethod(Swig::jclass_SurfJNI, Swig::director_methids[30], swigjobj); + if (jenv->ExceptionCheck() == JNI_TRUE) return c_result; + c_result = (double)jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +void SwigDirector_CpuAction::setPriority(double priority) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jdouble jpriority ; + + if (!swig_override[1]) { + Action::setPriority(priority); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jpriority = (jdouble) priority; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[31], swigjobj, jpriority); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_CpuAction::setState(e_surf_action_state_t state) { + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jint jstate ; + + if (!swig_override[2]) { + Action::setState(state); + return; + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + jstate = (jint) state; + jenv->CallStaticVoidMethod(Swig::jclass_SurfJNI, Swig::director_methids[32], swigjobj, jstate); + if (jenv->ExceptionCheck() == JNI_TRUE) return ; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object"); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); +} + +void SwigDirector_CpuAction::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) { + static struct { + const char *mname; + const char *mdesc; + jmethodID base_methid; + } methods[] = { + { + "getRemains", "()D", NULL + }, + { + "setPriority", "(D)V", NULL + }, + { + "setState", "(Lorg/simgrid/surf/ActionState;)V", NULL + } + }; + + static jclass baseclass = 0 ; + + if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) { + if (!baseclass) { + baseclass = jenv->FindClass("org/simgrid/surf/CpuAction"); + if (!baseclass) return; + baseclass = (jclass) jenv->NewGlobalRef(baseclass); + } + bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true); + for (int i = 0; i < 3; ++i) { + if (!methods[i].base_methid) { + methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc); + if (!methods[i].base_methid) return; + } + swig_override[i] = false; + if (derived) { + jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc); + swig_override[i] = (methid != methods[i].base_methid); + jenv->ExceptionClear(); + } + } + } +} + + + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_getAction(JNIEnv *env, jclass cls, jlong jarg1) { + Action * action = (Action *)jarg1; + jobject res; + CpuAction *cpu_action = dynamic_cast(action); + if (cpu_action) { + SwigDirector_CpuAction *dir_cpu_action = dynamic_cast(cpu_action); + if (dir_cpu_action) { + res = dir_cpu_action->swig_get_self(env);\ + } else { + jclass clss = env->FindClass("org/simgrid/surf/CpuAction");\ + jmethodID constru = env->GetMethodID(clss, "", "()V");\ + res = env->NewObject(clss, constru);\ + res = env->NewGlobalRef(res);\ + } + } else { + jclass clss = env->FindClass("org/simgrid/surf/Action");\ + jmethodID constru = env->GetMethodID(clss, "", "()V");\ + res = env->NewObject(clss, constru);\ + res = env->NewGlobalRef(res);\ + } + return res; +} + +#define GETDIRECTOR(NAME) \ +JNIEXPORT jobject JNICALL Java_org_simgrid_surf_SurfJNI_get## NAME ## Director(JNIEnv *env, jclass cls, jlong jarg1)\ +{\ + NAME * arg1 = (NAME*)jarg1;\ + SwigDirector_ ##NAME *director = dynamic_cast(arg1);\ + jobject res;\ + if (director) {\ + res = director->swig_get_self(env);\ + } else {\ + jclass clss = env->FindClass("org/simgrid/surf/NAME");\ + jmethodID constru = env->GetMethodID(clss, "", "()V");\ + res = env->NewObject(clss, constru);\ + res = env->NewGlobalRef(res);\ + }\ + return res;\ +} + +GETDIRECTOR(CpuModel) +GETDIRECTOR(Cpu) +GETDIRECTOR(CpuAction) + +#ifdef __cplusplus +} +#endif + + +SWIGEXPORT jlongArray JNICALL Java_org_simgrid_surf_SurfJNI_ActionList_1getArray(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlongArray jresult = 0 ; + ActionList *arg1 = (ActionList *) 0 ; + ActionArrayPtr result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(ActionList **)&jarg1; + result = (ActionArrayPtr)ActionList_getArray(arg1); + { + long l = 0; + for(ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) { + l++; + } + jresult = jenv->NewLongArray(l); + jlong *elts = jenv->GetLongArrayElements(jresult, NULL); + l = 0; + for(ActionList::iterator it(result->begin()), itend(result->end()); it != itend ; ++it) { + elts[l++] = (jlong)static_cast(&*it); + } + jenv->ReleaseLongArrayElements(jresult, elts, 0); + } + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1ActionList(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + ActionList *result = 0 ; + + (void)jenv; + (void)jcls; + result = (ActionList *)new ActionList(); + *(ActionList **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1ActionList(JNIEnv *jenv, jclass jcls, jlong jarg1) { + ActionList *arg1 = (ActionList *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(ActionList **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_getClock(JNIEnv *jenv, jclass jcls) { + jdouble jresult = 0 ; + double result; + + (void)jenv; + (void)jcls; + result = (double)getClock(); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_clean(JNIEnv *jenv, jclass jcls) { + (void)jenv; + (void)jcls; + clean(); +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_getCpuModel(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + CpuModel *result = 0 ; + + (void)jenv; + (void)jcls; + result = (CpuModel *)getCpuModel(); + *(CpuModel **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_setCpuModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + CpuModel *arg1 = (CpuModel *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(CpuModel **)&jarg1; + setCpuModel(arg1); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_setCpu(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2, jobject jarg2_) { + char *arg1 = (char *) 0 ; + Cpu *arg2 = (Cpu *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg2_; + arg1 = 0; + if (jarg1) { + arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); + if (!arg1) return ; + } + arg2 = *(Cpu **)&jarg2; + setCpu(arg1,arg2); + { + + } +} + + +SWIGEXPORT jlongArray JNICALL Java_org_simgrid_surf_SurfJNI_getRoute(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2) { + jlongArray jresult = 0 ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + NetworkLinkDynar result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); + if (!arg1) return 0; + } + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return 0; + } + result = getRoute(arg1,arg2); + { + long l = xbt_dynar_length(result); + jresult = jenv->NewLongArray(l); + unsigned i; + NetworkLink *link; + jlong *elts = jenv->GetLongArrayElements(jresult, NULL); + xbt_dynar_foreach(result, i, link) { + elts[i] = (jlong)link; + } + jenv->ReleaseLongArrayElements(jresult, elts, 0); + xbt_dynar_free(&result); + } + if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Plugin(JNIEnv *jenv, jclass jcls, jlong jarg1) { + Plugin *arg1 = (Plugin *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(Plugin **)&jarg1; + delete arg1; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + Plugin *arg1 = (Plugin *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Plugin **)&jarg1; + (arg1)->activateCpuCreatedCallback(); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + Plugin *arg1 = (Plugin *) 0 ; + Cpu *arg2 = (Cpu *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(Cpu **)&jarg2; + (arg1)->cpuCreatedCallback(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuCreatedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + Plugin *arg1 = (Plugin *) 0 ; + Cpu *arg2 = (Cpu *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(Cpu **)&jarg2; + (arg1)->Plugin::cpuCreatedCallback(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + Plugin *arg1 = (Plugin *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Plugin **)&jarg1; + (arg1)->activateCpuDestructedCallback(); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + Plugin *arg1 = (Plugin *) 0 ; + Cpu *arg2 = (Cpu *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(Cpu **)&jarg2; + (arg1)->cpuDestructedCallback(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuDestructedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + Plugin *arg1 = (Plugin *) 0 ; + Cpu *arg2 = (Cpu *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(Cpu **)&jarg2; + (arg1)->Plugin::cpuDestructedCallback(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + Plugin *arg1 = (Plugin *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Plugin **)&jarg1; + (arg1)->activateCpuStateChangedCallback(); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { + Plugin *arg1 = (Plugin *) 0 ; + Cpu *arg2 = (Cpu *) 0 ; + e_surf_resource_state_t arg3 ; + e_surf_resource_state_t arg4 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(Cpu **)&jarg2; + arg3 = (e_surf_resource_state_t)jarg3; + arg4 = (e_surf_resource_state_t)jarg4; + (arg1)->cpuStateChangedCallback(arg2,arg3,arg4); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { + Plugin *arg1 = (Plugin *) 0 ; + Cpu *arg2 = (Cpu *) 0 ; + e_surf_resource_state_t arg3 ; + e_surf_resource_state_t arg4 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(Cpu **)&jarg2; + arg3 = (e_surf_resource_state_t)jarg3; + arg4 = (e_surf_resource_state_t)jarg4; + (arg1)->Plugin::cpuStateChangedCallback(arg2,arg3,arg4); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateCpuActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + Plugin *arg1 = (Plugin *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Plugin **)&jarg1; + (arg1)->activateCpuActionStateChangedCallback(); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { + Plugin *arg1 = (Plugin *) 0 ; + CpuAction *arg2 = (CpuAction *) 0 ; + e_surf_action_state_t arg3 ; + e_surf_action_state_t arg4 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(CpuAction **)&jarg2; + arg3 = (e_surf_action_state_t)jarg3; + arg4 = (e_surf_action_state_t)jarg4; + (arg1)->cpuActionStateChangedCallback(arg2,arg3,arg4); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1cpuActionStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { + Plugin *arg1 = (Plugin *) 0 ; + CpuAction *arg2 = (CpuAction *) 0 ; + e_surf_action_state_t arg3 ; + e_surf_action_state_t arg4 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(CpuAction **)&jarg2; + arg3 = (e_surf_action_state_t)jarg3; + arg4 = (e_surf_action_state_t)jarg4; + (arg1)->Plugin::cpuActionStateChangedCallback(arg2,arg3,arg4); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkLinkCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + Plugin *arg1 = (Plugin *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Plugin **)&jarg1; + (arg1)->activateNetworkLinkCreatedCallback(); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkCreatedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + Plugin *arg1 = (Plugin *) 0 ; + NetworkLink *arg2 = (NetworkLink *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(NetworkLink **)&jarg2; + (arg1)->networkLinkCreatedCallback(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkCreatedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + Plugin *arg1 = (Plugin *) 0 ; + NetworkLink *arg2 = (NetworkLink *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(NetworkLink **)&jarg2; + (arg1)->Plugin::networkLinkCreatedCallback(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkLinkDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + Plugin *arg1 = (Plugin *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Plugin **)&jarg1; + (arg1)->activateNetworkLinkDestructedCallback(); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkDestructedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + Plugin *arg1 = (Plugin *) 0 ; + NetworkLink *arg2 = (NetworkLink *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(NetworkLink **)&jarg2; + (arg1)->networkLinkDestructedCallback(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkDestructedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + Plugin *arg1 = (Plugin *) 0 ; + NetworkLink *arg2 = (NetworkLink *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(NetworkLink **)&jarg2; + (arg1)->Plugin::networkLinkDestructedCallback(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkLinkStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + Plugin *arg1 = (Plugin *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Plugin **)&jarg1; + (arg1)->activateNetworkLinkStateChangedCallback(); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { + Plugin *arg1 = (Plugin *) 0 ; + NetworkLink *arg2 = (NetworkLink *) 0 ; + e_surf_resource_state_t arg3 ; + e_surf_resource_state_t arg4 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(NetworkLink **)&jarg2; + arg3 = (e_surf_resource_state_t)jarg3; + arg4 = (e_surf_resource_state_t)jarg4; + (arg1)->networkLinkStateChangedCallback(arg2,arg3,arg4); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkLinkStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { + Plugin *arg1 = (Plugin *) 0 ; + NetworkLink *arg2 = (NetworkLink *) 0 ; + e_surf_resource_state_t arg3 ; + e_surf_resource_state_t arg4 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(NetworkLink **)&jarg2; + arg3 = (e_surf_resource_state_t)jarg3; + arg4 = (e_surf_resource_state_t)jarg4; + (arg1)->Plugin::networkLinkStateChangedCallback(arg2,arg3,arg4); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + Plugin *arg1 = (Plugin *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Plugin **)&jarg1; + (arg1)->activateNetworkActionStateChangedCallback(); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkActionStateChangedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { + Plugin *arg1 = (Plugin *) 0 ; + NetworkAction *arg2 = (NetworkAction *) 0 ; + e_surf_action_state_t arg3 ; + e_surf_action_state_t arg4 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(NetworkAction **)&jarg2; + arg3 = (e_surf_action_state_t)jarg3; + arg4 = (e_surf_action_state_t)jarg4; + (arg1)->networkActionStateChangedCallback(arg2,arg3,arg4); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkActionStateChangedCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jint jarg4) { + Plugin *arg1 = (Plugin *) 0 ; + NetworkAction *arg2 = (NetworkAction *) 0 ; + e_surf_action_state_t arg3 ; + e_surf_action_state_t arg4 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(NetworkAction **)&jarg2; + arg3 = (e_surf_action_state_t)jarg3; + arg4 = (e_surf_action_state_t)jarg4; + (arg1)->Plugin::networkActionStateChangedCallback(arg2,arg3,arg4); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1activateNetworkCommunicateCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + Plugin *arg1 = (Plugin *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Plugin **)&jarg1; + (arg1)->activateNetworkCommunicateCallback(); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkCommunicateCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jdouble jarg5, jdouble jarg6) { + Plugin *arg1 = (Plugin *) 0 ; + NetworkAction *arg2 = (NetworkAction *) 0 ; + RoutingEdge *arg3 = (RoutingEdge *) 0 ; + RoutingEdge *arg4 = (RoutingEdge *) 0 ; + double arg5 ; + double arg6 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + (void)jarg3_; + (void)jarg4_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(NetworkAction **)&jarg2; + arg3 = *(RoutingEdge **)&jarg3; + arg4 = *(RoutingEdge **)&jarg4; + arg5 = (double)jarg5; + arg6 = (double)jarg6; + (arg1)->networkCommunicateCallback(arg2,arg3,arg4,arg5,arg6); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1networkCommunicateCallbackSwigExplicitPlugin(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jdouble jarg5, jdouble jarg6) { + Plugin *arg1 = (Plugin *) 0 ; + NetworkAction *arg2 = (NetworkAction *) 0 ; + RoutingEdge *arg3 = (RoutingEdge *) 0 ; + RoutingEdge *arg4 = (RoutingEdge *) 0 ; + double arg5 ; + double arg6 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + (void)jarg3_; + (void)jarg4_; + arg1 = *(Plugin **)&jarg1; + arg2 = *(NetworkAction **)&jarg2; + arg3 = *(RoutingEdge **)&jarg3; + arg4 = *(RoutingEdge **)&jarg4; + arg5 = (double)jarg5; + arg6 = (double)jarg6; + (arg1)->Plugin::networkCommunicateCallback(arg2,arg3,arg4,arg5,arg6); +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Plugin(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + Plugin *result = 0 ; + + (void)jenv; + (void)jcls; + result = (Plugin *)new SwigDirector_Plugin(jenv); + *(Plugin **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) { + Plugin *obj = *((Plugin **)&objarg); + (void)jcls; + SwigDirector_Plugin *director = dynamic_cast(obj); + if (director) { + director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE)); + } +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Plugin_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) { + Plugin *obj = *((Plugin **)&objarg); + SwigDirector_Plugin *director = dynamic_cast(obj); + (void)jcls; + if (director) { + director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false); + } +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1TmgrTrace(JNIEnv *jenv, jclass jcls, jlong jarg1) { + tmgr_trace *arg1 = (tmgr_trace *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(tmgr_trace **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_TmgrTraceEvent_1getIdx(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + tmgr_trace_event *arg1 = (tmgr_trace_event *) 0 ; + unsigned int result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(tmgr_trace_event **)&jarg1; + result = (unsigned int)tmgr_trace_event_getIdx(arg1); + jresult = (jlong)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1TmgrTraceEvent(JNIEnv *jenv, jclass jcls, jlong jarg1) { + tmgr_trace_event *arg1 = (tmgr_trace_event *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(tmgr_trace_event **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Model(JNIEnv *jenv, jclass jcls, jstring jarg1) { + jlong jresult = 0 ; + char *arg1 = (char *) 0 ; + Model *result = 0 ; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); + if (!arg1) return 0; + } + result = (Model *)new Model((char const *)arg1); + *(Model **)&jresult = result; + { + + } + return jresult; +} + + +SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_Model_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jstring jresult = 0 ; + Model *arg1 = (Model *) 0 ; + char *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Model **)&jarg1; + result = (char *)(arg1)->getName(); + if (result) jresult = jenv->NewStringUTF((const char *)result); + return jresult; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResources(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + jdouble jresult = 0 ; + Model *arg1 = (Model *) 0 ; + double arg2 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Model **)&jarg1; + arg2 = (double)jarg2; + result = (double)(arg1)->shareResources(arg2); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResourcesLazy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + jdouble jresult = 0 ; + Model *arg1 = (Model *) 0 ; + double arg2 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Model **)&jarg1; + arg2 = (double)jarg2; + result = (double)(arg1)->shareResourcesLazy(arg2); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Model_1shareResourcesFull(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + jdouble jresult = 0 ; + Model *arg1 = (Model *) 0 ; + double arg2 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Model **)&jarg1; + arg2 = (double)jarg2; + result = (double)(arg1)->shareResourcesFull(arg2); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) { + Model *arg1 = (Model *) 0 ; + double arg2 ; + double arg3 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Model **)&jarg1; + arg2 = (double)jarg2; + arg3 = (double)jarg3; + (arg1)->updateActionsState(arg2,arg3); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsStateLazy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) { + Model *arg1 = (Model *) 0 ; + double arg2 ; + double arg3 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Model **)&jarg1; + arg2 = (double)jarg2; + arg3 = (double)jarg3; + (arg1)->updateActionsStateLazy(arg2,arg3); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Model_1updateActionsStateFull(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) { + Model *arg1 = (Model *) 0 ; + double arg2 ; + double arg3 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Model **)&jarg1; + arg2 = (double)jarg2; + arg3 = (double)jarg3; + (arg1)->updateActionsStateFull(arg2,arg3); +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Model_1getRunningActionSet(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + Model *arg1 = (Model *) 0 ; + ActionList *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Model **)&jarg1; + result = (ActionList *)(arg1)->getRunningActionSet(); + *(ActionList **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Model(JNIEnv *jenv, jclass jcls, jlong jarg1) { + Model *arg1 = (Model *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(Model **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1CpuModel(JNIEnv *jenv, jclass jcls, jstring jarg1) { + jlong jresult = 0 ; + char *arg1 = (char *) 0 ; + CpuModel *result = 0 ; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); + if (!arg1) return 0; + } + result = (CpuModel *)new SwigDirector_CpuModel(jenv,(char const *)arg1); + *(CpuModel **)&jresult = result; + { + + } + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1CpuModel(JNIEnv *jenv, jclass jcls, jlong jarg1) { + CpuModel *arg1 = (CpuModel *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(CpuModel **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1createResource(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jdoubleArray jarg3, jint jarg4, jdouble jarg5, jlong jarg6, jobject jarg6_, jint jarg7, jint jarg8, jlong jarg9, jobject jarg9_, jlong jarg10, jobject jarg10_) { + jlong jresult = 0 ; + CpuModel *arg1 = (CpuModel *) 0 ; + char *arg2 = (char *) 0 ; + DoubleDynar arg3 ; + int arg4 ; + double arg5 ; + tmgr_trace *arg6 = (tmgr_trace *) 0 ; + int arg7 ; + e_surf_resource_state_t arg8 ; + tmgr_trace *arg9 = (tmgr_trace *) 0 ; + s_xbt_dict *arg10 = (s_xbt_dict *) 0 ; + DoubleDynar *argp3 ; + Cpu *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg6_; + (void)jarg9_; + (void)jarg10_; + arg1 = *(CpuModel **)&jarg1; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return 0; + } + argp3 = *(DoubleDynar **)&jarg3; + if (!argp3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null DoubleDynar"); + return 0; + } + arg3 = *argp3; + arg4 = (int)jarg4; + arg5 = (double)jarg5; + arg6 = *(tmgr_trace **)&jarg6; + arg7 = (int)jarg7; + arg8 = (e_surf_resource_state_t)jarg8; + arg9 = *(tmgr_trace **)&jarg9; + arg10 = *(s_xbt_dict **)&jarg10; + result = (Cpu *)(arg1)->createResource((char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); + *(Cpu **)&jresult = result; + { + + } + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1addTraces(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + CpuModel *arg1 = (CpuModel *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(CpuModel **)&jarg1; + (arg1)->addTraces(); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) { + CpuModel *obj = *((CpuModel **)&objarg); + (void)jcls; + SwigDirector_CpuModel *director = dynamic_cast(obj); + if (director) { + director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE)); + } +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) { + CpuModel *obj = *((CpuModel **)&objarg); + SwigDirector_CpuModel *director = dynamic_cast(obj); + (void)jcls; + if (director) { + director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false); + } +} + + +SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jstring jresult = 0 ; + Resource *arg1 = (Resource *) 0 ; + char *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Resource **)&jarg1; + result = (char *)(arg1)->getName(); + if (result) jresult = jenv->NewStringUTF((const char *)result); + return jresult; +} + + +SWIGEXPORT jboolean JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1isUsed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jboolean jresult = 0 ; + Resource *arg1 = (Resource *) 0 ; + bool result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Resource **)&jarg1; + result = (bool)(arg1)->isUsed(); + jresult = (jboolean)result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + Resource *arg1 = (Resource *) 0 ; + Model *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Resource **)&jarg1; + result = (Model *)(arg1)->getModel(); + *(Model **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + Resource *arg1 = (Resource *) 0 ; + e_surf_resource_state_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Resource **)&jarg1; + result = (e_surf_resource_state_t)(arg1)->getState(); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getConstraint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + Resource *arg1 = (Resource *) 0 ; + lmm_constraint *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Resource **)&jarg1; + result = (lmm_constraint *)(arg1)->getConstraint(); + *(lmm_constraint **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1getProperties(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + Resource *arg1 = (Resource *) 0 ; + s_xbt_dict *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Resource **)&jarg1; + result = (s_xbt_dict *)(arg1)->getProperties(); + *(s_xbt_dict **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Resource_1updateState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jdouble jarg3, jdouble jarg4) { + Resource *arg1 = (Resource *) 0 ; + tmgr_trace_event *arg2 = (tmgr_trace_event *) 0 ; + double arg3 ; + double arg4 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(Resource **)&jarg1; + arg2 = *(tmgr_trace_event **)&jarg2; + arg3 = (double)jarg3; + arg4 = (double)jarg4; + (arg1)->updateState(arg2,arg3,arg4); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Resource(JNIEnv *jenv, jclass jcls, jlong jarg1) { + Resource *arg1 = (Resource *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(Resource **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jint jarg5, jdouble jarg6, jdouble jarg7) { + jlong jresult = 0 ; + Model *arg1 = (Model *) 0 ; + char *arg2 = (char *) 0 ; + s_xbt_dict *arg3 = (s_xbt_dict *) 0 ; + lmm_constraint *arg4 = (lmm_constraint *) 0 ; + int arg5 ; + double arg6 ; + double arg7 ; + Cpu *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg3_; + (void)jarg4_; + arg1 = *(Model **)&jarg1; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return 0; + } + arg3 = *(s_xbt_dict **)&jarg3; + arg4 = *(lmm_constraint **)&jarg4; + arg5 = (int)jarg5; + arg6 = (double)jarg6; + arg7 = (double)jarg7; + result = (Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7); + *(Cpu **)&jresult = result; + { + + } + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Cpu_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jint jarg4, jdouble jarg5, jdouble jarg6) { + jlong jresult = 0 ; + Model *arg1 = (Model *) 0 ; + char *arg2 = (char *) 0 ; + s_xbt_dict *arg3 = (s_xbt_dict *) 0 ; + int arg4 ; + double arg5 ; + double arg6 ; + Cpu *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg3_; + arg1 = *(Model **)&jarg1; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return 0; + } + arg3 = *(s_xbt_dict **)&jarg3; + arg4 = (int)jarg4; + arg5 = (double)jarg5; + arg6 = (double)jarg6; + result = (Cpu *)new SwigDirector_Cpu(jenv,arg1,(char const *)arg2,arg3,arg4,arg5,arg6); + *(Cpu **)&jresult = result; + { + + } + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Cpu(JNIEnv *jenv, jclass jcls, jlong jarg1) { + Cpu *arg1 = (Cpu *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(Cpu **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCurrentPowerPeak(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + result = (double)(arg1)->getCurrentPowerPeak(); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCurrentPowerPeakSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + result = (double)(arg1)->Cpu::getCurrentPowerPeak(); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1execute(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + jlong jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + double arg2 ; + CpuAction *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + arg2 = (double)jarg2; + result = (CpuAction *)(arg1)->execute(arg2); + *(CpuAction **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1sleep(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + jlong jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + double arg2 ; + CpuAction *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + arg2 = (double)jarg2; + result = (CpuAction *)(arg1)->sleep(arg2); + *(CpuAction **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCore(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + int result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + result = (int)(arg1)->getCore(); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getCoreSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + int result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + result = (int)(arg1)->Cpu::getCore(); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getSpeed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + jdouble jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + double arg2 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + arg2 = (double)jarg2; + result = (double)(arg1)->getSpeed(arg2); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getSpeedSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + jdouble jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + double arg2 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + arg2 = (double)jarg2; + result = (double)(arg1)->Cpu::getSpeed(arg2); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getAvailableSpeed(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + result = (double)(arg1)->getAvailableSpeed(); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getAvailableSpeedSwigExplicitCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + result = (double)(arg1)->Cpu::getAvailableSpeed(); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getPowerPeakAt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + jdouble jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + int arg2 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + arg2 = (int)jarg2; + result = (double)(arg1)->getPowerPeakAt(arg2); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1getNbPstates(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + Cpu *arg1 = (Cpu *) 0 ; + int result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + result = (int)(arg1)->getNbPstates(); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1setPowerPeakAt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + Cpu *arg1 = (Cpu *) 0 ; + int arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + arg2 = (int)jarg2; + (arg1)->setPowerPeakAt(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1setState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + Cpu *arg1 = (Cpu *) 0 ; + e_surf_resource_state_t arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Cpu **)&jarg1; + arg2 = (e_surf_resource_state_t)jarg2; + (arg1)->setState(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) { + Cpu *obj = *((Cpu **)&objarg); + (void)jcls; + SwigDirector_Cpu *director = dynamic_cast(obj); + if (director) { + director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE)); + } +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) { + Cpu *obj = *((Cpu **)&objarg); + SwigDirector_Cpu *director = dynamic_cast(obj); + (void)jcls; + if (director) { + director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false); + } +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1NetworkLink(JNIEnv *jenv, jclass jcls, jlong jarg1) { + NetworkLink *arg1 = (NetworkLink *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(NetworkLink **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_NetworkLink_1getBandwidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + NetworkLink *arg1 = (NetworkLink *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(NetworkLink **)&jarg1; + result = (double)(arg1)->getBandwidth(); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_NetworkLink_1updateBandwidth_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) { + NetworkLink *arg1 = (NetworkLink *) 0 ; + double arg2 ; + double arg3 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(NetworkLink **)&jarg1; + arg2 = (double)jarg2; + arg3 = (double)jarg3; + (arg1)->updateBandwidth(arg2,arg3); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_NetworkLink_1updateBandwidth_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + NetworkLink *arg1 = (NetworkLink *) 0 ; + double arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(NetworkLink **)&jarg1; + arg2 = (double)jarg2; + (arg1)->updateBandwidth(arg2); +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_NetworkLink_1getLatency(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + NetworkLink *arg1 = (NetworkLink *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(NetworkLink **)&jarg1; + result = (double)(arg1)->getLatency(); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_NetworkLink_1updateLatency_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jdouble jarg3) { + NetworkLink *arg1 = (NetworkLink *) 0 ; + double arg2 ; + double arg3 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(NetworkLink **)&jarg1; + arg2 = (double)jarg2; + arg3 = (double)jarg3; + (arg1)->updateLatency(arg2,arg3); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_NetworkLink_1updateLatency_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + NetworkLink *arg1 = (NetworkLink *) 0 ; + double arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(NetworkLink **)&jarg1; + arg2 = (double)jarg2; + (arg1)->updateLatency(arg2); +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1Action(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jboolean jarg3) { + jlong jresult = 0 ; + Model *arg1 = (Model *) 0 ; + double arg2 ; + bool arg3 ; + Action *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Model **)&jarg1; + arg2 = (double)jarg2; + arg3 = jarg3 ? true : false; + result = (Action *)new Action(arg1,arg2,arg3); + *(Action **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1Action(JNIEnv *jenv, jclass jcls, jlong jarg1) { + Action *arg1 = (Action *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(Action **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getModel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + Action *arg1 = (Action *) 0 ; + Model *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Action **)&jarg1; + result = (Model *)(arg1)->getModel(); + *(Model **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getVariable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + Action *arg1 = (Action *) 0 ; + lmm_variable *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Action **)&jarg1; + result = (lmm_variable *)(arg1)->getVariable(); + *(lmm_variable **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; + Action *arg1 = (Action *) 0 ; + e_surf_action_state_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Action **)&jarg1; + result = (e_surf_action_state_t)(arg1)->getState(); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jboolean JNICALL Java_org_simgrid_surf_SurfJNI_Action_1isSuspended(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jboolean jresult = 0 ; + Action *arg1 = (Action *) 0 ; + bool result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Action **)&jarg1; + result = (bool)(arg1)->isSuspended(); + jresult = (jboolean)result; + return jresult; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + Action *arg1 = (Action *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Action **)&jarg1; + result = (double)(arg1)->getBound(); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setBound(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + Action *arg1 = (Action *) 0 ; + double arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Action **)&jarg1; + arg2 = (double)jarg2; + (arg1)->setBound(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1updateRemains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + Action *arg1 = (Action *) 0 ; + double arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Action **)&jarg1; + arg2 = (double)jarg2; + (arg1)->updateRemains(arg2); +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_Action_1getRemains(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + Action *arg1 = (Action *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Action **)&jarg1; + result = (double)(arg1)->getRemains(); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setPriority(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { + Action *arg1 = (Action *) 0 ; + double arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Action **)&jarg1; + arg2 = (double)jarg2; + (arg1)->setPriority(arg2); +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_Action_1setState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { + Action *arg1 = (Action *) 0 ; + e_surf_action_state_t arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Action **)&jarg1; + arg2 = (e_surf_action_state_t)jarg2; + (arg1)->setState(arg2); +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1CpuAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2, jboolean jarg3) { + jlong jresult = 0 ; + Model *arg1 = (Model *) 0 ; + double arg2 ; + bool arg3 ; + CpuAction *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Model **)&jarg1; + arg2 = (double)jarg2; + arg3 = jarg3 ? true : false; + result = (CpuAction *)new SwigDirector_CpuAction(jenv,arg1,arg2,arg3); + *(CpuAction **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1getCpu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + CpuAction *arg1 = (CpuAction *) 0 ; + Cpu *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(CpuAction **)&jarg1; + result = (Cpu *)CpuAction_getCpu(arg1); + *(Cpu **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1CpuAction(JNIEnv *jenv, jclass jcls, jlong jarg1) { + CpuAction *arg1 = (CpuAction *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(CpuAction **)&jarg1; + delete arg1; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) { + CpuAction *obj = *((CpuAction **)&objarg); + (void)jcls; + SwigDirector_CpuAction *director = dynamic_cast(obj); + if (director) { + director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE)); + } +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) { + CpuAction *obj = *((CpuAction **)&objarg); + SwigDirector_CpuAction *director = dynamic_cast(obj); + (void)jcls; + if (director) { + director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false); + } +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_NetworkAction_1getLatency(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + NetworkAction *arg1 = (NetworkAction *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(NetworkAction **)&jarg1; + result = (double)NetworkAction_getLatency(arg1); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1NetworkAction(JNIEnv *jenv, jclass jcls, jlong jarg1) { + NetworkAction *arg1 = (NetworkAction *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(NetworkAction **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_RoutingEdge_1getName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jstring jresult = 0 ; + RoutingEdge *arg1 = (RoutingEdge *) 0 ; + char *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(RoutingEdge **)&jarg1; + result = (char *)(arg1)->getName(); + if (result) jresult = jenv->NewStringUTF((const char *)result); + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1RoutingEdge(JNIEnv *jenv, jclass jcls, jlong jarg1) { + RoutingEdge *arg1 = (RoutingEdge *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(RoutingEdge **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_LmmConstraint_1getUsage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + lmm_constraint *arg1 = (lmm_constraint *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(lmm_constraint **)&jarg1; + result = (double)lmm_constraint_getUsage(arg1); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1LmmConstraint(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + lmm_constraint *result = 0 ; + + (void)jenv; + (void)jcls; + result = (lmm_constraint *)new lmm_constraint(); + *(lmm_constraint **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1LmmConstraint(JNIEnv *jenv, jclass jcls, jlong jarg1) { + lmm_constraint *arg1 = (lmm_constraint *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(lmm_constraint **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jdouble JNICALL Java_org_simgrid_surf_SurfJNI_LmmVariable_1getValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jdouble jresult = 0 ; + lmm_variable *arg1 = (lmm_variable *) 0 ; + double result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(lmm_variable **)&jarg1; + result = (double)lmm_variable_getValue(arg1); + jresult = (jdouble)result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1LmmVariable(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + lmm_variable *result = 0 ; + + (void)jenv; + (void)jcls; + result = (lmm_variable *)new lmm_variable(); + *(lmm_variable **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1LmmVariable(JNIEnv *jenv, jclass jcls, jlong jarg1) { + lmm_variable *arg1 = (lmm_variable *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(lmm_variable **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jstring JNICALL Java_org_simgrid_surf_SurfJNI_XbtDict_1getValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { + jstring jresult = 0 ; + s_xbt_dict *arg1 = (s_xbt_dict *) 0 ; + char *arg2 = (char *) 0 ; + char *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(s_xbt_dict **)&jarg1; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return 0; + } + result = (char *)s_xbt_dict_getValue(arg1,arg2); + if (result) jresult = jenv->NewStringUTF((const char *)result); + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_new_1XbtDict(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + s_xbt_dict *result = 0 ; + + (void)jenv; + (void)jcls; + result = (s_xbt_dict *)new s_xbt_dict(); + *(s_xbt_dict **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_delete_1XbtDict(JNIEnv *jenv, jclass jcls, jlong jarg1) { + s_xbt_dict *arg1 = (s_xbt_dict *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(s_xbt_dict **)&jarg1; + delete arg1; +} + + +SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1ACTION_1READY_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + e_surf_action_state_t result; + + (void)jenv; + (void)jcls; + result = (e_surf_action_state_t)SURF_ACTION_READY; + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1RESOURCE_1ON_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + e_surf_resource_state_t result; + + (void)jenv; + (void)jcls; + result = (e_surf_resource_state_t)SURF_RESOURCE_ON; + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_simgrid_surf_SurfJNI_SURF_1RESOURCE_1OFF_1get(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + e_surf_resource_state_t result; + + (void)jenv; + (void)jcls; + result = (e_surf_resource_state_t)SURF_RESOURCE_OFF; + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuModel_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { + jlong baseptr = 0; + (void)jenv; + (void)jcls; + *(Model **)&baseptr = *(CpuModel **)&jarg1; + return baseptr; +} + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_Cpu_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { + jlong baseptr = 0; + (void)jenv; + (void)jcls; + *(Resource **)&baseptr = *(Cpu **)&jarg1; + return baseptr; +} + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_NetworkLink_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { + jlong baseptr = 0; + (void)jenv; + (void)jcls; + *(Resource **)&baseptr = *(NetworkLink **)&jarg1; + return baseptr; +} + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_CpuAction_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { + jlong baseptr = 0; + (void)jenv; + (void)jcls; + *(Action **)&baseptr = *(CpuAction **)&jarg1; + return baseptr; +} + +SWIGEXPORT jlong JNICALL Java_org_simgrid_surf_SurfJNI_NetworkAction_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) { + jlong baseptr = 0; + (void)jenv; + (void)jcls; + *(Action **)&baseptr = *(NetworkAction **)&jarg1; + return baseptr; +} + +SWIGEXPORT void JNICALL Java_org_simgrid_surf_SurfJNI_swig_1module_1init(JNIEnv *jenv, jclass jcls) { + int i; + + static struct { + const char *method; + const char *signature; + } methods[33] = { + { + "SwigDirector_Plugin_cpuCreatedCallback", "(Lorg/simgrid/surf/Plugin;J)V" + }, + { + "SwigDirector_Plugin_cpuDestructedCallback", "(Lorg/simgrid/surf/Plugin;J)V" + }, + { + "SwigDirector_Plugin_cpuStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" + }, + { + "SwigDirector_Plugin_cpuActionStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" + }, + { + "SwigDirector_Plugin_networkLinkCreatedCallback", "(Lorg/simgrid/surf/Plugin;J)V" + }, + { + "SwigDirector_Plugin_networkLinkDestructedCallback", "(Lorg/simgrid/surf/Plugin;J)V" + }, + { + "SwigDirector_Plugin_networkLinkStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" + }, + { + "SwigDirector_Plugin_networkActionStateChangedCallback", "(Lorg/simgrid/surf/Plugin;JII)V" + }, + { + "SwigDirector_Plugin_networkCommunicateCallback", "(Lorg/simgrid/surf/Plugin;JJJDD)V" + }, + { + "SwigDirector_CpuModel_shareResources", "(Lorg/simgrid/surf/CpuModel;D)D" + }, + { + "SwigDirector_CpuModel_shareResourcesLazy", "(Lorg/simgrid/surf/CpuModel;D)D" + }, + { + "SwigDirector_CpuModel_shareResourcesFull", "(Lorg/simgrid/surf/CpuModel;D)D" + }, + { + "SwigDirector_CpuModel_updateActionsState", "(Lorg/simgrid/surf/CpuModel;DD)V" + }, + { + "SwigDirector_CpuModel_updateActionsStateLazy", "(Lorg/simgrid/surf/CpuModel;DD)V" + }, + { + "SwigDirector_CpuModel_updateActionsStateFull", "(Lorg/simgrid/surf/CpuModel;DD)V" + }, + { + "SwigDirector_CpuModel_getRunningActionSet", "(Lorg/simgrid/surf/CpuModel;)J" + }, + { + "SwigDirector_CpuModel_createResource", "(Lorg/simgrid/surf/CpuModel;Ljava/lang/String;[DIDJIIJJ)J" + }, + { + "SwigDirector_CpuModel_addTraces", "(Lorg/simgrid/surf/CpuModel;)V" + }, + { + "SwigDirector_Cpu_isUsed", "(Lorg/simgrid/surf/Cpu;)Z" + }, + { + "SwigDirector_Cpu_getState", "(Lorg/simgrid/surf/Cpu;)I" + }, + { + "SwigDirector_Cpu_updateState", "(Lorg/simgrid/surf/Cpu;JDD)V" + }, + { + "SwigDirector_Cpu_getCurrentPowerPeak", "(Lorg/simgrid/surf/Cpu;)D" + }, + { + "SwigDirector_Cpu_execute", "(Lorg/simgrid/surf/Cpu;D)J" + }, + { + "SwigDirector_Cpu_sleep", "(Lorg/simgrid/surf/Cpu;D)J" + }, + { + "SwigDirector_Cpu_getCore", "(Lorg/simgrid/surf/Cpu;)I" + }, + { + "SwigDirector_Cpu_getSpeed", "(Lorg/simgrid/surf/Cpu;D)D" + }, + { + "SwigDirector_Cpu_getAvailableSpeed", "(Lorg/simgrid/surf/Cpu;)D" + }, + { + "SwigDirector_Cpu_getPowerPeakAt", "(Lorg/simgrid/surf/Cpu;I)D" + }, + { + "SwigDirector_Cpu_getNbPstates", "(Lorg/simgrid/surf/Cpu;)I" + }, + { + "SwigDirector_Cpu_setPowerPeakAt", "(Lorg/simgrid/surf/Cpu;I)V" + }, + { + "SwigDirector_CpuAction_getRemains", "(Lorg/simgrid/surf/CpuAction;)D" + }, + { + "SwigDirector_CpuAction_setPriority", "(Lorg/simgrid/surf/CpuAction;D)V" + }, + { + "SwigDirector_CpuAction_setState", "(Lorg/simgrid/surf/CpuAction;I)V" + } + }; + Swig::jclass_SurfJNI = (jclass) jenv->NewGlobalRef(jcls); + if (!Swig::jclass_SurfJNI) return; + for (i = 0; i < (int) (sizeof(methods)/sizeof(methods[0])); ++i) { + Swig::director_methids[i] = jenv->GetStaticMethodID(jcls, methods[i].method, methods[i].signature); + if (!Swig::director_methids[i]) return; + } +} + + +#ifdef __cplusplus +} +#endif + diff --git a/src/bindings/java/surfJAVA_wrap.h b/src/bindings/java/surfJAVA_wrap.h new file mode 100644 index 0000000000..cb0143b501 --- /dev/null +++ b/src/bindings/java/surfJAVA_wrap.h @@ -0,0 +1,105 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#ifndef SWIG_Surf_WRAP_H_ +#define SWIG_Surf_WRAP_H_ + +class SwigDirector_Plugin : public Plugin, public Swig::Director { + +public: + void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); + SwigDirector_Plugin(JNIEnv *jenv); + virtual ~SwigDirector_Plugin(); + virtual void cpuCreatedCallback(Cpu *cpu); + virtual void cpuDestructedCallback(Cpu *cpu); + virtual void cpuStateChangedCallback(Cpu *cpu, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2); + virtual void cpuActionStateChangedCallback(CpuAction *action, e_surf_action_state_t arg1, e_surf_action_state_t arg2); + virtual void networkLinkCreatedCallback(NetworkLink *link); + virtual void networkLinkDestructedCallback(NetworkLink *link); + virtual void networkLinkStateChangedCallback(NetworkLink *link, e_surf_resource_state_t arg1, e_surf_resource_state_t arg2); + virtual void networkActionStateChangedCallback(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur); + virtual void networkCommunicateCallback(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate); +public: + bool swig_overrides(int n) { + return (n < 9 ? swig_override[n] : false); + } +protected: + bool swig_override[9]; +}; + +class SwigDirector_CpuModel : public CpuModel, public Swig::Director { + +public: + void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); + SwigDirector_CpuModel(JNIEnv *jenv, char const *name); + virtual double shareResources(double now); + virtual double shareResourcesLazy(double now); + virtual double shareResourcesFull(double now); + virtual void updateActionsState(double now, double delta); + virtual void updateActionsStateLazy(double now, double delta); + virtual void updateActionsStateFull(double now, double delta); + virtual ActionList *getRunningActionSet(); + virtual ~SwigDirector_CpuModel(); + virtual Cpu *createResource(char const *name, DoubleDynar power_peak, int pstate, double power_scale, tmgr_trace *power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace *state_trace, s_xbt_dict *cpu_properties); + virtual void addTraces(); +public: + bool swig_overrides(int n) { + return (n < 9 ? swig_override[n] : false); + } +protected: + bool swig_override[9]; +}; + +class SwigDirector_Cpu : public Cpu, public Swig::Director { + +public: + void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); + SwigDirector_Cpu(JNIEnv *jenv, Model *model, char const *name, s_xbt_dict *props, lmm_constraint *constraint, int core, double powerPeak, double powerScale); + SwigDirector_Cpu(JNIEnv *jenv, Model *model, char const *name, s_xbt_dict *props, int core, double powerPeak, double powerScale); + virtual bool isUsed(); + virtual e_surf_resource_state_t getState(); + virtual void updateState(tmgr_trace_event *event_type, double value, double date); + virtual ~SwigDirector_Cpu(); + virtual double getCurrentPowerPeak(); + virtual CpuAction *execute(double size); + virtual CpuAction *sleep(double duration); + virtual int getCore(); + virtual double getSpeed(double load); + virtual double getAvailableSpeed(); + virtual double getPowerPeakAt(int pstate_index); + virtual int getNbPstates(); + virtual void setPowerPeakAt(int pstate_index); +public: + bool swig_overrides(int n) { + return (n < 12 ? swig_override[n] : false); + } +protected: + bool swig_override[12]; +}; + +class SwigDirector_CpuAction : public CpuAction, public Swig::Director { + +public: + void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); + SwigDirector_CpuAction(JNIEnv *jenv, Model *model, double cost, bool failed); + virtual ~SwigDirector_CpuAction(); + virtual double getRemains(); + virtual void setPriority(double priority); + virtual void setState(e_surf_action_state_t state); +public: + bool swig_overrides(int n) { + return (n < 3 ? swig_override[n] : false); + } +protected: + bool swig_override[3]; +}; + + +#endif diff --git a/src/bindings/java/surf_swig.cpp b/src/bindings/java/surf_swig.cpp index 8bf9b0cbf3..afff2a9a8a 100644 --- a/src/bindings/java/surf_swig.cpp +++ b/src/bindings/java/surf_swig.cpp @@ -9,7 +9,6 @@ #include "surf_swig.hpp" #include "src/simix/smx_private.h" - double getClock() { return surf_get_clock(); } @@ -18,10 +17,26 @@ void clean() { SIMIX_clean(); } -/*NetworkModel *getNetworkModel() -{ - return surf_network_model; -}*/ +CpuModel *getCpuModel(){ + return surf_cpu_model_pm; +} + +CpuModel *java_cpu_model; +static void java_cpu_model_init_preparse() { + surf_cpu_model_pm = java_cpu_model; + xbt_dynar_push(model_list, &java_cpu_model); + xbt_dynar_push(model_list_invoke, &java_cpu_model); + sg_platf_host_add_cb(parse_cpu_init); +} + +void setCpuModel(CpuModel *cpuModel){ + java_cpu_model = cpuModel; + surf_cpu_model_init_preparse = java_cpu_model_init_preparse; +} + +void setCpu(char *name, Cpu *cpu) { + xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu); +} NetworkLinkDynar getRoute(char *srcName, char *dstName) { RoutingEdge *src = (RoutingEdge*)xbt_lib_get_or_null(host_lib, srcName, ROUTING_HOST_LEVEL); diff --git a/src/bindings/java/surf_swig.hpp b/src/bindings/java/surf_swig.hpp index 5237a9d8b5..4211ce152b 100644 --- a/src/bindings/java/surf_swig.hpp +++ b/src/bindings/java/surf_swig.hpp @@ -11,11 +11,17 @@ #include "src/surf/maxmin_private.hpp" typedef xbt_dynar_t NetworkLinkDynar; +typedef ActionList *ActionArrayPtr; double getClock(); void clean(); +CpuModel *getCpuModel(); +void setCpuModel(CpuModel *cpuModel); + +void setCpu(char *name, Cpu *cpu); + NetworkLinkDynar getRoute(char *srcName, char *dstName); class Plugin { diff --git a/src/bindings/java/surfdoc.i b/src/bindings/java/surfdoc.i new file mode 100644 index 0000000000..d88734c3c9 --- /dev/null +++ b/src/bindings/java/surfdoc.i @@ -0,0 +1,439 @@ + +%javamethodmodifiers getClock() " + /** + * @return The current simulated time + */ + public"; + +%typemap(javaimports) Model " +/** + * A component (e.g., Cpu, Network, Storage, ...) is composed of three classes: + *
    + *
  • Model: It handle the interactions between resoucses and actions
  • + *
  • Resource: A resource used by the model (e.g., a cpu, a network link)
  • + *
  • Action: An action generated by the resources (e.g., execution, communication)
  • + *
+ * @see Resource + * @see Action + */" + +%javamethodmodifiers Model::Model(const char *name) " + /** + * Model constructor + * @param name The name of the model + */ + public"; + +%javamethodmodifiers Model::getName() " + /** + * @return The name of the model + */ + public"; + +%javamethodmodifiers Model::shareResources(double now) " + /** + * Share the resources between the actions + * @param now the current time + * @return the date of the next action of the model will finish + */ + public"; + +%javamethodmodifiers Model::updateActionsState(double now, double delta) " + /** + * Update time of actions and eventually their states + * @param now the new current time + * @param delta the delta between previous and new current time + */ + public"; + + %javamethodmodifiers Model::getRunningActionSet() " + /** + * Get the List of running Actions + */ + public"; + + +%typemap(javaimports) CpuModel " +/** + * The generic model for the Cpu component + * @see Cpu + * @see CpuAction + */" + +%javamethodmodifiers CpuModel::CpuModel(const char *name) " + /** + * CpuModel constructon + * @param name The name of the cpumodel + */ + public"; + + +%javamethodmodifiers CpuModel::createResource(const char *name, DoubleDynar power_peak, + int pstate, double power_scale, + tmgr_trace *power_trace, int core, + e_surf_resource_state_t state_initial, + tmgr_trace *state_trace, + s_xbt_dict *cpu_properties) " + /** + * Create a new Cpu + * + * @param name + * @param power_peak + * @param pstate + * @param power_scale + * @param power_trace + * @param core + * @param state_initial + * @param state_trace + * @param cpu_properties + * @return The new Cpu + * @see Cpu + */ + public"; + + +%typemap(javaimports) Resource " +/** + * A resource used by a model (e.g., a cpu, a network link) + * @see Model + * @see Action + */" + +%javamethodmodifiers Resource::getName() " + /** + * @return The name of the resource + */ + public"; + +%javamethodmodifiers Resource::isUsed() " + /** + * @return True if the Resource is used + */ + public"; + +%javamethodmodifiers Resource::getModel() " + /** + * @return The model associated to this Resource + */ + public"; + +%javamethodmodifiers Resource::getState() " + /** + * @return The state of the resource + * @see ResourceState + */ + public"; + +%javamethodmodifiers Resource::getConstraint() " + /** + * @return The constraint associatied (if using LMM) + */ + public"; + +%javamethodmodifiers Resource::getProperties() " + /** + * @return The XbtDict of properties associated to this Resource + */ + public"; + +%javamethodmodifiers Resource::updateState(tmgr_trace_event *event_type, double value, double date) " + /** + * Update the state of the Resource + * @param event_type + * @param value + * @param date + */ + public"; + + +%typemap(javaimports) Cpu " +/** + * A generic resource for the cpu component + * @see CpuModel + * @see CpuAction + */" + +%javamethodmodifiers Cpu::Cpu(Model *model, const char *name, s_xbt_dict *props, + lmm_constraint *constraint, int core, double powerPeak, double powerScale) " + /** + * A cpu constructor (using LMM) + * @param model + * @param name + * @param props + * @param constraint + * @param core + * @param powerPeak + * @param powerScale + */ + public"; + +%javamethodmodifiers Cpu::Cpu(Model *model, const char *name, s_xbt_dict *props, + int core, double powerPeak, double powerScale) " + /** + * A cpu constructor + * @param model + * @param name + * @param props + * @param core + * @param powerPeak + * @param powerScale + */ + public"; + +%javamethodmodifiers Cpu::getCurrentPowerPeak() " + /** + * @return The current power peak + */ + public"; + +%javamethodmodifiers Cpu::execute(double size) " + /** + * Execute some quantity of computation + * @param size The processing amount (in flop) needed to process + * @return A cpu action representing code execution + */ + public"; + +%javamethodmodifiers Cpu::sleep(double duration) " + /** + * Make a process sleep for duration + * @param duration The number of seconds to sleep + * @return A cpu action representing sleeping + */ + public"; + +%javamethodmodifiers Cpu::getCore() " + /** + * @return The number of cores on the cpu + */ + public"; + +%javamethodmodifiers Cpu::getSpeed(double load) " + /** + * TODO + * @param load + */ + public"; + +%javamethodmodifiers Cpu::getAvailableSpeed() " + /** + * TODO + */ + public"; + +%javamethodmodifiers Cpu::getPowerPeakAt(int pstate_index) " + /** + * @param pstate_index index of power peak to get + * @return Power peak at index + */ + public"; + + %javamethodmodifiers Cpu::getNbPstates() " + /** + * @return Number of power peak + */ + public"; + +%javamethodmodifiers Cpu::setPowerPeakAt(int pstate_index) " + /** + * @param pstate_index index of power peak to set + */ + public"; + +%javamethodmodifiers Cpu::setState(e_surf_resource_state_t state) " + /** + * @param state The new state of the cpu + */ + public"; + + +%typemap(javaimports) NetworkLink " +/** + * A generic resource for the network component + */" + + %javamethodmodifiers NetworkLink::getBandwidth() " + /** + * @return The bandwidth of the link + */ + public"; + +%javamethodmodifiers NetworkLink::updateBandwidth(double value, double date=surf_get_clock()) " + /** + * @param value The new bandwidth + * @param date When to change the bandwidth + */ + public"; + + %javamethodmodifiers NetworkLink::getLatency() " + /** + * @return The latency of the link + */ + public"; + +%javamethodmodifiers NetworkLink::updateLatency(double value, double date=surf_get_clock()) " + /** + * @param value The new latency + * @param date When to change the latency + */ + public"; + + +%typemap(javaimports) Action " +/** + * An action created by a Resource (e.g., a communication, an execution) + * @see Model + * @see Resource + */" + +%javamethodmodifiers Action::Action(Model *model, double cost, bool failed) " + /** + * Action constructor + * @param model The model associated + * @param cost The cost of the action (e.g., flops, bytes) + * @param failed If the action has failed + */ + public"; + +%javamethodmodifiers Action::getModel() " + /** + * @return The model associated + */ + public"; + +%javamethodmodifiers Action::getVariable() " + /** + * @return The variable associatied (if using LMM) + */ + public"; + +%javamethodmodifiers Action::getState() " + /** + * @return The state of the action + */ + public"; + +%javamethodmodifiers Action::isSuspended() " + /** + * @return True if suspended + */ + public"; + +%javamethodmodifiers Action::getBound() " + /** + * @return TODO + */ + public"; + +%javamethodmodifiers Action::setBound(double bound) " + /** + * @param bound TODO + */ + public"; + +%javamethodmodifiers Action::updateRemains(double delta) " + /** + * Update remaining amount of cost to do + * @param delta Difference of time since last call to this function + */ + public"; + +%javamethodmodifiers Action::getRemains() " + /** + * @return The remaining amount of cost to do + */ + public"; + +%javamethodmodifiers Action::setPriority(double priority) " + /** + * @param priority The new priority of the action + */ + public"; + +%javamethodmodifiers Action::setState(e_surf_action_state_t state) " + /** + * @param state The new state + */ + public"; + + +%typemap(javaimports) CpuAction " +/** + * An cpu action created by a Cpu + * @see CpuModel + * @see Cpu + */" + +%javamethodmodifiers CpuAction::CpuAction(Model *model, double cost, bool failed) " + /** + * CpuAction constructor + * @param model The model associated + * @param cost The cost of the action (e.g., flops, bytes) + * @param failed If the action has failed + */ + public"; + +%javamethodmodifiers CpuAction::getCpu() " + /** + * @return The associated cpu + */ + public"; + + +%typemap(javaimports) NetworkAction " +/** + * An network action created by network model + * @see NetworkLink + */" + +%javamethodmodifiers NetworkAction::getLatency() " + /** + * @return The latency of the action + */ + public"; + + +%typemap(javaimports) LmmConstraint " +/** + * An linear maxmin generic constraint + */" + +%javamethodmodifiers LmmConstraint::getUsage() " + /** + * + */ + public"; + +%typemap(javaimports) LmmVariable " +/** + * An linear maxmin generic variable + */" + +%javamethodmodifiers LmmVariable::getValue() " + /** + * + */ + public"; + +%typemap(javaimports) XbtDict " +/** + * A c structure handling key:values + */" + +%javamethodmodifiers XbtDict::getValue(char *key) " + /** + * + */ + public"; + + +%typemap(javaimports) ActionState " +/** + * The possible states of an Action + */" + + +%typemap(javaimports) ResourceState " +/** + * The possible states of a Resource + */" diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 51708d0007..2903c05954 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -102,7 +102,7 @@ typedef WorkstationCLM03 *surf_workstation_CLM03_t; typedef NetworkCm02Link *surf_network_link_t; typedef Cpu *surf_cpu_t; -/** @ingroup SURF_c_bindings +/** @ingroup SURF_c_bindings * \brief Action structure * * Never create s_surf_action_t by yourself ! The actions are created @@ -165,8 +165,8 @@ typedef enum { } e_surf_action_state_t; /** @ingroup SURF_vm_interface - * - * + * + * */ /* FIXME: Where should the VM state be defined? */ typedef enum { @@ -217,9 +217,9 @@ XBT_PUBLIC(void) surf_as_cluster_set_backbone(AS_t as, void* backbone); /** @{ @ingroup SURF_c_bindings */ -/** +/** * @brief Get the name of a surf model - * + * * @param model A model * @return The name of the model */ @@ -227,7 +227,7 @@ XBT_PUBLIC(const char *) surf_model_name(surf_model_t model); /** * @brief Pop an action from the done actions set - * + * * @param model The model from which the action is extracted * @return An action in done state */ @@ -235,7 +235,7 @@ XBT_PUBLIC(surf_action_t) surf_model_extract_done_action_set(surf_model_t model) /** * @brief Pop an action from the failed actions set - * + * * @param model The model from which the action is extracted * @return An action in failed state */ @@ -243,7 +243,7 @@ XBT_PUBLIC(surf_action_t) surf_model_extract_failed_action_set(surf_model_t mode /** * @brief Pop an action from the ready actions set - * + * * @param model The model from which the action is extracted * @return An action in ready state */ @@ -251,7 +251,7 @@ XBT_PUBLIC(surf_action_t) surf_model_extract_ready_action_set(surf_model_t model /** * @brief Pop an action from the running actions set - * + * * @param model The model from which the action is extracted * @return An action in running state */ @@ -259,7 +259,7 @@ XBT_PUBLIC(surf_action_t) surf_model_extract_running_action_set(surf_model_t mod /** * @brief Get the size of the running action set of a model - * + * * @param model The model * @return The size of the running action set */ @@ -268,9 +268,9 @@ XBT_PUBLIC(int) surf_model_running_action_set_size(surf_model_t model); /** * @brief Execute a parallel task * @details [long description] - * + * * @param model The model which handle the parallelisation - * @param workstation_nb The number of workstations + * @param workstation_nb The number of workstations * @param workstation_list The list of workstations on which the task is executed * @param computation_amount The processing amount (in flop) needed to process * @param communication_amount The amount of data (in bytes) needed to transfer @@ -286,7 +286,7 @@ XBT_PUBLIC(surf_action_t) surf_workstation_model_execute_parallel_task(surf_work /** * @brief Create a communication between two hosts - * + * * @param model The model which handle the communication * @param src The source host * @param dst The destination host @@ -299,7 +299,7 @@ XBT_PUBLIC(surf_action_t) surf_workstation_model_communicate(surf_workstation_mo /** * @brief Get the route between two hosts * @details [long description] - * + * * @param model The model which handle the routes * @param src The source host * @param dst The destination host @@ -309,7 +309,7 @@ XBT_PUBLIC(xbt_dynar_t) surf_workstation_model_get_route(surf_workstation_model_ /** * @brief Create a new VM on the specified host - * + * * @param name The name of the workstation * @param ind_phys_host The host on which the VM is created */ @@ -318,7 +318,7 @@ XBT_PUBLIC(void) surf_vm_workstation_model_create(const char *name, surf_resourc /** * @brief Create a communication between two routing edges [TODO] * @details [long description] - * + * * @param model The model which handle the communication * @param src The source host * @param dst The destination host @@ -330,7 +330,7 @@ XBT_PUBLIC(surf_action_t) surf_network_model_communicate(surf_network_model_t mo /** * @brief Get the name of a surf resource (cpu, workstation, network, …) - * + * * @param resource The surf resource * @return The name of the surf resource */ @@ -338,7 +338,7 @@ XBT_PUBLIC(const char * ) surf_resource_name(surf_cpp_resource_t resource); /** * @brief Get the properties of a surf resource (cpu, workstation, network, …) - * + * * @param resource The surf resource * @return The properties of the surf resource */ @@ -346,7 +346,7 @@ XBT_PUBLIC(xbt_dict_t) surf_resource_get_properties(surf_cpp_resource_t resource /** * @brief Get the state of a surf resource (cpu, workstation, network, …) - * + * * @param resource The surf resource * @return The state of the surf resource */ @@ -354,7 +354,7 @@ XBT_PUBLIC(e_surf_resource_state_t) surf_resource_get_state(surf_cpp_resource_t /** * @brief Set the state of a surf resource (cpu, workstation, network, …) - * + * * @param resource The surf resource * @param state The new state of the surf resource */ @@ -362,17 +362,17 @@ XBT_PUBLIC(void) surf_resource_set_state(surf_cpp_resource_t resource, e_surf_re /** * @brief Get the speed of the cpu associtated to a workstation - * + * * @param resource The surf workstation * @param load [description] - * + * * @return [description] */ XBT_PUBLIC(double) surf_workstation_get_speed(surf_resource_t resource, double load); /** * @brief Get the available speed of cpu associtated to a workstation - * + * * @param resource The surf workstation * @return [description] */ @@ -380,7 +380,7 @@ XBT_PUBLIC(double) surf_workstation_get_available_speed(surf_resource_t resource /** * @brief Get the number of cores of the cpu associated to a workstation - * + * * @param resource The surf workstation * @return The number of cores */ @@ -391,14 +391,14 @@ XBT_PUBLIC(int) surf_workstation_get_core(surf_resource_t resource); * * @param resource The surf workstation * @param size The value of the processing amount (in flop) needed to process - * + * * @return The surf action corresponding to the processing */ XBT_PUBLIC(surf_action_t) surf_workstation_execute(surf_resource_t resource, double size); /** * @brief Make the workstation sleep - * + * * @param resource The surf workstation * @param duration The number of seconds to sleep * @return The surf action corresponding to the sleep @@ -407,7 +407,7 @@ XBT_PUBLIC(surf_action_t) surf_workstation_sleep(surf_resource_t resource, doubl /** * @brief Open a file on a workstation - * + * * @param workstation The surf workstation * @param fullpath The path to the file * @return The surf action corresponding to the openning @@ -416,17 +416,17 @@ XBT_PUBLIC(surf_action_t) surf_workstation_open(surf_resource_t workstation, con /** * @brief Close a file descriptor on a workstation - * + * * @param workstation The surf workstation * @param fd The file descriptor - * + * * @return The surf action corresponding to the closing */ XBT_PUBLIC(surf_action_t) surf_workstation_close(surf_resource_t workstation, surf_file_t fd); /** * @brief Read a file - * + * * @param resource The surf workstation * @param fd The file descriptor to read * @param size The size in bytes to read @@ -436,7 +436,7 @@ XBT_PUBLIC(surf_action_t) surf_workstation_read(surf_resource_t resource, surf_f /** * @brief Write a file - * + * * @param resource The surf workstation * @param fd The file descriptor to write * @param size The size in bytes to write @@ -452,7 +452,7 @@ XBT_PUBLIC(surf_action_t) surf_workstation_write(surf_resource_t resource, surf_ * - the storage name, * - the storage typeId, * - the storage content type - * + * * @param resource The surf workstation * @param fd The file descriptor * @return An xbt_dynar_t with the file informations @@ -461,7 +461,7 @@ XBT_PUBLIC(xbt_dynar_t) surf_workstation_get_info(surf_resource_t resource, surf /** * @brief Get the available space of the storage at the mount point - * + * * @param resource The surf workstation * @param name The mount point * @return The amount of availble space in bytes @@ -470,7 +470,7 @@ XBT_PUBLIC(sg_size_t) surf_workstation_get_free_size(surf_resource_t resource, c /** * @brief Get the used space of the storage at the mount point - * + * * @param resource The surf workstation * @param name The mount point * @return The amount of used space in bytes @@ -479,7 +479,7 @@ XBT_PUBLIC(sg_size_t) surf_workstation_get_used_size(surf_resource_t resource, c /** * @brief Get the VMs hosted on the workstation - * + * * @param resource The surf workstation * @return The list of VMs on the workstation */ @@ -488,7 +488,7 @@ XBT_PUBLIC(xbt_dynar_t) surf_workstation_get_vms(surf_resource_t resource); /** * @brief [brief description] * @details [long description] - * + * * @param resource [description] * @param params [description] */ @@ -497,7 +497,7 @@ XBT_PUBLIC(void) surf_workstation_get_params(surf_resource_t resource, ws_params /** * @brief [brief description] * @details [long description] - * + * * @param resource [description] * @param params [description] */ @@ -505,42 +505,42 @@ XBT_PUBLIC(void) surf_workstation_set_params(surf_resource_t resource, ws_params /** * @brief Destroy a Workstation VM - * + * * @param resource The surf workstation vm */ XBT_PUBLIC(void) surf_vm_workstation_destroy(surf_resource_t resource); /** * @brief Suspend a Workstation VM - * + * * @param resource The surf workstation vm */ XBT_PUBLIC(void) surf_vm_workstation_suspend(surf_resource_t resource); /** * @brief Resume a Workstation VM - * + * * @param resource The surf workstation vm */ XBT_PUBLIC(void) surf_vm_workstation_resume(surf_resource_t resource); /** * @brief Save the Workstation VM (Not yet implemented) - * + * * @param resource The surf workstation vm */ XBT_PUBLIC(void) surf_vm_workstation_save(surf_resource_t resource); /** * @brief Restore the Workstation VM (Not yet implemented) - * + * * @param resource The surf workstation vm */ XBT_PUBLIC(void) surf_vm_workstation_restore(surf_resource_t resource); /** * @brief Migrate the VM to the destination host - * + * * @param resource The surf workstation vm * @param ind_vm_ws_dest The destination host */ @@ -548,7 +548,7 @@ XBT_PUBLIC(void) surf_vm_workstation_migrate(surf_resource_t resource, surf_reso /** * @brief Get the physical machine hosting the VM - * + * * @param resource The surf workstation vm * @return The physical machine hosting the VM */ @@ -557,7 +557,7 @@ XBT_PUBLIC(surf_resource_t) surf_vm_workstation_get_pm(surf_resource_t resource) /** * @brief [brief description] * @details [long description] - * + * * @param resource [description] * @param bound [description] */ @@ -566,7 +566,7 @@ XBT_PUBLIC(void) surf_vm_workstation_set_bound(surf_resource_t resource, double /** * @brief [brief description] * @details [long description] - * + * * @param resource [description] * @param cpu [description] * @param mask [description] @@ -575,7 +575,7 @@ XBT_PUBLIC(void) surf_vm_workstation_set_affinity(surf_resource_t resource, surf /** * @brief Execute some quantity of computation - * + * * @param cpu The surf cpu * @param size The value of the processing amount (in flop) needed to process * @return The surf action corresponding to the processing @@ -585,7 +585,7 @@ XBT_PUBLIC(surf_action_t) surf_cpu_execute(surf_resource_t cpu, double size); /** * @brief Make the cpu sleep for duration (in seconds) * @details [long description] - * + * * @param cpu The surf cpu * @param duration The number of seconds to sleep * @return The surf action corresponding to the sleeping @@ -595,7 +595,7 @@ XBT_PUBLIC(surf_action_t) surf_cpu_sleep(surf_resource_t cpu, double duration); /** * @brief Get the workstation power peak * @details [long description] - * + * * @param host The surf workstation * @return The power peak */ @@ -604,10 +604,10 @@ XBT_PUBLIC(double) surf_workstation_get_current_power_peak(surf_resource_t host) /** * @brief [brief description] * @details [long description] - * + * * @param host [description] * @param pstate_index [description] - * + * * @return [description] */ XBT_PUBLIC(double) surf_workstation_get_power_peak_at(surf_resource_t host, int pstate_index); @@ -615,7 +615,7 @@ XBT_PUBLIC(double) surf_workstation_get_power_peak_at(surf_resource_t host, int /** * @brief [brief description] * @details [long description] - * + * * @param host [description] * @return [description] */ @@ -624,7 +624,7 @@ XBT_PUBLIC(int) surf_workstation_get_nb_pstates(surf_resource_t host); /** * @brief [brief description] * @details [long description] - * + * * @param host [description] * @param pstate_index [description] */ @@ -632,7 +632,7 @@ XBT_PUBLIC(void) surf_workstation_set_power_peak_at(surf_resource_t host, int ps /** * @brief Get the consumed energy (in joules) of a workstation - * + * * @param host The surf workstation * @return The consumed energy */ @@ -640,7 +640,7 @@ XBT_PUBLIC(double) surf_workstation_get_consumed_energy(surf_resource_t host); /** * @brief Get the list of storages mounted on a workstation - * + * * @param workstation The surf workstation * @return Dictionary of mount point, Storage */ @@ -656,27 +656,27 @@ XBT_PUBLIC(xbt_dynar_t) surf_workstation_get_attached_storage_list(surf_resource /** * @brief Unlink a file descriptor - * + * * @param workstation The surf workstation * @param fd The file descriptor - * + * * @return 0 if failed to unlink, 1 otherwise */ XBT_PUBLIC(int) surf_workstation_unlink(surf_resource_t workstation, surf_file_t fd); /** * @brief Get the size of a file on a workstation - * + * * @param workstation The surf workstation * @param fd The file descriptor - * + * * @return The size in bytes of the file */ XBT_PUBLIC(size_t) surf_workstation_get_size(surf_resource_t workstation, surf_file_t fd); /** * @brief Get the current position of the file descriptor - * + * * @param workstation The surf workstation * @param fd The file descriptor * @return The current position of the file descriptor @@ -698,7 +698,7 @@ XBT_PUBLIC(int) surf_workstation_file_move(surf_resource_t workstation, surf_fil /** * @brief Set the position indictator assiociated with the file descriptor to a new position * @details [long description] - * + * * @param workstation The surf workstation * @param fd The file descriptor * @param offset The offset from the origin @@ -713,7 +713,7 @@ XBT_PUBLIC(int) surf_workstation_file_seek(surf_resource_t workstation, surf_fil /** * @brief [brief description] * @details [long description] - * + * * @param link [description] * @return [description] */ @@ -721,7 +721,7 @@ XBT_PUBLIC(int) surf_network_link_is_shared(surf_cpp_resource_t link); /** * @brief Get the bandwidth of a link in bytes per second - * + * * @param link The surf link * @return The bandwidth in bytes per second */ @@ -729,7 +729,7 @@ XBT_PUBLIC(double) surf_network_link_get_bandwidth(surf_cpp_resource_t link); /** * @brief Get the latency of a link in seconds - * + * * @param link The surf link * @return The latency in seconds */ @@ -737,7 +737,7 @@ XBT_PUBLIC(double) surf_network_link_get_latency(surf_cpp_resource_t link); /** * @brief Get the content of a storage - * + * * @param resource The surf storage * @return A xbt_dict_t with path as keys and size in bytes as values */ @@ -745,15 +745,32 @@ XBT_PUBLIC(xbt_dict_t) surf_storage_get_content(surf_resource_t resource); /** * @brief Get the size in bytes of a storage - * + * * @param resource The surf storage * @return The size in bytes of the storage */ XBT_PUBLIC(sg_size_t) surf_storage_get_size(surf_resource_t resource); +/** + * @brief Get the available size in bytes of a storage + * + * @param resource The surf storage + * @return The available size in bytes of the storage + */ +XBT_PUBLIC(sg_size_t) surf_storage_get_free_size(surf_resource_t resource); + +/** + * @brief Get the size in bytes of a storage + * + * @param resource The surf storage + * @return The used size in bytes of the storage + */ +XBT_PUBLIC(sg_size_t) surf_storage_get_used_size(surf_resource_t resource); + + /** * @brief Get the data associated to the action - * + * * @param action The surf action * @return The data associated to the action */ @@ -762,7 +779,7 @@ XBT_PUBLIC(void*) surf_action_get_data(surf_action_t action); /** * @brief Set the data associated to the action * @details [long description] - * + * * @param action The surf action * @param data The new data associated to the action */ @@ -770,14 +787,14 @@ XBT_PUBLIC(void) surf_action_set_data(surf_action_t action, void *data); /** * @brief Unreference an action - * + * * @param action The surf action */ XBT_PUBLIC(void) surf_action_unref(surf_action_t action); /** * @brief Get the start time of an action - * + * * @param action The surf action * @return The start time in seconds from the beginning of the simulation */ @@ -785,7 +802,7 @@ XBT_PUBLIC(double) surf_action_get_start_time(surf_action_t action); /** * @brief Get the finish time of an action - * + * * @param action The surf action * @return The finish time in seconds from the beginning of the simulation */ @@ -793,7 +810,7 @@ XBT_PUBLIC(double) surf_action_get_finish_time(surf_action_t action); /** * @brief Get the remains amount of work to do of an action - * + * * @param action The surf action * @return The remains amount of work to do */ @@ -801,21 +818,21 @@ XBT_PUBLIC(double) surf_action_get_remains(surf_action_t action); /** * @brief Suspend an action - * + * * @param action The surf action */ XBT_PUBLIC(void) surf_action_suspend(surf_action_t action); /** * @brief Resume an action - * + * * @param action The surf action */ XBT_PUBLIC(void) surf_action_resume(surf_action_t action); /** * @brief Cancel an action - * + * * @param action The surf action */ XBT_PUBLIC(void) surf_action_cancel(surf_action_t action); @@ -823,7 +840,7 @@ XBT_PUBLIC(void) surf_action_cancel(surf_action_t action); /** * @brief Set the priority of an action * @details [long description] - * + * * @param action The surf action * @param priority The new priority [TODO] */ @@ -832,15 +849,15 @@ XBT_PUBLIC(void) surf_action_set_priority(surf_action_t action, double priority) /** * @brief Set the category of an action * @details [long description] - * + * * @param action The surf action * @param category The new category of the action */ XBT_PUBLIC(void) surf_action_set_category(surf_action_t action, const char *category); /** - * @brief Get the state of an action - * + * @brief Get the state of an action + * * @param action The surf action * @return The state of the action */ @@ -848,7 +865,7 @@ XBT_PUBLIC(e_surf_action_state_t) surf_action_get_state(surf_action_t action); /** * @brief Get the cost of an action - * + * * @param action The surf action * @return The cost of the action */ @@ -857,7 +874,7 @@ XBT_PUBLIC(double) surf_action_get_cost(surf_action_t action); /** * @brief [brief desrciption] * @details [long description] - * + * * @param action The surf cpu action * @param cpu [description] * @param mask [description] @@ -867,7 +884,7 @@ XBT_PUBLIC(void) surf_cpu_action_set_affinity(surf_action_t action, surf_resourc /** * @brief [brief description] * @details [long description] - * + * * @param action The surf cpu action * @param bound [description] */ @@ -883,7 +900,7 @@ XBT_PUBLIC(double) surf_network_action_get_latency_limited(surf_action_t action) /** * @brief Get the file associated to a storage action - * + * * @param action The surf storage action * @return The file associated to a storage action */ @@ -891,7 +908,7 @@ XBT_PUBLIC(surf_file_t) surf_storage_action_get_file(surf_action_t action); /** * @brief Get the result dictionary of an ls action - * + * * @param action The surf storage action * @return The dictionry listing a path */ @@ -914,6 +931,9 @@ XBT_PUBLIC(surf_model_t) surf_resource_model(const void *host, int level); /* Implementations of model object */ /**************************************/ +XBT_PUBLIC_DATA(int) autoload_surf_cpu_model; +XBT_PUBLIC_DATA(void_f_void_t) surf_cpu_model_init_preparse; + /** \ingroup SURF_models * \brief The CPU model object for the physical machine layer */ @@ -1207,8 +1227,9 @@ XBT_PUBLIC(xbt_dict_t) watched_hosts_lib; /*******************************************/ /*** SURF Platform *************************/ /*******************************************/ -XBT_PUBLIC_DATA(AS_t) surf_AS_get_routing_root(void); +XBT_PUBLIC_DATA(AS_t) surf_AS_get_routing_root(void); XBT_PUBLIC_DATA(const char *) surf_AS_get_name(AS_t as); +XBT_PUBLIC_DATA(AS_t) surf_AS_get_by_name(const char * name); XBT_PUBLIC_DATA(xbt_dict_t) surf_AS_get_routing_sons(AS_t as); XBT_PUBLIC_DATA(const char *) surf_AS_get_model(AS_t as); XBT_PUBLIC_DATA(xbt_dynar_t) surf_AS_get_hosts(AS_t as); @@ -1227,7 +1248,7 @@ XBT_PUBLIC_DATA(e_surf_network_element_type_t) surf_routing_edge_get_rc_type(sg_ * * This function has to be called to initialize the common * structures. Then you will have to create the environment by - * calling + * calling * e.g. surf_workstation_model_init_CM02() * * \see surf_workstation_model_init_CM02(), surf_workstation_model_init_compound(), surf_exit() diff --git a/src/instr/instr_TI_trace.c b/src/instr/instr_TI_trace.c index 29754729df..7c32c7de9f 100644 --- a/src/instr/instr_TI_trace.c +++ b/src/instr/instr_TI_trace.c @@ -149,6 +149,9 @@ void print_TIPushState(paje_event_t event) fprintf(trace_file, "%s irecv %d %d %s\n", process_id, extra->src, extra->send_size, extra->datatype1); break; + case TRACING_TEST: + fprintf(trace_file, "%s test\n", process_id); + break; case TRACING_WAIT: fprintf(trace_file, "%s wait\n", process_id); break; diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c index 4093e78b79..e01762519b 100644 --- a/src/instr/instr_config.c +++ b/src/instr/instr_config.c @@ -39,7 +39,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration"); #define OPT_TRACING_DISABLE_LINK "tracing/disable_link" #define OPT_TRACING_DISABLE_POWER "tracing/disable_power" -static int trace_enabled; +static int trace_enabled = 0; static int trace_platform; static int trace_platform_topology; static int trace_smpi_enabled; @@ -95,12 +95,14 @@ void TRACE_add_start_function(void (*func) ()) int TRACE_start() { - TRACE_getopts(); + if (TRACE_is_configured()) + TRACE_getopts(); // tracing system must be: // - enabled (with --cfg=tracing:yes) // - already configured (TRACE_global_init already called) - if (TRACE_is_enabled() && TRACE_is_configured()) { + if (TRACE_is_enabled()) { + XBT_DEBUG("Tracing starts"); /* init the tracing module to generate the right output */ diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 908ecd6cc3..80ba7b9a9c 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -421,6 +421,7 @@ typedef enum{ TRACING_RECV, TRACING_IRECV, TRACING_SENDRECV, + TRACING_TEST, TRACING_WAIT, TRACING_WAITALL, TRACING_WAITANY, diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index 44c502d8e3..3e96454766 100644 --- a/src/mc/mc_checkpoint.c +++ b/src/mc/mc_checkpoint.c @@ -54,7 +54,7 @@ static void local_variable_free_voidp(void *v){ static void MC_region_destroy(mc_mem_region_t reg) { - xbt_free(reg->data); + munmap(reg->data, reg->size); xbt_free(reg); } @@ -67,8 +67,8 @@ void MC_free_snapshot(mc_snapshot_t snapshot){ xbt_dynar_free(&(snapshot->stacks)); xbt_dynar_free(&(snapshot->to_ignore)); - size_t n = snapshot->nb_processes; - if(snapshot->privatization_regions) { + if(snapshot->privatization_regions){ + size_t n = snapshot->nb_processes; for(i=0; i!=n; ++i) { MC_region_destroy(snapshot->privatization_regions[i]); } @@ -87,8 +87,11 @@ static mc_mem_region_t MC_region_new(int type, void *start_addr, size_t size) mc_mem_region_t new_reg = xbt_new(s_mc_mem_region_t, 1); new_reg->start_addr = start_addr; new_reg->size = size; - new_reg->data = xbt_malloc(size); + new_reg->data = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + if(new_reg->data==MAP_FAILED) + xbt_die("Could not mmap new memory for snapshot."); memcpy(new_reg->data, start_addr, size); + madvise(new_reg->data, size, MADV_MERGEABLE); XBT_DEBUG("New region : type : %d, data : %p (real addr %p), size : %zu", type, new_reg->data, start_addr, size); @@ -266,9 +269,9 @@ void MC_find_object_address(memory_map_t maps, mc_object_info_t result) { * \param ip Instruction pointer * \return true if the variable is valid * */ -static bool mc_valid_variable(dw_variable_t var, dw_frame_t frame, const void* ip) { +static bool mc_valid_variable(dw_variable_t var, dw_frame_t scope, const void* ip) { // The variable is not yet valid: - if((const void*)((const char*) frame->low_pc + var->start_scope) > ip) + if((const void*)((const char*) scope->low_pc + var->start_scope) > ip) return false; else return true; @@ -283,7 +286,7 @@ static void mc_fill_local_variables_values(mc_stack_frame_t stack_frame, dw_fram dw_variable_t current_variable; xbt_dynar_foreach(scope->variables, cursor, current_variable){ - if(!mc_valid_variable(current_variable, stack_frame->frame, (void*) stack_frame->ip)) + if(!mc_valid_variable(current_variable, scope, (void*) stack_frame->ip)) continue; int region_type; @@ -299,13 +302,15 @@ static void mc_fill_local_variables_values(mc_stack_frame_t stack_frame, dw_fram new_var->type = current_variable->type; new_var->region= region_type; - /* if(current_variable->address!=NULL) { + if(current_variable->address!=NULL) { new_var->address = current_variable->address; - } else */ + } else if(current_variable->locations.size != 0){ new_var->address = (void*) mc_dwarf_resolve_locations(¤t_variable->locations, current_variable->object_info, &(stack_frame->unw_cursor), (void*)stack_frame->frame_base, NULL); + } else { + xbt_die("No address"); } xbt_dynar_push(result, &new_var); @@ -493,6 +498,13 @@ mc_snapshot_t MC_take_snapshot(int num_state){ if(num_state > 0) MC_dump_checkpoint_ignore(snapshot); + // mprotect the region after zero-ing ignored parts: + size_t i; + for(i=0; i!=NB_REGIONS; ++i) { + mc_mem_region_t region = snapshot->regions[i]; + mprotect(region->data, region->size, PROT_READ); + } + return snapshot; } diff --git a/src/mc/mc_dpor.c b/src/mc/mc_dpor.c index 5ab8aed15e..6c22b82738 100644 --- a/src/mc/mc_dpor.c +++ b/src/mc/mc_dpor.c @@ -14,6 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dpor, mc, xbt_dynar_t visited_states; xbt_dict_t first_enabled_state; xbt_dynar_t initial_communications_pattern; +xbt_dynar_t incomplete_communications_pattern; xbt_dynar_t communications_pattern; int nb_comm_pattern; @@ -82,6 +83,8 @@ static void deterministic_pattern(xbt_dynar_t initial_pattern, xbt_dynar_t patte comm_comparison = compare_comm_pattern(comm1, comm2); if(comm_comparison == 1){ initial_state_safety->comm_deterministic = 0; + if(!_sg_mc_send_determinism) + return; } recv_index++; } @@ -97,20 +100,23 @@ static void deterministic_pattern(xbt_dynar_t initial_pattern, xbt_dynar_t patte static int complete_comm_pattern(xbt_dynar_t list, mc_comm_pattern_t pattern){ mc_comm_pattern_t current_pattern; unsigned int cursor = 0; - xbt_dynar_foreach(list, cursor, current_pattern){ + int index; + xbt_dynar_foreach(incomplete_communications_pattern, cursor, index){ + current_pattern = (mc_comm_pattern_t)xbt_dynar_get_as(list, index, mc_comm_pattern_t); if(current_pattern->comm == pattern->comm){ - if(!current_pattern->completed){ - current_pattern->src_proc = pattern->comm->comm.src_proc->pid; - current_pattern->src_host = simcall_host_get_name(pattern->comm->comm.src_proc->smx_host); - current_pattern->dst_proc = pattern->comm->comm.dst_proc->pid; - current_pattern->dst_host = simcall_host_get_name(pattern->comm->comm.dst_proc->smx_host); + current_pattern->src_proc = pattern->comm->comm.src_proc->pid; + current_pattern->dst_proc = pattern->comm->comm.dst_proc->pid; + current_pattern->src_host = simcall_host_get_name(pattern->comm->comm.src_proc->smx_host); + current_pattern->dst_host = simcall_host_get_name(pattern->comm->comm.dst_proc->smx_host); + if(current_pattern->data_size == -1){ current_pattern->data_size = pattern->comm->comm.src_buff_size; current_pattern->data = xbt_malloc0(current_pattern->data_size); - current_pattern->matched_comm = pattern->num; memcpy(current_pattern->data, current_pattern->comm->comm.src_buff, current_pattern->data_size); - current_pattern->completed = 1; - return current_pattern->num; } + current_pattern->matched_comm = pattern->num; + current_pattern->completed = 1; + xbt_dynar_remove_at(incomplete_communications_pattern, cursor, NULL); + return current_pattern->num; } } return -1; @@ -121,14 +127,15 @@ void get_comm_pattern(xbt_dynar_t list, smx_simcall_t request, int call){ pattern = xbt_new0(s_mc_comm_pattern_t, 1); pattern->num = ++nb_comm_pattern; pattern->completed = 0; + pattern->data_size = -1; if(call == 1){ // ISEND pattern->comm = simcall_comm_isend__get__result(request); pattern->type = SIMIX_COMM_SEND; if(pattern->comm->comm.dst_proc != NULL){ pattern->matched_comm = complete_comm_pattern(list, pattern); pattern->dst_proc = pattern->comm->comm.dst_proc->pid; - pattern->completed = 1; pattern->dst_host = simcall_host_get_name(pattern->comm->comm.dst_proc->smx_host); + pattern->completed = 1; } pattern->src_proc = pattern->comm->comm.src_proc->pid; pattern->src_host = simcall_host_get_name(request->issuer->smx_host); @@ -141,20 +148,26 @@ void get_comm_pattern(xbt_dynar_t list, smx_simcall_t request, int call){ if(pattern->comm->comm.src_proc != NULL){ pattern->matched_comm = complete_comm_pattern(list, pattern); pattern->src_proc = pattern->comm->comm.src_proc->pid; - pattern->src_host = simcall_host_get_name(pattern->comm->comm.src_proc->smx_host); + pattern->src_host = simcall_host_get_name(request->issuer->smx_host); pattern->completed = 1; pattern->data_size = pattern->comm->comm.src_buff_size; pattern->data=xbt_malloc0(pattern->data_size); memcpy(pattern->data, pattern->comm->comm.src_buff, pattern->data_size); } pattern->dst_proc = pattern->comm->comm.dst_proc->pid; - pattern->dst_host = simcall_host_get_name(request->issuer->smx_host); + pattern->dst_host = simcall_host_get_name(pattern->comm->comm.dst_proc->smx_host); } + if(pattern->comm->comm.rdv != NULL) pattern->rdv = strdup(pattern->comm->comm.rdv->name); else pattern->rdv = strdup(pattern->comm->comm.rdv_cpy->name); + xbt_dynar_push(list, &pattern); + + if(!pattern->completed) + xbt_dynar_push_as(incomplete_communications_pattern, int, xbt_dynar_length(list) - 1); + } static void print_communications_pattern(xbt_dynar_t comms_pattern){ @@ -410,11 +423,15 @@ void MC_dpor_init() if(_sg_mc_visited > 0) visited_states = xbt_dynar_new(sizeof(mc_visited_state_t), visited_state_free_voidp); - first_enabled_state = xbt_dict_new_homogeneous(&xbt_free_f); + if(mc_reduce_kind == e_mc_reduce_dpor) + first_enabled_state = xbt_dict_new_homogeneous(&xbt_free_f); - initial_communications_pattern = xbt_dynar_new(sizeof(mc_comm_pattern_t), comm_pattern_free_voidp); - communications_pattern = xbt_dynar_new(sizeof(mc_comm_pattern_t), comm_pattern_free_voidp); - nb_comm_pattern = 0; + if(_sg_mc_comms_determinism || _sg_mc_send_determinism){ + initial_communications_pattern = xbt_dynar_new(sizeof(mc_comm_pattern_t), comm_pattern_free_voidp); + communications_pattern = xbt_dynar_new(sizeof(mc_comm_pattern_t), comm_pattern_free_voidp); + incomplete_communications_pattern = xbt_dynar_new(sizeof(int), NULL); + nb_comm_pattern = 0; + } initial_state = MC_state_new(); @@ -442,16 +459,18 @@ void MC_dpor_init() xbt_fifo_unshift(mc_stack_safety, initial_state); - /* To ensure the soundness of DPOR, we have to keep a list of - processes which are still enabled at each step of the exploration. - If max depth is reached, we interleave them in the state in which they have - been enabled for the first time. */ - xbt_swag_foreach(process, simix_global->process_list){ - if(MC_process_is_enabled(process)){ - char *key = bprintf("%lu", process->pid); - char *data = bprintf("%d", xbt_fifo_size(mc_stack_safety)); - xbt_dict_set(first_enabled_state, key, data, NULL); - xbt_free(key); + if(mc_reduce_kind == e_mc_reduce_dpor){ + /* To ensure the soundness of DPOR, we have to keep a list of + processes which are still enabled at each step of the exploration. + If max depth is reached, we interleave them in the state in which they have + been enabled for the first time. */ + xbt_swag_foreach(process, simix_global->process_list){ + if(MC_process_is_enabled(process)){ + char *key = bprintf("%lu", process->pid); + char *data = bprintf("%d", xbt_fifo_size(mc_stack_safety)); + xbt_dict_set(first_enabled_state, key, data, NULL); + xbt_free(key); + } } } @@ -520,12 +539,14 @@ void MC_dpor(void) MC_state_set_executed_request(state, req, value); mc_stats->executed_transitions++; - MC_SET_RAW_MEM; - char *key = bprintf("%lu", req->issuer->pid); - xbt_dict_remove(first_enabled_state, key); - xbt_free(key); - MC_UNSET_RAW_MEM; - + if(mc_reduce_kind == e_mc_reduce_dpor){ + MC_SET_RAW_MEM; + char *key = bprintf("%lu", req->issuer->pid); + xbt_dict_remove(first_enabled_state, key); + xbt_free(key); + MC_UNSET_RAW_MEM; + } + if(_sg_mc_comms_determinism || _sg_mc_send_determinism){ if(req->call == SIMCALL_COMM_ISEND) comm_pattern = 1; @@ -583,15 +604,17 @@ void MC_dpor(void) xbt_fifo_unshift(mc_stack_safety, next_state); - /* Insert in dict all enabled processes, if not included yet */ - xbt_swag_foreach(process, simix_global->process_list){ - if(MC_process_is_enabled(process)){ - char *key = bprintf("%lu", process->pid); - if(xbt_dict_get_or_null(first_enabled_state, key) == NULL){ - char *data = bprintf("%d", xbt_fifo_size(mc_stack_safety)); - xbt_dict_set(first_enabled_state, key, data, NULL); + if(mc_reduce_kind == e_mc_reduce_dpor){ + /* Insert in dict all enabled processes, if not included yet */ + xbt_swag_foreach(process, simix_global->process_list){ + if(MC_process_is_enabled(process)){ + char *key = bprintf("%lu", process->pid); + if(xbt_dict_get_or_null(first_enabled_state, key) == NULL){ + char *data = bprintf("%d", xbt_fifo_size(mc_stack_safety)); + xbt_dict_set(first_enabled_state, key, data, NULL); + } + xbt_free(key); } - xbt_free(key); } } @@ -614,19 +637,21 @@ void MC_dpor(void) visited_state = -1; - /* Interleave enabled processes in the state in which they have been enabled for the first time */ - xbt_swag_foreach(process, simix_global->process_list){ - if(MC_process_is_enabled(process)){ - char *key = bprintf("%lu", process->pid); - enabled = (int)strtoul(xbt_dict_get_or_null(first_enabled_state, key), 0, 10); - xbt_free(key); - int cursor = xbt_fifo_size(mc_stack_safety); - xbt_fifo_foreach(mc_stack_safety, item, state_test, mc_state_t){ - if(cursor-- == enabled){ - if(!MC_state_process_is_done(state_test, process) && state_test->num != state->num){ - XBT_DEBUG("Interleave process %lu in state %d", process->pid, state_test->num); - MC_state_interleave_process(state_test, process); - break; + if(mc_reduce_kind == e_mc_reduce_dpor){ + /* Interleave enabled processes in the state in which they have been enabled for the first time */ + xbt_swag_foreach(process, simix_global->process_list){ + if(MC_process_is_enabled(process)){ + char *key = bprintf("%lu", process->pid); + enabled = (int)strtoul(xbt_dict_get_or_null(first_enabled_state, key), 0, 10); + xbt_free(key); + int cursor = xbt_fifo_size(mc_stack_safety); + xbt_fifo_foreach(mc_stack_safety, item, state_test, mc_state_t){ + if(cursor-- == enabled){ + if(!MC_state_process_is_done(state_test, process) && state_test->num != state->num){ + XBT_DEBUG("Interleave process %lu in state %d", process->pid, state_test->num); + MC_state_interleave_process(state_test, process); + break; + } } } } @@ -764,13 +789,13 @@ void MC_dpor(void) XBT_DEBUG("Back-tracking to state %d at depth %d done", state->num, xbt_fifo_size(mc_stack_safety)); break; } else { - req = MC_state_get_internal_request(state); - if(_sg_mc_comms_determinism){ + /*req = MC_state_get_internal_request(state); + if(_sg_mc_comms_determinism || _sg_mc_send_determinism){ if(req->call == SIMCALL_COMM_ISEND || req->call == SIMCALL_COMM_IRECV){ if(!xbt_dynar_is_empty(communications_pattern)) xbt_dynar_remove_at(communications_pattern, xbt_dynar_length(communications_pattern) - 1, NULL); } - } + }*/ XBT_DEBUG("Delete state %d at depth %d", state->num, xbt_fifo_size(mc_stack_safety) + 1); MC_state_delete(state); } diff --git a/src/mc/mc_global.c b/src/mc/mc_global.c index 55cf9088ca..89b98559a9 100644 --- a/src/mc/mc_global.c +++ b/src/mc/mc_global.c @@ -800,14 +800,6 @@ static void MC_init_debug_info(void) { mc_libsimgrid_info = MC_find_object_info(maps, libsimgrid_path, 0); mc_object_infos[1] = mc_libsimgrid_info; -#ifdef MADV_MERGEABLE - for(int i=0; i!=mc_object_infos_size; ++i) { - void* start = mc_object_infos[i]->start_rw; - void* end = mc_object_infos[i]->end_rw; - madvise(start, (char*)end - (char*)start, MADV_MERGEABLE); - } -#endif - // Use information of the other objects: MC_post_process_object_info(mc_binary_info); MC_post_process_object_info(mc_libsimgrid_info); @@ -1123,17 +1115,24 @@ void MC_replay(xbt_fifo_t stack, int start) } MC_SET_RAW_MEM; - xbt_dict_reset(first_enabled_state); - xbt_swag_foreach(process, simix_global->process_list){ - if(MC_process_is_enabled(process)){ + + if(mc_reduce_kind == e_mc_reduce_dpor){ + xbt_dict_reset(first_enabled_state); + xbt_swag_foreach(process, simix_global->process_list){ + if(MC_process_is_enabled(process)){ char *key = bprintf("%lu", process->pid); char *data = bprintf("%d", count); xbt_dict_set(first_enabled_state, key, data, NULL); xbt_free(key); + } } } - if(_sg_mc_comms_determinism || _sg_mc_send_determinism) + + if(_sg_mc_comms_determinism || _sg_mc_send_determinism){ xbt_dynar_reset(communications_pattern); + xbt_dynar_reset(incomplete_communications_pattern); + } + MC_UNSET_RAW_MEM; @@ -1145,11 +1144,13 @@ void MC_replay(xbt_fifo_t stack, int start) state = (mc_state_t) xbt_fifo_get_item_content(item); saved_req = MC_state_get_executed_request(state, &value); - MC_SET_RAW_MEM; - char *key = bprintf("%lu", saved_req->issuer->pid); - xbt_dict_remove(first_enabled_state, key); - xbt_free(key); - MC_UNSET_RAW_MEM; + if(mc_reduce_kind == e_mc_reduce_dpor){ + MC_SET_RAW_MEM; + char *key = bprintf("%lu", saved_req->issuer->pid); + xbt_dict_remove(first_enabled_state, key); + xbt_free(key); + MC_UNSET_RAW_MEM; + } if(saved_req){ /* because we got a copy of the executed request, we have to fetch the @@ -1168,7 +1169,7 @@ void MC_replay(xbt_fifo_t stack, int start) if(req->call == SIMCALL_COMM_ISEND) comm_pattern = 1; else if(req->call == SIMCALL_COMM_IRECV) - comm_pattern = 2; + comm_pattern = 2; } SIMIX_simcall_pre(req, value); @@ -1186,19 +1187,21 @@ void MC_replay(xbt_fifo_t stack, int start) count++; - MC_SET_RAW_MEM; - /* Insert in dict all enabled processes */ - xbt_swag_foreach(process, simix_global->process_list){ - if(MC_process_is_enabled(process) /*&& !MC_state_process_is_done(state, process)*/){ - char *key = bprintf("%lu", process->pid); - if(xbt_dict_get_or_null(first_enabled_state, key) == NULL){ - char *data = bprintf("%d", count); - xbt_dict_set(first_enabled_state, key, data, NULL); + if(mc_reduce_kind == e_mc_reduce_dpor){ + MC_SET_RAW_MEM; + /* Insert in dict all enabled processes */ + xbt_swag_foreach(process, simix_global->process_list){ + if(MC_process_is_enabled(process) /*&& !MC_state_process_is_done(state, process)*/){ + char *key = bprintf("%lu", process->pid); + if(xbt_dict_get_or_null(first_enabled_state, key) == NULL){ + char *data = bprintf("%d", count); + xbt_dict_set(first_enabled_state, key, data, NULL); + } + xbt_free(key); } - xbt_free(key); } + MC_UNSET_RAW_MEM; } - MC_UNSET_RAW_MEM; /* Update statistics */ mc_stats->visited_states++; diff --git a/src/mc/mc_private.h b/src/mc/mc_private.h index 0de75609ec..0d45e7484b 100644 --- a/src/mc/mc_private.h +++ b/src/mc/mc_private.h @@ -562,12 +562,13 @@ typedef struct s_mc_comm_pattern{ const char *src_host; const char *dst_host; char *rdv; - size_t data_size; + ssize_t data_size; void *data; int matched_comm; }s_mc_comm_pattern_t, *mc_comm_pattern_t; extern xbt_dynar_t communications_pattern; +extern xbt_dynar_t incomplete_communications_pattern; void get_comm_pattern(xbt_dynar_t communications_pattern, smx_simcall_t request, int call); diff --git a/src/msg/instr_msg_process.c b/src/msg/instr_msg_process.c index e23f5d863b..977c0b6fbc 100644 --- a/src/msg/instr_msg_process.c +++ b/src/msg/instr_msg_process.c @@ -77,11 +77,11 @@ void TRACE_msg_process_destroy (const char *process_name, int process_pid, msg_h PJ_container_free (process); } -void TRACE_msg_process_kill(msg_process_t process) +void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process) { - if (TRACE_msg_process_is_enabled()){ + if (TRACE_msg_process_is_enabled() && status==SMX_EXIT_FAILURE){ //kill means that this process no longer exists, let's destroy it - TRACE_msg_process_destroy (MSG_process_get_name (process), MSG_process_get_PID (process), MSG_process_get_host (process)); + TRACE_msg_process_destroy(MSG_process_get_name (process), MSG_process_get_PID (process), MSG_process_get_host (process)); } } diff --git a/src/msg/msg_actions.c b/src/msg/msg_actions.c index 93bb48f021..434b254cdb 100644 --- a/src/msg/msg_actions.c +++ b/src/msg/msg_actions.c @@ -15,13 +15,13 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_action, msg, "MSG actions for trace driven simulation"); -void _MSG_action_init() +void MSG_action_init() { _xbt_replay_action_init(); MSG_function_register_default(xbt_replay_action_runner); } -void _MSG_action_exit() +void MSG_action_exit() { _xbt_replay_action_exit(); } @@ -44,8 +44,8 @@ msg_error_t MSG_action_trace_run(char *path) action_fp=NULL; if (path) { action_fp = fopen(path, "r"); - xbt_assert(action_fp != NULL, "Cannot open %s: %s", path, - strerror(errno)); + if (action_fp == NULL) + xbt_die("Cannot open %s: %s", path, strerror(errno)); } res = MSG_main(); diff --git a/src/msg/msg_environment.c b/src/msg/msg_environment.c index 74fc81b9e6..fef3604341 100644 --- a/src/msg/msg_environment.c +++ b/src/msg/msg_environment.c @@ -64,6 +64,10 @@ const char *MSG_environment_as_get_name(msg_as_t as) { return surf_AS_get_name(as); } +msg_as_t MSG_environment_as_get_by_name(const char * name) { + return surf_AS_get_by_name(name); +} + xbt_dict_t MSG_environment_as_get_routing_sons(msg_as_t as) { xbt_dict_t res = surf_AS_get_routing_sons(as); return res; diff --git a/src/msg/msg_global.c b/src/msg/msg_global.c index 52d88d8870..9511d5e150 100644 --- a/src/msg/msg_global.c +++ b/src/msg/msg_global.c @@ -25,6 +25,11 @@ static void MSG_exit(void); /********************************* MSG **************************************/ +static void _sg_cfg_cb_msg_debug_multiple_use(const char *name, int pos) +{ + msg_global->debug_multiple_use = xbt_cfg_get_boolean(_sg_cfg_set, name); +} + /** * \ingroup msg_simulation * \brief Initialize MSG with less verifications @@ -39,10 +44,15 @@ void MSG_init_nocheck(int *argc, char **argv) { xbt_getpid = MSG_process_self_PID; if (!msg_global) { - SIMIX_global_init(argc, argv); - msg_global = xbt_new0(s_MSG_Global_t, 1); + xbt_cfg_register(&_sg_cfg_set, "msg/debug_multiple_use", + "Print backtraces of both processes when there is a conflict of multiple use of a task", + xbt_cfgelm_boolean, 1, 1, _sg_cfg_cb_msg_debug_multiple_use, NULL); + xbt_cfg_setdefault_boolean(_sg_cfg_set, "msg/debug_multiple_use", "no"); + + SIMIX_global_init(argc, argv); + #ifdef MSG_USE_DEPRECATED msg_global->max_channel = 0; #endif @@ -50,24 +60,17 @@ void MSG_init_nocheck(int *argc, char **argv) { msg_global->task_copy_callback = NULL; msg_global->process_data_cleanup = NULL; - /* initialization of the action module */ - _MSG_action_init(); - SIMIX_function_register_process_create(MSG_process_create_from_SIMIX); SIMIX_function_register_process_cleanup(MSG_process_cleanup_from_SIMIX); sg_platf_postparse_add_cb(MSG_post_create_environment); } - + if(MC_is_active()){ /* Ignore total amount of messages sent during the simulation for heap comparison */ MC_ignore_heap(&(msg_global->sent_msg), sizeof(msg_global->sent_msg)); } -#ifdef HAVE_TRACING - TRACE_start(); -#endif - XBT_DEBUG("ADD MSG LEVELS"); MSG_HOST_LEVEL = xbt_lib_add_level(host_lib, (void_f_pvoid_t) __MSG_host_priv_free); MSG_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, (void_f_pvoid_t) __MSG_storage_destroy); @@ -166,12 +169,6 @@ static void MSG_exit(void) { #ifdef HAVE_TRACING TRACE_surf_resource_utilization_release(); -#endif - - /* initialization of the action module */ - _MSG_action_exit(); - -#ifdef HAVE_TRACING TRACE_end(); #endif diff --git a/src/msg/msg_gos.c b/src/msg/msg_gos.c index dbf0eac49c..198539f668 100644 --- a/src/msg/msg_gos.c +++ b/src/msg/msg_gos.c @@ -58,7 +58,7 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task) xbt_assert((!simdata->compute) && (task->simdata->isused == 0), "This task is executed somewhere else. Go fix your code! %d", - task->simdata->isused); + task->simdata->isused!=NULL); XBT_DEBUG("Computing on %s", MSG_process_get_name(MSG_process_self())); @@ -71,8 +71,10 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task) TRY { - - simdata->isused=1; + if (msg_global->debug_multiple_use) + MSG_BT(simdata->isused, "Using Backtrace"); + else + simdata->isused = (void*)1; if (simdata->host_nb > 0) { simdata->compute = simcall_host_parallel_execute(task->name, @@ -103,7 +105,9 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task) p_simdata->waiting_action = NULL; - simdata->isused=0; + if (msg_global->debug_multiple_use && simdata->isused!=0) + xbt_ex_free(*(xbt_ex_t*)simdata->isused); + simdata->isused = 0; XBT_DEBUG("Execution task '%s' finished in state %d", task->name, (int)comp_state); @@ -405,17 +409,29 @@ msg_comm_t MSG_task_isend_internal(msg_task_t task, const char *alias, t_simdata->sender = process; t_simdata->source = ((simdata_process_t) SIMIX_process_self_get_data(process))->m_host; - xbt_assert(t_simdata->isused == 0, - "This task is still being used somewhere else. You cannot send it now. Go fix your code!"); + if (t_simdata->isused != 0) { + if (msg_global->debug_multiple_use){ + XBT_ERROR("This task is already used in there:"); + xbt_backtrace_display(t_simdata->isused); + XBT_ERROR("And you try to reuse it from here:"); + xbt_backtrace_display_current(); + } else { + xbt_assert(t_simdata->isused == 0, + "This task is still being used somewhere else. You cannot send it now. Go fix your code! (use --cfg=msg/debug_multiple_use:on to get the backtrace of the other process)"); + } + } - t_simdata->isused = 1; + if (msg_global->debug_multiple_use) + MSG_BT(t_simdata->isused, "Using Backtrace"); + else + t_simdata->isused = (void*)1; t_simdata->comm = NULL; msg_global->sent_msg++; /* Send it by calling SIMIX network layer */ smx_action_t act = simcall_comm_isend(mailbox, t_simdata->message_size, t_simdata->rate, task, sizeof(void *), - match_fun, cleanup, match_data,detached); + match_fun, cleanup, NULL, match_data,detached); t_simdata->comm = act; /* FIXME: is the field t_simdata->comm still useful? */ msg_comm_t comm; @@ -591,7 +607,7 @@ msg_comm_t MSG_task_irecv_bounded(msg_task_t *task, const char *name, comm->task_sent = NULL; comm->task_received = task; comm->status = MSG_OK; - comm->s_comm = simcall_comm_irecv(rdv, task, NULL, NULL, NULL, rate); + comm->s_comm = simcall_comm_irecv(rdv, task, NULL, NULL, NULL, NULL, rate); return comm; } @@ -614,6 +630,8 @@ int MSG_comm_test(msg_comm_t comm) if (finished && comm->task_received != NULL) { /* I am the receiver */ + if (msg_global->debug_multiple_use && (*comm->task_received)->simdata->isused!=0) + xbt_ex_free(*(xbt_ex_t*)(*comm->task_received)->simdata->isused); (*comm->task_received)->simdata->isused = 0; } } @@ -688,6 +706,8 @@ int MSG_comm_testany(xbt_dynar_t comms) if (status == MSG_OK && comm->task_received != NULL) { /* I am the receiver */ + if (msg_global->debug_multiple_use && (*comm->task_received)->simdata->isused!=0) + xbt_ex_free(*(xbt_ex_t*)(*comm->task_received)->simdata->isused); (*comm->task_received)->simdata->isused = 0; } } @@ -721,6 +741,8 @@ msg_error_t MSG_comm_wait(msg_comm_t comm, double timeout) if (comm->task_received != NULL) { /* I am the receiver */ + if (msg_global->debug_multiple_use && (*comm->task_received)->simdata->isused!=0) + xbt_ex_free(*(xbt_ex_t*)(*comm->task_received)->simdata->isused); (*comm->task_received)->simdata->isused = 0; } @@ -808,6 +830,8 @@ int MSG_comm_waitany(xbt_dynar_t comms) if (comm->task_received != NULL) { /* I am the receiver */ + if (msg_global->debug_multiple_use && (*comm->task_received)->simdata->isused!=0) + xbt_ex_free(*(xbt_ex_t*)(*comm->task_received)->simdata->isused); (*comm->task_received)->simdata->isused = 0; } diff --git a/src/msg/msg_io.c b/src/msg/msg_io.c index 3f7e1f89d2..d5e169091b 100644 --- a/src/msg/msg_io.c +++ b/src/msg/msg_io.c @@ -443,20 +443,20 @@ const char *MSG_storage_get_name(msg_storage_t storage) { /** \ingroup msg_storage_management * \brief Returns the free space size of a storage element - * \param name the name of a storage + * \param storage a storage * \return the free space size of the storage element (as a #sg_size_t) */ -sg_size_t MSG_storage_get_free_size(const char* name){ - return simcall_storage_get_free_size(name); +sg_size_t MSG_storage_get_free_size(msg_storage_t storage){ + return simcall_storage_get_free_size(storage); } /** \ingroup msg_storage_management * \brief Returns the used space size of a storage element - * \param name the name of a storage + * \param storage a storage * \return the used space size of the storage element (as a #sg_size_t) */ -sg_size_t MSG_storage_get_used_size(const char* name){ - return simcall_storage_get_used_size(name); +sg_size_t MSG_storage_get_used_size(msg_storage_t storage){ + return simcall_storage_get_used_size(storage); } /** \ingroup msg_storage_management diff --git a/src/msg/msg_mailbox.c b/src/msg/msg_mailbox.c index b8b63a28d7..f2d79e5a22 100644 --- a/src/msg/msg_mailbox.c +++ b/src/msg/msg_mailbox.c @@ -58,13 +58,13 @@ msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias) /** \ingroup msg_mailbox_management * \brief Set the mailbox to receive in asynchronous mode * - * All messages sent to this mailbox will be transferred to - * the receiver without waiting for the receive call. + * All messages sent to this mailbox will be transferred to + * the receiver without waiting for the receive call. * The receive call will still be necessary to use the received data. - * If there is a need to receive some messages asynchronously, and some not, + * If there is a need to receive some messages asynchronously, and some not, * two different mailboxes should be used. * - * \param alias The name of the mailbox + * \param alias The name of the mailbox */ void MSG_mailbox_set_async(const char *alias){ msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias); @@ -130,9 +130,11 @@ MSG_mailbox_get_task_ext_bounded(msg_mailbox_t mailbox, msg_task_t * task, /* Try to receive it by calling SIMIX network layer */ TRY { - simcall_comm_recv(mailbox, task, NULL, NULL, NULL, timeout, rate); + simcall_comm_recv(mailbox, task, NULL, NULL, NULL, NULL, timeout, rate); XBT_DEBUG("Got task %s from %p",(*task)->name,mailbox); - (*task)->simdata->isused=0; + if (msg_global->debug_multiple_use && (*task)->simdata->isused!=0) + xbt_ex_free(*(xbt_ex_t*)(*task)->simdata->isused); + (*task)->simdata->isused = 0; } CATCH(e) { switch (e.category) { @@ -180,10 +182,22 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, msg_task_t task, t_simdata->sender = process; t_simdata->source = ((simdata_process_t) SIMIX_process_self_get_data(process))->m_host; - xbt_assert(t_simdata->isused == 0, - "This task is still being used somewhere else. You cannot send it now. Go fix your code!"); + if (t_simdata->isused != 0) { + if (msg_global->debug_multiple_use){ + XBT_ERROR("This task is already used in there:"); + xbt_backtrace_display(t_simdata->isused); + XBT_ERROR("And you try to reuse it from here:"); + xbt_backtrace_display_current(); + } else { + xbt_assert(t_simdata->isused == 0, + "This task is still being used somewhere else. You cannot send it now. Go fix your code! (use --cfg=msg/debug_multiple_use:on to get the backtrace of the other process)"); + } + } - t_simdata->isused=1; + if (msg_global->debug_multiple_use) + MSG_BT(t_simdata->isused, "Using Backtrace"); + else + t_simdata->isused = (void*)1; t_simdata->comm = NULL; msg_global->sent_msg++; @@ -195,7 +209,7 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, msg_task_t task, smx_action_t comm = NULL; /* MC needs the comm to be set to NULL during the simix call */ comm = simcall_comm_isend(mailbox, t_simdata->message_size, t_simdata->rate, task, sizeof(void *), - NULL, NULL, task, 0); + NULL, NULL, NULL, task, 0); #ifdef HAVE_TRACING if (TRACE_is_enabled()) { simcall_set_category(comm, task->category); @@ -222,6 +236,8 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, msg_task_t task, xbt_ex_free(e); /* If the send failed, it is not used anymore */ + if (msg_global->debug_multiple_use && t_simdata->isused!=0) + xbt_ex_free(*(xbt_ex_t*)t_simdata->isused); t_simdata->isused = 0; } diff --git a/src/msg/msg_private.h b/src/msg/msg_private.h index 56448820b1..d461ecc824 100644 --- a/src/msg/msg_private.h +++ b/src/msg/msg_private.h @@ -22,6 +22,22 @@ SG_BEGIN_DECL() /********************************* Task **************************************/ + +#define MSG_BT(ptr, m) \ + do {xbt_ex_t *_xbt_ex_t = xbt_new0(xbt_ex_t, 1); \ + /* build the exception */ \ + _xbt_ex_t->msg = (bprintf(m)); \ + _xbt_ex_t->category = (xbt_errcat_t)(0); \ + _xbt_ex_t->value = (0); \ + _xbt_ex_t->procname = (char*)xbt_procname(); \ + _xbt_ex_t->pid = xbt_getpid(); \ + _xbt_ex_t->file = (char*)__FILE__; \ + _xbt_ex_t->line = __LINE__; \ + _xbt_ex_t->func = (char*)_XBT_FUNCTION; \ + _xbt_ex_t->bt_strings = NULL; \ + xbt_backtrace_current(_xbt_ex_t); \ + ptr = _xbt_ex_t; } while(0) + typedef struct simdata_task { smx_action_t compute; /* SIMIX modeling of computation */ smx_action_t comm; /* SIMIX modeling of communication */ @@ -37,7 +53,7 @@ typedef struct simdata_task { /* CPU affinity database of this task */ xbt_dict_t affinity_mask_db; /* smx_host_t host => unsigned long mask */ - int isused; /* Indicates whether the task is used in SIMIX currently */ + void *isused; /* Indicates whether the task is used in SIMIX currently */ int host_nb; /* ==0 if sequential task; parallel task if not */ /******* Parallel Tasks Only !!!! *******/ smx_host_t *host_list; @@ -114,6 +130,7 @@ typedef struct MSG_Global { int max_channel; #endif int session; + int debug_multiple_use; unsigned long int sent_msg; /* Total amount of messages sent during the simulation */ void (*task_copy_callback) (msg_task_t task, msg_process_t src, msg_process_t dst); void_f_pvoid_t process_data_cleanup; @@ -152,9 +169,6 @@ void MSG_process_create_from_SIMIX(smx_process_t *process, const char *name, smx_process_t parent_process); void MSG_comm_copy_data_from_SIMIX(smx_action_t comm, void* buff, size_t buff_size); -void _MSG_action_init(void); -void _MSG_action_exit(void); - void MSG_post_create_environment(void); static inline void *msg_host_resource_priv(const void *host) { @@ -183,7 +197,7 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, msg_host_t new_host); void TRACE_msg_process_create (const char *process_name, int process_pid, msg_host_t host); void TRACE_msg_process_destroy (const char *process_name, int process_pid, msg_host_t host); -void TRACE_msg_process_kill(msg_process_t process); +void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process); void TRACE_msg_process_suspend(msg_process_t process); void TRACE_msg_process_resume(msg_process_t process); void TRACE_msg_process_sleep_in(msg_process_t process); //called from msg/gos.c diff --git a/src/msg/msg_process.c b/src/msg/msg_process.c index 6a64e9db7d..d28d07338c 100644 --- a/src/msg/msg_process.c +++ b/src/msg/msg_process.c @@ -182,7 +182,7 @@ msg_process_t MSG_process_create_with_environment(const char *name, } else { #ifdef HAVE_TRACING - simcall_process_on_exit(process,(int_f_pvoid_t)TRACE_msg_process_kill,MSG_process_self()); + simcall_process_on_exit(process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,process); #endif } return process; @@ -200,12 +200,23 @@ void MSG_process_kill(msg_process_t process) // if (p_simdata->waiting_task && p_simdata->waiting_task->simdata->comm) { // simcall_comm_cancel(p_simdata->waiting_task->simdata->comm); // } - + simcall_process_kill(process); return; } +/** +* \brief Wait for the completion of a #msg_process_t. +* +* \param process the process to wait for +* \param timeout wait until the process is over, or the timeout occurs +*/ +msg_error_t MSG_process_join(msg_process_t process, double timeout){ + simcall_process_join(process, timeout); + return MSG_OK; +} + /** \ingroup m_process_management * \brief Migrates a process to another location. * @@ -477,7 +488,7 @@ smx_context_t MSG_process_get_smx_ctx(msg_process_t process) { * The on_exit functions are the functions executed when your process is killed. * You should use them to free the data used by your process. */ -void MSG_process_on_exit(int_f_pvoid_t fun, void *data) { +void MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void *data) { simcall_process_on_exit(MSG_process_self(),fun,data); } /** diff --git a/src/msg/msg_synchro.c b/src/msg/msg_synchro.c index 8c3fa8d28a..70f13837fc 100644 --- a/src/msg/msg_synchro.c +++ b/src/msg/msg_synchro.c @@ -6,6 +6,7 @@ #include "msg_private.h" #include "xbt/sysdep.h" +#include "xbt/synchro_core.h" #include "xbt/log.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_synchro, msg, @@ -55,7 +56,7 @@ void MSG_sem_get_capacity(msg_sem_t sem) { void MSG_sem_destroy(msg_sem_t sem) { simcall_sem_destroy(sem); } -/** @brief returns a boolean indicating it this semaphore would block at this very specific time +/** @brief returns a boolean indicating if this semaphore would block at this very specific time * * Note that the returned value may be wrong right after the function call, when you try to use it... * But that's a classical semaphore issue, and SimGrid's semaphore are not different to usual ones here. @@ -64,4 +65,22 @@ int MSG_sem_would_block(msg_sem_t sem) { return simcall_sem_would_block(sem); } +/** @brief Initializes a barrier, with count elements */ +msg_bar_t MSG_barrier_init(unsigned int count) { + return (msg_bar_t)xbt_barrier_init(count); +} + +/** @brief Initializes a barrier, with count elements */ +void MSG_barrier_destroy(msg_bar_t bar) { + xbt_barrier_destroy((xbt_bar_t)bar); +} + +/** @brief Performs a barrier already initialized */ +int MSG_barrier_wait(msg_bar_t bar) { + if(xbt_barrier_wait((xbt_bar_t)bar) == XBT_BARRIER_SERIAL_PROCESS) + return MSG_BARRIER_SERIAL_PROCESS; + else + return 0; +} + /**@}*/ diff --git a/src/msg/msg_task.c b/src/msg/msg_task.c index bdbbc47e83..7c775a4e59 100644 --- a/src/msg/msg_task.c +++ b/src/msg/msg_task.c @@ -10,8 +10,8 @@ #include "xbt/log.h" /** @addtogroup m_task_management - * - * + * + * * Since most scheduling algorithms rely on a concept of task * that can be either computed locally or * transferred on another processor, it seems to be the @@ -310,7 +310,10 @@ msg_error_t MSG_task_cancel(msg_task_t task) } else if (task->simdata->comm) { simcall_comm_cancel(task->simdata->comm); - task->simdata->isused = 0; + simdata_task_t simdata = task->simdata; + if (msg_global->debug_multiple_use && simdata->isused!=0) + xbt_ex_free(*(xbt_ex_t*)simdata->isused); + simdata->isused = 0; } return MSG_OK; } @@ -351,7 +354,7 @@ void MSG_task_set_compute_duration(msg_task_t task, * \brief set the amount data attached with a task #msg_task_t. * * \warning If the transfer is ongoing (already started and not finished), - * it is not modified by this call. + * it is not modified by this call. */ void MSG_task_set_data_size(msg_task_t task, @@ -428,7 +431,7 @@ double MSG_task_get_data_size(msg_task_t task) /** \ingroup m_task_management - * \brief Changes the priority of a computation task. This priority doesn't affect + * \brief Changes the priority of a computation task. This priority doesn't affect * the transfer rate. A priority of 2 will make a task receive two times more * cpu power than the other ones. * diff --git a/src/msg/msg_vm.c b/src/msg/msg_vm.c index a4d0401c28..c45ad9c064 100644 --- a/src/msg/msg_vm.c +++ b/src/msg/msg_vm.c @@ -190,7 +190,7 @@ msg_vm_t MSG_vm_create(msg_host_t ind_pm, const char *name, params.skip_stage2 = 0; params.max_downtime = 0.03; params.dp_rate = (update_speed * 1024 * 1024) / host_speed; - params.dp_cap = params.ramsize / 0.9; // working set memory is 90% + params.dp_cap = params.ramsize * 0.9; // assume working set memory is 90% of ramsize params.mig_speed = (double)mig_netspeed * 1024 * 1024; // mig_speed //XBT_INFO("dp rate %f migspeed : %f intensity mem : %d, updatespeed %f, hostspeed %f",params.dp_rate, params.mig_speed, dp_intensity, update_speed, host_speed); diff --git a/src/simdag/dax_dtd.c b/src/simdag/dax_dtd.c index 8e1cded546..83641a2099 100644 --- a/src/simdag/dax_dtd.c +++ b/src/simdag/dax_dtd.c @@ -27,7 +27,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -180,7 +180,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int dax_leng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t dax_leng; extern FILE *dax_in, *dax_out; @@ -202,6 +207,13 @@ extern FILE *dax_in, *dax_out; if ( dax_text[yyl] == '\n' )\ --dax_lineno;\ }while(0) + #define YY_LINENO_REWIND_TO(dst) \ + do {\ + const char *p;\ + for ( p = yy_cp-1; p >= (dst); --p)\ + if ( *p == '\n' )\ + --dax_lineno;\ + }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -219,11 +231,6 @@ extern FILE *dax_in, *dax_out; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -241,7 +248,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -311,8 +318,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when dax_text is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int dax_leng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t dax_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -340,7 +347,7 @@ static void dax__init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE dax__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE dax__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE dax__scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE dax__scan_bytes (yyconst char *bytes,yy_size_t len ); void *dax_alloc (yy_size_t ); void *dax_realloc (void *,yy_size_t ); @@ -372,7 +379,7 @@ void dax_free (void * ); /* Begin user sect3 */ -#define dax_wrap(n) 1 +#define dax_wrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -1337,81 +1344,81 @@ const char dax__flexml_version[] = "1.9.6"; int dax__pcdata_ix; extern char *dax__bufferstack; #define dax__pcdata (dax__bufferstack + dax__pcdata_ix) -AT_dax__adag_version AX_dax__adag_version; -#define A_dax__adag_version (dax__bufferstack + AX_dax__adag_version) -short int dax__adag_version_isset; -AT_dax__uses_type AX_dax__uses_type; -#define A_dax__uses_type (dax__bufferstack + AX_dax__uses_type) -short int dax__uses_type_isset; AT_dax__uses_optional AX_dax__uses_optional; #define A_dax__uses_optional AX_dax__uses_optional short int dax__uses_optional_isset; -AT_dax__adag_name AX_dax__adag_name; -#define A_dax__adag_name (dax__bufferstack + AX_dax__adag_name) -short int dax__adag_name_isset; -AT_dax__child_ref AX_dax__child_ref; -#define A_dax__child_ref (dax__bufferstack + AX_dax__child_ref) -short int dax__child_ref_isset; -AT_dax__adag_xmlns AX_dax__adag_xmlns; -#define A_dax__adag_xmlns (dax__bufferstack + AX_dax__adag_xmlns) -short int dax__adag_xmlns_isset; -AT_dax__uses_transfer AX_dax__uses_transfer; -#define A_dax__uses_transfer AX_dax__uses_transfer -short int dax__uses_transfer_isset; -AT_dax__job_id AX_dax__job_id; -#define A_dax__job_id (dax__bufferstack + AX_dax__job_id) -short int dax__job_id_isset; -AT_dax__uses_file AX_dax__uses_file; -#define A_dax__uses_file (dax__bufferstack + AX_dax__uses_file) -short int dax__uses_file_isset; +AT_dax__job_name AX_dax__job_name; +#define A_dax__job_name (dax__bufferstack + AX_dax__job_name) +short int dax__job_name_isset; +AT_dax__job_namespace AX_dax__job_namespace; +#define A_dax__job_namespace (dax__bufferstack + AX_dax__job_namespace) +short int dax__job_namespace_isset; +AT_dax__adag_fileCount AX_dax__adag_fileCount; +#define A_dax__adag_fileCount (dax__bufferstack + AX_dax__adag_fileCount) +short int dax__adag_fileCount_isset; AT_dax__parent_ref AX_dax__parent_ref; #define A_dax__parent_ref (dax__bufferstack + AX_dax__parent_ref) short int dax__parent_ref_isset; -AT_dax__adag_count AX_dax__adag_count; -#define A_dax__adag_count (dax__bufferstack + AX_dax__adag_count) -short int dax__adag_count_isset; -AT_dax__adag_xmlns_c_xsi AX_dax__adag_xmlns_c_xsi; -#define A_dax__adag_xmlns_c_xsi (dax__bufferstack + AX_dax__adag_xmlns_c_xsi) -short int dax__adag_xmlns_c_xsi_isset; -AT_dax__adag_index AX_dax__adag_index; -#define A_dax__adag_index (dax__bufferstack + AX_dax__adag_index) -short int dax__adag_index_isset; -AT_dax__uses_size AX_dax__uses_size; -#define A_dax__uses_size (dax__bufferstack + AX_dax__uses_size) -short int dax__uses_size_isset; +AT_dax__uses_transfer AX_dax__uses_transfer; +#define A_dax__uses_transfer AX_dax__uses_transfer +short int dax__uses_transfer_isset; AT_dax__adag_childCount AX_dax__adag_childCount; #define A_dax__adag_childCount (dax__bufferstack + AX_dax__adag_childCount) short int dax__adag_childCount_isset; AT_dax__uses_link AX_dax__uses_link; #define A_dax__uses_link AX_dax__uses_link short int dax__uses_link_isset; -AT_dax__job_runtime AX_dax__job_runtime; -#define A_dax__job_runtime (dax__bufferstack + AX_dax__job_runtime) -short int dax__job_runtime_isset; +AT_dax__adag_xmlns_c_xsi AX_dax__adag_xmlns_c_xsi; +#define A_dax__adag_xmlns_c_xsi (dax__bufferstack + AX_dax__adag_xmlns_c_xsi) +short int dax__adag_xmlns_c_xsi_isset; +AT_dax__job_id AX_dax__job_id; +#define A_dax__job_id (dax__bufferstack + AX_dax__job_id) +short int dax__job_id_isset; AT_dax__job_level AX_dax__job_level; #define A_dax__job_level (dax__bufferstack + AX_dax__job_level) short int dax__job_level_isset; -AT_dax__job_namespace AX_dax__job_namespace; -#define A_dax__job_namespace (dax__bufferstack + AX_dax__job_namespace) -short int dax__job_namespace_isset; -AT_dax__job_name AX_dax__job_name; -#define A_dax__job_name (dax__bufferstack + AX_dax__job_name) -short int dax__job_name_isset; +AT_dax__job_runtime AX_dax__job_runtime; +#define A_dax__job_runtime (dax__bufferstack + AX_dax__job_runtime) +short int dax__job_runtime_isset; +AT_dax__uses_size AX_dax__uses_size; +#define A_dax__uses_size (dax__bufferstack + AX_dax__uses_size) +short int dax__uses_size_isset; +AT_dax__child_ref AX_dax__child_ref; +#define A_dax__child_ref (dax__bufferstack + AX_dax__child_ref) +short int dax__child_ref_isset; +AT_dax__adag_index AX_dax__adag_index; +#define A_dax__adag_index (dax__bufferstack + AX_dax__adag_index) +short int dax__adag_index_isset; +AT_dax__adag_count AX_dax__adag_count; +#define A_dax__adag_count (dax__bufferstack + AX_dax__adag_count) +short int dax__adag_count_isset; +AT_dax__uses_register AX_dax__uses_register; +#define A_dax__uses_register AX_dax__uses_register +short int dax__uses_register_isset; AT_dax__adag_jobCount AX_dax__adag_jobCount; #define A_dax__adag_jobCount (dax__bufferstack + AX_dax__adag_jobCount) short int dax__adag_jobCount_isset; +AT_dax__uses_file AX_dax__uses_file; +#define A_dax__uses_file (dax__bufferstack + AX_dax__uses_file) +short int dax__uses_file_isset; AT_dax__job_version AX_dax__job_version; #define A_dax__job_version (dax__bufferstack + AX_dax__job_version) short int dax__job_version_isset; +AT_dax__adag_xmlns AX_dax__adag_xmlns; +#define A_dax__adag_xmlns (dax__bufferstack + AX_dax__adag_xmlns) +short int dax__adag_xmlns_isset; AT_dax__adag_xsi_c_schemaLocation AX_dax__adag_xsi_c_schemaLocation; #define A_dax__adag_xsi_c_schemaLocation (dax__bufferstack + AX_dax__adag_xsi_c_schemaLocation) short int dax__adag_xsi_c_schemaLocation_isset; -AT_dax__uses_register AX_dax__uses_register; -#define A_dax__uses_register AX_dax__uses_register -short int dax__uses_register_isset; -AT_dax__adag_fileCount AX_dax__adag_fileCount; -#define A_dax__adag_fileCount (dax__bufferstack + AX_dax__adag_fileCount) -short int dax__adag_fileCount_isset; +AT_dax__adag_name AX_dax__adag_name; +#define A_dax__adag_name (dax__bufferstack + AX_dax__adag_name) +short int dax__adag_name_isset; +AT_dax__uses_type AX_dax__uses_type; +#define A_dax__uses_type (dax__bufferstack + AX_dax__uses_type) +short int dax__uses_type_isset; +AT_dax__adag_version AX_dax__adag_version; +#define A_dax__adag_version (dax__bufferstack + AX_dax__adag_version) +short int dax__adag_version_isset; /* XML state. */ #ifdef FLEX_DEBUG @@ -1637,7 +1644,7 @@ FILE *dax_get_out (void ); void dax_set_out (FILE * out_str ); -int dax_get_leng (void ); +yy_size_t dax_get_leng (void ); char *dax_get_text (void ); @@ -1791,6 +1798,34 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! dax_in ) + dax_in = stdin; + + if ( ! dax_out ) + dax_out = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + dax_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + dax__create_buffer(dax_in,YY_BUF_SIZE ); + } + + dax__load_buffer_state( ); + } + + { + /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); reset_dax__parse_err_msg(); @@ -1853,32 +1888,6 @@ YY_DECL /* COMMENTS and PIs: handled uniformly for efficiency. */ - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! dax_in ) - dax_in = stdin; - - if ( ! dax_out ) - dax_out = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - dax_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - dax__create_buffer(dax_in,YY_BUF_SIZE ); - } - - dax__load_buffer_state( ); - } - while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1895,7 +1904,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1925,7 +1934,7 @@ yy_find_action: if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - int yyl; + yy_size_t yyl; for ( yyl = 0; yyl < dax_leng; ++yyl ) if ( dax_text[yyl] == '\n' ) @@ -2203,11 +2212,11 @@ case 44: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",dax_text[0]); YY_BREAK -case YY_STATE_EOF(S_dax__adag_1): case YY_STATE_EOF(S_dax__adag_5): -case YY_STATE_EOF(E_dax__adag): -case YY_STATE_EOF(S_dax__adag_3): case YY_STATE_EOF(S_dax__adag): +case YY_STATE_EOF(S_dax__adag_3): +case YY_STATE_EOF(E_dax__adag): +case YY_STATE_EOF(S_dax__adag_1): FAIL("Premature EOF: `' expected."); YY_BREAK @@ -2350,9 +2359,9 @@ case 65: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",dax_text[0]); YY_BREAK -case YY_STATE_EOF(S_dax__job): -case YY_STATE_EOF(E_dax__job): case YY_STATE_EOF(S_dax__job_2): +case YY_STATE_EOF(E_dax__job): +case YY_STATE_EOF(S_dax__job): FAIL("Premature EOF: `' expected."); YY_BREAK @@ -2486,7 +2495,7 @@ YY_RULE_SETUP if (!AX_dax__uses_size) FAIL("Required attribute `size' not set for `uses' element."); LEAVE; STag_dax__uses(); dax__pcdata_ix = 0; ETag_dax__uses(); popbuffer(); /* attribute */ switch (YY_START) { - case S_dax__job: case S_dax__job_2: case S_dax__job_1: SET(S_dax__job_2); break; + case S_dax__job_1: case S_dax__job: case S_dax__job_2: SET(S_dax__job_2); break; } } YY_BREAK @@ -2510,7 +2519,7 @@ YY_RULE_SETUP ETag_dax__uses(); popbuffer(); /* attribute */ switch (YY_START) { - case S_dax__job: case S_dax__job_2: case S_dax__job_1: SET(S_dax__job_2); break; + case S_dax__job_1: case S_dax__job: case S_dax__job_2: SET(S_dax__job_2); break; } } YY_BREAK @@ -2565,7 +2574,7 @@ YY_RULE_SETUP if (!AX_dax__child_ref) FAIL("Required attribute `ref' not set for `child' element."); LEAVE; STag_dax__child(); dax__pcdata_ix = 0; ETag_dax__child(); popbuffer(); /* attribute */ switch (YY_START) { - case S_dax__adag_1: case S_dax__adag_4: case S_dax__adag_5: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_5); break; + case S_dax__adag: case S_dax__adag_5: case S_dax__adag_4: case S_dax__adag_1: case S_dax__adag_3: SET(S_dax__adag_5); break; } } YY_BREAK @@ -2589,7 +2598,7 @@ YY_RULE_SETUP ETag_dax__child(); popbuffer(); /* attribute */ switch (YY_START) { - case S_dax__adag_1: case S_dax__adag_4: case S_dax__adag_5: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_5); break; + case S_dax__adag: case S_dax__adag_5: case S_dax__adag_4: case S_dax__adag_1: case S_dax__adag_3: SET(S_dax__adag_5); break; } } YY_BREAK @@ -2602,8 +2611,8 @@ case 107: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",dax_text[0]); YY_BREAK -case YY_STATE_EOF(S_dax__child_2): case YY_STATE_EOF(E_dax__child): +case YY_STATE_EOF(S_dax__child_2): case YY_STATE_EOF(S_dax__child): FAIL("Premature EOF: `' expected."); YY_BREAK @@ -2646,7 +2655,7 @@ YY_RULE_SETUP if (!AX_dax__parent_ref) FAIL("Required attribute `ref' not set for `parent' element."); LEAVE; STag_dax__parent(); dax__pcdata_ix = 0; ETag_dax__parent(); popbuffer(); /* attribute */ switch (YY_START) { - case S_dax__child_2: case S_dax__child: case S_dax__child_1: SET(S_dax__child_2); break; + case S_dax__child: case S_dax__child_2: case S_dax__child_1: SET(S_dax__child_2); break; } } YY_BREAK @@ -2670,7 +2679,7 @@ YY_RULE_SETUP ETag_dax__parent(); popbuffer(); /* attribute */ switch (YY_START) { - case S_dax__child_2: case S_dax__child: case S_dax__child_1: SET(S_dax__child_2); break; + case S_dax__child: case S_dax__child_2: case S_dax__child_1: SET(S_dax__child_2); break; } } YY_BREAK @@ -2940,6 +2949,7 @@ case YY_STATE_EOF(IMPOSSIBLE): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of dax_lex */ /* yy_get_next_buffer - try to read in a new buffer @@ -2995,21 +3005,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -3040,7 +3050,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -3135,7 +3145,7 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 774); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT @@ -3162,7 +3172,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -3327,10 +3337,6 @@ static void dax__load_buffer_state (void) dax_free((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a dax_restart() or at EOF. @@ -3443,7 +3449,7 @@ void dax_pop_buffer_state (void) */ static void dax_ensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -3540,12 +3546,12 @@ YY_BUFFER_STATE dax__scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE dax__scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE dax__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -3659,7 +3665,7 @@ FILE *dax_get_out (void) /** Get the length of the current token. * */ -int dax_get_leng (void) +yy_size_t dax_get_leng (void) { return dax_leng; } diff --git a/src/simdag/dax_dtd.h b/src/simdag/dax_dtd.h index e31871dd23..c1cf38fa03 100644 --- a/src/simdag/dax_dtd.h +++ b/src/simdag/dax_dtd.h @@ -60,132 +60,132 @@ XBT_PUBLIC(void) STag_dax__parent(void); XBT_PUBLIC(void) ETag_dax__parent(void); /* XML application data. */ +typedef int AT_dax__adag_childCount; +#define AU_dax__adag_childCount NULL +typedef int AT_dax__parent_ref; +#define AU_dax__parent_ref NULL +typedef enum { AU_dax__uses_register, A_dax__uses_register_false,A_dax__uses_register_true } AT_dax__uses_register; +typedef int AT_dax__uses_size; +#define AU_dax__uses_size NULL +typedef int AT_dax__adag_fileCount; +#define AU_dax__adag_fileCount NULL +typedef int AT_dax__adag_xmlns; +#define AU_dax__adag_xmlns NULL +typedef enum { AU_dax__uses_transfer, A_dax__uses_transfer_false,A_dax__uses_transfer_true } AT_dax__uses_transfer; +typedef int AT_dax__adag_index; +#define AU_dax__adag_index NULL +typedef int AT_dax__job_namespace; +#define AU_dax__job_namespace NULL +typedef int AT_dax__job_version; +#define AU_dax__job_version NULL +typedef int AT_dax__child_ref; +#define AU_dax__child_ref NULL typedef int AT_dax__adag_version; #define AU_dax__adag_version NULL -typedef int AT_dax__uses_type; -#define AU_dax__uses_type NULL typedef enum { AU_dax__uses_optional, A_dax__uses_optional_false,A_dax__uses_optional_true } AT_dax__uses_optional; typedef int AT_dax__adag_name; #define AU_dax__adag_name NULL -typedef int AT_dax__child_ref; -#define AU_dax__child_ref NULL -typedef int AT_dax__adag_xmlns; -#define AU_dax__adag_xmlns NULL -typedef enum { AU_dax__uses_transfer, A_dax__uses_transfer_false,A_dax__uses_transfer_true } AT_dax__uses_transfer; -typedef int AT_dax__job_id; -#define AU_dax__job_id NULL +typedef int AT_dax__adag_jobCount; +#define AU_dax__adag_jobCount NULL +typedef int AT_dax__adag_xsi_c_schemaLocation; +#define AU_dax__adag_xsi_c_schemaLocation NULL +typedef int AT_dax__job_level; +#define AU_dax__job_level NULL typedef int AT_dax__uses_file; #define AU_dax__uses_file NULL -typedef int AT_dax__parent_ref; -#define AU_dax__parent_ref NULL typedef int AT_dax__adag_count; #define AU_dax__adag_count NULL +typedef enum { AU_dax__uses_link, A_dax__uses_link_input,A_dax__uses_link_output } AT_dax__uses_link; +typedef int AT_dax__uses_type; +#define AU_dax__uses_type NULL typedef int AT_dax__adag_xmlns_c_xsi; #define AU_dax__adag_xmlns_c_xsi NULL -typedef int AT_dax__adag_index; -#define AU_dax__adag_index NULL -typedef int AT_dax__uses_size; -#define AU_dax__uses_size NULL -typedef int AT_dax__adag_childCount; -#define AU_dax__adag_childCount NULL -typedef enum { AU_dax__uses_link, A_dax__uses_link_input,A_dax__uses_link_output } AT_dax__uses_link; typedef int AT_dax__job_runtime; #define AU_dax__job_runtime NULL -typedef int AT_dax__job_level; -#define AU_dax__job_level NULL -typedef int AT_dax__job_namespace; -#define AU_dax__job_namespace NULL +typedef int AT_dax__job_id; +#define AU_dax__job_id NULL typedef int AT_dax__job_name; #define AU_dax__job_name NULL -typedef int AT_dax__adag_jobCount; -#define AU_dax__adag_jobCount NULL -typedef int AT_dax__job_version; -#define AU_dax__job_version NULL -typedef int AT_dax__adag_xsi_c_schemaLocation; -#define AU_dax__adag_xsi_c_schemaLocation NULL -typedef enum { AU_dax__uses_register, A_dax__uses_register_false,A_dax__uses_register_true } AT_dax__uses_register; -typedef int AT_dax__adag_fileCount; -#define AU_dax__adag_fileCount NULL /* FleXML-provided data. */ XBT_PUBLIC_DATA(int) dax__pcdata_ix; XBT_PUBLIC_DATA(char *) dax__bufferstack; #define dax__pcdata (dax__bufferstack + dax__pcdata_ix) +XBT_PUBLIC_DATA(AT_dax__adag_childCount) AX_dax__adag_childCount; +#define A_dax__adag_childCount (dax__bufferstack + AX_dax__adag_childCount) +XBT_PUBLIC_DATA(short int) dax__adag_childCount_isset; +XBT_PUBLIC_DATA(AT_dax__parent_ref) AX_dax__parent_ref; +#define A_dax__parent_ref (dax__bufferstack + AX_dax__parent_ref) +XBT_PUBLIC_DATA(short int) dax__parent_ref_isset; +XBT_PUBLIC_DATA(AT_dax__uses_register) AX_dax__uses_register; +#define A_dax__uses_register AX_dax__uses_register +XBT_PUBLIC_DATA(short int) dax__uses_register_isset; +XBT_PUBLIC_DATA(AT_dax__uses_size) AX_dax__uses_size; +#define A_dax__uses_size (dax__bufferstack + AX_dax__uses_size) +XBT_PUBLIC_DATA(short int) dax__uses_size_isset; +XBT_PUBLIC_DATA(AT_dax__adag_fileCount) AX_dax__adag_fileCount; +#define A_dax__adag_fileCount (dax__bufferstack + AX_dax__adag_fileCount) +XBT_PUBLIC_DATA(short int) dax__adag_fileCount_isset; +XBT_PUBLIC_DATA(AT_dax__adag_xmlns) AX_dax__adag_xmlns; +#define A_dax__adag_xmlns (dax__bufferstack + AX_dax__adag_xmlns) +XBT_PUBLIC_DATA(short int) dax__adag_xmlns_isset; +XBT_PUBLIC_DATA(AT_dax__uses_transfer) AX_dax__uses_transfer; +#define A_dax__uses_transfer AX_dax__uses_transfer +XBT_PUBLIC_DATA(short int) dax__uses_transfer_isset; +XBT_PUBLIC_DATA(AT_dax__adag_index) AX_dax__adag_index; +#define A_dax__adag_index (dax__bufferstack + AX_dax__adag_index) +XBT_PUBLIC_DATA(short int) dax__adag_index_isset; +XBT_PUBLIC_DATA(AT_dax__job_namespace) AX_dax__job_namespace; +#define A_dax__job_namespace (dax__bufferstack + AX_dax__job_namespace) +XBT_PUBLIC_DATA(short int) dax__job_namespace_isset; +XBT_PUBLIC_DATA(AT_dax__job_version) AX_dax__job_version; +#define A_dax__job_version (dax__bufferstack + AX_dax__job_version) +XBT_PUBLIC_DATA(short int) dax__job_version_isset; +XBT_PUBLIC_DATA(AT_dax__child_ref) AX_dax__child_ref; +#define A_dax__child_ref (dax__bufferstack + AX_dax__child_ref) +XBT_PUBLIC_DATA(short int) dax__child_ref_isset; XBT_PUBLIC_DATA(AT_dax__adag_version) AX_dax__adag_version; #define A_dax__adag_version (dax__bufferstack + AX_dax__adag_version) XBT_PUBLIC_DATA(short int) dax__adag_version_isset; -XBT_PUBLIC_DATA(AT_dax__uses_type) AX_dax__uses_type; -#define A_dax__uses_type (dax__bufferstack + AX_dax__uses_type) -XBT_PUBLIC_DATA(short int) dax__uses_type_isset; XBT_PUBLIC_DATA(AT_dax__uses_optional) AX_dax__uses_optional; #define A_dax__uses_optional AX_dax__uses_optional XBT_PUBLIC_DATA(short int) dax__uses_optional_isset; XBT_PUBLIC_DATA(AT_dax__adag_name) AX_dax__adag_name; #define A_dax__adag_name (dax__bufferstack + AX_dax__adag_name) XBT_PUBLIC_DATA(short int) dax__adag_name_isset; -XBT_PUBLIC_DATA(AT_dax__child_ref) AX_dax__child_ref; -#define A_dax__child_ref (dax__bufferstack + AX_dax__child_ref) -XBT_PUBLIC_DATA(short int) dax__child_ref_isset; -XBT_PUBLIC_DATA(AT_dax__adag_xmlns) AX_dax__adag_xmlns; -#define A_dax__adag_xmlns (dax__bufferstack + AX_dax__adag_xmlns) -XBT_PUBLIC_DATA(short int) dax__adag_xmlns_isset; -XBT_PUBLIC_DATA(AT_dax__uses_transfer) AX_dax__uses_transfer; -#define A_dax__uses_transfer AX_dax__uses_transfer -XBT_PUBLIC_DATA(short int) dax__uses_transfer_isset; -XBT_PUBLIC_DATA(AT_dax__job_id) AX_dax__job_id; -#define A_dax__job_id (dax__bufferstack + AX_dax__job_id) -XBT_PUBLIC_DATA(short int) dax__job_id_isset; +XBT_PUBLIC_DATA(AT_dax__adag_jobCount) AX_dax__adag_jobCount; +#define A_dax__adag_jobCount (dax__bufferstack + AX_dax__adag_jobCount) +XBT_PUBLIC_DATA(short int) dax__adag_jobCount_isset; +XBT_PUBLIC_DATA(AT_dax__adag_xsi_c_schemaLocation) AX_dax__adag_xsi_c_schemaLocation; +#define A_dax__adag_xsi_c_schemaLocation (dax__bufferstack + AX_dax__adag_xsi_c_schemaLocation) +XBT_PUBLIC_DATA(short int) dax__adag_xsi_c_schemaLocation_isset; +XBT_PUBLIC_DATA(AT_dax__job_level) AX_dax__job_level; +#define A_dax__job_level (dax__bufferstack + AX_dax__job_level) +XBT_PUBLIC_DATA(short int) dax__job_level_isset; XBT_PUBLIC_DATA(AT_dax__uses_file) AX_dax__uses_file; #define A_dax__uses_file (dax__bufferstack + AX_dax__uses_file) XBT_PUBLIC_DATA(short int) dax__uses_file_isset; -XBT_PUBLIC_DATA(AT_dax__parent_ref) AX_dax__parent_ref; -#define A_dax__parent_ref (dax__bufferstack + AX_dax__parent_ref) -XBT_PUBLIC_DATA(short int) dax__parent_ref_isset; XBT_PUBLIC_DATA(AT_dax__adag_count) AX_dax__adag_count; #define A_dax__adag_count (dax__bufferstack + AX_dax__adag_count) XBT_PUBLIC_DATA(short int) dax__adag_count_isset; -XBT_PUBLIC_DATA(AT_dax__adag_xmlns_c_xsi) AX_dax__adag_xmlns_c_xsi; -#define A_dax__adag_xmlns_c_xsi (dax__bufferstack + AX_dax__adag_xmlns_c_xsi) -XBT_PUBLIC_DATA(short int) dax__adag_xmlns_c_xsi_isset; -XBT_PUBLIC_DATA(AT_dax__adag_index) AX_dax__adag_index; -#define A_dax__adag_index (dax__bufferstack + AX_dax__adag_index) -XBT_PUBLIC_DATA(short int) dax__adag_index_isset; -XBT_PUBLIC_DATA(AT_dax__uses_size) AX_dax__uses_size; -#define A_dax__uses_size (dax__bufferstack + AX_dax__uses_size) -XBT_PUBLIC_DATA(short int) dax__uses_size_isset; -XBT_PUBLIC_DATA(AT_dax__adag_childCount) AX_dax__adag_childCount; -#define A_dax__adag_childCount (dax__bufferstack + AX_dax__adag_childCount) -XBT_PUBLIC_DATA(short int) dax__adag_childCount_isset; XBT_PUBLIC_DATA(AT_dax__uses_link) AX_dax__uses_link; #define A_dax__uses_link AX_dax__uses_link XBT_PUBLIC_DATA(short int) dax__uses_link_isset; +XBT_PUBLIC_DATA(AT_dax__uses_type) AX_dax__uses_type; +#define A_dax__uses_type (dax__bufferstack + AX_dax__uses_type) +XBT_PUBLIC_DATA(short int) dax__uses_type_isset; +XBT_PUBLIC_DATA(AT_dax__adag_xmlns_c_xsi) AX_dax__adag_xmlns_c_xsi; +#define A_dax__adag_xmlns_c_xsi (dax__bufferstack + AX_dax__adag_xmlns_c_xsi) +XBT_PUBLIC_DATA(short int) dax__adag_xmlns_c_xsi_isset; XBT_PUBLIC_DATA(AT_dax__job_runtime) AX_dax__job_runtime; #define A_dax__job_runtime (dax__bufferstack + AX_dax__job_runtime) XBT_PUBLIC_DATA(short int) dax__job_runtime_isset; -XBT_PUBLIC_DATA(AT_dax__job_level) AX_dax__job_level; -#define A_dax__job_level (dax__bufferstack + AX_dax__job_level) -XBT_PUBLIC_DATA(short int) dax__job_level_isset; -XBT_PUBLIC_DATA(AT_dax__job_namespace) AX_dax__job_namespace; -#define A_dax__job_namespace (dax__bufferstack + AX_dax__job_namespace) -XBT_PUBLIC_DATA(short int) dax__job_namespace_isset; +XBT_PUBLIC_DATA(AT_dax__job_id) AX_dax__job_id; +#define A_dax__job_id (dax__bufferstack + AX_dax__job_id) +XBT_PUBLIC_DATA(short int) dax__job_id_isset; XBT_PUBLIC_DATA(AT_dax__job_name) AX_dax__job_name; #define A_dax__job_name (dax__bufferstack + AX_dax__job_name) XBT_PUBLIC_DATA(short int) dax__job_name_isset; -XBT_PUBLIC_DATA(AT_dax__adag_jobCount) AX_dax__adag_jobCount; -#define A_dax__adag_jobCount (dax__bufferstack + AX_dax__adag_jobCount) -XBT_PUBLIC_DATA(short int) dax__adag_jobCount_isset; -XBT_PUBLIC_DATA(AT_dax__job_version) AX_dax__job_version; -#define A_dax__job_version (dax__bufferstack + AX_dax__job_version) -XBT_PUBLIC_DATA(short int) dax__job_version_isset; -XBT_PUBLIC_DATA(AT_dax__adag_xsi_c_schemaLocation) AX_dax__adag_xsi_c_schemaLocation; -#define A_dax__adag_xsi_c_schemaLocation (dax__bufferstack + AX_dax__adag_xsi_c_schemaLocation) -XBT_PUBLIC_DATA(short int) dax__adag_xsi_c_schemaLocation_isset; -XBT_PUBLIC_DATA(AT_dax__uses_register) AX_dax__uses_register; -#define A_dax__uses_register AX_dax__uses_register -XBT_PUBLIC_DATA(short int) dax__uses_register_isset; -XBT_PUBLIC_DATA(AT_dax__adag_fileCount) AX_dax__adag_fileCount; -#define A_dax__adag_fileCount (dax__bufferstack + AX_dax__adag_fileCount) -XBT_PUBLIC_DATA(short int) dax__adag_fileCount_isset; /* XML application utilities. */ XBT_PUBLIC(int) dax__element_context(int); diff --git a/src/simdag/sd_global.c b/src/simdag/sd_global.c index e3f62b1381..0d87b7d99a 100644 --- a/src/simdag/sd_global.c +++ b/src/simdag/sd_global.c @@ -84,10 +84,6 @@ void SD_init(int *argc, char **argv) xbt_cfg_setdefault_string(_sg_cfg_set, "workstation/model", "ptask_L07"); -#ifdef HAVE_TRACING - TRACE_start (); -#endif - #ifdef HAVE_JEDULE jedule_sd_init(); #endif diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index 818aad91bd..bd6c7e2ef1 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -696,7 +696,11 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_register(&_sg_cfg_set, "contexts/guard_size", "Guard size for contexts stacks in memory pages", xbt_cfgelm_int, 1, 1, _sg_cfg_cb_context_guard_size, NULL); +#if defined(_XBT_WIN32) || (PTH_STACKGROWTH != -1) + xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/guard_size", 0); +#else xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/guard_size", 1); +#endif /* No, it was not set yet (the above setdefault() changed this to 1). */ smx_context_guard_size_was_set = 0; @@ -952,13 +956,17 @@ void surf_config_models_setup() xbt_assert(network_model_name, "Set a network model to use with the 'compound' workstation model"); + if(surf_cpu_model_init_preparse){ + surf_cpu_model_init_preparse(); + } else { + cpu_id = + find_model_description(surf_cpu_model_description, cpu_model_name); + surf_cpu_model_description[cpu_id].model_init_preparse(); + } + network_id = find_model_description(surf_network_model_description, network_model_name); - cpu_id = - find_model_description(surf_cpu_model_description, cpu_model_name); - - surf_cpu_model_description[cpu_id].model_init_preparse(); surf_network_model_description[network_id].model_init_preparse(); } diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index e28d7ccb4d..7d1998e12f 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -54,7 +54,7 @@ process_cleanup True (void) (process, void*, smx_process_t) process_change_host True (void) (process, void*, smx_process_t) (dest, void*, smx_host_t) process_suspend False (void) (process, void*, smx_process_t) process_resume True (void) (process, void*, smx_process_t) -process_count True (int) +process_count True (int) process_get_PID True (int) (process, void*, smx_process_t) process_get_PPID True (int) (process, void*, smx_process_t) process_get_data True (void*) (process, void*, smx_process_t) @@ -63,8 +63,9 @@ process_get_host True (void*, smx_host_t) (process, void*, smx_process_t) process_get_name True (const char*) (process, void*, smx_process_t) process_is_suspended True (int) (process, void*, smx_process_t) process_get_properties True (void*, xbt_dict_t) (process, void*, smx_process_t) +process_join False (int) (process, void*, smx_process_t) (timeout, double) process_sleep False (int) (duration, double) -process_on_exit True (void) (process, void*, smx_process_t) (fun, FPtr, int_f_pvoid_t) (data, void*) +process_on_exit True (void) (process, void*, smx_process_t) (fun, FPtr, int_f_pvoid_pvoid_t) (data, void*) process_auto_restart_set True (void) (process, void*, smx_process_t) (auto_restart, int) process_restart True (void*, smx_process_t) (process, void*, smx_process_t) rdv_create True (void*, smx_rdv_t) (name, const char*) @@ -75,10 +76,10 @@ rdv_get_head True (void*, smx_action_t) (rdv, void*, smx_rdv_t) rdv_set_receiver True (void) (rdv, void*, smx_rdv_t) (receiver, void*, smx_process_t) rdv_get_receiver True (void*, smx_process_t) (rdv, void*, smx_rdv_t) comm_iprobe True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (src, int) (tag, int) (match_fun, FPtr, simix_match_func_t) (data, void*) -comm_send False (void) (rdv, void*, smx_rdv_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (data, void*) (timeout, double) -comm_isend True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (clean_fun, FPtr, simix_clean_func_t) (data, void*) (detached, int) -comm_recv False (void) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (data, void*) (timeout, double) (rate, double) -comm_irecv True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (data, void*) (rate, double) +comm_send False (void) (rdv, void*, smx_rdv_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double) +comm_isend True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (clean_fun, FPtr, simix_clean_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (detached, int) +comm_recv False (void) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double) (rate, double) +comm_irecv True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (rate, double) comm_cancel True (void) (comm, void*, smx_action_t) comm_waitany False (int) (comms, void*, xbt_dynar_t) comm_wait False (void) (comm, void*, smx_action_t) (timeout, double) @@ -90,12 +91,12 @@ comm_get_src_data True (void*) (comm, void*, smx_action_t) comm_get_dst_data True (void*) (comm, void*, smx_action_t) comm_get_src_proc True (void*, smx_process_t) (comm, void*, smx_action_t) comm_get_dst_proc True (void*, smx_process_t) (comm, void*, smx_action_t) -mutex_init True (void*, smx_mutex_t) +mutex_init True (void*, smx_mutex_t) mutex_destroy True (void) (mutex, void*, smx_mutex_t) mutex_lock False (void) (mutex, void*, smx_mutex_t) mutex_trylock True (int) (mutex, void*, smx_mutex_t) mutex_unlock True (void) (mutex, void*, smx_mutex_t) -cond_init True (void*, smx_cond_t) +cond_init True (void*, smx_cond_t) cond_destroy True (void) (cond, void*, smx_cond_t) cond_signal True (void) (cond, void*, smx_cond_t) cond_wait False (void) (cond, void*, smx_cond_t) (mutex, void*, smx_mutex_t) @@ -118,8 +119,8 @@ file_tell True (sg_size_t) (fd, void*, smx_file_t) file_seek True (int) (fd, void*, smx_file_t) (offset, sg_size_t) (origin, int) file_get_info True (void*, xbt_dynar_t) (fd, void*, smx_file_t) file_move True (int) (fd, void*, smx_file_t) (fullpath, const char*) -storage_get_free_size True (sg_size_t) (name, const char*) -storage_get_used_size True (sg_size_t) (name, const char*) +storage_get_free_size True (sg_size_t) (storage, void*, smx_storage_t) +storage_get_used_size True (sg_size_t) (name, void*, smx_storage_t) storage_get_properties True (void*, xbt_dict_t) (storage, void*, smx_storage_t) storage_get_content True (void*, xbt_dict_t) (storage, void*, smx_storage_t) asr_get_properties True (void*, xbt_dict_t) (name, const char*) @@ -128,6 +129,6 @@ comm_is_latency_bounded True (int) (comm, void*, smx_action_t) ## HAVE_TRACING set_category True (void) (action, void*, smx_action_t) (category, const char*) ## HAVE_MC -mc_snapshot True (void*) +mc_snapshot True (void*) mc_compare_snapshots True (int) (s1, void*) (s2, void*) mc_random True (int) (min, int) (max, int) diff --git a/src/simix/simcalls_generated_args_getter_setter.h b/src/simix/simcalls_generated_args_getter_setter.h index 2cd2752f51..bc7a3e29d3 100644 --- a/src/simix/simcalls_generated_args_getter_setter.h +++ b/src/simix/simcalls_generated_args_getter_setter.h @@ -558,6 +558,18 @@ static inline smx_process_t simcall_process_get_properties__get__process(smx_sim static inline void simcall_process_get_properties__set__process(smx_simcall_t simcall, void* arg){ simcall->args[0].dp = arg; } +static inline smx_process_t simcall_process_join__get__process(smx_simcall_t simcall){ + return (smx_process_t) simcall->args[0].dp; +} +static inline void simcall_process_join__set__process(smx_simcall_t simcall, void* arg){ + simcall->args[0].dp = arg; +} +static inline double simcall_process_join__get__timeout(smx_simcall_t simcall){ + return simcall->args[1].d; +} +static inline void simcall_process_join__set__timeout(smx_simcall_t simcall, double arg){ + simcall->args[1].d = arg; +} static inline double simcall_process_sleep__get__duration(smx_simcall_t simcall){ return simcall->args[0].d; } @@ -570,8 +582,8 @@ static inline smx_process_t simcall_process_on_exit__get__process(smx_simcall_t static inline void simcall_process_on_exit__set__process(smx_simcall_t simcall, void* arg){ simcall->args[0].dp = arg; } -static inline int_f_pvoid_t simcall_process_on_exit__get__fun(smx_simcall_t simcall){ - return (int_f_pvoid_t) simcall->args[1].fp; +static inline int_f_pvoid_pvoid_t simcall_process_on_exit__get__fun(smx_simcall_t simcall){ + return (int_f_pvoid_pvoid_t) simcall->args[1].fp; } static inline void simcall_process_on_exit__set__fun(smx_simcall_t simcall, FPtr arg){ simcall->args[1].fp = arg; @@ -714,17 +726,23 @@ static inline simix_match_func_t simcall_comm_send__get__match_fun(smx_simcall_t static inline void simcall_comm_send__set__match_fun(smx_simcall_t simcall, FPtr arg){ simcall->args[5].fp = arg; } +static inline simix_copy_data_func_t simcall_comm_send__get__copy_data_fun(smx_simcall_t simcall){ + return (simix_copy_data_func_t) simcall->args[6].fp; +} +static inline void simcall_comm_send__set__copy_data_fun(smx_simcall_t simcall, FPtr arg){ + simcall->args[6].fp = arg; +} static inline void* simcall_comm_send__get__data(smx_simcall_t simcall){ - return simcall->args[6].dp; + return simcall->args[7].dp; } static inline void simcall_comm_send__set__data(smx_simcall_t simcall, void* arg){ - simcall->args[6].dp = arg; + simcall->args[7].dp = arg; } static inline double simcall_comm_send__get__timeout(smx_simcall_t simcall){ - return simcall->args[7].d; + return simcall->args[8].d; } static inline void simcall_comm_send__set__timeout(smx_simcall_t simcall, double arg){ - simcall->args[7].d = arg; + simcall->args[8].d = arg; } static inline smx_rdv_t simcall_comm_isend__get__rdv(smx_simcall_t simcall){ return (smx_rdv_t) simcall->args[0].dp; @@ -768,17 +786,23 @@ static inline simix_clean_func_t simcall_comm_isend__get__clean_fun(smx_simcall_ static inline void simcall_comm_isend__set__clean_fun(smx_simcall_t simcall, FPtr arg){ simcall->args[6].fp = arg; } +static inline simix_copy_data_func_t simcall_comm_isend__get__copy_data_fun(smx_simcall_t simcall){ + return (simix_copy_data_func_t) simcall->args[7].fp; +} +static inline void simcall_comm_isend__set__copy_data_fun(smx_simcall_t simcall, FPtr arg){ + simcall->args[7].fp = arg; +} static inline void* simcall_comm_isend__get__data(smx_simcall_t simcall){ - return simcall->args[7].dp; + return simcall->args[8].dp; } static inline void simcall_comm_isend__set__data(smx_simcall_t simcall, void* arg){ - simcall->args[7].dp = arg; + simcall->args[8].dp = arg; } static inline int simcall_comm_isend__get__detached(smx_simcall_t simcall){ - return simcall->args[8].i; + return simcall->args[9].i; } static inline void simcall_comm_isend__set__detached(smx_simcall_t simcall, int arg){ - simcall->args[8].i = arg; + simcall->args[9].i = arg; } static inline smx_rdv_t simcall_comm_recv__get__rdv(smx_simcall_t simcall){ return (smx_rdv_t) simcall->args[0].dp; @@ -804,23 +828,29 @@ static inline simix_match_func_t simcall_comm_recv__get__match_fun(smx_simcall_t static inline void simcall_comm_recv__set__match_fun(smx_simcall_t simcall, FPtr arg){ simcall->args[3].fp = arg; } +static inline simix_copy_data_func_t simcall_comm_recv__get__copy_data_fun(smx_simcall_t simcall){ + return (simix_copy_data_func_t) simcall->args[4].fp; +} +static inline void simcall_comm_recv__set__copy_data_fun(smx_simcall_t simcall, FPtr arg){ + simcall->args[4].fp = arg; +} static inline void* simcall_comm_recv__get__data(smx_simcall_t simcall){ - return simcall->args[4].dp; + return simcall->args[5].dp; } static inline void simcall_comm_recv__set__data(smx_simcall_t simcall, void* arg){ - simcall->args[4].dp = arg; + simcall->args[5].dp = arg; } static inline double simcall_comm_recv__get__timeout(smx_simcall_t simcall){ - return simcall->args[5].d; + return simcall->args[6].d; } static inline void simcall_comm_recv__set__timeout(smx_simcall_t simcall, double arg){ - simcall->args[5].d = arg; + simcall->args[6].d = arg; } static inline double simcall_comm_recv__get__rate(smx_simcall_t simcall){ - return simcall->args[6].d; + return simcall->args[7].d; } static inline void simcall_comm_recv__set__rate(smx_simcall_t simcall, double arg){ - simcall->args[6].d = arg; + simcall->args[7].d = arg; } static inline smx_rdv_t simcall_comm_irecv__get__rdv(smx_simcall_t simcall){ return (smx_rdv_t) simcall->args[0].dp; @@ -846,17 +876,23 @@ static inline simix_match_func_t simcall_comm_irecv__get__match_fun(smx_simcall_ static inline void simcall_comm_irecv__set__match_fun(smx_simcall_t simcall, FPtr arg){ simcall->args[3].fp = arg; } +static inline simix_copy_data_func_t simcall_comm_irecv__get__copy_data_fun(smx_simcall_t simcall){ + return (simix_copy_data_func_t) simcall->args[4].fp; +} +static inline void simcall_comm_irecv__set__copy_data_fun(smx_simcall_t simcall, FPtr arg){ + simcall->args[4].fp = arg; +} static inline void* simcall_comm_irecv__get__data(smx_simcall_t simcall){ - return simcall->args[4].dp; + return simcall->args[5].dp; } static inline void simcall_comm_irecv__set__data(smx_simcall_t simcall, void* arg){ - simcall->args[4].dp = arg; + simcall->args[5].dp = arg; } static inline double simcall_comm_irecv__get__rate(smx_simcall_t simcall){ - return simcall->args[5].d; + return simcall->args[6].d; } static inline void simcall_comm_irecv__set__rate(smx_simcall_t simcall, double arg){ - simcall->args[5].d = arg; + simcall->args[6].d = arg; } static inline smx_action_t simcall_comm_cancel__get__comm(smx_simcall_t simcall){ return (smx_action_t) simcall->args[0].dp; @@ -1166,17 +1202,17 @@ static inline const char* simcall_file_move__get__fullpath(smx_simcall_t simcall static inline void simcall_file_move__set__fullpath(smx_simcall_t simcall, const char* arg){ simcall->args[1].cc = arg; } -static inline const char* simcall_storage_get_free_size__get__name(smx_simcall_t simcall){ - return simcall->args[0].cc; +static inline smx_storage_t simcall_storage_get_free_size__get__storage(smx_simcall_t simcall){ + return (smx_storage_t) simcall->args[0].dp; } -static inline void simcall_storage_get_free_size__set__name(smx_simcall_t simcall, const char* arg){ - simcall->args[0].cc = arg; +static inline void simcall_storage_get_free_size__set__storage(smx_simcall_t simcall, void* arg){ + simcall->args[0].dp = arg; } -static inline const char* simcall_storage_get_used_size__get__name(smx_simcall_t simcall){ - return simcall->args[0].cc; +static inline smx_storage_t simcall_storage_get_used_size__get__name(smx_simcall_t simcall){ + return (smx_storage_t) simcall->args[0].dp; } -static inline void simcall_storage_get_used_size__set__name(smx_simcall_t simcall, const char* arg){ - simcall->args[0].cc = arg; +static inline void simcall_storage_get_used_size__set__name(smx_simcall_t simcall, void* arg){ + simcall->args[0].dp = arg; } static inline smx_storage_t simcall_storage_get_properties__get__storage(smx_simcall_t simcall){ return (smx_storage_t) simcall->args[0].dp; diff --git a/src/simix/simcalls_generated_body.c b/src/simix/simcalls_generated_body.c index c6e1f254ae..7f4189a1e3 100644 --- a/src/simix/simcalls_generated_body.c +++ b/src/simix/simcalls_generated_body.c @@ -910,6 +910,22 @@ } return self->simcall.result.dp; } + inline static int simcall_BODY_process_join(smx_process_t process, double timeout) { + smx_process_t self = SIMIX_process_self(); + self->simcall.call = SIMCALL_PROCESS_JOIN; + memset(&self->simcall.result, 0, sizeof(self->simcall.result)); + memset(self->simcall.args, 0, sizeof(self->simcall.args)); + self->simcall.args[0].dp = (void*) process; + self->simcall.args[1].d = (double) timeout; + if (self != simix_global->maestro_process) { + XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, + SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); + SIMIX_process_yield(self); + } else { + SIMIX_simcall_pre(&self->simcall, 0); + } + return self->simcall.result.i; + } inline static int simcall_BODY_process_sleep(double duration) { smx_process_t self = SIMIX_process_self(); self->simcall.call = SIMCALL_PROCESS_SLEEP; @@ -925,7 +941,7 @@ } return self->simcall.result.i; } - inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void* data) { + inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void* data) { smx_process_t self = SIMIX_process_self(); self->simcall.call = SIMCALL_PROCESS_ON_EXIT; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); @@ -1084,7 +1100,7 @@ } return self->simcall.result.dp; } - inline static void simcall_BODY_comm_send(smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, void* data, double timeout) { + inline static void simcall_BODY_comm_send(smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) { smx_process_t self = SIMIX_process_self(); self->simcall.call = SIMCALL_COMM_SEND; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); @@ -1095,8 +1111,9 @@ self->simcall.args[3].dp = (void*) src_buff; self->simcall.args[4].sz = (size_t) src_buff_size; self->simcall.args[5].fp = (FPtr) match_fun; - self->simcall.args[6].dp = (void*) data; - self->simcall.args[7].d = (double) timeout; + self->simcall.args[6].fp = (FPtr) copy_data_fun; + self->simcall.args[7].dp = (void*) data; + self->simcall.args[8].d = (double) timeout; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); @@ -1106,7 +1123,7 @@ } } - inline static smx_action_t simcall_BODY_comm_isend(smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, void* data, int detached) { + inline static smx_action_t simcall_BODY_comm_isend(smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) { smx_process_t self = SIMIX_process_self(); self->simcall.call = SIMCALL_COMM_ISEND; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); @@ -1118,8 +1135,9 @@ self->simcall.args[4].sz = (size_t) src_buff_size; self->simcall.args[5].fp = (FPtr) match_fun; self->simcall.args[6].fp = (FPtr) clean_fun; - self->simcall.args[7].dp = (void*) data; - self->simcall.args[8].i = (int) detached; + self->simcall.args[7].fp = (FPtr) copy_data_fun; + self->simcall.args[8].dp = (void*) data; + self->simcall.args[9].i = (int) detached; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); @@ -1129,7 +1147,7 @@ } return self->simcall.result.dp; } - inline static void simcall_BODY_comm_recv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double timeout, double rate) { + inline static void simcall_BODY_comm_recv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) { smx_process_t self = SIMIX_process_self(); self->simcall.call = SIMCALL_COMM_RECV; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); @@ -1138,9 +1156,10 @@ self->simcall.args[1].dp = (void*) dst_buff; self->simcall.args[2].dp = (void*) dst_buff_size; self->simcall.args[3].fp = (FPtr) match_fun; - self->simcall.args[4].dp = (void*) data; - self->simcall.args[5].d = (double) timeout; - self->simcall.args[6].d = (double) rate; + self->simcall.args[4].fp = (FPtr) copy_data_fun; + self->simcall.args[5].dp = (void*) data; + self->simcall.args[6].d = (double) timeout; + self->simcall.args[7].d = (double) rate; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); @@ -1150,7 +1169,7 @@ } } - inline static smx_action_t simcall_BODY_comm_irecv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, void* data, double rate) { + inline static smx_action_t simcall_BODY_comm_irecv(smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) { smx_process_t self = SIMIX_process_self(); self->simcall.call = SIMCALL_COMM_IRECV; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); @@ -1159,8 +1178,9 @@ self->simcall.args[1].dp = (void*) dst_buff; self->simcall.args[2].dp = (void*) dst_buff_size; self->simcall.args[3].fp = (FPtr) match_fun; - self->simcall.args[4].dp = (void*) data; - self->simcall.args[5].d = (double) rate; + self->simcall.args[4].fp = (FPtr) copy_data_fun; + self->simcall.args[5].dp = (void*) data; + self->simcall.args[6].d = (double) rate; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); @@ -1769,12 +1789,12 @@ } return self->simcall.result.i; } - inline static sg_size_t simcall_BODY_storage_get_free_size(const char* name) { + inline static sg_size_t simcall_BODY_storage_get_free_size(smx_storage_t storage) { smx_process_t self = SIMIX_process_self(); self->simcall.call = SIMCALL_STORAGE_GET_FREE_SIZE; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].cc = (const char*) name; + self->simcall.args[0].dp = (void*) storage; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); @@ -1784,12 +1804,12 @@ } return self->simcall.result.sgsz; } - inline static sg_size_t simcall_BODY_storage_get_used_size(const char* name) { + inline static sg_size_t simcall_BODY_storage_get_used_size(smx_storage_t name) { smx_process_t self = SIMIX_process_self(); self->simcall.call = SIMCALL_STORAGE_GET_USED_SIZE; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].cc = (const char*) name; + self->simcall.args[0].dp = (void*) name; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); diff --git a/src/simix/simcalls_generated_case.c b/src/simix/simcalls_generated_case.c index 45ef5a2ae2..9966f2e097 100644 --- a/src/simix/simcalls_generated_case.c +++ b/src/simix/simcalls_generated_case.c @@ -293,12 +293,16 @@ case SIMCALL_PROCESS_GET_PROPERTIES: SIMIX_simcall_answer(simcall); break; +case SIMCALL_PROCESS_JOIN: + SIMIX_pre_process_join(simcall , (smx_process_t) simcall->args[0].dp, simcall->args[1].d); + break; + case SIMCALL_PROCESS_SLEEP: SIMIX_pre_process_sleep(simcall , simcall->args[0].d); break; case SIMCALL_PROCESS_ON_EXIT: - SIMIX_pre_process_on_exit(simcall , (smx_process_t) simcall->args[0].dp, (int_f_pvoid_t) simcall->args[1].fp, simcall->args[2].dp); + SIMIX_pre_process_on_exit(simcall , (smx_process_t) simcall->args[0].dp, (int_f_pvoid_pvoid_t) simcall->args[1].fp, simcall->args[2].dp); SIMIX_simcall_answer(simcall); break; @@ -348,20 +352,20 @@ case SIMCALL_COMM_IPROBE: break; case SIMCALL_COMM_SEND: - SIMIX_pre_comm_send(simcall , (smx_rdv_t) simcall->args[0].dp, simcall->args[1].d, simcall->args[2].d, simcall->args[3].dp, simcall->args[4].sz, (simix_match_func_t) simcall->args[5].fp, simcall->args[6].dp, simcall->args[7].d); + SIMIX_pre_comm_send(simcall , (smx_rdv_t) simcall->args[0].dp, simcall->args[1].d, simcall->args[2].d, simcall->args[3].dp, simcall->args[4].sz, (simix_match_func_t) simcall->args[5].fp, (simix_copy_data_func_t) simcall->args[6].fp, simcall->args[7].dp, simcall->args[8].d); break; case SIMCALL_COMM_ISEND: - simcall->result.dp = SIMIX_pre_comm_isend(simcall , (smx_rdv_t) simcall->args[0].dp, simcall->args[1].d, simcall->args[2].d, simcall->args[3].dp, simcall->args[4].sz, (simix_match_func_t) simcall->args[5].fp, (simix_clean_func_t) simcall->args[6].fp, simcall->args[7].dp, simcall->args[8].i); + simcall->result.dp = SIMIX_pre_comm_isend(simcall , (smx_rdv_t) simcall->args[0].dp, simcall->args[1].d, simcall->args[2].d, simcall->args[3].dp, simcall->args[4].sz, (simix_match_func_t) simcall->args[5].fp, (simix_clean_func_t) simcall->args[6].fp, (simix_copy_data_func_t) simcall->args[7].fp, simcall->args[8].dp, simcall->args[9].i); SIMIX_simcall_answer(simcall); break; case SIMCALL_COMM_RECV: - SIMIX_pre_comm_recv(simcall , (smx_rdv_t) simcall->args[0].dp, simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp, simcall->args[4].dp, simcall->args[5].d, simcall->args[6].d); + SIMIX_pre_comm_recv(simcall , (smx_rdv_t) simcall->args[0].dp, simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp, (simix_copy_data_func_t) simcall->args[4].fp, simcall->args[5].dp, simcall->args[6].d, simcall->args[7].d); break; case SIMCALL_COMM_IRECV: - simcall->result.dp = SIMIX_pre_comm_irecv(simcall , (smx_rdv_t) simcall->args[0].dp, simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp, simcall->args[4].dp, simcall->args[5].d); + simcall->result.dp = SIMIX_pre_comm_irecv(simcall , (smx_rdv_t) simcall->args[0].dp, simcall->args[1].dp, (size_t*) simcall->args[2].dp, (simix_match_func_t) simcall->args[3].fp, (simix_copy_data_func_t) simcall->args[4].fp, simcall->args[5].dp, simcall->args[6].d); SIMIX_simcall_answer(simcall); break; @@ -548,12 +552,12 @@ case SIMCALL_FILE_MOVE: break; case SIMCALL_STORAGE_GET_FREE_SIZE: - simcall->result.sgsz = SIMIX_pre_storage_get_free_size(simcall , simcall->args[0].cc); + simcall->result.sgsz = SIMIX_pre_storage_get_free_size(simcall , (smx_storage_t) simcall->args[0].dp); SIMIX_simcall_answer(simcall); break; case SIMCALL_STORAGE_GET_USED_SIZE: - simcall->result.sgsz = SIMIX_pre_storage_get_used_size(simcall , simcall->args[0].cc); + simcall->result.sgsz = SIMIX_pre_storage_get_used_size(simcall , (smx_storage_t) simcall->args[0].dp); SIMIX_simcall_answer(simcall); break; diff --git a/src/simix/simcalls_generated_enum.h b/src/simix/simcalls_generated_enum.h index 5337849bf0..c2e7fe9b53 100644 --- a/src/simix/simcalls_generated_enum.h +++ b/src/simix/simcalls_generated_enum.h @@ -63,6 +63,7 @@ SIMCALL_PROCESS_GET_HOST, SIMCALL_PROCESS_GET_NAME, SIMCALL_PROCESS_IS_SUSPENDED, SIMCALL_PROCESS_GET_PROPERTIES, +SIMCALL_PROCESS_JOIN, SIMCALL_PROCESS_SLEEP, SIMCALL_PROCESS_ON_EXIT, SIMCALL_PROCESS_AUTO_RESTART_SET, diff --git a/src/simix/simcalls_generated_res_getter_setter.h b/src/simix/simcalls_generated_res_getter_setter.h index defe198cb9..6afe222ab6 100644 --- a/src/simix/simcalls_generated_res_getter_setter.h +++ b/src/simix/simcalls_generated_res_getter_setter.h @@ -241,6 +241,12 @@ static inline xbt_dict_t simcall_process_get_properties__get__result(smx_simcall static inline void simcall_process_get_properties__set__result(smx_simcall_t simcall, void* result){ simcall->result.dp = result; } +static inline int simcall_process_join__get__result(smx_simcall_t simcall){ + return simcall->result.i; +} +static inline void simcall_process_join__set__result(smx_simcall_t simcall, int result){ + simcall->result.i = result; +} static inline int simcall_process_sleep__get__result(smx_simcall_t simcall){ return simcall->result.i; } diff --git a/src/simix/simcalls_generated_string.c b/src/simix/simcalls_generated_string.c index d409da2de8..8269d30282 100644 --- a/src/simix/simcalls_generated_string.c +++ b/src/simix/simcalls_generated_string.c @@ -63,6 +63,7 @@ [SIMCALL_PROCESS_GET_NAME] = "SIMCALL_PROCESS_GET_NAME", [SIMCALL_PROCESS_IS_SUSPENDED] = "SIMCALL_PROCESS_IS_SUSPENDED", [SIMCALL_PROCESS_GET_PROPERTIES] = "SIMCALL_PROCESS_GET_PROPERTIES", +[SIMCALL_PROCESS_JOIN] = "SIMCALL_PROCESS_JOIN", [SIMCALL_PROCESS_SLEEP] = "SIMCALL_PROCESS_SLEEP", [SIMCALL_PROCESS_ON_EXIT] = "SIMCALL_PROCESS_ON_EXIT", [SIMCALL_PROCESS_AUTO_RESTART_SET] = "SIMCALL_PROCESS_AUTO_RESTART_SET", diff --git a/src/simix/smx_context.c b/src/simix/smx_context.c index 186b1236df..f222f62f28 100644 --- a/src/simix/smx_context.c +++ b/src/simix/smx_context.c @@ -124,7 +124,21 @@ void *SIMIX_context_stack_new(void) { void *stack; + /* FIXME: current code for stack overflow protection assumes that stacks are + * growing downward (PTH_STACKGROWTH == -1). Protected pages need to be put + * after the stack when PTH_STACKGROWTH == 1. */ + if (smx_context_guard_size > 0 && !MC_is_active()) { + +#if defined(_XBT_WIN32) || (PTH_STACKGROWTH != -1) + static int warned_once = 0; + if (!warned_once) { + XBT_WARN("Stack overflow protection is known to be broken on your system. Either you're on Windows or PTH_STACKGROWTH != -1 (current value is %d).", + PTH_STACKGROWTH); + warned_once = 1; + } +#endif + size_t size = smx_context_stack_size + smx_context_guard_size; #ifdef HAVE_MC /* Cannot use posix_memalign when HAVE_MC. Align stack by hand, and save the @@ -132,14 +146,14 @@ void *SIMIX_context_stack_new(void) char *alloc = xbt_malloc0(size + xbt_pagesize); stack = alloc - ((uintptr_t)alloc & (xbt_pagesize - 1)) + xbt_pagesize; *((void **)stack - 1) = alloc; -#elif !defined(WIN32) +#elif !defined(_XBT_WIN32) if (posix_memalign(&stack, xbt_pagesize, size) != 0) xbt_die("Failed to allocate stack."); #else - stack = _aligned_malloc(size, xbt_pagesize); + stack = _aligned_malloc(size, xbt_pagesize); #endif -#ifndef WIN32 +#ifndef _XBT_WIN32 if (mprotect(stack, smx_context_guard_size, PROT_NONE) == -1) { XBT_WARN("Failed to protect stack: %s", strerror(errno)); /* That's not fatal, pursue anyway. */ diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index a169f8d9e6..eb212911ac 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -191,9 +191,9 @@ void SIMIX_global_init(int *argc, char **argv) * * This functions remove the memory used by SIMIX */ -int cleaned = 0; void SIMIX_clean(void) { + static int cleaned = 0; #ifdef TIME_BENCH_PER_SR smx_ctx_raw_new_sr(); #endif @@ -535,6 +535,10 @@ void SIMIX_display_process_status(void) action_description = "sleeping"; break; + case SIMIX_ACTION_JOIN: + action_description = "joining"; + break; + case SIMIX_ACTION_SYNCHRO: action_description = "synchronization"; break; diff --git a/src/simix/smx_io.c b/src/simix/smx_io.c index 969991b74e..cd48e0acf7 100644 --- a/src/simix/smx_io.c +++ b/src/simix/smx_io.c @@ -262,26 +262,29 @@ int SIMIX_file_move(smx_process_t process, smx_file_t file, const char* fullpath return surf_workstation_file_move(host, file->surf_file, fullpath); } -sg_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall, const char* name) +sg_size_t SIMIX_storage_get_size(smx_storage_t storage){ + xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)"); + return surf_storage_get_size(storage); +} + +sg_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall, smx_storage_t storage) { - return SIMIX_storage_get_free_size(simcall->issuer, name); + return SIMIX_storage_get_free_size(simcall->issuer, storage); } -sg_size_t SIMIX_storage_get_free_size(smx_process_t process, const char* name) +sg_size_t SIMIX_storage_get_free_size(smx_process_t process, smx_storage_t storage) { - smx_host_t host = process->smx_host; - return surf_workstation_get_free_size(host, name); + return surf_storage_get_free_size(storage); } -sg_size_t SIMIX_pre_storage_get_used_size(smx_simcall_t simcall, const char* name) +sg_size_t SIMIX_pre_storage_get_used_size(smx_simcall_t simcall, smx_storage_t storage) { - return SIMIX_storage_get_used_size(simcall->issuer, name); + return SIMIX_storage_get_used_size(simcall->issuer, storage); } -sg_size_t SIMIX_storage_get_used_size(smx_process_t process, const char* name) +sg_size_t SIMIX_storage_get_used_size(smx_process_t process, smx_storage_t storage) { - smx_host_t host = process->smx_host; - return surf_workstation_get_used_size(host, name); + return surf_storage_get_used_size(storage); } xbt_dict_t SIMIX_pre_storage_get_properties(smx_simcall_t simcall, smx_storage_t storage){ @@ -310,11 +313,6 @@ xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage){ return surf_storage_get_content(storage); } -sg_size_t SIMIX_storage_get_size(smx_storage_t storage){ - xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)"); - return surf_storage_get_size(storage); -} - const char* SIMIX_pre_storage_get_host(smx_simcall_t simcall, smx_storage_t storage){ return SIMIX_storage_get_host(storage); } diff --git a/src/simix/smx_io_private.h b/src/simix/smx_io_private.h index 82f14f050d..8ddde551c6 100644 --- a/src/simix/smx_io_private.h +++ b/src/simix/smx_io_private.h @@ -43,11 +43,11 @@ xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd); int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_size_t offset, int origin); int SIMIX_file_move(smx_process_t process, smx_file_t fd, const char* fullpath); -sg_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall,const char* name); -sg_size_t SIMIX_storage_get_free_size(smx_process_t process,const char* name); +sg_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall,smx_storage_t storage); +sg_size_t SIMIX_storage_get_free_size(smx_process_t process,smx_storage_t storage); -sg_size_t SIMIX_pre_storage_get_used_size(smx_simcall_t simcall,const char* name); -sg_size_t SIMIX_storage_get_used_size(smx_process_t process,const char* name); +sg_size_t SIMIX_pre_storage_get_used_size(smx_simcall_t simcall,smx_storage_t storage); +sg_size_t SIMIX_storage_get_used_size(smx_process_t process,smx_storage_t storage); xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage); xbt_dict_t SIMIX_pre_storage_get_properties(smx_simcall_t, smx_storage_t); diff --git a/src/simix/smx_network.c b/src/simix/smx_network.c index b6c5e60d28..f613a519b2 100644 --- a/src/simix/smx_network.c +++ b/src/simix/smx_network.c @@ -355,9 +355,10 @@ void SIMIX_pre_comm_send(smx_simcall_t simcall, smx_rdv_t rdv, double task_size, double rate, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *,smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double timeout){ smx_action_t comm = SIMIX_comm_isend(simcall->issuer, rdv, task_size, rate, - src_buff, src_buff_size, match_fun, NULL, + src_buff, src_buff_size, match_fun, NULL, copy_data_fun, data, 0); SIMCALL_SET_MC_VALUE(simcall, 0); SIMIX_pre_comm_wait(simcall, comm, timeout); @@ -367,9 +368,10 @@ smx_action_t SIMIX_pre_comm_isend(smx_simcall_t simcall, smx_rdv_t rdv, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *,smx_action_t), void (*clean_fun)(void *), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, int detached){ return SIMIX_comm_isend(simcall->issuer, rdv, task_size, rate, src_buff, - src_buff_size, match_fun, clean_fun, data, detached); + src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached); } smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv, @@ -377,6 +379,7 @@ smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *,smx_action_t), void (*clean_fun)(void *), // used to free the action in case of problem after a detached send + void (*copy_data_fun)(smx_action_t, void*, size_t), // used to copy data if not default one void *data, int detached) { @@ -437,6 +440,8 @@ smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv, other_action->comm.src_data = data; other_action->comm.match_fun = match_fun; + other_action->comm.copy_data_fun = copy_data_fun; + if (MC_is_active()) { other_action->state = SIMIX_RUNNING; @@ -450,10 +455,11 @@ smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv, void SIMIX_pre_comm_recv(smx_simcall_t simcall, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double timeout, double rate) { smx_action_t comm = SIMIX_comm_irecv(simcall->issuer, rdv, dst_buff, - dst_buff_size, match_fun, data, rate); + dst_buff_size, match_fun, copy_data_fun, data, rate); SIMCALL_SET_MC_VALUE(simcall, 0); SIMIX_pre_comm_wait(simcall, comm, timeout); } @@ -461,15 +467,17 @@ void SIMIX_pre_comm_recv(smx_simcall_t simcall, smx_rdv_t rdv, smx_action_t SIMIX_pre_comm_irecv(smx_simcall_t simcall, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double rate) { return SIMIX_comm_irecv(simcall->issuer, rdv, dst_buff, dst_buff_size, - match_fun, data, rate); + match_fun, copy_data_fun, data, rate); } smx_action_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), // used to copy data if not default one void *data, double rate) { XBT_DEBUG("recv from %p %p\n", rdv, rdv->comm_fifo); @@ -541,6 +549,7 @@ smx_action_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv, other_action->comm.rate = rate; other_action->comm.match_fun = match_fun; + other_action->comm.copy_data_fun = copy_data_fun; /*if(already_received)//do the actual copy, because the first one after the comm didn't have all the info @@ -1170,8 +1179,13 @@ void SIMIX_comm_copy_data(smx_action_t comm) if (comm->comm.dst_buff_size) *comm->comm.dst_buff_size = buff_size; - if (buff_size > 0) - SIMIX_comm_copy_data_callback (comm, comm->comm.src_buff, buff_size); + if (buff_size > 0){ + if(comm->comm.copy_data_fun) + comm->comm.copy_data_fun (comm, comm->comm.src_buff, buff_size); + else + SIMIX_comm_copy_data_callback (comm, comm->comm.src_buff, buff_size); + } + /* Set the copied flag so we copy data only once */ /* (this function might be called from both communication ends) */ diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index e85cf584f8..d0c69678eb 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -39,11 +39,13 @@ smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *, smx_action_t), void (*clean_fun)(void *), // used to free the action in case of problem after a detached send + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, int detached); smx_action_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, int (*)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double rate); void SIMIX_comm_destroy(smx_action_t action); void SIMIX_comm_destroy_internal_actions(smx_action_t action); @@ -79,20 +81,24 @@ void SIMIX_pre_comm_send(smx_simcall_t simcall, smx_rdv_t rdv, double task_size, double rate, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *,smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double timeout); smx_action_t SIMIX_pre_comm_isend(smx_simcall_t simcall, smx_rdv_t rdv, double task_size, double rate, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *,smx_action_t), void (*clean_fun)(void *), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, int detached); void SIMIX_pre_comm_recv(smx_simcall_t simcall, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double timeout, double rate); smx_action_t SIMIX_pre_comm_irecv(smx_simcall_t simcall, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double rate); void SIMIX_pre_comm_cancel(smx_simcall_t simcall, smx_action_t action); double SIMIX_pre_comm_get_remains(smx_simcall_t simcall, smx_action_t action); diff --git a/src/simix/smx_private.h b/src/simix/smx_private.h index 24d8a2c020..495ba7a795 100644 --- a/src/simix/smx_private.h +++ b/src/simix/smx_private.h @@ -99,6 +99,7 @@ typedef enum { SIMIX_ACTION_EXECUTE, SIMIX_ACTION_PARALLEL_EXECUTE, SIMIX_ACTION_COMMUNICATE, + SIMIX_ACTION_JOIN, SIMIX_ACTION_SLEEP, SIMIX_ACTION_SYNCHRO, SIMIX_ACTION_IO, @@ -154,6 +155,7 @@ typedef struct s_smx_action { int (*match_fun)(void*,void*,smx_action_t); /* Filter function used by the other side. It is used when looking if a given communication matches my needs. For that, myself must match the expectations of the other side, too. See */ + void (*copy_data_fun) (smx_action_t, void*, size_t); /* Surf action data */ surf_action_t surf_comm; /* The Surf communication action encapsulated */ diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index 8378a66790..60fc8a6abd 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -49,6 +49,8 @@ void SIMIX_process_cleanup(smx_process_t process) XBT_DEBUG("Cleanup process %s (%p), waiting action %p", process->name, process, process->waiting_action); + SIMIX_process_on_exit_runall(process); + /* cancel non-blocking communications */ smx_action_t action; while ((action = xbt_fifo_pop(process->comms))) { @@ -101,7 +103,7 @@ void SIMIX_process_cleanup(smx_process_t process) process->context->iwannadie = 0; } -/** +/** * Garbage collection * * Should be called some time to time to free the memory allocated for processes @@ -253,7 +255,7 @@ void SIMIX_process_create(smx_process_t *process, (*process)->data = data; (*process)->comms = xbt_fifo_new(); (*process)->simcall.issuer = *process; - + if (parent_process) { (*process)->ppid = SIMIX_process_get_PID(parent_process); } else { @@ -362,6 +364,10 @@ void SIMIX_process_kill(smx_process_t process, smx_process_t issuer) { SIMIX_process_sleep_destroy(process->waiting_action); break; + case SIMIX_ACTION_JOIN: + SIMIX_process_sleep_destroy(process->waiting_action); + break; + case SIMIX_ACTION_SYNCHRO: SIMIX_synchro_stop_waiting(process, &process->simcall); SIMIX_synchro_destroy(process->waiting_action); @@ -518,7 +524,7 @@ void SIMIX_process_resume(smx_process_t process, smx_process_t issuer) switch (process->waiting_action->type) { - case SIMIX_ACTION_EXECUTE: + case SIMIX_ACTION_EXECUTE: case SIMIX_ACTION_PARALLEL_EXECUTE: SIMIX_host_execution_resume(process->waiting_action); break; @@ -581,7 +587,7 @@ int SIMIX_process_get_PPID(smx_process_t self){ } void* SIMIX_pre_process_self_get_data(smx_simcall_t simcall, smx_process_t self){ - return SIMIX_process_self_get_data(self); + return SIMIX_process_self_get_data(self); } void* SIMIX_process_self_get_data(smx_process_t self) @@ -673,6 +679,44 @@ xbt_dict_t SIMIX_process_get_properties(smx_process_t process) return process->properties; } +void SIMIX_pre_process_join(smx_simcall_t simcall, smx_process_t process, double timeout) +{ + smx_action_t action = SIMIX_process_join(simcall->issuer, process, timeout); + xbt_fifo_push(action->simcalls, simcall); + simcall->issuer->waiting_action = action; +} + +static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_action_t action){ + if (action->sleep.surf_sleep) { + surf_action_cancel(action->sleep.surf_sleep); + + smx_simcall_t simcall; + while ((simcall = xbt_fifo_shift(action->simcalls))) { + simcall_process_sleep__set__result(simcall, SIMIX_DONE); + simcall->issuer->waiting_action = NULL; + if (simcall->issuer->suspended) { + XBT_DEBUG("Wait! This process is suspended and can't wake up now."); + simcall->issuer->suspended = 0; + SIMIX_pre_process_suspend(simcall, simcall->issuer); + } else { + SIMIX_simcall_answer(simcall); + } + } + surf_action_unref(action->sleep.surf_sleep); + action->sleep.surf_sleep = NULL; + } + xbt_mallocator_release(simix_global->action_mallocator, action); + return 0; +} + +smx_action_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout) +{ + smx_action_t res = SIMIX_process_sleep(issuer, timeout); + res->type = SIMIX_ACTION_JOIN; + SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res); + return res; +} + void SIMIX_pre_process_sleep(smx_simcall_t simcall, double duration) { if (MC_is_active()) { @@ -718,7 +762,7 @@ void SIMIX_post_process_sleep(smx_action_t action) { smx_simcall_t simcall; e_smx_state_t state; - xbt_assert(action->type == SIMIX_ACTION_SLEEP); + xbt_assert(action->type == SIMIX_ACTION_SLEEP || action->type == SIMIX_ACTION_JOIN); while ((simcall = xbt_fifo_shift(action->simcalls))) { @@ -757,11 +801,14 @@ void SIMIX_post_process_sleep(smx_action_t action) void SIMIX_process_sleep_destroy(smx_action_t action) { XBT_DEBUG("Destroy action %p", action); - xbt_assert(action->type == SIMIX_ACTION_SLEEP); + xbt_assert(action->type == SIMIX_ACTION_SLEEP || action->type == SIMIX_ACTION_JOIN); - if (action->sleep.surf_sleep) + if (action->sleep.surf_sleep) { surf_action_unref(action->sleep.surf_sleep); - xbt_mallocator_release(simix_global->action_mallocator, action); + action->sleep.surf_sleep = NULL; + } + if (action->type == SIMIX_ACTION_SLEEP) + xbt_mallocator_release(simix_global->action_mallocator, action); } void SIMIX_process_sleep_suspend(smx_action_t action) @@ -777,7 +824,7 @@ void SIMIX_process_sleep_resume(smx_action_t action) surf_action_resume(action->sleep.surf_sleep); } -/** +/** * \brief Calling this function makes the process to yield. * * Only the current process can call this function, giving back the control to @@ -876,19 +923,20 @@ xbt_dynar_t SIMIX_processes_as_dynar(void) { void SIMIX_process_on_exit_runall(smx_process_t process) { s_smx_process_exit_fun_t exit_fun; - + smx_process_exit_status_t exit_status = (process->context->iwannadie) ? + SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS; while (!xbt_dynar_is_empty(process->on_exit)) { exit_fun = xbt_dynar_pop_as(process->on_exit,s_smx_process_exit_fun_t); - (exit_fun.fun)(exit_fun.arg); + (exit_fun.fun)((void*)exit_status, exit_fun.arg); } } void SIMIX_pre_process_on_exit(smx_simcall_t simcall, smx_process_t process, - int_f_pvoid_t fun, void *data) { + int_f_pvoid_pvoid_t fun, void *data) { SIMIX_process_on_exit(process, fun, data); } -void SIMIX_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data) { +void SIMIX_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void *data) { xbt_assert(process, "current process not found: are you in maestro context ?"); if (!process->on_exit) { @@ -902,7 +950,7 @@ void SIMIX_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data) void SIMIX_pre_process_auto_restart_set(smx_simcall_t simcall, smx_process_t process, int auto_restart) { - SIMIX_process_auto_restart_set(process, auto_restart); + SIMIX_process_auto_restart_set(process, auto_restart); } /** * \brief Sets the auto-restart status of the process. @@ -914,7 +962,7 @@ void SIMIX_process_auto_restart_set(smx_process_t process, int auto_restart) { } smx_process_t SIMIX_pre_process_restart(smx_simcall_t simcall, smx_process_t process) { - return SIMIX_process_restart(process, simcall->issuer); + return SIMIX_process_restart(process, simcall->issuer); } /** * \brief Restart a process. diff --git a/src/simix/smx_process_private.h b/src/simix/smx_process_private.h index eb269f97fa..bff1f1a840 100644 --- a/src/simix/smx_process_private.h +++ b/src/simix/smx_process_private.h @@ -11,7 +11,7 @@ #include "smx_smurf_private.h" typedef struct s_smx_process_exit_fun { - int_f_pvoid_t fun; + int_f_pvoid_pvoid_t fun; void *arg; } s_smx_process_exit_fun_t, *smx_process_exit_fun_t; @@ -27,7 +27,6 @@ typedef struct s_smx_process_arg { unsigned auto_restart:1; } s_smx_process_arg_t, *smx_process_arg_t; - /** @brief Process datatype */ typedef struct s_smx_process { s_xbt_swag_hookup_t process_hookup; @@ -99,6 +98,8 @@ const char* SIMIX_process_get_name(smx_process_t process); smx_process_t SIMIX_process_get_by_name(const char* name); int SIMIX_process_is_suspended(smx_process_t process); xbt_dict_t SIMIX_process_get_properties(smx_process_t process); +void SIMIX_pre_process_join(smx_simcall_t simcall, smx_process_t process, double timeout); +smx_action_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout); void SIMIX_pre_process_sleep(smx_simcall_t simcall, double duration); smx_action_t SIMIX_process_sleep(smx_process_t process, double duration); void SIMIX_post_process_sleep(smx_action_t action); @@ -130,7 +131,7 @@ const char* SIMIX_pre_process_get_name(smx_simcall_t simcall, smx_process_t proc int SIMIX_pre_process_is_suspended(smx_simcall_t simcall, smx_process_t process); xbt_dict_t SIMIX_pre_process_get_properties(smx_simcall_t simcall, smx_process_t process); void SIMIX_pre_process_on_exit(smx_simcall_t simcall, smx_process_t process, - int_f_pvoid_t fun, void *data); + int_f_pvoid_pvoid_t fun, void *data); void SIMIX_pre_process_auto_restart_set(smx_simcall_t simcall, smx_process_t process, int auto_restart); smx_process_t SIMIX_pre_process_restart(smx_simcall_t simcall, smx_process_t process); diff --git a/src/simix/smx_smurf.c b/src/simix/smx_smurf.c index 515446b43e..e36f6d2065 100644 --- a/src/simix/smx_smurf.c +++ b/src/simix/smx_smurf.c @@ -96,6 +96,10 @@ void SIMIX_simcall_post(smx_action_t action) SIMIX_post_process_sleep(action); break; + case SIMIX_ACTION_JOIN: + SIMIX_post_process_sleep(action); + break; + case SIMIX_ACTION_SYNCHRO: SIMIX_post_synchro(action); break; @@ -120,7 +124,7 @@ void SIMIX_simcall_post(smx_action_t action) /* FIXME find a way to make this work simcall_handler_t simcall_table[NUM_SIMCALLS] = { #undef SIMCALL_ENUM_ELEMENT -#define SIMCALL_ENUM_ELEMENT(x,y) &y // generate strings from the enumeration values +#define SIMCALL_ENUM_ELEMENT(x,y) &y // generate strings from the enumeration values SIMCALL_LIST #undef SIMCALL_ENUM_ELEMENT };*/ diff --git a/src/simix/smx_smurf_private.h b/src/simix/smx_smurf_private.h index dbd5f92907..ee9131a899 100644 --- a/src/simix/smx_smurf_private.h +++ b/src/simix/smx_smurf_private.h @@ -29,6 +29,7 @@ NUM_SIMCALLS } e_smx_simcall_t; typedef int (*simix_match_func_t)(void *, void *, smx_action_t); +typedef void (*simix_copy_data_func_t)(smx_action_t, void*, size_t); typedef void (*simix_clean_func_t)(void *); typedef void (*FPtr)(void); // Hide the ugliness diff --git a/src/simix/smx_user.c b/src/simix/smx_user.c index 42487416a3..700e2e3c4b 100644 --- a/src/simix/smx_user.c +++ b/src/simix/smx_user.c @@ -239,7 +239,7 @@ smx_action_t simcall_host_execute(const char *name, smx_host_t host, /* checking for infinite values */ xbt_assert(isfinite(computation_amount), "computation_amount is not finite!"); xbt_assert(isfinite(priority), "priority is not finite!"); - + return simcall_BODY_host_execute(name, host, computation_amount, priority, bound, affinity_mask); } @@ -271,14 +271,14 @@ smx_action_t simcall_host_parallel_execute(const char *name, for (i = 0 ; i < host_nb ; ++i) { xbt_assert(isfinite(computation_amount[i]), "computation_amount[%d] is not finite!", i); for (j = 0 ; j < host_nb ; ++j) { - xbt_assert(isfinite(communication_amount[i + host_nb * j]), + xbt_assert(isfinite(communication_amount[i + host_nb * j]), "communication_amount[%d+%d*%d] is not finite!", i, host_nb, j); - } - } - + } + } + xbt_assert(isfinite(amount), "amount is not finite!"); xbt_assert(isfinite(rate), "rate is not finite!"); - + return simcall_BODY_host_parallel_execute(name, host_nb, host_list, computation_amount, communication_amount, @@ -346,7 +346,7 @@ void simcall_host_execution_set_priority(smx_action_t execution, double priority { /* checking for infinite values */ xbt_assert(isfinite(priority), "priority is not finite!"); - + simcall_BODY_host_execution_set_priority(execution, priority); } @@ -629,6 +629,11 @@ void simcall_process_change_host(smx_process_t process, smx_host_t dest) simcall_BODY_process_change_host(process, dest); } +void simcall_process_join(smx_process_t process, double timeout) +{ + simcall_BODY_process_join(process, timeout); +} + /** * \ingroup simix_process_management * \brief Suspends a process. @@ -814,7 +819,7 @@ xbt_dict_t simcall_process_get_properties(smx_process_t process) * \brief Add an on_exit function * Add an on_exit function which will be executed when the process exits/is killed. */ -XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data) +XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void *data) { simcall_BODY_process_on_exit(process, fun, data); } @@ -930,27 +935,28 @@ smx_process_t simcall_rdv_get_receiver(smx_rdv_t rdv) */ void simcall_comm_send(smx_rdv_t rdv, double task_size, double rate, void *src_buff, size_t src_buff_size, - int (*match_fun)(void *, void *, smx_action_t), void *data, + int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double timeout) { /* checking for infinite values */ xbt_assert(isfinite(task_size), "task_size is not finite!"); xbt_assert(isfinite(rate), "rate is not finite!"); xbt_assert(isfinite(timeout), "timeout is not finite!"); - + xbt_assert(rdv, "No rendez-vous point defined for send"); if (MC_is_active()) { /* the model-checker wants two separate simcalls */ smx_action_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */ comm = simcall_comm_isend(rdv, task_size, rate, - src_buff, src_buff_size, match_fun, NULL, data, 0); + src_buff, src_buff_size, match_fun, NULL, copy_data_fun, data, 0); simcall_comm_wait(comm, timeout); comm = NULL; } else { simcall_BODY_comm_send(rdv, task_size, rate, src_buff, src_buff_size, - match_fun, data, timeout); + match_fun, copy_data_fun, data, timeout); } } @@ -961,18 +967,19 @@ smx_action_t simcall_comm_isend(smx_rdv_t rdv, double task_size, double rate, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *, smx_action_t), void (*clean_fun)(void *), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, int detached) { /* checking for infinite values */ xbt_assert(isfinite(task_size), "task_size is not finite!"); xbt_assert(isfinite(rate), "rate is not finite!"); - + xbt_assert(rdv, "No rendez-vous point defined for isend"); return simcall_BODY_comm_isend(rdv, task_size, rate, src_buff, src_buff_size, match_fun, - clean_fun, data, detached); + clean_fun, copy_data_fun, data, detached); } /** @@ -980,6 +987,7 @@ smx_action_t simcall_comm_isend(smx_rdv_t rdv, double task_size, double rate, */ void simcall_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size, int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double timeout, double rate) { xbt_assert(isfinite(timeout), "timeout is not finite!"); @@ -989,13 +997,13 @@ void simcall_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size, /* the model-checker wants two separate simcalls */ smx_action_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */ comm = simcall_comm_irecv(rdv, dst_buff, dst_buff_size, - match_fun, data, rate); + match_fun, copy_data_fun, data, rate); simcall_comm_wait(comm, timeout); comm = NULL; } else { simcall_BODY_comm_recv(rdv, dst_buff, dst_buff_size, - match_fun, data, timeout, rate); + match_fun, copy_data_fun, data, timeout, rate); } } /** @@ -1003,12 +1011,13 @@ void simcall_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size, */ smx_action_t simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_action_t), + void (*copy_data_fun)(smx_action_t, void*, size_t), void *data, double rate) { xbt_assert(rdv, "No rendez-vous point defined for irecv"); return simcall_BODY_comm_irecv(rdv, dst_buff, dst_buff_size, - match_fun, data, rate); + match_fun, copy_data_fun, data, rate); } /** @@ -1134,7 +1143,7 @@ smx_process_t simcall_comm_get_src_proc(smx_action_t comm) */ smx_process_t simcall_comm_get_dst_proc(smx_action_t comm) { - return simcall_BODY_comm_get_dst_proc(comm); + return simcall_BODY_comm_get_dst_proc(comm); } #ifdef HAVE_LATENCY_BOUND_TRACKING @@ -1172,7 +1181,7 @@ void simcall_mutex_destroy(smx_mutex_t mutex) */ void simcall_mutex_lock(smx_mutex_t mutex) { - simcall_BODY_mutex_lock(mutex); + simcall_BODY_mutex_lock(mutex); } /** @@ -1181,7 +1190,7 @@ void simcall_mutex_lock(smx_mutex_t mutex) */ int simcall_mutex_trylock(smx_mutex_t mutex) { - return simcall_BODY_mutex_trylock(mutex); + return simcall_BODY_mutex_trylock(mutex); } /** @@ -1190,7 +1199,7 @@ int simcall_mutex_trylock(smx_mutex_t mutex) */ void simcall_mutex_unlock(smx_mutex_t mutex) { - simcall_BODY_mutex_unlock(mutex); + simcall_BODY_mutex_unlock(mutex); } /** @@ -1256,7 +1265,7 @@ void simcall_cond_broadcast(smx_cond_t cond) */ smx_sem_t simcall_sem_init(int capacity) { - return simcall_BODY_sem_init(capacity); + return simcall_BODY_sem_init(capacity); } /** @@ -1274,7 +1283,7 @@ void simcall_sem_destroy(smx_sem_t sem) */ void simcall_sem_release(smx_sem_t sem) { - simcall_BODY_sem_release(sem); + simcall_BODY_sem_release(sem); } /** @@ -1405,21 +1414,21 @@ int simcall_file_move(smx_file_t fd, const char* fullpath) /** * \ingroup simix_storage_management * \brief Returns the free space size on a given storage element. - * \param storage name + * \param storage a storage * \return Return the free space size on a given storage element (as sg_size_t) */ -sg_size_t simcall_storage_get_free_size (const char* name){ - return simcall_BODY_storage_get_free_size(name); +sg_size_t simcall_storage_get_free_size (smx_storage_t storage){ + return simcall_BODY_storage_get_free_size(storage); } /** * \ingroup simix_storage_management * \brief Returns the used space size on a given storage element. - * \param storage name + * \param storage a storage * \return Return the used space size on a given storage element (as sg_size_t) */ -sg_size_t simcall_storage_get_used_size (const char* name){ - return simcall_BODY_storage_get_used_size(name); +sg_size_t simcall_storage_get_used_size (smx_storage_t storage){ + return simcall_BODY_storage_get_used_size(storage); } /** @@ -1475,7 +1484,7 @@ void *simcall_mc_snapshot(void) return simcall_BODY_mc_snapshot(); } -int simcall_mc_compare_snapshots(void *s1, void *s2){ +int simcall_mc_compare_snapshots(void *s1, void *s2){ return simcall_BODY_mc_compare_snapshots(s1, s2); } diff --git a/src/smpi/instr_smpi.c b/src/smpi/instr_smpi.c index a097ed6dbf..31597feea5 100644 --- a/src/smpi/instr_smpi.c +++ b/src/smpi/instr_smpi.c @@ -281,6 +281,32 @@ void TRACE_smpi_computing_out(int rank) new_pajePopState (SIMIX_get_clock(), container, type); } +void TRACE_smpi_testing_in(int rank, instr_extra_data extra) +{ + //do not forget to set the color first, otherwise this will explode + if (!TRACE_smpi_is_enabled()) { + cleanup_extra_data(extra); + return; + } + + char str[INSTR_DEFAULT_STR_SIZE]; + smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); + container_t container = PJ_container_get (str); + type_t type = PJ_type_get ("MPI_STATE", container->type); + val_t value = PJ_value_get_or_new ("test", NULL, type); + new_pajePushStateWithExtra (SIMIX_get_clock(), container, type, value, (void*)extra); +} + +void TRACE_smpi_testing_out(int rank) +{ + if (!TRACE_smpi_is_enabled()) return; + char str[INSTR_DEFAULT_STR_SIZE]; + smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); + container_t container = PJ_container_get (str); + type_t type = PJ_type_get ("MPI_STATE", container->type); + new_pajePopState (SIMIX_get_clock(), container, type); +} + void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_extra_data extra) { if (!TRACE_smpi_is_enabled()) { diff --git a/src/smpi/private.h b/src/smpi/private.h index 74ee1b6a32..09e66faf84 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -10,6 +10,7 @@ #include "internal_config.h" #include "xbt.h" #include "xbt/xbt_os_time.h" +#include "xbt/synchro_core.h" #include "simgrid/simix.h" #include "smpi/smpi_interface.h" #include "smpi/smpi.h" @@ -72,6 +73,9 @@ typedef struct s_smpi_mpi_datatype{ #define COLL_TAG_GATHERV -2223 #define COLL_TAG_BCAST -3334 #define COLL_TAG_ALLREDUCE -4445 + +#define MPI_COMM_UNINITIALIZED ((MPI_Comm)-1) + //***************************************************************************************** typedef struct s_smpi_mpi_request { @@ -110,12 +114,26 @@ int smpi_process_finalized(void); int smpi_process_initialized(void); void smpi_process_mark_as_initialized(void); +void smpi_topo_destroy(MPI_Topology topo); +MPI_Topology smpi_topo_create(int ndims); +int smpi_mpi_cart_create(MPI_Comm comm_old, int ndims, int dims[], + int periodic[], int reorder, MPI_Comm *comm_cart); +int smpi_mpi_cart_shift(MPI_Comm comm, int direction, int disp, + int *rank_source, int *rank_dest); +int smpi_mpi_cart_rank(MPI_Comm comm, int* coords, int* rank); +int smpi_mpi_cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords); +int smpi_mpi_cart_coords(MPI_Comm comm, int rank, int maxdims, + int coords[]); +int smpi_mpi_cartdim_get(MPI_Comm comm, int *ndims); +int smpi_mpi_dims_create(int nnodes, int ndims, int dims[]); +int smpi_mpi_cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm); smpi_process_data_t smpi_process_data(void); smpi_process_data_t smpi_process_remote_data(int index); void smpi_process_set_user_data(void *); void* smpi_process_get_user_data(void); int smpi_process_count(void); +MPI_Comm smpi_process_comm_world(void); smx_rdv_t smpi_process_mailbox(void); smx_rdv_t smpi_process_remote_mailbox(int index); smx_rdv_t smpi_process_mailbox_small(void); @@ -126,6 +144,12 @@ double smpi_process_simulated_elapsed(void); void smpi_process_set_sampling(int s); int smpi_process_get_sampling(void); +void smpi_deployment_register_process(const char* instance_id, int rank, int index, MPI_Comm**, xbt_bar_t*); +void smpi_deployment_cleanup_instances(void); + +void smpi_comm_copy_buffer_callback(smx_action_t comm, + void *buff, size_t buff_size); + void print_request(const char *message, MPI_Request request); void smpi_global_init(void); @@ -181,7 +205,8 @@ int smpi_group_unuse(MPI_Group group); int smpi_group_size(MPI_Group group); int smpi_group_compare(MPI_Group group1, MPI_Group group2); -MPI_Comm smpi_comm_new(MPI_Group group); +MPI_Topology smpi_comm_topo(MPI_Comm comm); +MPI_Comm smpi_comm_new(MPI_Group group, MPI_Topology topo); void smpi_comm_destroy(MPI_Comm comm); MPI_Group smpi_comm_group(MPI_Comm comm); int smpi_comm_size(MPI_Comm comm); @@ -577,6 +602,8 @@ 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, instr_extra_data extra); +void TRACE_smpi_testing_out(int rank); +void TRACE_smpi_testing_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); diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index f2085f2041..cc9e4097d8 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -260,8 +260,8 @@ void smpi_action_trace_run(char *path) action_fp=NULL; if (path) { action_fp = fopen(path, "r"); - xbt_assert(action_fp != NULL, "Cannot open %s: %s", path, - strerror(errno)); + if (action_fp == NULL) + xbt_die("Cannot open %s: %s", path, strerror(errno)); } if (!xbt_dict_is_empty(action_queues)) { @@ -335,7 +335,7 @@ void smpi_mpi_start(MPI_Request request) smpi_datatype_use(request->old_type); smpi_comm_use(request->comm); request->action = simcall_comm_irecv(mailbox, request->buf, - &request->real_size, &match_recv, + &request->real_size, &match_recv, &smpi_comm_copy_buffer_callback, request, -1.0); //integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0 @@ -411,6 +411,7 @@ void smpi_mpi_start(MPI_Request request) buf, request->real_size, &match_send, &xbt_free, // how to free the userdata if a detached send fails + &smpi_comm_copy_buffer_callback, request, // detach if msg size < eager/rdv switch limit request->detached); diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index f7464dbd2a..28ef158e06 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -224,10 +224,29 @@ unsigned int smpi_sleep(unsigned int secs) simcall_host_execution_wait(action); smpi_bench_begin(); - return secs; + return 0; +} + +int smpi_usleep(useconds_t usecs) +{ + smx_action_t action; + + smpi_bench_end(); + + double flops = (double) (usecs/1000000.0)*simcall_host_get_speed(SIMIX_host_self()); + XBT_DEBUG("Sleep for: %f flops", flops); + action = simcall_host_execute("computation", SIMIX_host_self(), flops, 1, 0, 0); + #ifdef HAVE_TRACING + simcall_set_category (action, TRACE_internal_smpi_get_category()); + #endif + simcall_host_execution_wait(action); + + smpi_bench_begin(); + return 0; } -int smpi_gettimeofday(struct timeval *tv) + +int smpi_gettimeofday(struct timeval *tv, void* tz) { double now; smpi_bench_end(); diff --git a/src/smpi/smpi_comm.c b/src/smpi/smpi_comm.c index 1c36589728..d462877aeb 100644 --- a/src/smpi/smpi_comm.c +++ b/src/smpi/smpi_comm.c @@ -12,8 +12,16 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_comm, smpi, "Logging specific to SMPI (comm)"); + + +/* Support for cartesian topology was added, but there are 2 other types of + * topology, graph et dist graph. In order to support them, we have to add a + * field MPIR_Topo_type, and replace the MPI_Topology field by an union. */ + typedef struct s_smpi_mpi_communicator { MPI_Group group; + MPIR_Topo_type topoType; + MPI_Topology topo; // to be replaced by an union int refcount; } s_smpi_mpi_communicator_t; @@ -37,7 +45,7 @@ static int smpi_compare_rankmap(const void *a, const void *b) return 1; } -MPI_Comm smpi_comm_new(MPI_Group group) +MPI_Comm smpi_comm_new(MPI_Group group, MPI_Topology topo) { MPI_Comm comm; @@ -45,32 +53,52 @@ MPI_Comm smpi_comm_new(MPI_Group group) comm->group = group; smpi_group_use(comm->group); comm->refcount=1; + comm->topo = topo; return comm; } void smpi_comm_destroy(MPI_Comm comm) { + if (comm == MPI_COMM_UNINITIALIZED) + comm = smpi_process_comm_world(); smpi_group_unuse(comm->group); + smpi_topo_destroy(comm->topo); // there's no use count on topos smpi_comm_unuse(comm); } MPI_Group smpi_comm_group(MPI_Comm comm) { + if (comm == MPI_COMM_UNINITIALIZED) + comm = smpi_process_comm_world(); + return comm->group; } +MPI_Topology smpi_comm_topo(MPI_Comm comm) { + if (comm != MPI_COMM_NULL) + return comm->topo; + return NULL; +} + int smpi_comm_size(MPI_Comm comm) { + if (comm == MPI_COMM_UNINITIALIZED) + comm = smpi_process_comm_world(); + return smpi_group_size(smpi_comm_group(comm)); } int smpi_comm_rank(MPI_Comm comm) { + if (comm == MPI_COMM_UNINITIALIZED) + comm = smpi_process_comm_world(); return smpi_group_rank(smpi_comm_group(comm), smpi_process_index()); } void smpi_comm_get_name (MPI_Comm comm, char* name, int* len) { + if (comm == MPI_COMM_UNINITIALIZED) + comm = smpi_process_comm_world(); if(comm == MPI_COMM_WORLD) { strcpy(name, "WORLD"); *len = 5; @@ -81,6 +109,8 @@ void smpi_comm_get_name (MPI_Comm comm, char* name, int* len) MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key) { + if (comm == MPI_COMM_UNINITIALIZED) + comm = smpi_process_comm_world(); int system_tag = 123; int index, rank, size, i, j, count, reqs; int* sendbuf; @@ -157,15 +187,20 @@ MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key) } } /* otherwise, exit with group_out == NULL */ } - return group_out ? smpi_comm_new(group_out) : MPI_COMM_NULL; + return group_out ? smpi_comm_new(group_out, NULL) : MPI_COMM_NULL; } void smpi_comm_use(MPI_Comm comm){ + if (comm == MPI_COMM_UNINITIALIZED) + comm = smpi_process_comm_world(); comm->refcount++; } void smpi_comm_unuse(MPI_Comm comm){ + if (comm == MPI_COMM_UNINITIALIZED) + comm = smpi_process_comm_world(); comm->refcount--; if(comm->refcount==0) xbt_free(comm); } + diff --git a/src/smpi/smpi_deployment.c b/src/smpi/smpi_deployment.c new file mode 100644 index 0000000000..83714ad7b1 --- /dev/null +++ b/src/smpi/smpi_deployment.c @@ -0,0 +1,96 @@ +/* Copyright (c) 2004-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. */ + +#include "private.h" +#include "xbt/sysdep.h" +#include "xbt/synchro_core.h" +#include "xbt/log.h" +#include "xbt/dict.h" + +static xbt_dict_t smpi_instances = NULL; +extern int process_count; +extern int* index_to_process_data; + +typedef struct s_smpi_mpi_instance{ + const char* name; + int size; + int present_processes; + int index; + MPI_Comm comm_world; + xbt_bar_t finalization_barrier; +} s_smpi_mpi_instance_t; + + +/** \ingroup smpi_simulation + * \brief Registers a running instance of a MPI program. + * + * FIXME : remove MSG from the loop at some point. + * \param name the reference name of the function. + * \param code the main mpi function (must have the same prototype than the main function of any C program: int ..(int argc, char *argv[])) + * \param num_processes the size of the instance we want to deploy + */ +void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_processes) +{ + SIMIX_function_register(name, code); + + s_smpi_mpi_instance_t* instance = + (s_smpi_mpi_instance_t*)xbt_malloc(sizeof(s_smpi_mpi_instance_t)); + + instance->name = name; + instance->size = num_processes; + instance->present_processes = 0; + instance->index = process_count; + instance->comm_world = MPI_COMM_NULL; + instance->finalization_barrier=xbt_barrier_init(num_processes); + + process_count+=num_processes; + + if(!smpi_instances){ + smpi_instances=xbt_dict_new_homogeneous(xbt_free); + } + + xbt_dict_set(smpi_instances, name, (void*)instance, NULL); + return; +} + + +//get the index of the process in the process_data array +void smpi_deployment_register_process(const char* instance_id, int rank, int index,MPI_Comm** comm, xbt_bar_t* bar){ + + if(!smpi_instances){//no instance registered, we probably used smpirun. + index_to_process_data[index]=index; + *bar = NULL; + *comm = NULL; + return; + } + + s_smpi_mpi_instance_t* instance = xbt_dict_get_or_null(smpi_instances, instance_id); + if (!instance) + xbt_die("Error, unknown instance %s", instance_id); + + if(instance->comm_world == MPI_COMM_NULL){ + MPI_Group group = smpi_group_new(instance->size); + instance->comm_world = smpi_comm_new(group, NULL); + } + instance->present_processes++; + index_to_process_data[index]=instance->index+rank; + smpi_group_set_mapping(smpi_comm_group(instance->comm_world), index, rank); + *bar = instance->finalization_barrier; + *comm = &instance->comm_world; + return; +} + +void smpi_deployment_cleanup_instances(){ + xbt_dict_cursor_t cursor = NULL; + s_smpi_mpi_instance_t* instance = NULL; + char *name = NULL; + xbt_dict_foreach((xbt_dict_t) smpi_instances, cursor, name, instance) { + while (smpi_group_unuse(smpi_comm_group(instance->comm_world)) > 0); + xbt_free(instance->comm_world); + xbt_barrier_destroy(instance->finalization_barrier); + } +} + diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 75815c11fe..fbf18b4e80 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -28,16 +28,21 @@ typedef struct s_smpi_process_data { smx_rdv_t mailbox_small; xbt_os_timer_t timer; MPI_Comm comm_self; + MPI_Comm* comm_world; void *data; /* user data */ int index; char state; int sampling; /* inside an SMPI_SAMPLE_ block? */ + char* instance_id; + xbt_bar_t finalization_barrier; } s_smpi_process_data_t; static smpi_process_data_t *process_data = NULL; -static int process_count = 0; +int process_count = 0; +int* index_to_process_data = NULL; -MPI_Comm MPI_COMM_WORLD = MPI_COMM_NULL; + +MPI_Comm MPI_COMM_WORLD = MPI_COMM_UNINITIALIZED; int MPI_UNIVERSE_SIZE; MPI_Errhandler *MPI_ERRORS_RETURN = NULL; @@ -62,25 +67,41 @@ static char *get_mailbox_name_small(char *str, int index) void smpi_process_init(int *argc, char ***argv) { - int index; + int index=-1; smpi_process_data_t data; smx_process_t proc; if (argc && argv) { proc = SIMIX_process_self(); - index = atoi((*argv)[1]); + //FIXME: dirty cleanup method to avoid using msg cleanup functions on these processes when using MSG+SMPI + proc->context->cleanup_func=SIMIX_process_cleanup; + char* instance_id = (*argv)[1]; + int rank = atoi((*argv)[2]); + index = SIMIX_process_get_PID(proc) -1; + #ifdef SMPI_F2C smpi_current_rank = index; #endif - + if(!index_to_process_data){ + index_to_process_data=(int*)xbt_malloc(SIMIX_process_count()*sizeof(int)); + } + MPI_Comm* temp_comm_world; + xbt_bar_t temp_bar; + smpi_deployment_register_process(instance_id, rank, index, &temp_comm_world ,&temp_bar); data = smpi_process_remote_data(index); + data->comm_world = temp_comm_world; + if(temp_bar != NULL) data->finalization_barrier = temp_bar; + data->index = index; + data->instance_id = instance_id; simcall_process_set_data(proc, data); - if (*argc > 2) { + if (*argc > 3) { free((*argv)[1]); - memmove(&(*argv)[1], &(*argv)[2], sizeof(char *) * (*argc - 2)); + free((*argv)[2]); + memmove(&(*argv)[1], &(*argv)[3], sizeof(char *) * (*argc - 3)); (*argv)[(*argc) - 1] = NULL; + (*argv)[(*argc) - 2] = NULL; } - (*argc)--; + (*argc)-=2; data->argc = argc; data->argv = argv; // set the process attached to the mailbox @@ -102,7 +123,7 @@ void smpi_process_destroy(void) if(smpi_privatize_global_variables){ switch_data_segment(index); } - process_data[index]->state = SMPI_FINALIZED; + process_data[index_to_process_data[index]]->state = SMPI_FINALIZED; XBT_DEBUG("<%d> Process left the game", index); } @@ -111,44 +132,10 @@ void smpi_process_destroy(void) */ void smpi_process_finalize(void) { -#if 0 - // wait for all pending asynchronous comms to finish - while (SIMIX_process_has_pending_comms(SIMIX_process_self())) { - simcall_process_sleep(0.01); - } -#else - int i; - int size = smpi_comm_size(MPI_COMM_WORLD); - int rank = smpi_comm_rank(MPI_COMM_WORLD); - /* All non-root send & receive zero-length message. */ - if (rank > 0) { - smpi_mpi_ssend (NULL, 0, MPI_BYTE, 0, - COLL_TAG_BARRIER, - MPI_COMM_WORLD); - smpi_mpi_recv (NULL, 0, MPI_BYTE, 0, - COLL_TAG_BARRIER, - MPI_COMM_WORLD, MPI_STATUS_IGNORE); - } - /* The root collects and broadcasts the messages. */ - else { - MPI_Request* requests; - requests = (MPI_Request*)malloc( size * sizeof(MPI_Request) ); - for (i = 1; i < size; ++i) { - requests[i] = smpi_mpi_irecv(NULL, 0, MPI_BYTE, MPI_ANY_SOURCE, - COLL_TAG_BARRIER, MPI_COMM_WORLD - ); - } - smpi_mpi_waitall( size-1, requests+1, MPI_STATUSES_IGNORE ); - for (i = 1; i < size; ++i) { - requests[i] = smpi_mpi_issend(NULL, 0, MPI_BYTE, i, - COLL_TAG_BARRIER, - MPI_COMM_WORLD - ); - } - smpi_mpi_waitall( size-1, requests+1, MPI_STATUSES_IGNORE ); - free( requests ); - } -#endif + int index = smpi_process_index(); + // wait for all pending asynchronous comms to finish + xbt_barrier_wait(process_data[index_to_process_data[index]]->finalization_barrier); + } /** @@ -158,7 +145,7 @@ int smpi_process_finalized() { int index = smpi_process_index(); if (index != MPI_UNDEFINED) - return (process_data[index]->state == SMPI_FINALIZED); + return (process_data[index_to_process_data[index]]->state == SMPI_FINALIZED); else return 0; } @@ -170,7 +157,7 @@ int smpi_process_initialized(void) { int index = smpi_process_index(); return ( (index != MPI_UNDEFINED) - && (process_data[index]->state == SMPI_INITIALIZED)); + && (process_data[index_to_process_data[index]]->state == SMPI_INITIALIZED)); } /** @@ -179,8 +166,8 @@ int smpi_process_initialized(void) void smpi_process_mark_as_initialized(void) { int index = smpi_process_index(); - if ((index != MPI_UNDEFINED) && (!process_data[index]->state != SMPI_FINALIZED)) - process_data[index]->state = SMPI_INITIALIZED; + if ((index != MPI_UNDEFINED) && (!process_data[index_to_process_data[index]]->state != SMPI_FINALIZED)) + process_data[index_to_process_data[index]]->state = SMPI_INITIALIZED; } @@ -230,7 +217,7 @@ smpi_process_data_t smpi_process_data(void) smpi_process_data_t smpi_process_remote_data(int index) { - return process_data[index]; + return process_data[index_to_process_data[index]]; } void smpi_process_set_user_data(void *data) @@ -257,6 +244,13 @@ int smpi_process_index(void) return data ? data->index : MPI_UNDEFINED; } +MPI_Comm smpi_process_comm_world(void) +{ + smpi_process_data_t data = smpi_process_data(); + //return MPI_COMM_NULL if not initialized + return data ? *data->comm_world : MPI_COMM_NULL; +} + smx_rdv_t smpi_process_mailbox(void) { smpi_process_data_t data = smpi_process_data(); @@ -305,7 +299,7 @@ MPI_Comm smpi_process_comm_self(void) smpi_process_data_t data = smpi_process_data(); if(data->comm_self==MPI_COMM_NULL){ MPI_Group group = smpi_group_new(1); - data->comm_self = smpi_comm_new(group); + data->comm_self = smpi_comm_new(group, NULL); smpi_group_set_mapping(group, smpi_process_index(), 0); } @@ -332,7 +326,7 @@ void print_request(const char *message, MPI_Request request) request->dst, request->tag, request->flags); } -static void smpi_comm_copy_buffer_callback(smx_action_t comm, +void smpi_comm_copy_buffer_callback(smx_action_t comm, void *buff, size_t buff_size) { XBT_DEBUG("Copy the data over"); @@ -367,7 +361,7 @@ static void smpi_comm_copy_buffer_callback(smx_action_t comm, //It seems that the request is used after the call there this should //be free somewhereelse but where??? //xbt_free(comm->comm.src_data);// inside SMPI the request is keep - //inside the user data and should be free + //inside the user data and should be free comm->comm.src_buff = NULL; } @@ -375,18 +369,36 @@ static void smpi_comm_copy_buffer_callback(smx_action_t comm, } +static void smpi_check_options(){ + //check correctness of MPI parameters + + xbt_assert(sg_cfg_get_int("smpi/async_small_thres") <= + sg_cfg_get_int("smpi/send_is_detached_thres")); + + if (sg_cfg_is_default_value("smpi/running_power")) { + XBT_INFO("You did not set the power of the host running the simulation. " + "The timings will certainly not be accurate. " + "Use the option \"--cfg=smpi/running_power:\" to set its value." + "Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information. "); + } +} + void smpi_global_init(void) { int i; MPI_Group group; char name[MAILBOX_NAME_MAXLEN]; + int smpirun=0; - SIMIX_comm_set_copy_data_callback(&smpi_comm_copy_buffer_callback); - process_count = SIMIX_process_count(); - process_data = xbt_new(smpi_process_data_t, process_count); + + if (process_count == 0){ + process_count = SIMIX_process_count(); + smpirun=1; + } + process_data = xbt_new0(smpi_process_data_t, process_count); for (i = 0; i < process_count; i++) { process_data[i] = xbt_new(s_smpi_process_data_t, 1); - process_data[i]->index = i; + //process_data[i]->index = i; process_data[i]->argc = NULL; process_data[i]->argv = NULL; process_data[i]->mailbox = simcall_rdv_create(get_mailbox_name(name, i)); @@ -396,29 +408,26 @@ void smpi_global_init(void) if (MC_is_active()) MC_ignore_heap(process_data[i]->timer, xbt_os_timer_size()); process_data[i]->comm_self = MPI_COMM_NULL; + process_data[i]->comm_world = NULL; process_data[i]->state = SMPI_UNINITIALIZED; process_data[i]->sampling = 0; + process_data[i]->finalization_barrier = NULL; } - group = smpi_group_new(process_count); - MPI_COMM_WORLD = smpi_comm_new(group); - MPI_UNIVERSE_SIZE = smpi_comm_size(MPI_COMM_WORLD); - for (i = 0; i < process_count; i++) { - smpi_group_set_mapping(group, i, i); - } - - //check correctness of MPI parameters - - xbt_assert(sg_cfg_get_int("smpi/async_small_thres") <= - sg_cfg_get_int("smpi/send_is_detached_thres")); - - if (sg_cfg_is_default_value("smpi/running_power")) { - XBT_INFO("You did not set the power of the host running the simulation. " - "The timings will certainly not be accurate. " - "Use the option \"--cfg=smpi/running_power:\" to set its value." - "Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information. "); + //if the process was launched through smpirun script + //we generate a global mpi_comm_world + //if not, we let MPI_COMM_NULL, and the comm world + //will be private to each mpi instance + if(smpirun){ + group = smpi_group_new(process_count); + MPI_COMM_WORLD = smpi_comm_new(group, NULL); + xbt_bar_t bar=xbt_barrier_init(process_count); + + MPI_UNIVERSE_SIZE = smpi_comm_size(MPI_COMM_WORLD); + for (i = 0; i < process_count; i++) { + smpi_group_set_mapping(group, i, i); + process_data[i]->finalization_barrier = bar; + } } - if(smpi_privatize_global_variables) - smpi_initialize_global_memory_segments(); } void smpi_global_destroy(void) @@ -427,8 +436,13 @@ void smpi_global_destroy(void) int i; smpi_bench_destroy(); - while (smpi_group_unuse(smpi_comm_group(MPI_COMM_WORLD)) > 0); - xbt_free(MPI_COMM_WORLD); + if (MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED){ + while (smpi_group_unuse(smpi_comm_group(MPI_COMM_WORLD)) > 0); + xbt_free(MPI_COMM_WORLD); + xbt_barrier_destroy(process_data[0]->finalization_barrier); + }else{ + smpi_deployment_cleanup_instances(); + } MPI_COMM_WORLD = MPI_COMM_NULL; for (i = 0; i < count; i++) { if(process_data[i]->comm_self!=MPI_COMM_NULL){ @@ -442,6 +456,8 @@ void smpi_global_destroy(void) } xbt_free(process_data); process_data = NULL; + + xbt_free(index_to_process_data); if(smpi_privatize_global_variables) smpi_destroy_global_memory_segments(); smpi_free_static(); @@ -478,15 +494,7 @@ int __attribute__ ((weak)) MAIN__() }; #endif -int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[]) -{ - srand(SMPI_RAND_SEED); - - if (getenv("SMPI_PRETEND_CC") != NULL) { - /* Hack to ensure that smpicc can pretend to be a simple - * compiler. Particularly handy to pass it to the configuration tools */ - return 0; - } +static void smpi_init_logs(){ /* Connect log categories. See xbt/log.c */ XBT_LOG_CONNECT(smpi); /* Keep this line as soon as possible in this @@ -509,6 +517,102 @@ int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[]) XBT_LOG_CONNECT(smpi_pmpi); XBT_LOG_CONNECT(smpi_replay); +} + + +static void smpi_init_options(){ + int gather_id = find_coll_description(mpi_coll_gather_description, + sg_cfg_get_string("smpi/gather")); + mpi_coll_gather_fun = (int (*)(void *, int, MPI_Datatype, + void *, int, MPI_Datatype, int, MPI_Comm)) + mpi_coll_gather_description[gather_id].coll; + + int allgather_id = find_coll_description(mpi_coll_allgather_description, + sg_cfg_get_string("smpi/allgather")); + mpi_coll_allgather_fun = (int (*)(void *, int, MPI_Datatype, + void *, int, MPI_Datatype, MPI_Comm)) + mpi_coll_allgather_description[allgather_id].coll; + + int allgatherv_id = find_coll_description(mpi_coll_allgatherv_description, + sg_cfg_get_string("smpi/allgatherv")); + mpi_coll_allgatherv_fun = (int (*)(void *, int, MPI_Datatype, void *, int *, + int *, MPI_Datatype, MPI_Comm)) + mpi_coll_allgatherv_description[allgatherv_id].coll; + + int allreduce_id = find_coll_description(mpi_coll_allreduce_description, + sg_cfg_get_string("smpi/allreduce")); + mpi_coll_allreduce_fun = (int (*)(void *sbuf, void *rbuf, int rcount, + MPI_Datatype dtype, MPI_Op op, + MPI_Comm comm)) + mpi_coll_allreduce_description[allreduce_id].coll; + + int alltoall_id = find_coll_description(mpi_coll_alltoall_description, + sg_cfg_get_string("smpi/alltoall")); + mpi_coll_alltoall_fun = (int (*)(void *, int, MPI_Datatype, + void *, int, MPI_Datatype, MPI_Comm)) + mpi_coll_alltoall_description[alltoall_id].coll; + + int alltoallv_id = find_coll_description(mpi_coll_alltoallv_description, + sg_cfg_get_string("smpi/alltoallv")); + mpi_coll_alltoallv_fun = (int (*)(void *, int *, int *, MPI_Datatype, + void *, int *, int *, MPI_Datatype, + MPI_Comm)) + mpi_coll_alltoallv_description[alltoallv_id].coll; + + int bcast_id = find_coll_description(mpi_coll_bcast_description, + sg_cfg_get_string("smpi/bcast")); + mpi_coll_bcast_fun = (int (*)(void *buf, int count, MPI_Datatype datatype, + int root, MPI_Comm com)) + mpi_coll_bcast_description[bcast_id].coll; + + int reduce_id = find_coll_description(mpi_coll_reduce_description, + sg_cfg_get_string("smpi/reduce")); + mpi_coll_reduce_fun = (int (*)(void *buf, void *rbuf, int count, + MPI_Datatype datatype, MPI_Op op, + int root, MPI_Comm comm)) + mpi_coll_reduce_description[reduce_id].coll; + + int reduce_scatter_id = + find_coll_description(mpi_coll_reduce_scatter_description, + sg_cfg_get_string("smpi/reduce_scatter")); + mpi_coll_reduce_scatter_fun = (int (*)(void *sbuf, void *rbuf, int *rcounts, + MPI_Datatype dtype, MPI_Op op, + MPI_Comm comm)) + mpi_coll_reduce_scatter_description[reduce_scatter_id].coll; + + int scatter_id = find_coll_description(mpi_coll_scatter_description, + sg_cfg_get_string("smpi/scatter")); + mpi_coll_scatter_fun = (int (*)(void *sendbuf, int sendcount, + MPI_Datatype sendtype, void *recvbuf, + int recvcount, MPI_Datatype recvtype, + int root, MPI_Comm comm)) + mpi_coll_scatter_description[scatter_id].coll; + + int barrier_id = find_coll_description(mpi_coll_barrier_description, + sg_cfg_get_string("smpi/barrier")); + mpi_coll_barrier_fun = (int (*)(MPI_Comm comm)) + mpi_coll_barrier_description[barrier_id].coll; + + smpi_cpu_threshold = sg_cfg_get_double("smpi/cpu_threshold"); + smpi_running_power = sg_cfg_get_double("smpi/running_power"); + smpi_privatize_global_variables = sg_cfg_get_boolean("smpi/privatize_global_variables"); + if (smpi_cpu_threshold < 0) + smpi_cpu_threshold = DBL_MAX; + +} + +int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[]) +{ + srand(SMPI_RAND_SEED); + + if (getenv("SMPI_PRETEND_CC") != NULL) { + /* Hack to ensure that smpicc can pretend to be a simple + * compiler. Particularly handy to pass it to the configuration tools */ + return 0; + } + + smpi_init_logs(); + #ifdef HAVE_TRACING TRACE_global_init(&argc, argv); @@ -518,96 +622,21 @@ int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[]) SIMIX_global_init(&argc, argv); -#ifdef HAVE_TRACING - TRACE_start(); -#endif - // parse the platform file: get the host list SIMIX_create_environment(argv[1]); - + SIMIX_comm_set_copy_data_callback(&smpi_comm_copy_buffer_callback); SIMIX_function_register_default(realmain); SIMIX_launch_application(argv[2]); - int gather_id = find_coll_description(mpi_coll_gather_description, - sg_cfg_get_string("smpi/gather")); - mpi_coll_gather_fun = (int (*)(void *, int, MPI_Datatype, - void *, int, MPI_Datatype, int, MPI_Comm)) - mpi_coll_gather_description[gather_id].coll; - - int allgather_id = find_coll_description(mpi_coll_allgather_description, - sg_cfg_get_string("smpi/allgather")); - mpi_coll_allgather_fun = (int (*)(void *, int, MPI_Datatype, - void *, int, MPI_Datatype, MPI_Comm)) - mpi_coll_allgather_description[allgather_id].coll; - - int allgatherv_id = find_coll_description(mpi_coll_allgatherv_description, - sg_cfg_get_string("smpi/allgatherv")); - mpi_coll_allgatherv_fun = (int (*)(void *, int, MPI_Datatype, void *, int *, - int *, MPI_Datatype, MPI_Comm)) - mpi_coll_allgatherv_description[allgatherv_id].coll; - - int allreduce_id = find_coll_description(mpi_coll_allreduce_description, - sg_cfg_get_string("smpi/allreduce")); - mpi_coll_allreduce_fun = (int (*)(void *sbuf, void *rbuf, int rcount, - MPI_Datatype dtype, MPI_Op op, - MPI_Comm comm)) - mpi_coll_allreduce_description[allreduce_id].coll; - - int alltoall_id = find_coll_description(mpi_coll_alltoall_description, - sg_cfg_get_string("smpi/alltoall")); - mpi_coll_alltoall_fun = (int (*)(void *, int, MPI_Datatype, - void *, int, MPI_Datatype, MPI_Comm)) - mpi_coll_alltoall_description[alltoall_id].coll; - - int alltoallv_id = find_coll_description(mpi_coll_alltoallv_description, - sg_cfg_get_string("smpi/alltoallv")); - mpi_coll_alltoallv_fun = (int (*)(void *, int *, int *, MPI_Datatype, - void *, int *, int *, MPI_Datatype, - MPI_Comm)) - mpi_coll_alltoallv_description[alltoallv_id].coll; - - int bcast_id = find_coll_description(mpi_coll_bcast_description, - sg_cfg_get_string("smpi/bcast")); - mpi_coll_bcast_fun = (int (*)(void *buf, int count, MPI_Datatype datatype, - int root, MPI_Comm com)) - mpi_coll_bcast_description[bcast_id].coll; - - int reduce_id = find_coll_description(mpi_coll_reduce_description, - sg_cfg_get_string("smpi/reduce")); - mpi_coll_reduce_fun = (int (*)(void *buf, void *rbuf, int count, - MPI_Datatype datatype, MPI_Op op, - int root, MPI_Comm comm)) - mpi_coll_reduce_description[reduce_id].coll; - - int reduce_scatter_id = - find_coll_description(mpi_coll_reduce_scatter_description, - sg_cfg_get_string("smpi/reduce_scatter")); - mpi_coll_reduce_scatter_fun = (int (*)(void *sbuf, void *rbuf, int *rcounts, - MPI_Datatype dtype, MPI_Op op, - MPI_Comm comm)) - mpi_coll_reduce_scatter_description[reduce_scatter_id].coll; - - int scatter_id = find_coll_description(mpi_coll_scatter_description, - sg_cfg_get_string("smpi/scatter")); - mpi_coll_scatter_fun = (int (*)(void *sendbuf, int sendcount, - MPI_Datatype sendtype, void *recvbuf, - int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm)) - mpi_coll_scatter_description[scatter_id].coll; - - int barrier_id = find_coll_description(mpi_coll_barrier_description, - sg_cfg_get_string("smpi/barrier")); - mpi_coll_barrier_fun = (int (*)(MPI_Comm comm)) - mpi_coll_barrier_description[barrier_id].coll; - - smpi_cpu_threshold = sg_cfg_get_double("smpi/cpu_threshold"); - smpi_running_power = sg_cfg_get_double("smpi/running_power"); - smpi_privatize_global_variables = sg_cfg_get_boolean("smpi/privatize_global_variables"); - if (smpi_cpu_threshold < 0) - smpi_cpu_threshold = DBL_MAX; + smpi_init_options(); smpi_global_init(); + smpi_check_options(); + + if(smpi_privatize_global_variables) + smpi_initialize_global_memory_segments(); + /* Clean IO before the run */ fflush(stdout); fflush(stderr); @@ -628,3 +657,23 @@ int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[]) return 0; } + +// This function can be called from extern file, to initialize logs, options, and processes of smpi +// without the need of smpirun +void SMPI_init(){ + smpi_init_logs(); + smpi_init_options(); + smpi_global_init(); + smpi_check_options(); +#ifdef HAVE_TRACING + if (TRACE_is_enabled() && TRACE_is_configured()) { + TRACE_smpi_alloc(); + } +#endif + if(smpi_privatize_global_variables) + smpi_initialize_global_memory_segments(); +} + +void SMPI_finalize(){ + smpi_global_destroy(); +} diff --git a/src/smpi/smpi_group.c b/src/smpi/smpi_group.c index 587ab1df5e..921f71910e 100644 --- a/src/smpi/smpi_group.c +++ b/src/smpi/smpi_group.c @@ -30,7 +30,7 @@ MPI_Group smpi_group_new(int size) MPI_Group group; int i, count; - count = smpi_process_count(); + count = SIMIX_process_count(); group = xbt_new(s_smpi_mpi_group_t, 1); group->size = size; group->rank_to_index_map = xbt_new(int, size); @@ -84,7 +84,7 @@ void smpi_group_destroy(MPI_Group group) void smpi_group_set_mapping(MPI_Group group, int index, int rank) { - if (rank < group->size && index < smpi_process_count()) { + if (rank < group->size && index < SIMIX_process_count()) { group->rank_to_index_map[rank] = index; if(index!=MPI_UNDEFINED)group->index_to_rank_map[index] = rank; } @@ -103,10 +103,7 @@ int smpi_group_index(MPI_Group group, int rank) int smpi_group_rank(MPI_Group group, int index) { int rank = MPI_UNDEFINED; - - if (index < smpi_process_count()) { - rank = group->index_to_rank_map[index]; - } + rank = group->index_to_rank_map[index]; return rank; } diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index 5b51a9bf89..63e69db0f8 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -74,7 +74,7 @@ int PMPI_Get_version (int *version,int *subversion){ int PMPI_Get_library_version (char *version,int *len){ int retval = MPI_SUCCESS; smpi_bench_end(); - snprintf(version,MPI_MAX_LIBRARY_VERSION_STRING,"SMPI Version %d.%d. Copyright The Simgrid Team 2007-2013",SIMGRID_VERSION_MAJOR, + snprintf(version,MPI_MAX_LIBRARY_VERSION_STRING,"SMPI Version %d.%d. Copyright The Simgrid Team 2007-2014",SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR); *len = strlen(version) > MPI_MAX_LIBRARY_VERSION_STRING ? MPI_MAX_LIBRARY_VERSION_STRING : strlen(version); smpi_bench_begin(); @@ -773,7 +773,7 @@ int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm) } else if (newcomm == NULL) { retval = MPI_ERR_ARG; } else { - *newcomm = smpi_comm_new(smpi_comm_group(comm)); + *newcomm = smpi_comm_new(smpi_comm_group(comm), smpi_comm_topo(comm)); retval = MPI_SUCCESS; } return retval; @@ -794,7 +794,7 @@ int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm) retval = MPI_SUCCESS; }else{ - *newcomm = smpi_comm_new(group); + *newcomm = smpi_comm_new(group, NULL); retval = MPI_SUCCESS; } return retval; @@ -1362,7 +1362,6 @@ int PMPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype, int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status) { int retval = 0; - smpi_bench_end(); if (request == NULL || flag == NULL) { retval = MPI_ERR_ARG; @@ -1371,7 +1370,19 @@ int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status) smpi_empty_status(status); retval = MPI_ERR_REQUEST; } else { +#ifdef HAVE_TRACING + int rank = request && (*request)->comm != MPI_COMM_NULL + ? smpi_process_index() + : -1; + + instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); + extra->type = TRACING_TEST; + TRACE_smpi_testing_in(rank, extra); +#endif *flag = smpi_mpi_test(request, status); +#ifdef HAVE_TRACING + TRACE_smpi_testing_out(rank); +#endif retval = MPI_SUCCESS; } smpi_bench_begin(); @@ -2554,168 +2565,244 @@ int PMPI_Initialized(int* flag) { return MPI_SUCCESS; } -/* The following calls are not yet implemented and will fail at runtime. */ -/* Once implemented, please move them above this notice. */ +/* The topo part of MPI_COMM_WORLD should always be NULL. When other topologies + * will be implemented, not only should we check if the topology is NULL, but + * we should check if it is the good topology type (so we have to add a + * MPIR_Topo_Type field, and replace the MPI_Topology field by an union)*/ -#define NOT_YET_IMPLEMENTED {\ - XBT_WARN("Not yet implemented : %s. Please contact the Simgrid team if support is needed", __FUNCTION__);\ - return MPI_SUCCESS;\ - } +int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periodic, int reorder, MPI_Comm* comm_cart) { + int retval = 0; + smpi_bench_end(); + if (comm_old == MPI_COMM_NULL){ + return MPI_ERR_COMM; + } + else if (ndims < 0 || + (ndims > 0 && (dims == NULL || + periodic == NULL)) || + comm_cart == NULL) { + return MPI_ERR_ARG; + } + retval = smpi_mpi_cart_create(comm_old, ndims, dims, periodic, reorder, comm_cart); + smpi_bench_begin(); -int PMPI_Type_dup(MPI_Datatype datatype, MPI_Datatype *newtype){ - NOT_YET_IMPLEMENTED + return retval; } -int PMPI_Type_set_name(MPI_Datatype datatype, char * name) -{ - NOT_YET_IMPLEMENTED +int PMPI_Cart_rank(MPI_Comm comm, int* coords, int* rank) { + if(comm == MPI_COMM_NULL || smpi_comm_topo(comm) == NULL) { + return MPI_ERR_TOPOLOGY; + } + if (coords == NULL) { + return MPI_ERR_ARG; + } + return smpi_mpi_cart_rank(comm, coords, rank); } -int PMPI_Type_get_name(MPI_Datatype datatype, char * name, int* len) -{ - NOT_YET_IMPLEMENTED +int PMPI_Cart_shift(MPI_Comm comm, int direction, int displ, int* source, int* dest) { + if(comm == MPI_COMM_NULL || smpi_comm_topo(comm) == NULL) { + return MPI_ERR_TOPOLOGY; + } + if (source == NULL || dest == NULL || direction < 0 ) { + return MPI_ERR_ARG; + } + return smpi_mpi_cart_shift(comm, direction, displ, source, dest); } -int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) { - NOT_YET_IMPLEMENTED +int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int* coords) { + if(comm == MPI_COMM_NULL || smpi_comm_topo(comm) == NULL) { + return MPI_ERR_TOPOLOGY; + } + if (rank < 0 || rank >= smpi_comm_size(comm)) { + return MPI_ERR_RANK; + } + if (maxdims <= 0) { + return MPI_ERR_ARG; + } + if(coords == NULL) { + return MPI_ERR_ARG; + } + return smpi_mpi_cart_coords(comm, rank, maxdims, coords); } -int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int* coords) { - NOT_YET_IMPLEMENTED +int PMPI_Cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) { + if(comm == NULL || smpi_comm_topo(comm) == NULL) { + return MPI_ERR_TOPOLOGY; + } + if(maxdims <= 0 || dims == NULL || periods == NULL || coords == NULL) { + return MPI_ERR_ARG; + } + return smpi_mpi_cart_get(comm, maxdims, dims, periods, coords); } -int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periods, int reorder, MPI_Comm* comm_cart) { - NOT_YET_IMPLEMENTED +int PMPI_Cartdim_get(MPI_Comm comm, int* ndims) { + if (comm == MPI_COMM_NULL || smpi_comm_topo(comm) == NULL) { + return MPI_ERR_TOPOLOGY; + } + if (ndims == NULL) { + return MPI_ERR_ARG; + } + return smpi_mpi_cartdim_get(comm, ndims); } -int PMPI_Cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) { - NOT_YET_IMPLEMENTED +int PMPI_Dims_create(int nnodes, int ndims, int* dims) { + if(dims == NULL) { + return MPI_ERR_ARG; + } + if (ndims < 1 || nnodes < 1) { + return MPI_ERR_DIMS; + } + + return smpi_mpi_dims_create(nnodes, ndims, dims); } -int PMPI_Cart_map(MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank) { - NOT_YET_IMPLEMENTED +int PMPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) { + if(comm == MPI_COMM_NULL || smpi_comm_topo(comm) == NULL) { + return MPI_ERR_TOPOLOGY; + } + if (comm_new == NULL) { + return MPI_ERR_ARG; + } + return smpi_mpi_cart_sub(comm, remain_dims, comm_new); } -int PMPI_Cart_rank(MPI_Comm comm, int* coords, int* rank) { - NOT_YET_IMPLEMENTED + +/* The following calls are not yet implemented and will fail at runtime. */ +/* Once implemented, please move them above this notice. */ + +#define NOT_YET_IMPLEMENTED { \ + XBT_WARN("Not yet implemented : %s. Please contact the Simgrid team if support is needed", __FUNCTION__); \ + return MPI_SUCCESS; \ + } + + +int PMPI_Type_dup(MPI_Datatype datatype, MPI_Datatype *newtype){ + NOT_YET_IMPLEMENTED } -int PMPI_Cart_shift(MPI_Comm comm, int direction, int displ, int* source, int* dest) { - NOT_YET_IMPLEMENTED +int PMPI_Type_set_name(MPI_Datatype datatype, char * name) +{ + NOT_YET_IMPLEMENTED } -int PMPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) { - NOT_YET_IMPLEMENTED +int PMPI_Type_get_name(MPI_Datatype datatype, char * name, int* len) +{ + NOT_YET_IMPLEMENTED } -int PMPI_Cartdim_get(MPI_Comm comm, int* ndims) { - NOT_YET_IMPLEMENTED +int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) { + NOT_YET_IMPLEMENTED } + +int PMPI_Cart_map(MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank) { + NOT_YET_IMPLEMENTED +} + + int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, int* index, int* edges, int reorder, MPI_Comm* comm_graph) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int* index, int* edges) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Graph_map(MPI_Comm comm_old, int nnodes, int* index, int* edges, int* newrank) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int* neighbors) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int* nneighbors) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Graphdims_get(MPI_Comm comm, int* nnodes, int* nedges) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Topo_test(MPI_Comm comm, int* top_type) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Errhandler_create(MPI_Handler_function* function, MPI_Errhandler* errhandler) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Errhandler_free(MPI_Errhandler* errhandler) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler* errhandler) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Error_string(int errorcode, char* string, int* resultlen) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler* errhandler) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Cancel(MPI_Request* request) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Buffer_attach(void* buffer, int size) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Buffer_detach(void* buffer, int* size) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Comm_test_inter(MPI_Comm comm, int* flag) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Comm_get_attr (MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Comm_set_attr (MPI_Comm comm, int comm_keyval, void *attribute_val) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Comm_delete_attr (MPI_Comm comm, int comm_keyval) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Comm_create_keyval(MPI_Comm_copy_attr_function* copy_fn, MPI_Comm_delete_attr_function* delete_fn, int* keyval, void* extra_state) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Comm_free_keyval(int* keyval) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Pcontrol(const int level ) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Type_get_attr (MPI_Datatype type, int type_keyval, void *attribute_val, int* flag) @@ -2743,71 +2830,71 @@ int PMPI_Type_free_keyval(int* keyval) { } int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm* comm_out) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Intercomm_merge(MPI_Comm comm, int high, MPI_Comm* comm_out) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Bsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Bsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Ibsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group* group) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Comm_remote_size(MPI_Comm comm, int* size) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Attr_delete(MPI_Comm comm, int keyval) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Rsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Rsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Irsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval, void* extra_state) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Keyval_free(int* keyval) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Test_cancelled(MPI_Status* status, int* flag) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Pack_external_size(char *datarep, int incount, MPI_Datatype datatype, MPI_Aint *size){ @@ -2823,19 +2910,15 @@ int PMPI_Unpack_external( char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint } int PMPI_Get_elements(MPI_Status* status, MPI_Datatype datatype, int* elements) { - NOT_YET_IMPLEMENTED -} - -int PMPI_Dims_create(int nnodes, int ndims, int* dims) { - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Win_fence( int assert, MPI_Win win){ - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Win_free( MPI_Win* win){ - NOT_YET_IMPLEMENTED + NOT_YET_IMPLEMENTED } int PMPI_Win_create( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win){ @@ -2855,18 +2938,18 @@ int PMPI_Info_free( MPI_Info *info){ } int PMPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, - MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win){ + MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win){ NOT_YET_IMPLEMENTED } int PMPI_Type_get_envelope( MPI_Datatype datatype, int *num_integers, - int *num_addresses, int *num_datatypes, int *combiner){ + int *num_addresses, int *num_datatypes, int *combiner){ NOT_YET_IMPLEMENTED } int PMPI_Type_get_contents(MPI_Datatype datatype, int max_integers, int max_addresses, - int max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses, - MPI_Datatype* array_of_datatypes){ + int max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses, + MPI_Datatype* array_of_datatypes){ NOT_YET_IMPLEMENTED } @@ -2889,8 +2972,8 @@ int PMPI_Type_match_size(int typeclass,int size,MPI_Datatype *datatype){ } int PMPI_Alltoallw( void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype *sendtypes, - void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype *recvtypes, - MPI_Comm comm){ + void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype *recvtypes, + MPI_Comm comm){ NOT_YET_IMPLEMENTED } @@ -3015,8 +3098,8 @@ int PMPI_Comm_spawn( char *command, char **argv, int maxprocs, MPI_Info info, in } int PMPI_Comm_spawn_multiple( int count, char **array_of_commands, char*** array_of_argv, - int* array_of_maxprocs, MPI_Info* array_of_info, int root, - MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes){ + int* array_of_maxprocs, MPI_Info* array_of_info, int root, + MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes){ NOT_YET_IMPLEMENTED } diff --git a/src/smpi/smpi_replay.c b/src/smpi/smpi_replay.c index 9e00ae97bd..df4f3f5b27 100644 --- a/src/smpi/smpi_replay.c +++ b/src/smpi/smpi_replay.c @@ -313,6 +313,35 @@ static void action_Irecv(const char *const *action) log_timed_action (action, clock); } +static void action_test(const char *const *action){ + double clock = smpi_process_simulated_elapsed(); + MPI_Request request; + MPI_Status status; + int flag = TRUE; + + request = xbt_dynar_pop_as(reqq[smpi_comm_rank(MPI_COMM_WORLD)],MPI_Request); + xbt_assert(request != NULL, "found null request in reqq"); + +#ifdef HAVE_TRACING + int rank = smpi_comm_rank(MPI_COMM_WORLD); + instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); + extra->type=TRACING_TEST; + TRACE_smpi_testing_in(rank, extra); +#endif + flag = smpi_mpi_test(&request, &status); + XBT_DEBUG("MPI_Test result: %d", flag); + /* push back request in dynar to be caught by a subsequent wait. if the test + * did succeed, the request is now NULL. + */ + xbt_dynar_push_as(reqq[smpi_comm_rank(MPI_COMM_WORLD)],MPI_Request, request); + +#ifdef HAVE_TRACING + TRACE_smpi_testing_out(rank); +#endif + + log_timed_action (action, clock); +} + static void action_wait(const char *const *action){ double clock = smpi_process_simulated_elapsed(); MPI_Request request; @@ -322,7 +351,14 @@ static void action_wait(const char *const *action){ "action wait not preceded by any irecv or isend: %s", xbt_str_join_array(action," ")); request = xbt_dynar_pop_as(reqq[smpi_comm_rank(MPI_COMM_WORLD)],MPI_Request); - xbt_assert(request != NULL, "found null request in reqq"); + + if (!request){ + /* Assuming that the trace is well formed, this mean the comm might have + * been caught by a MPI_test. Then just return. + */ + return; + } + #ifdef HAVE_TRACING int rank = request->comm != MPI_COMM_NULL ? smpi_comm_rank(request->comm) @@ -955,6 +991,7 @@ void smpi_replay_init(int *argc, char***argv){ xbt_replay_action_register("Isend", action_Isend); xbt_replay_action_register("recv", action_recv); xbt_replay_action_register("Irecv", action_Irecv); + xbt_replay_action_register("test", action_test); xbt_replay_action_register("wait", action_wait); xbt_replay_action_register("waitAll", action_waitall); xbt_replay_action_register("barrier", action_barrier); diff --git a/src/smpi/smpi_topo.c b/src/smpi/smpi_topo.c new file mode 100644 index 0000000000..56622b867e --- /dev/null +++ b/src/smpi/smpi_topo.c @@ -0,0 +1,470 @@ +#include "xbt/sysdep.h" +#include "smpi/smpi.h" +#include "private.h" + +#include + +typedef struct s_smpi_mpi_topology { + int nnodes; + int ndims; + int *dims; + int *periodic; + int *position; +} s_smpi_mpi_topology_t; + + + +void smpi_topo_destroy(MPI_Topology topo) { + if (topo) { + if(topo->dims) { + free(topo->dims); + } + if(topo->periodic) { + free(topo->periodic); + } + if(topo->position) { + free(topo->position); + } + free(topo); + } +} + +MPI_Topology smpi_topo_create(int ndims) { + MPI_Topology topo = xbt_malloc(sizeof(*topo)); + topo->nnodes = 0; + topo->ndims = ndims; + topo->dims = xbt_malloc(ndims * sizeof(*topo->dims)); + topo->periodic = xbt_malloc(ndims * sizeof(*topo->periodic)); + topo->position = xbt_malloc(ndims * sizeof(*topo->position)); + return topo; +} + +/* reorder is ignored, don't know what would be the consequences of a dumb + * reordering but neither do I see the point of reordering*/ +int smpi_mpi_cart_create(MPI_Comm comm_old, int ndims, int dims[], + int periods[], int reorder, MPI_Comm *comm_cart) { + int retval = MPI_SUCCESS; + int i; + MPI_Topology topo; + MPI_Group newGroup, oldGroup; + int rank, nranks, newSize; + + + + rank = smpi_comm_rank(comm_old); + + + + newSize = 1; + if(ndims != 0) { + topo = smpi_topo_create(ndims); + for (i = 0 ; i < ndims ; i++) { + newSize *= dims[i]; + } + if(rank >= newSize) { + *comm_cart = MPI_COMM_NULL; + return retval; + } + oldGroup = smpi_comm_group(comm_old); + newGroup = smpi_group_new(newSize); + for (i = 0 ; i < newSize ; i++) { + smpi_group_set_mapping(newGroup, smpi_group_index(oldGroup, i), i); + } + + topo->nnodes = newSize; + + memcpy(topo->dims, dims, ndims * sizeof(*topo->dims)); + memcpy(topo->periodic, periods, ndims * sizeof(*topo->periodic)); + + // code duplication... See smpi_mpi_cart_coords + nranks = newSize; + for (i=0; idims[i] = dims[i]; + topo->periodic[i] = periods[i]; + nranks = nranks / dims[i]; + /* FIXME: nranks could be zero (?) */ + topo->position[i] = rank / nranks; + rank = rank % nranks; + } + + *comm_cart = smpi_comm_new(newGroup, topo); + } + else { + if (rank == 0) { + topo = smpi_topo_create(ndims); + *comm_cart = smpi_comm_new(smpi_comm_group(MPI_COMM_SELF), topo); + } + else { + *comm_cart = MPI_COMM_NULL; + } + } + return retval; +} + +int smpi_mpi_cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm) { + MPI_Topology oldTopo = smpi_comm_topo(comm); + int oldNDims = oldTopo->ndims; + int i, j = 0, newNDims, *newDims = NULL, *newPeriodic = NULL; + + if (remain_dims == NULL && oldNDims != 0) { + return MPI_ERR_ARG; + } + newNDims = 0; + for (i = 0 ; i < oldNDims ; i++) { + if (remain_dims[i]) newNDims++; + } + + if (newNDims > 0) { + newDims = malloc(newNDims * sizeof(*newDims)); + newPeriodic = malloc(newNDims * sizeof(*newPeriodic)); + + // that should not segfault + for (i = 0 ; j < newNDims ; i++) { + if(remain_dims[i]) { + newDims[j] = oldTopo->dims[i]; + newPeriodic[j] = oldTopo->periodic[i]; + j++; + } + } + } + return smpi_mpi_cart_create(comm, newNDims, newDims, newPeriodic, 0, newcomm); +} + + + + +int smpi_mpi_cart_coords(MPI_Comm comm, int rank, int maxdims, + int coords[]) { + int nnodes; + int i; + MPI_Topology topo = smpi_comm_topo(comm); + + nnodes = topo->nnodes; + for ( i=0; i < topo->ndims; i++ ) { + nnodes = nnodes / topo->dims[i]; + coords[i] = rank / nnodes; + rank = rank % nnodes; + } + return MPI_SUCCESS; +} + +int smpi_mpi_cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) { + MPI_Topology topo = smpi_comm_topo(comm); + int i; + for(i = 0 ; i < maxdims ; i++) { + dims[i] = topo->dims[i]; + periods[i] = topo->periodic[i]; + coords[i] = topo->position[i]; + } + return MPI_SUCCESS; +} + +int smpi_mpi_cart_rank(MPI_Comm comm, int* coords, int* rank) { + MPI_Topology topo = smpi_comm_topo(comm); + int ndims = topo->ndims; + int multiplier, coord,i; + *rank = 0; + multiplier = 1; + + + + for ( i=ndims-1; i >=0; i-- ) { + coord = coords[i]; + + /* Should we check first for args correction, then process, + * or check while we work (as it is currently done) ? */ + if (coord >= topo->dims[i]) { + if ( topo->periodic[i] ) { + coord = coord % topo->dims[i]; + } + else { + // Should I do that ? + *rank = -1; + return MPI_ERR_ARG; + } + } + else if (coord < 0) { + if(topo->periodic[i]) { + coord = coord % topo->dims[i]; + if (coord) coord = topo->dims[i] + coord; + } + else { + *rank = -1; + return MPI_ERR_ARG; + } + } + + *rank += multiplier * coord; + multiplier *= topo->dims[i]; + } + return MPI_SUCCESS; +} + +int smpi_mpi_cart_shift(MPI_Comm comm, int direction, int disp, + int *rank_source, int *rank_dest) { + MPI_Topology topo = smpi_comm_topo(comm); + int position[topo->ndims]; + + + if(topo->ndims == 0) { + return MPI_ERR_ARG; + } + if (topo->ndims < direction) { + return MPI_ERR_DIMS; + } + + smpi_mpi_cart_coords(comm, smpi_comm_rank(comm), topo->ndims, position); + position[direction] += disp; + + if(position[direction] < 0 || position[direction] >= topo->dims[direction]) { + if(topo->periodic[direction]) { + position[direction] %= topo->dims[direction]; + smpi_mpi_cart_rank(comm, position, rank_dest); + } + else { + *rank_dest = MPI_PROC_NULL; + } + } + else { + smpi_mpi_cart_rank(comm, position, rank_dest); + } + + position[direction] = topo->position[direction] - disp; + if(position[direction] < 0 || position[direction] >= topo->dims[direction]) { + if(topo->periodic[direction]) { + position[direction] %= topo->dims[direction]; + smpi_mpi_cart_rank(comm, position, rank_source); + } + else { + *rank_source = MPI_PROC_NULL; + } + } + else { + smpi_mpi_cart_rank(comm, position, rank_source); + } + + return MPI_SUCCESS; +} + +int smpi_mpi_cartdim_get(MPI_Comm comm, int *ndims) { + MPI_Topology topo = smpi_comm_topo(comm); + + *ndims = topo->ndims; + return MPI_SUCCESS; +} + + + +// Everything below has been taken from ompi, but could be easily rewritten. + +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2014 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2012 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2014 Intel, Inc. All rights reserved + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +/* static functions */ +static int assignnodes(int ndim, int nfactor, int *pfacts,int **pdims); +static int getfactors(int num, int *nfators, int **factors); + +/* + * This is a utility function, no need to have anything in the lower + * layer for this at all + */ +int smpi_mpi_dims_create(int nnodes, int ndims, int dims[]) +{ + int i; + int freeprocs; + int freedims; + int nfactors; + int *factors; + int *procs; + int *p; + int err; + + /* Get # of free-to-be-assigned processes and # of free dimensions */ + freeprocs = nnodes; + freedims = 0; + for (i = 0, p = dims; i < ndims; ++i,++p) { + if (*p == 0) { + ++freedims; + } else if ((*p < 0) || ((nnodes % *p) != 0)) { + return MPI_ERR_DIMS; + + } else { + freeprocs /= *p; + } + } + + if (freedims == 0) { + if (freeprocs == 1) { + return MPI_SUCCESS; + } + return MPI_ERR_DIMS; + } + + if (freeprocs == 1) { + for (i = 0; i < ndims; ++i, ++dims) { + if (*dims == 0) { + *dims = 1; + } + } + return MPI_SUCCESS; + } + + /* Factor the number of free processes */ + if (MPI_SUCCESS != (err = getfactors(freeprocs, &nfactors, &factors))) { + return err; + } + + /* Assign free processes to free dimensions */ + if (MPI_SUCCESS != (err = assignnodes(freedims, nfactors, factors, &procs))) { + return err; + } + + /* Return assignment results */ + p = procs; + for (i = 0; i < ndims; ++i, ++dims) { + if (*dims == 0) { + *dims = *p++; + } + } + + free((char *) factors); + free((char *) procs); + + /* all done */ + return MPI_SUCCESS; +} + +/* + * assignnodes + * + * Function: - assign processes to dimensions + * - get "best-balanced" grid + * - greedy bin-packing algorithm used + * - sort dimensions in decreasing order + * - dimensions array dynamically allocated + * Accepts: - # of dimensions + * - # of prime factors + * - array of prime factors + * - ptr to array of dimensions (returned value) + * Returns: - 0 or ERROR + */ +static int +assignnodes(int ndim, int nfactor, int *pfacts, int **pdims) +{ + int *bins; + int i, j; + int n; + int f; + int *p; + int *pmin; + + if (0 >= ndim) { + return MPI_ERR_DIMS; + } + + /* Allocate and initialize the bins */ + bins = (int *) malloc((unsigned) ndim * sizeof(int)); + if (NULL == bins) { + return MPI_ERR_NO_MEM; + } + *pdims = bins; + + for (i = 0, p = bins; i < ndim; ++i, ++p) { + *p = 1; + } + + /* Loop assigning factors from the highest to the lowest */ + for (j = nfactor - 1; j >= 0; --j) { + f = pfacts[j]; + /* Assign a factor to the smallest bin */ + pmin = bins; + for (i = 1, p = pmin + 1; i < ndim; ++i, ++p) { + if (*p < *pmin) { + pmin = p; + } + } + *pmin *= f; + } + + /* Sort dimensions in decreasing order (O(n^2) for now) */ + for (i = 0, pmin = bins; i < ndim - 1; ++i, ++pmin) { + for (j = i + 1, p = pmin + 1; j < ndim; ++j, ++p) { + if (*p > *pmin) { + n = *p; + *p = *pmin; + *pmin = n; + } + } + } + + return MPI_SUCCESS; +} + +/* + * getfactors + * + * Function: - factorize a number + * Accepts: - number + * - # prime factors + * - array of prime factors + * Returns: - MPI_SUCCESS or ERROR + */ +static int +getfactors(int num, int *nfactors, int **factors) { + int size; + int d; + int i; + int sqrtnum; + + if(num < 2) { + (*nfactors) = 0; + (*factors) = NULL; + return MPI_SUCCESS; + } + /* Allocate the array of prime factors which cannot exceed log_2(num) entries */ + sqrtnum = ceil(sqrt(num)); + size = ceil(log(num) / log(2)); + *factors = (int *) malloc((unsigned) size * sizeof(int)); + + i = 0; + /* determine all occurences of factor 2 */ + while((num % 2) == 0) { + num /= 2; + (*factors)[i++] = 2; + } + /* determine all occurences of uneven prime numbers up to sqrt(num) */ + d = 3; + for(d = 3; (num > 1) && (d < sqrtnum); d += 2) { + while((num % d) == 0) { + num /= d; + (*factors)[i++] = d; + } + } + /* as we looped only up to sqrt(num) one factor > sqrt(num) may be left over */ + if(num != 1) { + (*factors)[i++] = num; + } + (*nfactors) = i; + return MPI_SUCCESS; +} + diff --git a/src/smpi/smpicxx.in b/src/smpi/smpicxx.in new file mode 100755 index 0000000000..1f2cb32a12 --- /dev/null +++ b/src/smpi/smpicxx.in @@ -0,0 +1,57 @@ +#! /bin/sh + +# Copyright (c) 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. + +CC=@CMAKE_CXX_COMPILER@ + +INCLUDEARGS="@includeflag@" +CMAKE_LINKARGS="-L@libdir@" + +@SMPITOOLS_SH@ + +list_set CFLAGS +list_set LINKARGS +if [ "@WIN32@" != "1" ]; then + list_add CFLAGS "-Dmain=smpi_simulated_main_" + list_add LINKARGS "-lsimgrid" +else + list_add CFLAGS "-include" "@includedir@/smpi/smpi_main.h" + list_add LINKARGS "@libdir@\libsimgrid.dll" +fi + +list_set CMDARGS +while [ $# -gt 0 ]; do + ARG="$1" + shift + case "${ARG}" in + -c) + CMAKE_LINKARGS="" + LINKARGS="" + list_add CMDARGS "-c" + ;; + *.c) + SRCFILE="$(readlink -f ${ARG} 2>/dev/null)" + if [ -z "$SRCFILE" ] ; then + SRCFILE="$ARG" + fi + list_add CMDARGS "${SRCFILE}" + ;; + *) + list_add CMDARGS "${ARG}" + ;; + esac +done + +list_set CMDLINE "${CC}" +list_add_not_empty CMDLINE "${CFLAGS}" +list_add_not_empty CMDLINE ${INCLUDEARGS} +list_add_not_empty CMDLINE ${CMAKE_LINKARGS} +list_add_not_empty CMDLINE "${CMDARGS}" +list_add_not_empty CMDLINE "${LINKARGS}" + +eval $(list_get CMDLINE) +"$@" diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 3a015ffbda..a27daaa4cf 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -21,7 +21,7 @@ NETWORK_BANDWIDTH="${DEFAULT_NETWORK_BANDWIDTH}" NETWORK_LATENCY="${DEFAULT_NETWORK_LATENCY}" POWER="${DEFAULT_POWER}" -SIMOPTS="--cfg=maxmin/precision:1e-9 --cfg=surf/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP_gamma:4194304" +SIMOPTS="--cfg=maxmin/precision:1e-3 --cfg=surf/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP_gamma:4194304" #usage to print the way this script should be called usage () { @@ -356,6 +356,7 @@ do host="$(echo $hostnames|cut -d' ' -f$j)" fi echo " " >> ${APPLICATIONTMP} + echo " " >> ${APPLICATIONTMP} echo " " >> ${APPLICATIONTMP} if [ "${EXTOPT}" = "smpi_replay" ]; then if [ ${NUMTRACES} -gt 1 ]; then diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index a66bacad37..3c6662dda7 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -17,18 +17,10 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu, * CallBacks * *************/ -static void parse_cpu_init(sg_platf_host_cbarg_t host){ - ((CpuCas01ModelPtr)surf_cpu_model_pm)->parseInit(host); -} - -static void cpu_add_traces_cpu(){ - surf_cpu_model_pm->addTraces(); -} - static void cpu_define_callbacks() { sg_platf_host_add_cb(parse_cpu_init); - sg_platf_postparse_add_cb(cpu_add_traces_cpu); + sg_platf_postparse_add_cb(add_traces_cpu); } /********* diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index 652259da77..1a08d36e34 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -10,9 +10,11 @@ XBT_LOG_EXTERNAL_CATEGORY(surf_kernel); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf, "Logging specific to the SURF cpu module"); +int autoload_surf_cpu_model = 1; +void_f_void_t surf_cpu_model_init_preparse = NULL; + CpuModelPtr surf_cpu_model_pm; CpuModelPtr surf_cpu_model_vm; - /************* * Callbacks * *************/ @@ -28,9 +30,29 @@ surf_callback(void, CpuPtr) cpuDestructedCallbacks; surf_callback(void, CpuPtr, e_surf_resource_state_t, e_surf_resource_state_t) cpuStateChangedCallbacks; surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf_action_state_t) cpuActionStateChangedCallbacks; +void parse_cpu_init(sg_platf_host_cbarg_t host){ + surf_cpu_model_pm->parseInit(host); +} + +void add_traces_cpu(){ + surf_cpu_model_pm->addTraces(); +} + /********* * Model * *********/ +void CpuModel::parseInit(sg_platf_host_cbarg_t host) +{ + createResource(host->id, + host->power_peak, + host->pstate, + host->power_scale, + host->power_trace, + host->core_amount, + host->initial_state, + host->state_trace, + host->properties); +} void CpuModel::updateActionsStateLazy(double now, double /*delta*/) { @@ -185,6 +207,11 @@ Cpu::~Cpu(){ xbt_free(p_constraintCoreId); } +double Cpu::getCurrentPowerPeak() +{ + return m_powerPeak; +} + double Cpu::getSpeed(double load) { return load * m_powerPeak; diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 4991eb462b..b2f4e8a709 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -54,6 +54,10 @@ XBT_PUBLIC_DATA( surf_callback(void, CpuPtr, e_surf_resource_state_t, e_surf_res */ XBT_PUBLIC_DATA( surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf_action_state_t)) cpuActionStateChangedCallbacks; +XBT_PUBLIC(void) parse_cpu_init(sg_platf_host_cbarg_t host); + +XBT_PUBLIC(void) add_traces_cpu(); + /********* * Model * *********/ @@ -62,7 +66,7 @@ XBT_PUBLIC_DATA( surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf * @brief SURF cpu model interface class * @details A model is an object which handle the interactions between its Resources and its Actions */ -class CpuModel : public Model { +XBT_PUBLIC_CLASS CpuModel : public Model { public: /** * @brief CpuModel constructor @@ -74,13 +78,16 @@ public: /** * @brief Create a Cpu * - * @param name The name of the Cpu - * - * @return The created Cpu + * @param host [TODO] */ - CpuPtr createResource(string name); + void parseInit(sg_platf_host_cbarg_t host); - void setState(e_surf_resource_state_t state); + virtual CpuPtr createResource(const char *name, xbt_dynar_t power_peak, + int pstate, double power_scale, + tmgr_trace_t power_trace, int core, + e_surf_resource_state_t state_initial, + tmgr_trace_t state_trace, + xbt_dict_t cpu_properties)=0; void updateActionsStateLazy(double now, double delta); void updateActionsStateFull(double now, double delta); @@ -96,7 +103,7 @@ public: * @brief SURF cpu resource interface class * @details A Cpu represent a cpu associated to a workstation */ -class Cpu : public Resource { +XBT_PUBLIC_CLASS Cpu : public Resource { public: /** * @brief Cpu constructor @@ -181,7 +188,7 @@ public: * * @return The current Cpu power peak */ - virtual double getCurrentPowerPeak()=0; + virtual double getCurrentPowerPeak(); virtual double getPowerPeakAt(int pstate_index)=0; @@ -210,7 +217,7 @@ public: * @brief SURF Cpu action interface class * @details A CpuAction represent the execution of code on a Cpu */ -class CpuAction : public Action { +XBT_PUBLIC_CLASS CpuAction : public Action { friend CpuPtr getActionCpu(CpuActionPtr action); public: /** diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index c4bf40422c..5c083d5929 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -119,7 +119,7 @@ double CpuTiTgmr::integrate(double a, double b) /** * \brief Auxiliary function to calculate the integral between a and b. - * It simply calculates the integral at point a and b and returns the difference + * It simply calculates the integral at point a and b and returns the difference * between them. * \param trace Trace structure * \param a Initial point @@ -257,7 +257,7 @@ double CpuTiTgmr::solveSomewhatSimple(double a, double amount) * It returns the date when the requested amount of flops is available * \param trace Trace structure * \param a Initial point - * \param amount Amount of flops + * \param amount Amount of flops * \return The date when amount is available. */ double CpuTiTrace::solveSimple(double a, double amount) @@ -347,7 +347,7 @@ CpuTiTgmr::CpuTiTgmr(tmgr_trace_t power_trace, double value) /** * \brief Binary search in array. - * It returns the first point of the interval in which "a" is. + * It returns the first point of the interval in which "a" is. * \param array Array * \param a Value to search * \param low Low bound to search in array @@ -379,18 +379,10 @@ int CpuTiTrace::binarySearch(double *array, double a, int low, int high) * CallBacks * *************/ -static void parse_cpu_ti_init(sg_platf_host_cbarg_t host){ - ((CpuTiModelPtr)surf_cpu_model_pm)->parseInit(host); -} - -static void add_traces_cpu_ti(){ - surf_cpu_model_pm->addTraces(); -} - static void cpu_ti_define_callbacks() { - sg_platf_host_add_cb(parse_cpu_ti_init); - sg_platf_postparse_add_cb(add_traces_cpu_ti); + sg_platf_host_add_cb(parse_cpu_init); + sg_platf_postparse_add_cb(add_traces_cpu); } /********* @@ -435,20 +427,7 @@ CpuTiModel::~CpuTiModel() xbt_heap_free(p_tiActionHeap); } -void CpuTiModel::parseInit(sg_platf_host_cbarg_t host) -{ - createResource(host->id, - host->power_peak, - host->pstate, - host->power_scale, - host->power_trace, - host->core_amount, - host->initial_state, - host->state_trace, - host->properties); -} - -CpuTiPtr CpuTiModel::createResource(const char *name, +CpuPtr CpuTiModel::createResource(const char *name, xbt_dynar_t powerPeak, int pstate, double powerScale, @@ -571,8 +550,8 @@ CpuTi::CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak, setState(stateInitial); m_powerScale = powerScale; m_core = core; - tmgr_trace_t empty_trace; - s_tmgr_event_t val; + tmgr_trace_t empty_trace; + s_tmgr_event_t val; xbt_assert(core==1,"Multi-core not handled with this model yet"); XBT_DEBUG("power scale %f", powerScale); p_availTrace = new CpuTiTgmr(powerTrace, powerScale); @@ -593,7 +572,7 @@ CpuTi::CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak, if (stateTrace) p_stateEvent = tmgr_history_add_trace(history, stateTrace, 0.0, 0, static_cast(this)); if (powerTrace && xbt_dynar_length(powerTrace->s_list.event_list) > 1) { - // add a fake trace event if periodicity == 0 + // add a fake trace event if periodicity == 0 xbt_dynar_get_cpy(powerTrace->s_list.event_list, xbt_dynar_length(powerTrace->s_list.event_list) - 1, &val); if (val.delta == 0) { @@ -886,7 +865,7 @@ void CpuTiAction::updateIndexHeap(int i) void CpuTiAction::setState(e_surf_action_state_t state) { - Action::setState(state); + CpuAction::setState(state); xbt_swag_insert(p_cpu, reinterpret_cast(getModel())->p_modifiedCpu); } diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index 752754a285..1361b0ef4b 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -50,7 +50,7 @@ private: }; enum trace_type { - + TRACE_FIXED, /*< Trace fixed, no availability file */ TRACE_DYNAMIC /*< Dynamic, availability file disponible */ }; @@ -86,7 +86,7 @@ public: ~CpuTiModel(); void parseInit(sg_platf_host_cbarg_t host); - CpuTiPtr createResource(const char *name, xbt_dynar_t powerPeak, + CpuPtr createResource(const char *name, xbt_dynar_t powerPeak, int pstate, double power_scale, tmgr_trace_t power_trace, int core, e_surf_resource_state_t state_initial, @@ -121,7 +121,7 @@ public: xbt_dict_t properties) ; ~CpuTi(); - void updateState(tmgr_trace_event_t event_type, double value, double date); + void updateState(tmgr_trace_event_t event_type, double value, double date); void updateActionsFinishTime(double now); bool isUsed(); void printCpuTiModel(); diff --git a/src/surf/simgrid_dtd.c b/src/surf/simgrid_dtd.c index 3ceb04d4a1..8c24d7e19f 100644 --- a/src/surf/simgrid_dtd.c +++ b/src/surf/simgrid_dtd.c @@ -27,7 +27,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -180,7 +180,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int surf_parse_leng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t surf_parse_leng; extern FILE *surf_parse_in, *surf_parse_out; @@ -202,6 +207,13 @@ extern FILE *surf_parse_in, *surf_parse_out; if ( surf_parse_text[yyl] == '\n' )\ --surf_parse_lineno;\ }while(0) + #define YY_LINENO_REWIND_TO(dst) \ + do {\ + const char *p;\ + for ( p = yy_cp-1; p >= (dst); --p)\ + if ( *p == '\n' )\ + --surf_parse_lineno;\ + }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -219,11 +231,6 @@ extern FILE *surf_parse_in, *surf_parse_out; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -241,7 +248,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -311,8 +318,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when surf_parse_text is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int surf_parse_leng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t surf_parse_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -340,7 +347,7 @@ static void surf_parse__init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE surf_parse__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE surf_parse__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE surf_parse__scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE surf_parse__scan_bytes (yyconst char *bytes,yy_size_t len ); void *surf_parse_alloc (yy_size_t ); void *surf_parse_realloc (void *,yy_size_t ); @@ -372,7 +379,7 @@ void surf_parse_free (void * ); /* Begin user sect3 */ -#define surf_parse_wrap(n) 1 +#define surf_parse_wrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -4659,366 +4666,366 @@ const char surfxml_flexml_version[] = "1.9.6"; int surfxml_pcdata_ix; extern char *surfxml_bufferstack; #define surfxml_pcdata (surfxml_bufferstack + surfxml_pcdata_ix) -AT_surfxml_mount_name AX_surfxml_mount_name; -#define A_surfxml_mount_name (surfxml_bufferstack + AX_surfxml_mount_name) -short int surfxml_mount_name_isset; -AT_surfxml_random_generator AX_surfxml_random_generator; -#define A_surfxml_random_generator AX_surfxml_random_generator -short int surfxml_random_generator_isset; -AT_surfxml_ASroute_gw___dst AX_surfxml_ASroute_gw___dst; -#define A_surfxml_ASroute_gw___dst (surfxml_bufferstack + AX_surfxml_ASroute_gw___dst) -short int surfxml_ASroute_gw___dst_isset; -AT_surfxml_trace___connect_element AX_surfxml_trace___connect_element; -#define A_surfxml_trace___connect_element (surfxml_bufferstack + AX_surfxml_trace___connect_element) -short int surfxml_trace___connect_element_isset; -AT_surfxml_prop_id AX_surfxml_prop_id; -#define A_surfxml_prop_id (surfxml_bufferstack + AX_surfxml_prop_id) -short int surfxml_prop_id_isset; +AT_surfxml_backbone_bandwidth AX_surfxml_backbone_bandwidth; +#define A_surfxml_backbone_bandwidth (surfxml_bufferstack + AX_surfxml_backbone_bandwidth) +short int surfxml_backbone_bandwidth_isset; +AT_surfxml_storage_typeId AX_surfxml_storage_typeId; +#define A_surfxml_storage_typeId (surfxml_bufferstack + AX_surfxml_storage_typeId) +short int surfxml_storage_typeId_isset; +AT_surfxml_config_id AX_surfxml_config_id; +#define A_surfxml_config_id (surfxml_bufferstack + AX_surfxml_config_id) +short int surfxml_config_id_isset; +AT_surfxml_storage_content AX_surfxml_storage_content; +#define A_surfxml_storage_content (surfxml_bufferstack + AX_surfxml_storage_content) +short int surfxml_storage_content_isset; +AT_surfxml_process_function AX_surfxml_process_function; +#define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function) +short int surfxml_process_function_isset; AT_surfxml_host___link_up AX_surfxml_host___link_up; #define A_surfxml_host___link_up (surfxml_bufferstack + AX_surfxml_host___link_up) short int surfxml_host___link_up_isset; -AT_surfxml_host_id AX_surfxml_host_id; -#define A_surfxml_host_id (surfxml_bufferstack + AX_surfxml_host_id) -short int surfxml_host_id_isset; -AT_surfxml_ASroute_symmetrical AX_surfxml_ASroute_symmetrical; -#define A_surfxml_ASroute_symmetrical AX_surfxml_ASroute_symmetrical -short int surfxml_ASroute_symmetrical_isset; AT_surfxml_peer_lat AX_surfxml_peer_lat; #define A_surfxml_peer_lat (surfxml_bufferstack + AX_surfxml_peer_lat) short int surfxml_peer_lat_isset; -AT_surfxml_process_on___failure AX_surfxml_process_on___failure; -#define A_surfxml_process_on___failure AX_surfxml_process_on___failure -short int surfxml_process_on___failure_isset; -AT_surfxml_link_latency___file AX_surfxml_link_latency___file; -#define A_surfxml_link_latency___file (surfxml_bufferstack + AX_surfxml_link_latency___file) -short int surfxml_link_latency___file_isset; -AT_surfxml_peer_availability___file AX_surfxml_peer_availability___file; -#define A_surfxml_peer_availability___file (surfxml_bufferstack + AX_surfxml_peer_availability___file) -short int surfxml_peer_availability___file_isset; -AT_surfxml_model___prop_value AX_surfxml_model___prop_value; -#define A_surfxml_model___prop_value (surfxml_bufferstack + AX_surfxml_model___prop_value) -short int surfxml_model___prop_value_isset; -AT_surfxml_link___ctn_direction AX_surfxml_link___ctn_direction; -#define A_surfxml_link___ctn_direction AX_surfxml_link___ctn_direction -short int surfxml_link___ctn_direction_isset; -AT_surfxml_host_state AX_surfxml_host_state; -#define A_surfxml_host_state AX_surfxml_host_state -short int surfxml_host_state_isset; +AT_surfxml_bypassASroute_gw___dst AX_surfxml_bypassASroute_gw___dst; +#define A_surfxml_bypassASroute_gw___dst (surfxml_bufferstack + AX_surfxml_bypassASroute_gw___dst) +short int surfxml_bypassASroute_gw___dst_isset; +AT_surfxml_ASroute_symmetrical AX_surfxml_ASroute_symmetrical; +#define A_surfxml_ASroute_symmetrical AX_surfxml_ASroute_symmetrical +short int surfxml_ASroute_symmetrical_isset; +AT_surfxml_cabinet_id AX_surfxml_cabinet_id; +#define A_surfxml_cabinet_id (surfxml_bufferstack + AX_surfxml_cabinet_id) +short int surfxml_cabinet_id_isset; AT_surfxml_AS_id AX_surfxml_AS_id; #define A_surfxml_AS_id (surfxml_bufferstack + AX_surfxml_AS_id) short int surfxml_AS_id_isset; -AT_surfxml_host_power AX_surfxml_host_power; -#define A_surfxml_host_power (surfxml_bufferstack + AX_surfxml_host_power) -short int surfxml_host_power_isset; +AT_surfxml_cluster_state___file AX_surfxml_cluster_state___file; +#define A_surfxml_cluster_state___file (surfxml_bufferstack + AX_surfxml_cluster_state___file) +short int surfxml_cluster_state___file_isset; +AT_surfxml_process_host AX_surfxml_process_host; +#define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host) +short int surfxml_process_host_isset; +AT_surfxml_cabinet_power AX_surfxml_cabinet_power; +#define A_surfxml_cabinet_power (surfxml_bufferstack + AX_surfxml_cabinet_power) +short int surfxml_cabinet_power_isset; +AT_surfxml_ASroute_dst AX_surfxml_ASroute_dst; +#define A_surfxml_ASroute_dst (surfxml_bufferstack + AX_surfxml_ASroute_dst) +short int surfxml_ASroute_dst_isset; +AT_surfxml_link_bandwidth___file AX_surfxml_link_bandwidth___file; +#define A_surfxml_link_bandwidth___file (surfxml_bufferstack + AX_surfxml_link_bandwidth___file) +short int surfxml_link_bandwidth___file_isset; +AT_surfxml_cluster_loopback___bw AX_surfxml_cluster_loopback___bw; +#define A_surfxml_cluster_loopback___bw (surfxml_bufferstack + AX_surfxml_cluster_loopback___bw) +short int surfxml_cluster_loopback___bw_isset; +AT_surfxml_random_generator AX_surfxml_random_generator; +#define A_surfxml_random_generator AX_surfxml_random_generator +short int surfxml_random_generator_isset; +AT_surfxml_cluster_bb___bw AX_surfxml_cluster_bb___bw; +#define A_surfxml_cluster_bb___bw (surfxml_bufferstack + AX_surfxml_cluster_bb___bw) +short int surfxml_cluster_bb___bw_isset; +AT_surfxml_peer_coordinates AX_surfxml_peer_coordinates; +#define A_surfxml_peer_coordinates (surfxml_bufferstack + AX_surfxml_peer_coordinates) +short int surfxml_peer_coordinates_isset; AT_surfxml_cabinet_suffix AX_surfxml_cabinet_suffix; #define A_surfxml_cabinet_suffix (surfxml_bufferstack + AX_surfxml_cabinet_suffix) short int surfxml_cabinet_suffix_isset; -AT_surfxml_gpu_name AX_surfxml_gpu_name; -#define A_surfxml_gpu_name (surfxml_bufferstack + AX_surfxml_gpu_name) -short int surfxml_gpu_name_isset; -AT_surfxml_router_id AX_surfxml_router_id; -#define A_surfxml_router_id (surfxml_bufferstack + AX_surfxml_router_id) -short int surfxml_router_id_isset; -AT_surfxml_storage___type_id AX_surfxml_storage___type_id; -#define A_surfxml_storage___type_id (surfxml_bufferstack + AX_surfxml_storage___type_id) -short int surfxml_storage___type_id_isset; -AT_surfxml_process_start___time AX_surfxml_process_start___time; -#define A_surfxml_process_start___time (surfxml_bufferstack + AX_surfxml_process_start___time) -short int surfxml_process_start___time_isset; -AT_surfxml_cabinet_bw AX_surfxml_cabinet_bw; -#define A_surfxml_cabinet_bw (surfxml_bufferstack + AX_surfxml_cabinet_bw) -short int surfxml_cabinet_bw_isset; -AT_surfxml_cluster_suffix AX_surfxml_cluster_suffix; -#define A_surfxml_cluster_suffix (surfxml_bufferstack + AX_surfxml_cluster_suffix) -short int surfxml_cluster_suffix_isset; -AT_surfxml_bypassASroute_dst AX_surfxml_bypassASroute_dst; -#define A_surfxml_bypassASroute_dst (surfxml_bufferstack + AX_surfxml_bypassASroute_dst) -short int surfxml_bypassASroute_dst_isset; -AT_surfxml_host___link_id AX_surfxml_host___link_id; -#define A_surfxml_host___link_id (surfxml_bufferstack + AX_surfxml_host___link_id) -short int surfxml_host___link_id_isset; -AT_surfxml_model___prop_id AX_surfxml_model___prop_id; -#define A_surfxml_model___prop_id (surfxml_bufferstack + AX_surfxml_model___prop_id) -short int surfxml_model___prop_id_isset; AT_surfxml_ASroute_src AX_surfxml_ASroute_src; #define A_surfxml_ASroute_src (surfxml_bufferstack + AX_surfxml_ASroute_src) short int surfxml_ASroute_src_isset; -AT_surfxml_cluster_prefix AX_surfxml_cluster_prefix; -#define A_surfxml_cluster_prefix (surfxml_bufferstack + AX_surfxml_cluster_prefix) -short int surfxml_cluster_prefix_isset; -AT_surfxml_cabinet_prefix AX_surfxml_cabinet_prefix; -#define A_surfxml_cabinet_prefix (surfxml_bufferstack + AX_surfxml_cabinet_prefix) -short int surfxml_cabinet_prefix_isset; -AT_surfxml_trace_file AX_surfxml_trace_file; -#define A_surfxml_trace_file (surfxml_bufferstack + AX_surfxml_trace_file) -short int surfxml_trace_file_isset; +AT_surfxml_cluster_limiter___link AX_surfxml_cluster_limiter___link; +#define A_surfxml_cluster_limiter___link (surfxml_bufferstack + AX_surfxml_cluster_limiter___link) +short int surfxml_cluster_limiter___link_isset; +AT_surfxml_host_core AX_surfxml_host_core; +#define A_surfxml_host_core (surfxml_bufferstack + AX_surfxml_host_core) +short int surfxml_host_core_isset; +AT_surfxml_storage___type_id AX_surfxml_storage___type_id; +#define A_surfxml_storage___type_id (surfxml_bufferstack + AX_surfxml_storage___type_id) +short int surfxml_storage___type_id_isset; +AT_surfxml_storage___type_content___type AX_surfxml_storage___type_content___type; +#define A_surfxml_storage___type_content___type (surfxml_bufferstack + AX_surfxml_storage___type_content___type) +short int surfxml_storage___type_content___type_isset; +AT_surfxml_link_id AX_surfxml_link_id; +#define A_surfxml_link_id (surfxml_bufferstack + AX_surfxml_link_id) +short int surfxml_link_id_isset; +AT_surfxml_trace_periodicity AX_surfxml_trace_periodicity; +#define A_surfxml_trace_periodicity (surfxml_bufferstack + AX_surfxml_trace_periodicity) +short int surfxml_trace_periodicity_isset; +AT_surfxml_link___ctn_direction AX_surfxml_link___ctn_direction; +#define A_surfxml_link___ctn_direction AX_surfxml_link___ctn_direction +short int surfxml_link___ctn_direction_isset; +AT_surfxml_storage_content___type AX_surfxml_storage_content___type; +#define A_surfxml_storage_content___type (surfxml_bufferstack + AX_surfxml_storage_content___type) +short int surfxml_storage_content___type_isset; +AT_surfxml_host_power AX_surfxml_host_power; +#define A_surfxml_host_power (surfxml_bufferstack + AX_surfxml_host_power) +short int surfxml_host_power_isset; +AT_surfxml_peer_id AX_surfxml_peer_id; +#define A_surfxml_peer_id (surfxml_bufferstack + AX_surfxml_peer_id) +short int surfxml_peer_id_isset; +AT_surfxml_peer_state___file AX_surfxml_peer_state___file; +#define A_surfxml_peer_state___file (surfxml_bufferstack + AX_surfxml_peer_state___file) +short int surfxml_peer_state___file_isset; +AT_surfxml_cluster_core AX_surfxml_cluster_core; +#define A_surfxml_cluster_core (surfxml_bufferstack + AX_surfxml_cluster_core) +short int surfxml_cluster_core_isset; +AT_surfxml_cluster_radical AX_surfxml_cluster_radical; +#define A_surfxml_cluster_radical (surfxml_bufferstack + AX_surfxml_cluster_radical) +short int surfxml_cluster_radical_isset; +AT_surfxml_mount_storageId AX_surfxml_mount_storageId; +#define A_surfxml_mount_storageId (surfxml_bufferstack + AX_surfxml_mount_storageId) +short int surfxml_mount_storageId_isset; AT_surfxml_link_sharing___policy AX_surfxml_link_sharing___policy; #define A_surfxml_link_sharing___policy AX_surfxml_link_sharing___policy short int surfxml_link_sharing___policy_isset; -AT_surfxml_storage_typeId AX_surfxml_storage_typeId; -#define A_surfxml_storage_typeId (surfxml_bufferstack + AX_surfxml_storage_typeId) -short int surfxml_storage_typeId_isset; -AT_surfxml_random_min AX_surfxml_random_min; -#define A_surfxml_random_min (surfxml_bufferstack + AX_surfxml_random_min) -short int surfxml_random_min_isset; -AT_surfxml_link___ctn_id AX_surfxml_link___ctn_id; -#define A_surfxml_link___ctn_id (surfxml_bufferstack + AX_surfxml_link___ctn_id) -short int surfxml_link___ctn_id_isset; -AT_surfxml_peer_bw___out AX_surfxml_peer_bw___out; -#define A_surfxml_peer_bw___out (surfxml_bufferstack + AX_surfxml_peer_bw___out) -short int surfxml_peer_bw___out_isset; -AT_surfxml_cluster_availability___file AX_surfxml_cluster_availability___file; -#define A_surfxml_cluster_availability___file (surfxml_bufferstack + AX_surfxml_cluster_availability___file) -short int surfxml_cluster_availability___file_isset; -AT_surfxml_storage_content AX_surfxml_storage_content; -#define A_surfxml_storage_content (surfxml_bufferstack + AX_surfxml_storage_content) -short int surfxml_storage_content_isset; -AT_surfxml_process_kill___time AX_surfxml_process_kill___time; -#define A_surfxml_process_kill___time (surfxml_bufferstack + AX_surfxml_process_kill___time) -short int surfxml_process_kill___time_isset; -AT_surfxml_cluster_bb___bw AX_surfxml_cluster_bb___bw; -#define A_surfxml_cluster_bb___bw (surfxml_bufferstack + AX_surfxml_cluster_bb___bw) -short int surfxml_cluster_bb___bw_isset; -AT_surfxml_host_pstate AX_surfxml_host_pstate; -#define A_surfxml_host_pstate (surfxml_bufferstack + AX_surfxml_host_pstate) -short int surfxml_host_pstate_isset; -AT_surfxml_argument_value AX_surfxml_argument_value; -#define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value) -short int surfxml_argument_value_isset; -AT_surfxml_link_state AX_surfxml_link_state; -#define A_surfxml_link_state AX_surfxml_link_state -short int surfxml_link_state_isset; -AT_surfxml_cluster_loopback___bw AX_surfxml_cluster_loopback___bw; -#define A_surfxml_cluster_loopback___bw (surfxml_bufferstack + AX_surfxml_cluster_loopback___bw) -short int surfxml_cluster_loopback___bw_isset; -AT_surfxml_ASroute_gw___src AX_surfxml_ASroute_gw___src; -#define A_surfxml_ASroute_gw___src (surfxml_bufferstack + AX_surfxml_ASroute_gw___src) -short int surfxml_ASroute_gw___src_isset; -AT_surfxml_AS_routing AX_surfxml_AS_routing; -#define A_surfxml_AS_routing AX_surfxml_AS_routing -short int surfxml_AS_routing_isset; -AT_surfxml_link_bandwidth AX_surfxml_link_bandwidth; -#define A_surfxml_link_bandwidth (surfxml_bufferstack + AX_surfxml_link_bandwidth) -short int surfxml_link_bandwidth_isset; -AT_surfxml_cluster_id AX_surfxml_cluster_id; -#define A_surfxml_cluster_id (surfxml_bufferstack + AX_surfxml_cluster_id) -short int surfxml_cluster_id_isset; AT_surfxml_peer_bw___in AX_surfxml_peer_bw___in; #define A_surfxml_peer_bw___in (surfxml_bufferstack + AX_surfxml_peer_bw___in) short int surfxml_peer_bw___in_isset; -AT_surfxml_random_mean AX_surfxml_random_mean; -#define A_surfxml_random_mean (surfxml_bufferstack + AX_surfxml_random_mean) -short int surfxml_random_mean_isset; -AT_surfxml_storage___type_size AX_surfxml_storage___type_size; -#define A_surfxml_storage___type_size (surfxml_bufferstack + AX_surfxml_storage___type_size) -short int surfxml_storage___type_size_isset; -AT_surfxml_storage_attach AX_surfxml_storage_attach; -#define A_surfxml_storage_attach (surfxml_bufferstack + AX_surfxml_storage_attach) -short int surfxml_storage_attach_isset; +AT_surfxml_include_file AX_surfxml_include_file; +#define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file) +short int surfxml_include_file_isset; +AT_surfxml_cluster_availability___file AX_surfxml_cluster_availability___file; +#define A_surfxml_cluster_availability___file (surfxml_bufferstack + AX_surfxml_cluster_availability___file) +short int surfxml_cluster_availability___file_isset; AT_surfxml_cluster_bb___lat AX_surfxml_cluster_bb___lat; #define A_surfxml_cluster_bb___lat (surfxml_bufferstack + AX_surfxml_cluster_bb___lat) short int surfxml_cluster_bb___lat_isset; -AT_surfxml_link_latency AX_surfxml_link_latency; -#define A_surfxml_link_latency (surfxml_bufferstack + AX_surfxml_link_latency) -short int surfxml_link_latency_isset; -AT_surfxml_backbone_bandwidth AX_surfxml_backbone_bandwidth; -#define A_surfxml_backbone_bandwidth (surfxml_bufferstack + AX_surfxml_backbone_bandwidth) -short int surfxml_backbone_bandwidth_isset; +AT_surfxml_AS_routing AX_surfxml_AS_routing; +#define A_surfxml_AS_routing AX_surfxml_AS_routing +short int surfxml_AS_routing_isset; +AT_surfxml_random_min AX_surfxml_random_min; +#define A_surfxml_random_min (surfxml_bufferstack + AX_surfxml_random_min) +short int surfxml_random_min_isset; +AT_surfxml_cluster_router___id AX_surfxml_cluster_router___id; +#define A_surfxml_cluster_router___id (surfxml_bufferstack + AX_surfxml_cluster_router___id) +short int surfxml_cluster_router___id_isset; +AT_surfxml_host_pstate AX_surfxml_host_pstate; +#define A_surfxml_host_pstate (surfxml_bufferstack + AX_surfxml_host_pstate) +short int surfxml_host_pstate_isset; +AT_surfxml_random_std___deviation AX_surfxml_random_std___deviation; +#define A_surfxml_random_std___deviation (surfxml_bufferstack + AX_surfxml_random_std___deviation) +short int surfxml_random_std___deviation_isset; +AT_surfxml_ASroute_gw___dst AX_surfxml_ASroute_gw___dst; +#define A_surfxml_ASroute_gw___dst (surfxml_bufferstack + AX_surfxml_ASroute_gw___dst) +short int surfxml_ASroute_gw___dst_isset; AT_surfxml_backbone_id AX_surfxml_backbone_id; #define A_surfxml_backbone_id (surfxml_bufferstack + AX_surfxml_backbone_id) short int surfxml_backbone_id_isset; -AT_surfxml_trace___connect_kind AX_surfxml_trace___connect_kind; -#define A_surfxml_trace___connect_kind AX_surfxml_trace___connect_kind -short int surfxml_trace___connect_kind_isset; -AT_surfxml_cabinet_lat AX_surfxml_cabinet_lat; -#define A_surfxml_cabinet_lat (surfxml_bufferstack + AX_surfxml_cabinet_lat) -short int surfxml_cabinet_lat_isset; -AT_surfxml_random_seed AX_surfxml_random_seed; -#define A_surfxml_random_seed (surfxml_bufferstack + AX_surfxml_random_seed) -short int surfxml_random_seed_isset; -AT_surfxml_cluster_state___file AX_surfxml_cluster_state___file; -#define A_surfxml_cluster_state___file (surfxml_bufferstack + AX_surfxml_cluster_state___file) -short int surfxml_cluster_state___file_isset; -AT_surfxml_link_bandwidth___file AX_surfxml_link_bandwidth___file; -#define A_surfxml_link_bandwidth___file (surfxml_bufferstack + AX_surfxml_link_bandwidth___file) -short int surfxml_link_bandwidth___file_isset; -AT_surfxml_storage___type_content AX_surfxml_storage___type_content; -#define A_surfxml_storage___type_content (surfxml_bufferstack + AX_surfxml_storage___type_content) -short int surfxml_storage___type_content_isset; +AT_surfxml_host___link_down AX_surfxml_host___link_down; +#define A_surfxml_host___link_down (surfxml_bufferstack + AX_surfxml_host___link_down) +short int surfxml_host___link_down_isset; +AT_surfxml_cluster_sharing___policy AX_surfxml_cluster_sharing___policy; +#define A_surfxml_cluster_sharing___policy AX_surfxml_cluster_sharing___policy +short int surfxml_cluster_sharing___policy_isset; +AT_surfxml_cluster_topo___parameters AX_surfxml_cluster_topo___parameters; +#define A_surfxml_cluster_topo___parameters (surfxml_bufferstack + AX_surfxml_cluster_topo___parameters) +short int surfxml_cluster_topo___parameters_isset; AT_surfxml_route_symmetrical AX_surfxml_route_symmetrical; #define A_surfxml_route_symmetrical AX_surfxml_route_symmetrical short int surfxml_route_symmetrical_isset; -AT_surfxml_random_id AX_surfxml_random_id; -#define A_surfxml_random_id (surfxml_bufferstack + AX_surfxml_random_id) -short int surfxml_random_id_isset; -AT_surfxml_mstorage_name AX_surfxml_mstorage_name; -#define A_surfxml_mstorage_name (surfxml_bufferstack + AX_surfxml_mstorage_name) -short int surfxml_mstorage_name_isset; +AT_surfxml_prop_id AX_surfxml_prop_id; +#define A_surfxml_prop_id (surfxml_bufferstack + AX_surfxml_prop_id) +short int surfxml_prop_id_isset; +AT_surfxml_peer_bw___out AX_surfxml_peer_bw___out; +#define A_surfxml_peer_bw___out (surfxml_bufferstack + AX_surfxml_peer_bw___out) +short int surfxml_peer_bw___out_isset; +AT_surfxml_cabinet_bw AX_surfxml_cabinet_bw; +#define A_surfxml_cabinet_bw (surfxml_bufferstack + AX_surfxml_cabinet_bw) +short int surfxml_cabinet_bw_isset; +AT_surfxml_cabinet_radical AX_surfxml_cabinet_radical; +#define A_surfxml_cabinet_radical (surfxml_bufferstack + AX_surfxml_cabinet_radical) +short int surfxml_cabinet_radical_isset; +AT_surfxml_router_id AX_surfxml_router_id; +#define A_surfxml_router_id (surfxml_bufferstack + AX_surfxml_router_id) +short int surfxml_router_id_isset; +AT_surfxml_route_dst AX_surfxml_route_dst; +#define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst) +short int surfxml_route_dst_isset; +AT_surfxml_cluster_loopback___lat AX_surfxml_cluster_loopback___lat; +#define A_surfxml_cluster_loopback___lat (surfxml_bufferstack + AX_surfxml_cluster_loopback___lat) +short int surfxml_cluster_loopback___lat_isset; +AT_surfxml_prop_value AX_surfxml_prop_value; +#define A_surfxml_prop_value (surfxml_bufferstack + AX_surfxml_prop_value) +short int surfxml_prop_value_isset; +AT_surfxml_cabinet_lat AX_surfxml_cabinet_lat; +#define A_surfxml_cabinet_lat (surfxml_bufferstack + AX_surfxml_cabinet_lat) +short int surfxml_cabinet_lat_isset; +AT_surfxml_storage_attach AX_surfxml_storage_attach; +#define A_surfxml_storage_attach (surfxml_bufferstack + AX_surfxml_storage_attach) +short int surfxml_storage_attach_isset; +AT_surfxml_bypassASroute_gw___src AX_surfxml_bypassASroute_gw___src; +#define A_surfxml_bypassASroute_gw___src (surfxml_bufferstack + AX_surfxml_bypassASroute_gw___src) +short int surfxml_bypassASroute_gw___src_isset; +AT_surfxml_host___link_id AX_surfxml_host___link_id; +#define A_surfxml_host___link_id (surfxml_bufferstack + AX_surfxml_host___link_id) +short int surfxml_host___link_id_isset; +AT_surfxml_mstorage_typeId AX_surfxml_mstorage_typeId; +#define A_surfxml_mstorage_typeId (surfxml_bufferstack + AX_surfxml_mstorage_typeId) +short int surfxml_mstorage_typeId_isset; +AT_surfxml_link___ctn_id AX_surfxml_link___ctn_id; +#define A_surfxml_link___ctn_id (surfxml_bufferstack + AX_surfxml_link___ctn_id) +short int surfxml_link___ctn_id_isset; +AT_surfxml_cluster_prefix AX_surfxml_cluster_prefix; +#define A_surfxml_cluster_prefix (surfxml_bufferstack + AX_surfxml_cluster_prefix) +short int surfxml_cluster_prefix_isset; +AT_surfxml_storage___type_model AX_surfxml_storage___type_model; +#define A_surfxml_storage___type_model (surfxml_bufferstack + AX_surfxml_storage___type_model) +short int surfxml_storage___type_model_isset; AT_surfxml_random_max AX_surfxml_random_max; #define A_surfxml_random_max (surfxml_bufferstack + AX_surfxml_random_max) short int surfxml_random_max_isset; -AT_surfxml_link_id AX_surfxml_link_id; -#define A_surfxml_link_id (surfxml_bufferstack + AX_surfxml_link_id) -short int surfxml_link_id_isset; -AT_surfxml_cluster_topology AX_surfxml_cluster_topology; -#define A_surfxml_cluster_topology AX_surfxml_cluster_topology -short int surfxml_cluster_topology_isset; -AT_surfxml_process_host AX_surfxml_process_host; -#define A_surfxml_process_host (surfxml_bufferstack + AX_surfxml_process_host) -short int surfxml_process_host_isset; -AT_surfxml_cabinet_id AX_surfxml_cabinet_id; -#define A_surfxml_cabinet_id (surfxml_bufferstack + AX_surfxml_cabinet_id) -short int surfxml_cabinet_id_isset; -AT_surfxml_host_availability___file AX_surfxml_host_availability___file; -#define A_surfxml_host_availability___file (surfxml_bufferstack + AX_surfxml_host_availability___file) -short int surfxml_host_availability___file_isset; -AT_surfxml_cluster_lat AX_surfxml_cluster_lat; -#define A_surfxml_cluster_lat (surfxml_bufferstack + AX_surfxml_cluster_lat) -short int surfxml_cluster_lat_isset; -AT_surfxml_router_coordinates AX_surfxml_router_coordinates; -#define A_surfxml_router_coordinates (surfxml_bufferstack + AX_surfxml_router_coordinates) -short int surfxml_router_coordinates_isset; -AT_surfxml_trace_periodicity AX_surfxml_trace_periodicity; -#define A_surfxml_trace_periodicity (surfxml_bufferstack + AX_surfxml_trace_periodicity) -short int surfxml_trace_periodicity_isset; +AT_surfxml_storage___type_content AX_surfxml_storage___type_content; +#define A_surfxml_storage___type_content (surfxml_bufferstack + AX_surfxml_storage___type_content) +short int surfxml_storage___type_content_isset; +AT_surfxml_cluster_bw AX_surfxml_cluster_bw; +#define A_surfxml_cluster_bw (surfxml_bufferstack + AX_surfxml_cluster_bw) +short int surfxml_cluster_bw_isset; +AT_surfxml_trace_file AX_surfxml_trace_file; +#define A_surfxml_trace_file (surfxml_bufferstack + AX_surfxml_trace_file) +short int surfxml_trace_file_isset; AT_surfxml_cluster_bb___sharing___policy AX_surfxml_cluster_bb___sharing___policy; #define A_surfxml_cluster_bb___sharing___policy AX_surfxml_cluster_bb___sharing___policy short int surfxml_cluster_bb___sharing___policy_isset; -AT_surfxml_peer_state___file AX_surfxml_peer_state___file; -#define A_surfxml_peer_state___file (surfxml_bufferstack + AX_surfxml_peer_state___file) -short int surfxml_peer_state___file_isset; -AT_surfxml_peer_coordinates AX_surfxml_peer_coordinates; -#define A_surfxml_peer_coordinates (surfxml_bufferstack + AX_surfxml_peer_coordinates) -short int surfxml_peer_coordinates_isset; +AT_surfxml_cluster_lat AX_surfxml_cluster_lat; +#define A_surfxml_cluster_lat (surfxml_bufferstack + AX_surfxml_cluster_lat) +short int surfxml_cluster_lat_isset; +AT_surfxml_cluster_id AX_surfxml_cluster_id; +#define A_surfxml_cluster_id (surfxml_bufferstack + AX_surfxml_cluster_id) +short int surfxml_cluster_id_isset; +AT_surfxml_cluster_suffix AX_surfxml_cluster_suffix; +#define A_surfxml_cluster_suffix (surfxml_bufferstack + AX_surfxml_cluster_suffix) +short int surfxml_cluster_suffix_isset; +AT_surfxml_bypassRoute_dst AX_surfxml_bypassRoute_dst; +#define A_surfxml_bypassRoute_dst (surfxml_bufferstack + AX_surfxml_bypassRoute_dst) +short int surfxml_bypassRoute_dst_isset; +AT_surfxml_cluster_topology AX_surfxml_cluster_topology; +#define A_surfxml_cluster_topology AX_surfxml_cluster_topology +short int surfxml_cluster_topology_isset; AT_surfxml_bypassASroute_src AX_surfxml_bypassASroute_src; #define A_surfxml_bypassASroute_src (surfxml_bufferstack + AX_surfxml_bypassASroute_src) short int surfxml_bypassASroute_src_isset; -AT_surfxml_prop_value AX_surfxml_prop_value; -#define A_surfxml_prop_value (surfxml_bufferstack + AX_surfxml_prop_value) -short int surfxml_prop_value_isset; -AT_surfxml_mstorage_typeId AX_surfxml_mstorage_typeId; -#define A_surfxml_mstorage_typeId (surfxml_bufferstack + AX_surfxml_mstorage_typeId) -short int surfxml_mstorage_typeId_isset; -AT_surfxml_ASroute_dst AX_surfxml_ASroute_dst; -#define A_surfxml_ASroute_dst (surfxml_bufferstack + AX_surfxml_ASroute_dst) -short int surfxml_ASroute_dst_isset; -AT_surfxml_link_state___file AX_surfxml_link_state___file; -#define A_surfxml_link_state___file (surfxml_bufferstack + AX_surfxml_link_state___file) -short int surfxml_link_state___file_isset; -AT_surfxml_random_radical AX_surfxml_random_radical; -#define A_surfxml_random_radical (surfxml_bufferstack + AX_surfxml_random_radical) -short int surfxml_random_radical_isset; -AT_surfxml_mount_storageId AX_surfxml_mount_storageId; -#define A_surfxml_mount_storageId (surfxml_bufferstack + AX_surfxml_mount_storageId) -short int surfxml_mount_storageId_isset; -AT_surfxml_bypassASroute_gw___src AX_surfxml_bypassASroute_gw___src; -#define A_surfxml_bypassASroute_gw___src (surfxml_bufferstack + AX_surfxml_bypassASroute_gw___src) -short int surfxml_bypassASroute_gw___src_isset; -AT_surfxml_trace___connect_trace AX_surfxml_trace___connect_trace; -#define A_surfxml_trace___connect_trace (surfxml_bufferstack + AX_surfxml_trace___connect_trace) -short int surfxml_trace___connect_trace_isset; +AT_surfxml_bypassASroute_dst AX_surfxml_bypassASroute_dst; +#define A_surfxml_bypassASroute_dst (surfxml_bufferstack + AX_surfxml_bypassASroute_dst) +short int surfxml_bypassASroute_dst_isset; +AT_surfxml_host_id AX_surfxml_host_id; +#define A_surfxml_host_id (surfxml_bufferstack + AX_surfxml_host_id) +short int surfxml_host_id_isset; +AT_surfxml_random_id AX_surfxml_random_id; +#define A_surfxml_random_id (surfxml_bufferstack + AX_surfxml_random_id) +short int surfxml_random_id_isset; +AT_surfxml_process_kill___time AX_surfxml_process_kill___time; +#define A_surfxml_process_kill___time (surfxml_bufferstack + AX_surfxml_process_kill___time) +short int surfxml_process_kill___time_isset; +AT_surfxml_route_src AX_surfxml_route_src; +#define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src) +short int surfxml_route_src_isset; +AT_surfxml_link_latency___file AX_surfxml_link_latency___file; +#define A_surfxml_link_latency___file (surfxml_bufferstack + AX_surfxml_link_latency___file) +short int surfxml_link_latency___file_isset; +AT_surfxml_peer_power AX_surfxml_peer_power; +#define A_surfxml_peer_power (surfxml_bufferstack + AX_surfxml_peer_power) +short int surfxml_peer_power_isset; +AT_surfxml_random_seed AX_surfxml_random_seed; +#define A_surfxml_random_seed (surfxml_bufferstack + AX_surfxml_random_seed) +short int surfxml_random_seed_isset; AT_surfxml_cluster_power AX_surfxml_cluster_power; #define A_surfxml_cluster_power (surfxml_bufferstack + AX_surfxml_cluster_power) short int surfxml_cluster_power_isset; -AT_surfxml_cluster_topo___parameters AX_surfxml_cluster_topo___parameters; -#define A_surfxml_cluster_topo___parameters (surfxml_bufferstack + AX_surfxml_cluster_topo___parameters) -short int surfxml_cluster_topo___parameters_isset; -AT_surfxml_process_function AX_surfxml_process_function; -#define A_surfxml_process_function (surfxml_bufferstack + AX_surfxml_process_function) -short int surfxml_process_function_isset; -AT_surfxml_peer_id AX_surfxml_peer_id; -#define A_surfxml_peer_id (surfxml_bufferstack + AX_surfxml_peer_id) -short int surfxml_peer_id_isset; -AT_surfxml_cabinet_radical AX_surfxml_cabinet_radical; -#define A_surfxml_cabinet_radical (surfxml_bufferstack + AX_surfxml_cabinet_radical) -short int surfxml_cabinet_radical_isset; -AT_surfxml_cluster_loopback___lat AX_surfxml_cluster_loopback___lat; -#define A_surfxml_cluster_loopback___lat (surfxml_bufferstack + AX_surfxml_cluster_loopback___lat) -short int surfxml_cluster_loopback___lat_isset; -AT_surfxml_storage_content___type AX_surfxml_storage_content___type; -#define A_surfxml_storage_content___type (surfxml_bufferstack + AX_surfxml_storage_content___type) -short int surfxml_storage_content___type_isset; -AT_surfxml_cluster_router___id AX_surfxml_cluster_router___id; -#define A_surfxml_cluster_router___id (surfxml_bufferstack + AX_surfxml_cluster_router___id) -short int surfxml_cluster_router___id_isset; -AT_surfxml_cluster_sharing___policy AX_surfxml_cluster_sharing___policy; -#define A_surfxml_cluster_sharing___policy AX_surfxml_cluster_sharing___policy -short int surfxml_cluster_sharing___policy_isset; -AT_surfxml_bypassRoute_dst AX_surfxml_bypassRoute_dst; -#define A_surfxml_bypassRoute_dst (surfxml_bufferstack + AX_surfxml_bypassRoute_dst) -short int surfxml_bypassRoute_dst_isset; -AT_surfxml_cabinet_power AX_surfxml_cabinet_power; -#define A_surfxml_cabinet_power (surfxml_bufferstack + AX_surfxml_cabinet_power) -short int surfxml_cabinet_power_isset; -AT_surfxml_host_core AX_surfxml_host_core; -#define A_surfxml_host_core (surfxml_bufferstack + AX_surfxml_host_core) -short int surfxml_host_core_isset; -AT_surfxml_host_availability AX_surfxml_host_availability; -#define A_surfxml_host_availability (surfxml_bufferstack + AX_surfxml_host_availability) -short int surfxml_host_availability_isset; -AT_surfxml_storage___type_model AX_surfxml_storage___type_model; -#define A_surfxml_storage___type_model (surfxml_bufferstack + AX_surfxml_storage___type_model) -short int surfxml_storage___type_model_isset; +AT_surfxml_storage_id AX_surfxml_storage_id; +#define A_surfxml_storage_id (surfxml_bufferstack + AX_surfxml_storage_id) +short int surfxml_storage_id_isset; +AT_surfxml_storage___type_size AX_surfxml_storage___type_size; +#define A_surfxml_storage___type_size (surfxml_bufferstack + AX_surfxml_storage___type_size) +short int surfxml_storage___type_size_isset; +AT_surfxml_link_state___file AX_surfxml_link_state___file; +#define A_surfxml_link_state___file (surfxml_bufferstack + AX_surfxml_link_state___file) +short int surfxml_link_state___file_isset; +AT_surfxml_argument_value AX_surfxml_argument_value; +#define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value) +short int surfxml_argument_value_isset; AT_surfxml_bypassRoute_src AX_surfxml_bypassRoute_src; #define A_surfxml_bypassRoute_src (surfxml_bufferstack + AX_surfxml_bypassRoute_src) short int surfxml_bypassRoute_src_isset; +AT_surfxml_platform_version AX_surfxml_platform_version; +#define A_surfxml_platform_version (surfxml_bufferstack + AX_surfxml_platform_version) +short int surfxml_platform_version_isset; +AT_surfxml_model___prop_id AX_surfxml_model___prop_id; +#define A_surfxml_model___prop_id (surfxml_bufferstack + AX_surfxml_model___prop_id) +short int surfxml_model___prop_id_isset; +AT_surfxml_cabinet_prefix AX_surfxml_cabinet_prefix; +#define A_surfxml_cabinet_prefix (surfxml_bufferstack + AX_surfxml_cabinet_prefix) +short int surfxml_cabinet_prefix_isset; +AT_surfxml_router_coordinates AX_surfxml_router_coordinates; +#define A_surfxml_router_coordinates (surfxml_bufferstack + AX_surfxml_router_coordinates) +short int surfxml_router_coordinates_isset; +AT_surfxml_host_state AX_surfxml_host_state; +#define A_surfxml_host_state AX_surfxml_host_state +short int surfxml_host_state_isset; +AT_surfxml_random_radical AX_surfxml_random_radical; +#define A_surfxml_random_radical (surfxml_bufferstack + AX_surfxml_random_radical) +short int surfxml_random_radical_isset; +AT_surfxml_ASroute_gw___src AX_surfxml_ASroute_gw___src; +#define A_surfxml_ASroute_gw___src (surfxml_bufferstack + AX_surfxml_ASroute_gw___src) +short int surfxml_ASroute_gw___src_isset; +AT_surfxml_link_latency AX_surfxml_link_latency; +#define A_surfxml_link_latency (surfxml_bufferstack + AX_surfxml_link_latency) +short int surfxml_link_latency_isset; +AT_surfxml_peer_availability___file AX_surfxml_peer_availability___file; +#define A_surfxml_peer_availability___file (surfxml_bufferstack + AX_surfxml_peer_availability___file) +short int surfxml_peer_availability___file_isset; +AT_surfxml_mstorage_name AX_surfxml_mstorage_name; +#define A_surfxml_mstorage_name (surfxml_bufferstack + AX_surfxml_mstorage_name) +short int surfxml_mstorage_name_isset; +AT_surfxml_process_on___failure AX_surfxml_process_on___failure; +#define A_surfxml_process_on___failure AX_surfxml_process_on___failure +short int surfxml_process_on___failure_isset; +AT_surfxml_mount_name AX_surfxml_mount_name; +#define A_surfxml_mount_name (surfxml_bufferstack + AX_surfxml_mount_name) +short int surfxml_mount_name_isset; +AT_surfxml_gpu_name AX_surfxml_gpu_name; +#define A_surfxml_gpu_name (surfxml_bufferstack + AX_surfxml_gpu_name) +short int surfxml_gpu_name_isset; +AT_surfxml_trace___connect_element AX_surfxml_trace___connect_element; +#define A_surfxml_trace___connect_element (surfxml_bufferstack + AX_surfxml_trace___connect_element) +short int surfxml_trace___connect_element_isset; +AT_surfxml_process_start___time AX_surfxml_process_start___time; +#define A_surfxml_process_start___time (surfxml_bufferstack + AX_surfxml_process_start___time) +short int surfxml_process_start___time_isset; +AT_surfxml_host_state___file AX_surfxml_host_state___file; +#define A_surfxml_host_state___file (surfxml_bufferstack + AX_surfxml_host_state___file) +short int surfxml_host_state___file_isset; +AT_surfxml_host_availability AX_surfxml_host_availability; +#define A_surfxml_host_availability (surfxml_bufferstack + AX_surfxml_host_availability) +short int surfxml_host_availability_isset; AT_surfxml_backbone_latency AX_surfxml_backbone_latency; #define A_surfxml_backbone_latency (surfxml_bufferstack + AX_surfxml_backbone_latency) short int surfxml_backbone_latency_isset; -AT_surfxml_route_src AX_surfxml_route_src; -#define A_surfxml_route_src (surfxml_bufferstack + AX_surfxml_route_src) -short int surfxml_route_src_isset; -AT_surfxml_storage_id AX_surfxml_storage_id; -#define A_surfxml_storage_id (surfxml_bufferstack + AX_surfxml_storage_id) -short int surfxml_storage_id_isset; -AT_surfxml_storage___type_content___type AX_surfxml_storage___type_content___type; -#define A_surfxml_storage___type_content___type (surfxml_bufferstack + AX_surfxml_storage___type_content___type) -short int surfxml_storage___type_content___type_isset; +AT_surfxml_trace___connect_kind AX_surfxml_trace___connect_kind; +#define A_surfxml_trace___connect_kind AX_surfxml_trace___connect_kind +short int surfxml_trace___connect_kind_isset; +AT_surfxml_link_bandwidth AX_surfxml_link_bandwidth; +#define A_surfxml_link_bandwidth (surfxml_bufferstack + AX_surfxml_link_bandwidth) +short int surfxml_link_bandwidth_isset; AT_surfxml_host_coordinates AX_surfxml_host_coordinates; #define A_surfxml_host_coordinates (surfxml_bufferstack + AX_surfxml_host_coordinates) short int surfxml_host_coordinates_isset; AT_surfxml_trace_id AX_surfxml_trace_id; #define A_surfxml_trace_id (surfxml_bufferstack + AX_surfxml_trace_id) short int surfxml_trace_id_isset; -AT_surfxml_peer_power AX_surfxml_peer_power; -#define A_surfxml_peer_power (surfxml_bufferstack + AX_surfxml_peer_power) -short int surfxml_peer_power_isset; -AT_surfxml_cluster_radical AX_surfxml_cluster_radical; -#define A_surfxml_cluster_radical (surfxml_bufferstack + AX_surfxml_cluster_radical) -short int surfxml_cluster_radical_isset; -AT_surfxml_config_id AX_surfxml_config_id; -#define A_surfxml_config_id (surfxml_bufferstack + AX_surfxml_config_id) -short int surfxml_config_id_isset; -AT_surfxml_bypassASroute_gw___dst AX_surfxml_bypassASroute_gw___dst; -#define A_surfxml_bypassASroute_gw___dst (surfxml_bufferstack + AX_surfxml_bypassASroute_gw___dst) -short int surfxml_bypassASroute_gw___dst_isset; -AT_surfxml_host___link_down AX_surfxml_host___link_down; -#define A_surfxml_host___link_down (surfxml_bufferstack + AX_surfxml_host___link_down) -short int surfxml_host___link_down_isset; -AT_surfxml_include_file AX_surfxml_include_file; -#define A_surfxml_include_file (surfxml_bufferstack + AX_surfxml_include_file) -short int surfxml_include_file_isset; -AT_surfxml_random_std___deviation AX_surfxml_random_std___deviation; -#define A_surfxml_random_std___deviation (surfxml_bufferstack + AX_surfxml_random_std___deviation) -short int surfxml_random_std___deviation_isset; -AT_surfxml_cluster_core AX_surfxml_cluster_core; -#define A_surfxml_cluster_core (surfxml_bufferstack + AX_surfxml_cluster_core) -short int surfxml_cluster_core_isset; -AT_surfxml_cluster_limiter___link AX_surfxml_cluster_limiter___link; -#define A_surfxml_cluster_limiter___link (surfxml_bufferstack + AX_surfxml_cluster_limiter___link) -short int surfxml_cluster_limiter___link_isset; -AT_surfxml_host_state___file AX_surfxml_host_state___file; -#define A_surfxml_host_state___file (surfxml_bufferstack + AX_surfxml_host_state___file) -short int surfxml_host_state___file_isset; -AT_surfxml_route_dst AX_surfxml_route_dst; -#define A_surfxml_route_dst (surfxml_bufferstack + AX_surfxml_route_dst) -short int surfxml_route_dst_isset; -AT_surfxml_cluster_bw AX_surfxml_cluster_bw; -#define A_surfxml_cluster_bw (surfxml_bufferstack + AX_surfxml_cluster_bw) -short int surfxml_cluster_bw_isset; -AT_surfxml_platform_version AX_surfxml_platform_version; -#define A_surfxml_platform_version (surfxml_bufferstack + AX_surfxml_platform_version) -short int surfxml_platform_version_isset; +AT_surfxml_host_availability___file AX_surfxml_host_availability___file; +#define A_surfxml_host_availability___file (surfxml_bufferstack + AX_surfxml_host_availability___file) +short int surfxml_host_availability___file_isset; +AT_surfxml_link_state AX_surfxml_link_state; +#define A_surfxml_link_state AX_surfxml_link_state +short int surfxml_link_state_isset; +AT_surfxml_trace___connect_trace AX_surfxml_trace___connect_trace; +#define A_surfxml_trace___connect_trace (surfxml_bufferstack + AX_surfxml_trace___connect_trace) +short int surfxml_trace___connect_trace_isset; +AT_surfxml_random_mean AX_surfxml_random_mean; +#define A_surfxml_random_mean (surfxml_bufferstack + AX_surfxml_random_mean) +short int surfxml_random_mean_isset; +AT_surfxml_model___prop_value AX_surfxml_model___prop_value; +#define A_surfxml_model___prop_value (surfxml_bufferstack + AX_surfxml_model___prop_value) +short int surfxml_model___prop_value_isset; /* XML state. */ #ifdef FLEX_DEBUG @@ -5342,7 +5349,7 @@ FILE *surf_parse_get_out (void ); void surf_parse_set_out (FILE * out_str ); -int surf_parse_get_leng (void ); +yy_size_t surf_parse_get_leng (void ); char *surf_parse_get_text (void ); @@ -5496,6 +5503,34 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! surf_parse_in ) + surf_parse_in = stdin; + + if ( ! surf_parse_out ) + surf_parse_out = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + surf_parse_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); + } + + surf_parse__load_buffer_state( ); + } + + { + /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); reset_surfxml_parse_err_msg(); @@ -5661,32 +5696,6 @@ YY_DECL /* COMMENTS and PIs: handled uniformly for efficiency. */ - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! surf_parse_in ) - surf_parse_in = stdin; - - if ( ! surf_parse_out ) - surf_parse_out = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - surf_parse_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); - } - - surf_parse__load_buffer_state( ); - } - while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -5703,7 +5712,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -5733,7 +5742,7 @@ yy_find_action: if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - int yyl; + yy_size_t yyl; for ( yyl = 0; yyl < surf_parse_leng; ++yyl ) if ( surf_parse_text[yyl] == '\n' ) @@ -5903,13 +5912,13 @@ case 26: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK -case YY_STATE_EOF(S_surfxml_platform_8): +case YY_STATE_EOF(S_surfxml_platform_4): case YY_STATE_EOF(S_surfxml_platform_1): case YY_STATE_EOF(S_surfxml_platform_3): +case YY_STATE_EOF(S_surfxml_platform_8): case YY_STATE_EOF(S_surfxml_platform): -case YY_STATE_EOF(S_surfxml_platform_4): -case YY_STATE_EOF(S_surfxml_platform_6): case YY_STATE_EOF(E_surfxml_platform): +case YY_STATE_EOF(S_surfxml_platform_6): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -5951,10 +5960,10 @@ YY_RULE_SETUP if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element."); LEAVE; STag_surfxml_include(); surfxml_pcdata_ix = 0; ETag_surfxml_include(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_6: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_6: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_3: case S_surfxml_AS_13: case S_surfxml_AS: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_1: SET(S_surfxml_AS_14); break; + case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } YY_BREAK @@ -5978,10 +5987,10 @@ YY_RULE_SETUP ETag_surfxml_include(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_6: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_6: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_3: case S_surfxml_AS_13: case S_surfxml_AS: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_1: SET(S_surfxml_AS_14); break; + case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; } } YY_BREAK @@ -5995,8 +6004,8 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(E_surfxml_include): -case YY_STATE_EOF(S_surfxml_include): case YY_STATE_EOF(S_surfxml_include_2): +case YY_STATE_EOF(S_surfxml_include): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -6064,13 +6073,13 @@ YY_RULE_SETUP if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element."); LEAVE; STag_surfxml_trace(); surfxml_pcdata_ix = 0; ETag_surfxml_trace(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_11: case S_surfxml_AS_10: case S_surfxml_AS_7: SET(S_surfxml_AS_11); break; - case S_surfxml_AS_12: case S_surfxml_AS_15: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break; - case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; + case S_surfxml_platform: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; case S_surfxml_AS_14: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; - case S_surfxml_AS_9: case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_8: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_9); break; - case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_AS_4: case S_surfxml_AS_11: case S_surfxml_AS: case S_surfxml_AS_9: case S_surfxml_AS_7: case S_surfxml_AS_10: SET(S_surfxml_AS_11); break; + case S_surfxml_include_1: case S_surfxml_include_2: case S_surfxml_include: SET(S_surfxml_include_2); break; + case S_surfxml_AS_12: case S_surfxml_AS_3: case S_surfxml_AS_16: case S_surfxml_AS_1: case S_surfxml_AS_15: SET(S_surfxml_AS_16); break; + case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; + case S_surfxml_AS_8: SET(S_surfxml_AS_9); break; } } YY_BREAK @@ -6096,13 +6105,13 @@ YY_RULE_SETUP surfxml_pcdata_ix = popbuffer(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_11: case S_surfxml_AS_10: case S_surfxml_AS_7: SET(S_surfxml_AS_11); break; - case S_surfxml_AS_12: case S_surfxml_AS_15: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break; - case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; + case S_surfxml_platform: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; case S_surfxml_AS_14: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; - case S_surfxml_AS_9: case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_8: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_9); break; - case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_AS_4: case S_surfxml_AS_11: case S_surfxml_AS: case S_surfxml_AS_9: case S_surfxml_AS_7: case S_surfxml_AS_10: SET(S_surfxml_AS_11); break; + case S_surfxml_include_1: case S_surfxml_include_2: case S_surfxml_include: SET(S_surfxml_include_2); break; + case S_surfxml_AS_12: case S_surfxml_AS_3: case S_surfxml_AS_16: case S_surfxml_AS_1: case S_surfxml_AS_15: SET(S_surfxml_AS_16); break; + case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; + case S_surfxml_AS_8: SET(S_surfxml_AS_9); break; } } YY_BREAK @@ -6393,12 +6402,12 @@ YY_RULE_SETUP if (!AX_surfxml_trace___connect_element) FAIL("Required attribute `element' not set for `trace_connect' element."); LEAVE; STag_surfxml_trace___connect(); surfxml_pcdata_ix = 0; ETag_surfxml_trace___connect(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_11: case S_surfxml_AS_10: case S_surfxml_AS_7: SET(S_surfxml_AS_11); break; - case S_surfxml_AS_12: case S_surfxml_AS_15: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break; - case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; - case S_surfxml_AS_14: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; - case S_surfxml_AS_9: case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_8: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_9); break; + case S_surfxml_platform_3: case S_surfxml_platform_6: case S_surfxml_platform_1: case S_surfxml_platform_5: case S_surfxml_platform: SET(S_surfxml_platform_6); break; + case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_15: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_16: case S_surfxml_AS_12: SET(S_surfxml_AS_16); break; + case S_surfxml_AS_8: SET(S_surfxml_AS_9); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; + case S_surfxml_AS_10: case S_surfxml_AS_9: case S_surfxml_AS_7: case S_surfxml_AS: case S_surfxml_AS_11: case S_surfxml_AS_4: SET(S_surfxml_AS_11); break; case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; } } @@ -6423,12 +6432,12 @@ YY_RULE_SETUP ETag_surfxml_trace___connect(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_11: case S_surfxml_AS_10: case S_surfxml_AS_7: SET(S_surfxml_AS_11); break; - case S_surfxml_AS_12: case S_surfxml_AS_15: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break; - case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; - case S_surfxml_AS_14: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; - case S_surfxml_AS_9: case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_8: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_9); break; + case S_surfxml_platform_3: case S_surfxml_platform_6: case S_surfxml_platform_1: case S_surfxml_platform_5: case S_surfxml_platform: SET(S_surfxml_platform_6); break; + case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_15: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_16: case S_surfxml_AS_12: SET(S_surfxml_AS_16); break; + case S_surfxml_AS_8: SET(S_surfxml_AS_9); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; + case S_surfxml_AS_10: case S_surfxml_AS_9: case S_surfxml_AS_7: case S_surfxml_AS: case S_surfxml_AS_11: case S_surfxml_AS_4: SET(S_surfxml_AS_11); break; case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; } } @@ -6544,9 +6553,9 @@ YY_RULE_SETUP if (!AX_surfxml_AS_routing) FAIL("Required attribute `routing' not set for `AS' element."); LEAVE; STag_surfxml_AS(); surfxml_pcdata_ix = 0; ETag_surfxml_AS(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS: SET(S_surfxml_AS_6); break; case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_platform_1: case S_surfxml_platform_6: case S_surfxml_platform_3: case S_surfxml_platform: case S_surfxml_platform_5: SET(S_surfxml_platform_6); break; } } YY_BREAK @@ -6570,9 +6579,9 @@ YY_RULE_SETUP ETag_surfxml_AS(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS: SET(S_surfxml_AS_6); break; case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_platform_1: case S_surfxml_platform_6: case S_surfxml_platform_3: case S_surfxml_platform: case S_surfxml_platform_5: SET(S_surfxml_platform_6); break; } } YY_BREAK @@ -6585,18 +6594,18 @@ case 132: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK -case YY_STATE_EOF(S_surfxml_AS_12): -case YY_STATE_EOF(S_surfxml_AS_9): -case YY_STATE_EOF(S_surfxml_AS_1): -case YY_STATE_EOF(S_surfxml_AS_7): case YY_STATE_EOF(S_surfxml_AS_11): +case YY_STATE_EOF(S_surfxml_AS_4): case YY_STATE_EOF(S_surfxml_AS_14): case YY_STATE_EOF(S_surfxml_AS_6): -case YY_STATE_EOF(E_surfxml_AS): -case YY_STATE_EOF(S_surfxml_AS_16): +case YY_STATE_EOF(S_surfxml_AS_12): case YY_STATE_EOF(S_surfxml_AS_3): case YY_STATE_EOF(S_surfxml_AS): -case YY_STATE_EOF(S_surfxml_AS_4): +case YY_STATE_EOF(S_surfxml_AS_16): +case YY_STATE_EOF(E_surfxml_AS): +case YY_STATE_EOF(S_surfxml_AS_7): +case YY_STATE_EOF(S_surfxml_AS_9): +case YY_STATE_EOF(S_surfxml_AS_1): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -6690,8 +6699,8 @@ YY_RULE_SETUP if (!AX_surfxml_storage___type_size) FAIL("Required attribute `size' not set for `storage_type' element."); LEAVE; STag_surfxml_storage___type(); surfxml_pcdata_ix = 0; ETag_surfxml_storage___type(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; + case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -6715,8 +6724,8 @@ YY_RULE_SETUP ETag_surfxml_storage___type(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; + case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -6729,9 +6738,9 @@ case 151: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK -case YY_STATE_EOF(E_surfxml_storage___type): -case YY_STATE_EOF(S_surfxml_storage___type): case YY_STATE_EOF(S_surfxml_storage___type_2): +case YY_STATE_EOF(S_surfxml_storage___type): +case YY_STATE_EOF(E_surfxml_storage___type): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -6787,7 +6796,7 @@ YY_RULE_SETUP if (!AX_surfxml_mount_name) FAIL("Required attribute `name' not set for `mount' element."); LEAVE; STag_surfxml_mount(); surfxml_pcdata_ix = 0; ETag_surfxml_mount(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_host_1: case S_surfxml_host_2: case S_surfxml_host: SET(S_surfxml_host_2); break; + case S_surfxml_host_2: case S_surfxml_host_1: case S_surfxml_host: SET(S_surfxml_host_2); break; } } YY_BREAK @@ -6811,7 +6820,7 @@ YY_RULE_SETUP ETag_surfxml_mount(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_host_1: case S_surfxml_host_2: case S_surfxml_host: SET(S_surfxml_host_2); break; + case S_surfxml_host_2: case S_surfxml_host_1: case S_surfxml_host: SET(S_surfxml_host_2); break; } } YY_BREAK @@ -6880,7 +6889,7 @@ YY_RULE_SETUP if (!AX_surfxml_mstorage_name) FAIL("Required attribute `name' not set for `mstorage' element."); LEAVE; STag_surfxml_mstorage(); surfxml_pcdata_ix = 0; ETag_surfxml_mstorage(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_host_1: case S_surfxml_host_2: case S_surfxml_host: SET(S_surfxml_host_2); break; + case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break; } } YY_BREAK @@ -6904,7 +6913,7 @@ YY_RULE_SETUP ETag_surfxml_mstorage(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_host_1: case S_surfxml_host_2: case S_surfxml_host: SET(S_surfxml_host_2); break; + case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break; } } YY_BREAK @@ -7061,7 +7070,7 @@ YY_RULE_SETUP if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element."); LEAVE; STag_surfxml_host(); surfxml_pcdata_ix = 0; ETag_surfxml_host(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -7085,7 +7094,7 @@ YY_RULE_SETUP ETag_surfxml_host(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -7099,8 +7108,8 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(S_surfxml_host): -case YY_STATE_EOF(E_surfxml_host): case YY_STATE_EOF(S_surfxml_host_2): +case YY_STATE_EOF(E_surfxml_host): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -7194,8 +7203,8 @@ YY_RULE_SETUP if (!AX_surfxml_storage_attach) FAIL("Required attribute `attach' not set for `storage' element."); LEAVE; STag_surfxml_storage(); surfxml_pcdata_ix = 0; ETag_surfxml_storage(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; } } YY_BREAK @@ -7219,8 +7228,8 @@ YY_RULE_SETUP ETag_surfxml_storage(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; } } YY_BREAK @@ -7233,9 +7242,9 @@ case 225: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK -case YY_STATE_EOF(E_surfxml_storage): -case YY_STATE_EOF(S_surfxml_storage): case YY_STATE_EOF(S_surfxml_storage_2): +case YY_STATE_EOF(S_surfxml_storage): +case YY_STATE_EOF(E_surfxml_storage): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -7277,7 +7286,7 @@ YY_RULE_SETUP if (!AX_surfxml_gpu_name) FAIL("Required attribute `name' not set for `gpu' element."); LEAVE; STag_surfxml_gpu(); surfxml_pcdata_ix = 0; ETag_surfxml_gpu(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_14: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -7301,7 +7310,7 @@ YY_RULE_SETUP ETag_surfxml_gpu(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_14: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -7384,7 +7393,7 @@ YY_RULE_SETUP if (!AX_surfxml_host___link_down) FAIL("Required attribute `down' not set for `host_link' element."); LEAVE; STag_surfxml_host___link(); surfxml_pcdata_ix = 0; ETag_surfxml_host___link(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_14: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -7408,7 +7417,7 @@ YY_RULE_SETUP ETag_surfxml_host___link(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_14: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -7722,9 +7731,9 @@ YY_RULE_SETUP if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element."); LEAVE; STag_surfxml_cluster(); surfxml_pcdata_ix = 0; ETag_surfxml_cluster(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_1: SET(S_surfxml_AS_6); break; + case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_6: case S_surfxml_platform: case S_surfxml_platform_5: SET(S_surfxml_platform_6); break; } } YY_BREAK @@ -7748,9 +7757,9 @@ YY_RULE_SETUP ETag_surfxml_cluster(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_1: SET(S_surfxml_AS_6); break; + case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_6: case S_surfxml_platform: case S_surfxml_platform_5: SET(S_surfxml_platform_6); break; } } YY_BREAK @@ -7763,8 +7772,8 @@ case 308: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK -case YY_STATE_EOF(S_surfxml_cluster_2): case YY_STATE_EOF(S_surfxml_cluster): +case YY_STATE_EOF(S_surfxml_cluster_2): case YY_STATE_EOF(E_surfxml_cluster): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -7891,10 +7900,10 @@ YY_RULE_SETUP if (!AX_surfxml_cabinet_lat) FAIL("Required attribute `lat' not set for `cabinet' element."); LEAVE; STag_surfxml_cabinet(); surfxml_pcdata_ix = 0; ETag_surfxml_cabinet(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; - case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: SET(S_surfxml_AS_14); break; + case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_6: case S_surfxml_platform: case S_surfxml_platform_5: SET(S_surfxml_platform_6); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; + case S_surfxml_include: case S_surfxml_include_1: case S_surfxml_include_2: SET(S_surfxml_include_2); break; } } YY_BREAK @@ -7918,10 +7927,10 @@ YY_RULE_SETUP ETag_surfxml_cabinet(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; - case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: SET(S_surfxml_AS_14); break; + case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_6: case S_surfxml_platform: case S_surfxml_platform_5: SET(S_surfxml_platform_6); break; + case S_surfxml_AS_6: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break; + case S_surfxml_include: case S_surfxml_include_1: case S_surfxml_include_2: SET(S_surfxml_include_2); break; } } YY_BREAK @@ -8068,9 +8077,9 @@ YY_RULE_SETUP if (!AX_surfxml_peer_lat) FAIL("Required attribute `lat' not set for `peer' element."); LEAVE; STag_surfxml_peer(); surfxml_pcdata_ix = 0; ETag_surfxml_peer(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; - case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_platform: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; + case S_surfxml_include_2: case S_surfxml_include_1: case S_surfxml_include: SET(S_surfxml_include_2); break; + case S_surfxml_AS_5: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } YY_BREAK @@ -8094,9 +8103,9 @@ YY_RULE_SETUP ETag_surfxml_peer(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_6); break; - case S_surfxml_platform_6: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_6); break; - case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break; + case S_surfxml_platform: case S_surfxml_platform_5: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break; + case S_surfxml_include_2: case S_surfxml_include_1: case S_surfxml_include: SET(S_surfxml_include_2); break; + case S_surfxml_AS_5: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; } } YY_BREAK @@ -8163,7 +8172,7 @@ YY_RULE_SETUP if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element."); LEAVE; STag_surfxml_router(); surfxml_pcdata_ix = 0; ETag_surfxml_router(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_14: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -8187,7 +8196,7 @@ YY_RULE_SETUP ETag_surfxml_router(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_14: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -8271,7 +8280,7 @@ YY_RULE_SETUP LEAVE; STag_surfxml_backbone(); surfxml_pcdata_ix = 0; ETag_surfxml_backbone(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_14: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -8296,7 +8305,7 @@ YY_RULE_SETUP popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; + case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_14: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -8452,8 +8461,8 @@ YY_RULE_SETUP if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element."); LEAVE; STag_surfxml_link(); surfxml_pcdata_ix = 0; ETag_surfxml_link(); popbuffer(); /* attribute */ switch (YY_START) { + case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -8477,8 +8486,8 @@ YY_RULE_SETUP ETag_surfxml_link(); popbuffer(); /* attribute */ switch (YY_START) { + case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: SET(S_surfxml_AS_14); break; case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break; - case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS_13: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break; } } YY_BREAK @@ -8491,9 +8500,9 @@ case 415: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK -case YY_STATE_EOF(E_surfxml_link): case YY_STATE_EOF(S_surfxml_link_2): case YY_STATE_EOF(S_surfxml_link): +case YY_STATE_EOF(E_surfxml_link): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -8565,7 +8574,7 @@ YY_RULE_SETUP if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element."); LEAVE; STag_surfxml_route(); surfxml_pcdata_ix = 0; ETag_surfxml_route(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_12: case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS: case S_surfxml_AS_15: case S_surfxml_AS_3: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break; + case S_surfxml_AS_16: case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_12: case S_surfxml_AS_14: case S_surfxml_AS_15: SET(S_surfxml_AS_16); break; } } YY_BREAK @@ -8589,7 +8598,7 @@ YY_RULE_SETUP ETag_surfxml_route(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_12: case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS: case S_surfxml_AS_15: case S_surfxml_AS_3: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break; + case S_surfxml_AS_16: case S_surfxml_AS_3: case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_12: case S_surfxml_AS_14: case S_surfxml_AS_15: SET(S_surfxml_AS_16); break; } } YY_BREAK @@ -8603,8 +8612,8 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(S_surfxml_route): -case YY_STATE_EOF(S_surfxml_route_2): case YY_STATE_EOF(E_surfxml_route): +case YY_STATE_EOF(S_surfxml_route_2): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -8704,7 +8713,7 @@ YY_RULE_SETUP if (!AX_surfxml_ASroute_gw___dst) FAIL("Required attribute `gw_dst' not set for `ASroute' element."); LEAVE; STag_surfxml_ASroute(); surfxml_pcdata_ix = 0; ETag_surfxml_ASroute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_9: case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_8: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_9); break; + case S_surfxml_AS_8: case S_surfxml_AS_6: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_9: case S_surfxml_AS_1: case S_surfxml_AS_4: SET(S_surfxml_AS_9); break; } } YY_BREAK @@ -8728,7 +8737,7 @@ YY_RULE_SETUP ETag_surfxml_ASroute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_9: case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_8: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_9); break; + case S_surfxml_AS_8: case S_surfxml_AS_6: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_9: case S_surfxml_AS_1: case S_surfxml_AS_4: SET(S_surfxml_AS_9); break; } } YY_BREAK @@ -8741,9 +8750,9 @@ case 453: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK -case YY_STATE_EOF(E_surfxml_ASroute): case YY_STATE_EOF(S_surfxml_ASroute): case YY_STATE_EOF(S_surfxml_ASroute_2): +case YY_STATE_EOF(E_surfxml_ASroute): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -8808,10 +8817,10 @@ YY_RULE_SETUP if (!AX_surfxml_link___ctn_id) FAIL("Required attribute `id' not set for `link_ctn' element."); LEAVE; STag_surfxml_link___ctn(); surfxml_pcdata_ix = 0; ETag_surfxml_link___ctn(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_bypassRoute: case S_surfxml_bypassRoute_2: case S_surfxml_bypassRoute_1: SET(S_surfxml_bypassRoute_2); break; - case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break; - case S_surfxml_bypassASroute_2: case S_surfxml_bypassASroute_1: case S_surfxml_bypassASroute: SET(S_surfxml_bypassASroute_2); break; - case S_surfxml_ASroute: case S_surfxml_ASroute_1: case S_surfxml_ASroute_2: SET(S_surfxml_ASroute_2); break; + case S_surfxml_route_1: case S_surfxml_route_2: case S_surfxml_route: SET(S_surfxml_route_2); break; + case S_surfxml_bypassRoute_2: case S_surfxml_bypassRoute: case S_surfxml_bypassRoute_1: SET(S_surfxml_bypassRoute_2); break; + case S_surfxml_bypassASroute: case S_surfxml_bypassASroute_2: case S_surfxml_bypassASroute_1: SET(S_surfxml_bypassASroute_2); break; + case S_surfxml_ASroute_2: case S_surfxml_ASroute: case S_surfxml_ASroute_1: SET(S_surfxml_ASroute_2); break; } } YY_BREAK @@ -8835,10 +8844,10 @@ YY_RULE_SETUP ETag_surfxml_link___ctn(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_bypassRoute: case S_surfxml_bypassRoute_2: case S_surfxml_bypassRoute_1: SET(S_surfxml_bypassRoute_2); break; - case S_surfxml_route_1: case S_surfxml_route: case S_surfxml_route_2: SET(S_surfxml_route_2); break; - case S_surfxml_bypassASroute_2: case S_surfxml_bypassASroute_1: case S_surfxml_bypassASroute: SET(S_surfxml_bypassASroute_2); break; - case S_surfxml_ASroute: case S_surfxml_ASroute_1: case S_surfxml_ASroute_2: SET(S_surfxml_ASroute_2); break; + case S_surfxml_route_1: case S_surfxml_route_2: case S_surfxml_route: SET(S_surfxml_route_2); break; + case S_surfxml_bypassRoute_2: case S_surfxml_bypassRoute: case S_surfxml_bypassRoute_1: SET(S_surfxml_bypassRoute_2); break; + case S_surfxml_bypassASroute: case S_surfxml_bypassASroute_2: case S_surfxml_bypassASroute_1: SET(S_surfxml_bypassASroute_2); break; + case S_surfxml_ASroute_2: case S_surfxml_ASroute: case S_surfxml_ASroute_1: SET(S_surfxml_ASroute_2); break; } } YY_BREAK @@ -8907,7 +8916,7 @@ YY_RULE_SETUP if (!AX_surfxml_bypassRoute_dst) FAIL("Required attribute `dst' not set for `bypassRoute' element."); LEAVE; STag_surfxml_bypassRoute(); surfxml_pcdata_ix = 0; ETag_surfxml_bypassRoute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_12: case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS: case S_surfxml_AS_15: case S_surfxml_AS_3: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break; + case S_surfxml_AS_15: case S_surfxml_AS_12: case S_surfxml_AS_14: case S_surfxml_AS_1: case S_surfxml_AS_16: case S_surfxml_AS_3: case S_surfxml_AS: SET(S_surfxml_AS_16); break; } } YY_BREAK @@ -8931,7 +8940,7 @@ YY_RULE_SETUP ETag_surfxml_bypassRoute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_12: case S_surfxml_AS_1: case S_surfxml_AS_14: case S_surfxml_AS: case S_surfxml_AS_15: case S_surfxml_AS_3: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break; + case S_surfxml_AS_15: case S_surfxml_AS_12: case S_surfxml_AS_14: case S_surfxml_AS_1: case S_surfxml_AS_16: case S_surfxml_AS_3: case S_surfxml_AS: SET(S_surfxml_AS_16); break; } } YY_BREAK @@ -8944,9 +8953,9 @@ case 483: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK -case YY_STATE_EOF(S_surfxml_bypassRoute): case YY_STATE_EOF(S_surfxml_bypassRoute_2): case YY_STATE_EOF(E_surfxml_bypassRoute): +case YY_STATE_EOF(S_surfxml_bypassRoute): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -9030,7 +9039,7 @@ YY_RULE_SETUP if (!AX_surfxml_bypassASroute_gw___dst) FAIL("Required attribute `gw_dst' not set for `bypassASroute' element."); LEAVE; STag_surfxml_bypassASroute(); surfxml_pcdata_ix = 0; ETag_surfxml_bypassASroute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_9: case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_8: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_9); break; + case S_surfxml_AS_4: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: case S_surfxml_AS_9: case S_surfxml_AS_6: case S_surfxml_AS_8: SET(S_surfxml_AS_9); break; } } YY_BREAK @@ -9054,7 +9063,7 @@ YY_RULE_SETUP ETag_surfxml_bypassASroute(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_9: case S_surfxml_AS_1: case S_surfxml_AS: case S_surfxml_AS_8: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_9); break; + case S_surfxml_AS_4: case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_1: case S_surfxml_AS_9: case S_surfxml_AS_6: case S_surfxml_AS_8: SET(S_surfxml_AS_9); break; } } YY_BREAK @@ -9068,8 +9077,8 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(S_surfxml_bypassASroute_2): -case YY_STATE_EOF(E_surfxml_bypassASroute): case YY_STATE_EOF(S_surfxml_bypassASroute): +case YY_STATE_EOF(E_surfxml_bypassASroute): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -9165,7 +9174,7 @@ YY_RULE_SETUP if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element."); LEAVE; STag_surfxml_process(); surfxml_pcdata_ix = 0; ETag_surfxml_process(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_platform_6: case S_surfxml_platform_4: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_8: case S_surfxml_platform_7: case S_surfxml_platform_3: SET(S_surfxml_platform_8); break; + case S_surfxml_platform_7: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_6: case S_surfxml_platform: case S_surfxml_platform_8: case S_surfxml_platform_4: SET(S_surfxml_platform_8); break; } } YY_BREAK @@ -9189,7 +9198,7 @@ YY_RULE_SETUP ETag_surfxml_process(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_platform_6: case S_surfxml_platform_4: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_8: case S_surfxml_platform_7: case S_surfxml_platform_3: SET(S_surfxml_platform_8); break; + case S_surfxml_platform_7: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_6: case S_surfxml_platform: case S_surfxml_platform_8: case S_surfxml_platform_4: SET(S_surfxml_platform_8); break; } } YY_BREAK @@ -9202,9 +9211,9 @@ case 521: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK +case YY_STATE_EOF(S_surfxml_process_2): case YY_STATE_EOF(E_surfxml_process): case YY_STATE_EOF(S_surfxml_process): -case YY_STATE_EOF(S_surfxml_process_2): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -9323,7 +9332,7 @@ YY_RULE_SETUP { LEAVE; STag_surfxml_config(); surfxml_pcdata_ix = 0; ETag_surfxml_config(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break; + case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break; } } YY_BREAK @@ -9347,7 +9356,7 @@ YY_RULE_SETUP ETag_surfxml_config(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break; + case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break; } } YY_BREAK @@ -9361,8 +9370,8 @@ YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",surf_parse_text[0]); YY_BREAK case YY_STATE_EOF(S_surfxml_config): -case YY_STATE_EOF(S_surfxml_config_2): case YY_STATE_EOF(E_surfxml_config): +case YY_STATE_EOF(S_surfxml_config_2): if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `' expected."); YY_BREAK @@ -9420,14 +9429,14 @@ YY_RULE_SETUP if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element."); LEAVE; STag_surfxml_prop(); surfxml_pcdata_ix = 0; ETag_surfxml_prop(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_2: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_3); break; - case S_surfxml_storage_1: case S_surfxml_storage_2: case S_surfxml_storage: SET(S_surfxml_storage_2); break; - case S_surfxml_cluster_2: case S_surfxml_cluster: case S_surfxml_cluster_1: SET(S_surfxml_cluster_2); break; - case S_surfxml_host_1: case S_surfxml_host_2: case S_surfxml_host: SET(S_surfxml_host_2); break; - case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break; - case S_surfxml_config_1: case S_surfxml_config: case S_surfxml_config_2: SET(S_surfxml_config_2); break; - case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break; - case S_surfxml_storage___type_1: case S_surfxml_storage___type: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break; + case S_surfxml_host: case S_surfxml_host_2: case S_surfxml_host_1: SET(S_surfxml_host_2); break; + case S_surfxml_storage_1: case S_surfxml_storage: case S_surfxml_storage_2: SET(S_surfxml_storage_2); break; + case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: case S_surfxml_storage___type: SET(S_surfxml_storage___type_2); break; + case S_surfxml_process: case S_surfxml_process_1: case S_surfxml_process_2: SET(S_surfxml_process_2); break; + case S_surfxml_config_1: case S_surfxml_config_2: case S_surfxml_config: SET(S_surfxml_config_2); break; + case S_surfxml_link: case S_surfxml_link_1: case S_surfxml_link_2: SET(S_surfxml_link_2); break; + case S_surfxml_cluster_2: case S_surfxml_cluster_1: case S_surfxml_cluster: SET(S_surfxml_cluster_2); break; + case S_surfxml_AS_2: case S_surfxml_AS_3: case S_surfxml_AS: SET(S_surfxml_AS_3); break; } } YY_BREAK @@ -9451,14 +9460,14 @@ YY_RULE_SETUP ETag_surfxml_prop(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_AS_2: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_3); break; - case S_surfxml_storage_1: case S_surfxml_storage_2: case S_surfxml_storage: SET(S_surfxml_storage_2); break; - case S_surfxml_cluster_2: case S_surfxml_cluster: case S_surfxml_cluster_1: SET(S_surfxml_cluster_2); break; - case S_surfxml_host_1: case S_surfxml_host_2: case S_surfxml_host: SET(S_surfxml_host_2); break; - case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break; - case S_surfxml_config_1: case S_surfxml_config: case S_surfxml_config_2: SET(S_surfxml_config_2); break; - case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break; - case S_surfxml_storage___type_1: case S_surfxml_storage___type: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break; + case S_surfxml_host: case S_surfxml_host_2: case S_surfxml_host_1: SET(S_surfxml_host_2); break; + case S_surfxml_storage_1: case S_surfxml_storage: case S_surfxml_storage_2: SET(S_surfxml_storage_2); break; + case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: case S_surfxml_storage___type: SET(S_surfxml_storage___type_2); break; + case S_surfxml_process: case S_surfxml_process_1: case S_surfxml_process_2: SET(S_surfxml_process_2); break; + case S_surfxml_config_1: case S_surfxml_config_2: case S_surfxml_config: SET(S_surfxml_config_2); break; + case S_surfxml_link: case S_surfxml_link_1: case S_surfxml_link_2: SET(S_surfxml_link_2); break; + case S_surfxml_cluster_2: case S_surfxml_cluster_1: case S_surfxml_cluster: SET(S_surfxml_cluster_2); break; + case S_surfxml_AS_2: case S_surfxml_AS_3: case S_surfxml_AS: SET(S_surfxml_AS_3); break; } } YY_BREAK @@ -9529,7 +9538,7 @@ YY_RULE_SETUP if (!AX_surfxml_model___prop_value) FAIL("Required attribute `value' not set for `model_prop' element."); LEAVE; STag_surfxml_model___prop(); surfxml_pcdata_ix = 0; ETag_surfxml_model___prop(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_storage___type_1: case S_surfxml_storage___type: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break; + case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: case S_surfxml_storage___type: SET(S_surfxml_storage___type_2); break; } } YY_BREAK @@ -9553,7 +9562,7 @@ YY_RULE_SETUP ETag_surfxml_model___prop(); popbuffer(); /* attribute */ switch (YY_START) { - case S_surfxml_storage___type_1: case S_surfxml_storage___type: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break; + case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: case S_surfxml_storage___type: SET(S_surfxml_storage___type_2); break; } } YY_BREAK @@ -9840,6 +9849,7 @@ case YY_STATE_EOF(IMPOSSIBLE): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of surf_parse_lex */ /* yy_get_next_buffer - try to read in a new buffer @@ -9895,21 +9905,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -9940,7 +9950,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -10035,7 +10045,7 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 3468); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT @@ -10062,7 +10072,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -10227,10 +10237,6 @@ static void surf_parse__load_buffer_state (void) surf_parse_free((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a surf_parse_restart() or at EOF. @@ -10343,7 +10349,7 @@ void surf_parse_pop_buffer_state (void) */ static void surf_parse_ensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -10440,12 +10446,12 @@ YY_BUFFER_STATE surf_parse__scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE surf_parse__scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE surf_parse__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -10559,7 +10565,7 @@ FILE *surf_parse_get_out (void) /** Get the length of the current token. * */ -int surf_parse_get_leng (void) +yy_size_t surf_parse_get_leng (void) { return surf_parse_leng; } diff --git a/src/surf/storage_interface.cpp b/src/surf/storage_interface.cpp index d1c824d2fb..28de019eb4 100644 --- a/src/surf/storage_interface.cpp +++ b/src/surf/storage_interface.cpp @@ -146,7 +146,6 @@ void Storage::setState(e_surf_resource_state_t state) xbt_dict_t Storage::getContent() { /* For the moment this action has no cost, but in the future we could take in account access latency of the disk */ - /*surf_action_t action = storage_action_execute(storage,0, LS);*/ xbt_dict_t content_dict = xbt_dict_new_homogeneous(NULL); xbt_dict_cursor_t cursor = NULL; @@ -163,20 +162,29 @@ sg_size_t Storage::getSize(){ return m_size; } +sg_size_t Storage::getFreeSize(){ + return m_size - m_usedSize; +} + +sg_size_t Storage::getUsedSize(){ + return m_usedSize; +} + /********** * Action * **********/ StorageAction::StorageAction(ModelPtr model, double cost, bool failed, - StoragePtr storage, e_surf_action_storage_type_t type) + StoragePtr storage, e_surf_action_storage_type_t type) : Action(model, cost, failed) -, m_type(type), p_storage(storage), p_file(NULL), p_lsDict(NULL) -{ +, m_type(type), p_storage(storage), p_file(NULL){ + progress = 0; }; StorageAction::StorageAction(ModelPtr model, double cost, bool failed, lmm_variable_t var, - StoragePtr storage, e_surf_action_storage_type_t type) + StoragePtr storage, e_surf_action_storage_type_t type) : Action(model, cost, failed, var) - , m_type(type), p_storage(storage), p_file(NULL), p_lsDict(NULL) { + , m_type(type), p_storage(storage), p_file(NULL){ + progress = 0; } void StorageAction::setState(e_surf_action_state_t state){ diff --git a/src/surf/storage_interface.hpp b/src/surf/storage_interface.hpp index 357200e7a9..61ef3abd8a 100644 --- a/src/surf/storage_interface.hpp +++ b/src/surf/storage_interface.hpp @@ -192,15 +192,6 @@ public: */ virtual StorageActionPtr close(surf_file_t fd)=0; - /** - * @brief List directory contents of a path - * @details [long description] - * - * @param path The path to the directory - * @return The StorageAction corresponding to the ls action - */ - virtual StorageActionPtr ls(const char *path)=0; - /** * @brief Read a file * @@ -233,6 +224,21 @@ public: */ virtual sg_size_t getSize(); + /** + * @brief Get the available size in bytes of the current Storage + * + * @return The available size in bytes of the current Storage + */ + virtual sg_size_t getFreeSize(); + + /** + * @brief Get the used size in bytes of the current Storage + * + * @return The used size in bytes of the current Storage + */ + virtual sg_size_t getUsedSize(); + + xbt_dict_t parseContent(char *filename); xbt_dynar_t p_writeActions; @@ -253,8 +259,7 @@ typedef enum { WRITE, /**< Write in a file */ STAT, /**< Stat a file */ OPEN, /**< Open a file */ - CLOSE, /**< Close a file */ - LS /**< List directory contents */ + CLOSE /**< Close a file */ } e_surf_action_storage_type_t; /** @ingroup SURF_storage_interface @@ -292,7 +297,7 @@ public: e_surf_action_storage_type_t m_type; StoragePtr p_storage; surf_file_t p_file; - xbt_dict_t p_lsDict; + double progress; }; typedef struct s_storage_type { diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index d27457bca7..d0bc4080f0 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -6,7 +6,7 @@ #include "storage_n11.hpp" #include "surf_private.h" - +#include /*ceil*/ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage); static int storage_selective_update = 0; @@ -305,17 +305,34 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta) ; it != itend ; it=itNext) { ++itNext; action = static_cast(&*it); + if(action->m_type == WRITE) { // Update the disk usage - // Update the file size - // For each action of type write - double rate = lmm_variable_getvalue(action->getVariable()); - /* Hack to avoid rounding differences between x86 and x86_64 - * (note that the next sizes are of type sg_size_t). */ - long incr = delta * rate + 0.00001; // Use legacy value. I don't know what this hack can be... FIXME: Pierre, please check. + // Update the file size + // For each action of type write + double current_progress = + delta * lmm_variable_getvalue(action->getVariable()); + long int incr = current_progress; + + XBT_DEBUG("%s:\n\t progress = %.2f, current_progress = %.2f, " + "incr = %ld, lrint(1) = %ld, lrint(2) = %ld", + action->p_file->name, + action->progress, current_progress, incr, + lrint(action->progress + current_progress), + lrint(action->progress)+ incr); + + /* Take care of rounding error accumulation */ + if (lrint(action->progress + current_progress) > + lrint(action->progress)+ incr) + incr++; + + action->progress +=current_progress; + action->p_storage->m_usedSize += incr; // disk usage - action->p_file->size += incr; // file size + action->p_file->current_position+= incr; // current_position + // which becomes the new file size + action->p_file->size = action->p_file->current_position ; sg_size_t *psize = xbt_new(sg_size_t,1); *psize = action->p_file->size; @@ -361,51 +378,6 @@ StorageN11::StorageN11(StorageModelPtr model, const char* name, xbt_dict_t prope XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size); } -StorageActionPtr StorageN11::ls(const char* path) -{ - StorageActionPtr action = new StorageN11Action(getModel(), 0, getState() != SURF_RESOURCE_ON, this, LS); - - action->p_lsDict = NULL; - xbt_dict_t ls_dict = xbt_dict_new_homogeneous(xbt_free); - - char* key; - sg_size_t size = 0; - xbt_dict_cursor_t cursor = NULL; - - xbt_dynar_t dyn = NULL; - char* file = NULL; - - // for each file in the storage content - xbt_dict_foreach(p_content,cursor,key,size){ - // Search if file start with the prefix 'path' - if(xbt_str_start_with(key,path)){ - file = &key[strlen(path)]; - - // Split file with '/' - dyn = xbt_str_split(file,"/"); - file = xbt_dynar_get_as(dyn,0,char*); - - // file - if(xbt_dynar_length(dyn) == 1){ - sg_size_t *psize = xbt_new(sg_size_t, 1); - *psize=size; - xbt_dict_set(ls_dict, file, psize, NULL); - } - // Directory - else - { - // if directory does not exist yet in the dictionary - if(!xbt_dict_get_or_null(ls_dict,file)) - xbt_dict_set(ls_dict,file,NULL,NULL); - } - xbt_dynar_free(&dyn); - } - } - - action->p_lsDict = ls_dict; - return action; -} - StorageActionPtr StorageN11::open(const char* mount, const char* path) { XBT_DEBUG("\tOpen file '%s'",path); @@ -416,7 +388,7 @@ StorageActionPtr StorageN11::open(const char* mount, const char* path) if(psize) size = *psize; else { - psize = xbt_new(sg_size_t,1); + psize = xbt_new(sg_size_t,1); size = 0; *psize = size; xbt_dict_set(p_content, path, psize, NULL); @@ -458,12 +430,12 @@ StorageActionPtr StorageN11::close(surf_file_t fd) StorageActionPtr StorageN11::read(surf_file_t fd, sg_size_t size) { - if(size > fd->size){ - size = fd->size; + if(fd->current_position + size > fd->size){ + size = fd->size - fd->current_position; fd->current_position = fd->size; } else - fd->current_position += size; + fd->current_position += size; StorageActionPtr action = new StorageN11Action(getModel(), size, getState() != SURF_RESOURCE_ON, this, READ); return action; @@ -476,8 +448,10 @@ StorageActionPtr StorageN11::write(surf_file_t fd, sg_size_t size) StorageActionPtr action = new StorageN11Action(getModel(), size, getState() != SURF_RESOURCE_ON, this, WRITE); action->p_file = fd; - fd->current_position += size; - // If the storage is full + /* Substract the part of the file that might disappear from the used sized on + * the storage element */ + m_usedSize -= (fd->size - fd->current_position); + // If the storage is full before even starting to write if(m_usedSize==m_size) { action->setState(SURF_ACTION_FAILED); } @@ -500,15 +474,14 @@ StorageN11Action::StorageN11Action(ModelPtr model, double cost, bool failed, Sto case OPEN: case CLOSE: case STAT: - case LS: break; case READ: lmm_expand(model->getMaxminSystem(), storage->p_constraintRead, - getVariable(), 1.0); + getVariable(), 1.0); break; case WRITE: lmm_expand(model->getMaxminSystem(), storage->p_constraintWrite, - getVariable(), 1.0); + getVariable(), 1.0); ActionPtr action = this; xbt_dynar_push(storage->p_writeActions, &action); ref(); diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 0cefa0cb30..6ee28a1431 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -388,14 +388,6 @@ xbt_dynar_t surf_workstation_get_info(surf_resource_t resource, surf_file_t fd){ return get_casted_workstation(resource)->getInfo(fd); } -sg_size_t surf_workstation_get_free_size(surf_resource_t resource, const char* name){ - return get_casted_workstation(resource)->getFreeSize(name); -} - -sg_size_t surf_workstation_get_used_size(surf_resource_t resource, const char* name){ - return get_casted_workstation(resource)->getUsedSize(name); -} - size_t surf_workstation_file_tell(surf_resource_t workstation, surf_file_t fd){ return get_casted_workstation(workstation)->fileTell(fd); } @@ -476,6 +468,14 @@ sg_size_t surf_storage_get_size(surf_resource_t resource){ return static_cast(surf_storage_resource_priv(resource))->getSize(); } +sg_size_t surf_storage_get_free_size(surf_resource_t resource){ + return static_cast(surf_storage_resource_priv(resource))->getFreeSize(); +} + +sg_size_t surf_storage_get_used_size(surf_resource_t resource){ + return static_cast(surf_storage_resource_priv(resource))->getUsedSize(); +} + const char* surf_storage_get_host(surf_resource_t resource){ return static_cast(surf_storage_resource_priv(resource))->p_attach; } @@ -557,7 +557,3 @@ double surf_network_action_get_latency_limited(surf_action_t action) { surf_file_t surf_storage_action_get_file(surf_action_t action){ return static_cast(action)->p_file; } - -xbt_dict_t surf_storage_action_get_ls_dict(surf_action_t action){ - return static_cast(action)->p_lsDict; -} diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index e5e44a6877..a636b30c9a 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -74,7 +74,7 @@ typedef Model* ModelPtr; //class Resource; typedef Resource* ResourcePtr; - + //class Action; typedef Action* ActionPtr; @@ -102,8 +102,8 @@ enum heap_action_type{ XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list; XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_host_avail; XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_power; -XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_link_avail; -XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_bandwidth; +XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_link_avail; +XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_bandwidth; XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_latency; /********* @@ -117,56 +117,56 @@ XBT_PUBLIC_DATA(xbt_dynar_t) model_list; */ XBT_PUBLIC_CLASS Model { public: - /** + /** * @brief Model constructor - * + * * @param name the name of the model */ Model(const char *name); - /** + /** * @brief Model destructor */ virtual ~Model(); /** * @brief Get the name of the current Model - * + * * @return The name of the current Model */ const char *getName() {return p_name;} /** - * @brief Get the set of [actions](@ref Action) in *ready* state - * - * @return The set of [actions](@ref Action) in *ready* state + * @brief Get the set of [actions](@ref Action) in *ready* state + * + * @return The set of [actions](@ref Action) in *ready* state */ virtual ActionListPtr getReadyActionSet() {return p_readyActionSet;} /** * @brief Get the set of [actions](@ref Action) in *running* state - * + * * @return The set of [actions](@ref Action) in *running* state */ virtual ActionListPtr getRunningActionSet() {return p_runningActionSet;} /** * @brief Get the set of [actions](@ref Action) in *failed* state - * + * * @return The set of [actions](@ref Action) in *failed* state */ virtual ActionListPtr getFailedActionSet() {return p_failedActionSet;} /** * @brief Get the set of [actions](@ref Action) in *done* state - * + * * @return The set of [actions](@ref Action) in *done* state */ virtual ActionListPtr getDoneActionSet() {return p_doneActionSet;} /** * @brief Get the set of modified [actions](@ref Action) - * + * * @return The set of modified [actions](@ref Action) */ virtual ActionLmmListPtr getModifiedSet() {return p_modifiedSet;} @@ -181,7 +181,7 @@ public: /** * @brief Get the update mechanism of the current Model * @see e_UM_t - * + * * @return [description] */ e_UM_t getUpdateMechanism() {return p_updateMechanism;} @@ -189,17 +189,17 @@ public: /** * @brief Get Action heap * @details [TODO] - * + * * @return The Action heap */ xbt_heap_t getActionHeap() {return p_actionHeap;} - /** + /** * @brief share the resources - * @details Share the resources between the actions - * - * @param now [TODO] - * @return the date of the next action will finish + * @details Share the resources between the actions + * + * @param now The current time of the simulation + * @return The delta of time till the next action will finish */ virtual double shareResources(double now); virtual double shareResourcesLazy(double now); @@ -210,10 +210,10 @@ public: /** * @brief Update state of actions - * @details [TODO] - * - * @param now [TODO] - * @param delta [TODO] + * @details Update action to the current time + * + * @param now The current time of the simulation + * @param delta The delta of time since the last update */ virtual void updateActionsState(double now, double delta); virtual void updateActionsStateLazy(double now, double delta); @@ -254,23 +254,23 @@ typedef struct { */ XBT_PUBLIC_CLASS Resource { public: - /** + /** * @brief Resource constructor */ Resource(); - /** + /** * @brief Resource constructor - * + * * @param model Model associated to this Resource * @param name The name of the Resource * @param props Dictionary of properties associated to this Resource */ Resource(ModelPtr model, const char *name, xbt_dict_t props); - /** + /** * @brief Resource constructor - * + * * @param model Model associated to this Resource * @param name The name of the Resource * @param props Dictionary of properties associated to this Resource @@ -278,9 +278,9 @@ public: */ Resource(ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint); - /** + /** * @brief Resource constructor - * + * * @param model Model associated to this Resource * @param name The name of the Resource * @param props Dictionary of properties associated to this Resource @@ -291,25 +291,25 @@ public: /** * @brief Resource destructor */ - virtual ~Resource(); + virtual ~Resource(); /** * @brief Get the Model of the current Resource - * + * * @return The Model of the current Resource */ ModelPtr getModel(); /** * @brief Get the name of the current Resource - * + * * @return The name of the current Resource */ const char *getName(); /** * @brief Get the properties of the current Resource - * + * * @return The properties of the current Resource */ virtual xbt_dict_t getProperties(); @@ -317,7 +317,7 @@ public: /** * @brief Update the state of the current Resource * @details [TODO] - * + * * @param event_type [TODO] * @param value [TODO] * @param date [TODO] @@ -356,7 +356,7 @@ public: /** * @brief Set the [state](\ref e_surf_resource_state_t) of the current Resource - * + * * @param state The new state of the current Resource */ virtual void setState(e_surf_resource_state_t state); @@ -372,7 +372,7 @@ private: public: /** * @brief Get the lmm constraint associated to this Resource if it is part of a LMM component - * + * * @return The lmm constraint associated to this Resource */ lmm_constraint_t getConstraint(); @@ -400,7 +400,7 @@ private: public: /** * @brief Action constructor - * + * * @param model The Model associated to this Action * @param cost The cost of the Action * @param failed If the action is impossible (e.g.: execute something on a switched off workstation) @@ -409,7 +409,7 @@ public: /** * @brief Action constructor - * + * * @param model The Model associated to this Action * @param cost The cost of the Action * @param failed If the action is impossible (e.g.: execute something on a switched off workstation) @@ -421,7 +421,7 @@ public: * @brief Action destructor */ virtual ~Action(); - + /** * @brief Finish the action */ @@ -429,21 +429,21 @@ public: /** * @brief Get the [state](\ref e_surf_action_state_t) of the current Action - * + * * @return The state of the current Action */ e_surf_action_state_t getState(); /**< get the state*/ /** * @brief Set the [state](\ref e_surf_action_state_t) of the current Action - * + * * @param state The new state of the current Action */ virtual void setState(e_surf_action_state_t state); /** * @brief Get the bound of the current Action - * + * * @return The bound of the current Action */ double getBound(); @@ -457,84 +457,84 @@ public: /** * @brief Get the start time of the current action - * + * * @return The start time of the current action */ double getStartTime(); /** * @brief Get the finish time of the current action - * + * * @return The finish time of the current action */ double getFinishTime(); /** * @brief Get the data associated to the current action - * + * * @return The data associated to the current action */ void *getData() {return p_data;} /** * @brief Set the data associated to the current action - * + * * @param data The new data associated to the current action */ void setData(void* data); /** * @brief Get the maximum duration of the current action - * + * * @return The maximum duration of the current action */ double getMaxDuration() {return m_maxDuration;} /** * @brief Get the category associated to the current action - * + * * @return The category associated to the current action */ char *getCategory() {return p_category;} /** * @brief Get the cost of the current action - * + * * @return The cost of the current action */ double getCost() {return m_cost;} /** * @brief Set the cost of the current action - * + * * @param cost The new cost of the current action */ void setCost(double cost) {m_cost = cost;} /** * @brief Update the maximum duration of the current action - * + * * @param delta [TODO] */ void updateMaxDuration(double delta) {double_update(&m_maxDuration, delta,sg_surf_precision);} /** * @brief Update the remaining time of the current action - * + * * @param delta [TODO] */ void updateRemains(double delta) {double_update(&m_remains, delta, sg_maxmin_precision*sg_surf_precision);} /** * @brief Set the remaining time of the current action - * + * * @param value The new remaining time of the current action */ void setRemains(double value) {m_remains = value;} /** * @brief Set the finish time of the current action - * + * * @param value The new Finush time of the current action */ void setFinishTime(double value) {m_finish = value;} @@ -547,7 +547,7 @@ public: /** * @brief Remove a reference to the current action * @details If the Action has no more reference, we destroy it - * + * * @return true if the action was destroyed and false if someone still has references on it */ virtual int unref(); @@ -574,21 +574,21 @@ public: /** * @brief Check if the current action is running - * + * * @return true if the current Action is suspended, false otherwise */ virtual bool isSuspended(); /** * @brief Set the maximum duration of the current Action - * + * * @param duration The new maximum duration of the current Action */ virtual void setMaxDuration(double duration); /** * @brief Set the priority of the current Action - * + * * @param priority The new priority of the current Action */ virtual void setPriority(double priority); @@ -596,7 +596,7 @@ public: #ifdef HAVE_TRACING /** * @brief Set the category of the current Action - * + * * @param category The new category of the current Action */ void setCategory(const char *category); @@ -604,21 +604,21 @@ public: /** * @brief Get the remaining time of the current action after updating the resource - * + * * @return The remaining time */ virtual double getRemains(); /** * @brief Get the remaining time of the current action without updating the resource - * + * * @return The remaining time */ double getRemainsNoUpdate(); /** * @brief Get the priority of the current Action - * + * * @return The priority of the current Action */ double getPriority() {return m_priority;}; @@ -626,7 +626,7 @@ public: /** * @brief Get the state set in which the action is * @details [TODO] - * + * * @return The state set in which the action is */ ActionListPtr getStateSet() {return p_stateSet;}; @@ -649,7 +649,7 @@ private: /** * @brief Share the resources to the actions * @details [TODO] - * + * * @param now [TODO] * @return in how much time the next action may terminatedescription] */ @@ -658,7 +658,7 @@ private: /** * @brief Update the current action state * @details [TODO] - * + * * @param now [TODO] * @param delta [TODO] */ @@ -667,7 +667,7 @@ private: /** * @brief Update the [TODO] * @details [TODO] - * + * * @param id [TODO] * @param event_type [TODO] * @param value [TODO] diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index a983231003..72291ae999 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -86,6 +86,7 @@ XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict */ XBT_PUBLIC(void) surfxml_bufferstack_push(int _new); XBT_PUBLIC(void) surfxml_bufferstack_pop(int _new); +XBT_PUBLIC(void) parse_after_config(void); XBT_PUBLIC_DATA(int) surfxml_bufferstack_size; diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index f62f852947..5c6e4509ba 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -401,7 +401,7 @@ void routing_AS_begin(sg_platf_AS_cbarg_t AS) /* add to the father element list */ info->setId(current_routing->parseAS(info)); } else { - THROWF(arg_error, 0, "All defined components must be belong to a AS"); + THROWF(arg_error, 0, "All defined components must belong to a AS"); } xbt_lib_set(as_router_lib, info->getName(), ROUTING_ASR_LEVEL, @@ -1252,7 +1252,7 @@ static void check_disk_attachment() StoragePtr storage = static_cast(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL)); host_elm = sg_routing_edge_by_name_or_null(storage->p_attach); if(!host_elm) - surf_parse_error("Enable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach); + surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach); } } } @@ -1325,6 +1325,32 @@ const char *surf_AS_get_name(AsPtr as) { return as->p_name; } +static AsPtr surf_AS_recursive_get_by_name(AsPtr current, const char * name) { + xbt_dict_cursor_t cursor = NULL; + char *key; + AS_t elem; + AsPtr tmp = NULL; + + if(!strcmp(current->p_name, name)) + return current; + + xbt_dict_foreach(current->p_routingSons, cursor, key, elem) { + tmp = surf_AS_recursive_get_by_name(elem, name); + if(tmp != NULL ) { + break; + } + } + return tmp; +} + + +AsPtr surf_AS_get_by_name(const char * name) { + AsPtr as = surf_AS_recursive_get_by_name(routing_platf->p_root, name); + if(as == NULL) + XBT_WARN("Impossible to find an AS with name %s, please check your input", name); + return as; +} + xbt_dict_t surf_AS_get_routing_sons(AsPtr as) { return as->p_routingSons; } diff --git a/src/surf/surf_routing_cluster_fat_tree.cpp b/src/surf/surf_routing_cluster_fat_tree.cpp new file mode 100644 index 0000000000..1c541d5299 --- /dev/null +++ b/src/surf/surf_routing_cluster_fat_tree.cpp @@ -0,0 +1,368 @@ +#include "surf_routing_cluster_fat_tree.hpp" +#include "xbt/lib.h" + +#include +#include +#include +#include + + + +AsClusterFatTree::AsClusterFatTree() : levels(0) {} + +AsClusterFatTree::~AsClusterFatTree() { + for (unsigned int i = 0 ; i < this->nodes.size() ; i++) { + delete this->nodes[i]; + } +} + +bool AsClusterFatTree::isInSubTree(FatTreeNode *root, FatTreeNode *node) { + for (unsigned int i = 0 ; i < node->level ; i++) { + if(root->label[i] != node->label[i]) { + return false; + } + } + + for (unsigned int i = root->level + 1 ; i < this->levels ; i++) { + if(root->label[i] != node->label[i]) { + return false; + } + } + return true; +} + +void AsClusterFatTree::getRouteAndLatency(RoutingEdgePtr src, + RoutingEdgePtr dst, + sg_platf_route_cbarg_t into, + double *latency) { + FatTreeNode *source, *destination, *currentNode; + std::vector route; + source = this->nodes.find(src->getId())->second; + destination = this->nodes.find(dst->getId())->second; + + int d = 0, k = 0; // as in d-mod-k + + currentNode = source; + + // up part + while (!isInSubTree(currentNode, destination)) { + d = destination->position; + + for (unsigned int i = 0 ; i < currentNode->level ; i++) { + d /= this->upperLevelNodesNumber[i]; + } + k = this->upperLevelNodesNumber[currentNode->level] * + this->lowerLevelNodesNumber[currentNode->level]; + d = d % k; + route.push_back(currentNode->parents[d]->upLink); + if(latency) { + *latency += currentNode->parents[d]->upLink->getLatency(); + } + currentNode = currentNode->parents[d]->upNode; + } + + // Down part + while(currentNode != destination) { + for(unsigned int i = 0 ; i < currentNode->children.size() ; i++) { + if(i % this->lowerLevelNodesNumber[currentNode->level] == + destination->label[currentNode->level]) { + route.push_back(currentNode->children[i]->downLink); + if(latency) { + *latency += currentNode->children[d]->downLink->getLatency(); + } + currentNode = currentNode->children[i]->downNode; + } + } + } + + for (unsigned int i = 0 ; i < route.size() ; i++) { + xbt_dynar_push_as(into->link_list, void*, route[i]); + } + +} + +/* This function makes the assumption that parse_specific_arguments() and + * addNodes() have already been called + */ +void AsClusterFatTree::create_links(sg_platf_cluster_cbarg_t cluster){ + if(this->levels == 0) { + return; + } + this->generateSwitches(); + this->generateLabels(); + unsigned int k = 0; + // Nodes are totally ordered, by level and then by position, in this->nodes + for (unsigned int i = 0 ; i < this->levels ; i++) { + for (unsigned int j = 0 ; j < this->nodesByLevel[i] ; j++) { + if(i != this->levels - 1) { + for(unsigned int l = 0 ; l < this->nodesByLevel[i+1] ; l++) { + this->connectNodeToParents(cluster, this->nodes[k]); + } + } + k++; + } + } +} + +int AsClusterFatTree::connectNodeToParents(sg_platf_cluster_cbarg_t cluster, + FatTreeNode *node) { + FatTreeNode* currentParentNode; + int connectionsNumber = 0; + const int level = node->level; + currentParentNode = this->nodes[this->getLevelPosition(level + 1)]; + for (unsigned int i = 0 ; i < this->nodesByLevel[level] ; i++ ) { + if(this->areRelated(currentParentNode, node)) { + for (unsigned int j = 0 ; j < this->lowerLevelPortsNumber[level + 1] ; j++) { + this->addLink(cluster, currentParentNode, node->label[level + 1] + + j * this->lowerLevelNodesNumber[level + 1], node, + currentParentNode->label[level + 1] + + j * this->upperLevelNodesNumber[level + 1]); + } + connectionsNumber++; + } + } + return connectionsNumber; +} + + +bool AsClusterFatTree::areRelated(FatTreeNode *parent, FatTreeNode *child) { + if (parent->level != child->level + 1) { + return false; + } + + for (unsigned int i = 0 ; i < this->levels; i++) { + if (parent->label[i] != child->label[i] && i != parent->level) { + return false; + } + } + return true; +} + +void AsClusterFatTree::generateSwitches() { + this->nodesByLevel.resize(this->levels, 0); + unsigned int nodesRequired = 0; + + // We take care of the number of nodes by level + this->nodesByLevel[0] = 1; + for (unsigned int i = 0 ; i < this->levels ; i++) { + this->nodesByLevel[0] *= this->lowerLevelNodesNumber[i]; + } + + + if(this->nodesByLevel[0] < this->nodes.size()) { + surf_parse_error("There is not enough nodes to fit to the described topology." + " Please check your platform description (We need %d nodes, we only got %zu)", + this->nodesByLevel[0], this->nodes.size()); + return; + } + + for (unsigned int i = 0 ; i < this->levels ; i++) { + int nodesInThisLevel = 1; + + for (unsigned int j = 0 ; j <= i ; j++) { + nodesInThisLevel *= this->upperLevelNodesNumber[j]; + } + + for (unsigned int j = i+1 ; j < this->levels ; j++) { + nodesInThisLevel *= this->lowerLevelNodesNumber[j]; + } + + this->nodesByLevel[i+1] = nodesInThisLevel; + nodesRequired += nodesInThisLevel; + } + + + // If we have to many compute nodes, we ditch them + if (this->nodesByLevel[0] > this->nodes.size()) { + for (unsigned int i = this->nodesByLevel[0] ; i < this->nodes.size() ; i++) { + delete this->nodes[i]; + } + } + + // We create the switches + int k = 0; + for (unsigned int i = 0 ; i < this->levels ; i++) { + for (unsigned int j = 0 ; j < this->nodesByLevel[i] ; j++) { + FatTreeNode* newNode; + newNode = new FatTreeNode(--k, i + 1, j); + newNode->children.resize(this->lowerLevelNodesNumber[i] * + this->lowerLevelPortsNumber[i]); + if (i != this->levels - 1) { + newNode->parents.resize(this->upperLevelNodesNumber[i + 1]); + } + this->nodes.insert(std::make_pair(k,newNode)); + } + } +} + +void AsClusterFatTree::generateLabels() { + // TODO : check if nodesByLevel and nodes are filled + for (unsigned int i = 0 ; i < this->levels ; i++) { + std::vector maxLabel(this->nodesByLevel[i]); + std::vector currentLabel(this->nodesByLevel[i], 0); + unsigned int k = 0; + for (unsigned int j = 0 ; j < this->nodesByLevel[i] ; j++) { + maxLabel[j] = j > i ? + this->lowerLevelNodesNumber[i] : this->upperLevelNodesNumber[i]; + } + + for (unsigned int j = 0 ; j < this->nodesByLevel[i] ; j++) { + this->nodes[k]->label.assign(currentLabel.begin(), currentLabel.end()); + + int remainder = 0; + + do { + int pos = currentLabel.size() - 1; + remainder = ++currentLabel[pos] / maxLabel[pos]; + currentLabel[pos] = currentLabel[pos] % maxLabel[pos]; + --pos; + } + while(remainder != 0); + k++; + } + } +} + + +int AsClusterFatTree::getLevelPosition(const unsigned int level) { + if (level > this->levels - 1) { + // Well, that should never happen. Maybe should we throw instead. + return -1; + } + int tempPosition = 0; + + for (unsigned int i = 0 ; i < level ; i++) { + tempPosition += this->nodesByLevel[i]; + } + return tempPosition; +} + +void AsClusterFatTree::addComputeNodes(std::vector const& id) { + using std::make_pair; + FatTreeNode* newNode; + for (size_t i = 0 ; i < id.size() ; i++) { + newNode = new FatTreeNode(id[i], 0, i); + newNode->parents.resize(this->upperLevelNodesNumber[0] * this->lowerLevelPortsNumber[i]); + this->nodes.insert(make_pair(id[i],newNode)); + } +} + +void AsClusterFatTree::addLink(sg_platf_cluster_cbarg_t cluster, + FatTreeNode *parent, unsigned int parentPort, + FatTreeNode *child, unsigned int childPort) { + FatTreeLink *newLink; + newLink = new FatTreeLink(cluster, parent, child); + + parent->children[parentPort] = newLink; + child->parents[childPort] = newLink; + + this->links.push_back(newLink); + + + +} + +void AsClusterFatTree::parse_specific_arguments(sg_platf_cluster_cbarg_t + cluster) { + std::vector parameters; + std::vector tmp; + boost::split(parameters, cluster->topo_parameters, boost::is_any_of(";")); + + + // TODO : we have to check for zeros and negative numbers, or it might crash + if (parameters.size() != 4){ + surf_parse_error("Fat trees are defined by the levels number and 3 vectors" + ", see the documentation for more informations"); + // Well, there's no doc, yet + } + + // The first parts of topo_parameters should be the levels number + this->levels = std::atoi(tmp[0].c_str()); // stoi() only in C++11... + + // Then, a l-sized vector standing for the childs number by level + boost::split(tmp, parameters[1], boost::is_any_of(",")); + if(tmp.size() != this->levels) { + surf_parse_error("Fat trees are defined by the levels number and 3 vectors" + ", see the documentation for more informations"); + } + for(size_t i = 0 ; i < tmp.size() ; i++){ + this->lowerLevelNodesNumber.push_back(std::atoi(tmp[i].c_str())); + } + + // Then, a l-sized vector standing for the parents number by level + boost::split(tmp, parameters[2], boost::is_any_of(",")); + if(tmp.size() != this->levels) { + surf_parse_error("Fat trees are defined by the levels number and 3 vectors" + ", see the documentation for more informations"); + } + for(size_t i = 0 ; i < tmp.size() ; i++){ + this->upperLevelNodesNumber.push_back(std::atoi(tmp[i].c_str())); + } + + // Finally, a l-sized vector standing for the ports number with the lower level + boost::split(tmp, parameters[3], boost::is_any_of(",")); + if(tmp.size() != this->levels) { + surf_parse_error("Fat trees are defined by the levels number and 3 vectors" + ", see the documentation for more informations"); + + } + for(size_t i = 0 ; i < tmp.size() ; i++){ + this->lowerLevelPortsNumber.push_back(std::atoi(tmp[i].c_str())); + } +} + + +void AsClusterFatTree::generateDotFile(const string& filename) const { + ofstream file; + /* Maybe should we get directly a char*, as open takes strings only beginning + * with C++11... + */ + file.open(filename.c_str(), ios::out | ios::trunc); + + if(file.is_open()) { + // That could also be greatly clarified with C++11 + std::vector::const_iterator iter; + file << "graph AsClusterFatTree {\n"; + for (iter = this->links.begin() ; iter != this->links.end() ; iter++ ) { + file << (*iter)->downNode->id + << " -- " + << (*iter)->upNode->id + << ";\n"; + } + file << "}"; + file.close(); + } + else { + std::cerr << "Unable to open file " << filename << std::endl; + return; + } +} + +FatTreeNode::FatTreeNode(int id, int level, int position) : id(id), + level(level), + position(position){} + +FatTreeLink::FatTreeLink(sg_platf_cluster_cbarg_t cluster, FatTreeNode *downNode, + FatTreeNode *upNode) : upNode(upNode), + downNode(downNode) { + static int uniqueId = 0; + s_sg_platf_link_cbarg_t linkTemplate; + linkTemplate.bandwidth = cluster->bw; + linkTemplate.latency = cluster->lat; + linkTemplate.state = SURF_RESOURCE_ON; + linkTemplate.policy = cluster->sharing_policy; // Maybe should we do sthg with that ? + + + NetworkLink* link; + linkTemplate.id = bprintf("link_from_%d_to_%d_%d_UP", downNode->id, upNode->id, uniqueId); + sg_platf_new_link(&linkTemplate); + link = (NetworkLink*) xbt_lib_get_or_null(link_lib, linkTemplate.id, SURF_LINK_LEVEL); + this->upLink = link; // check link? + linkTemplate.id = bprintf("link_from_%d_to_%d_%d_DOWN", downNode->id, upNode->id, uniqueId); + sg_platf_new_link(&linkTemplate); + link = (NetworkLink*) xbt_lib_get_or_null(link_lib, linkTemplate.id, SURF_LINK_LEVEL); + this->downLink = link; // check link ? + + uniqueId++; + +} diff --git a/src/surf/surf_routing_cluster_fat_tree.hpp b/src/surf/surf_routing_cluster_fat_tree.hpp new file mode 100644 index 0000000000..edc48f1ab8 --- /dev/null +++ b/src/surf/surf_routing_cluster_fat_tree.hpp @@ -0,0 +1,94 @@ +/* Copyright (c) 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. */ + +#include "surf_routing_cluster.hpp" + +#ifndef SURF_ROUTING_CLUSTER_FAT_TREE_HPP_ +#define SURF_ROUTING_CLUSTER_FAT_TREE_HPP_ + + +/* The class AsClusterFatTree describes PGFT, as introduced by Eitan Zahavi + * in "D-Mod-K Routing Providing Non-Blocking Traffic for Shift Permutations + * on Real Life Fat Trees" (2010). RLFT are PGFT with some restrictions to + * address real world constraints, which are not currently enforced (but it + * should certainly be checked for) + */ + +/* TODO : limiter link ? Loopback? + * + */ +class FatTreeNode; +class FatTreeLink; + + +class FatTreeNode { +public: + int id; + unsigned int level; // The 0th level represents the leafs of the PGFT + unsigned int position; // Position in the level + std::vector label; + /* We can see the sizes sum of the two following vectors as the device + * ports number. If we use the notations used in Zahavi's paper, + * children.size() = m_level and parents.size() = w_(level+1) + * + */ + std::vector children; // m, apply from lvl 0 to levels - 1 + std::vector parents; // w, apply from lvl 1 to levels + FatTreeNode(int id, int level=-1, int position=-1); +}; + +class FatTreeLink { +public: + FatTreeLink(sg_platf_cluster_cbarg_t cluster, FatTreeNode *source, + FatTreeNode *destination); + // unsigned int ports; + /* Links are dependant of the chosen network model, but must implement + * NetworkLink + */ + NetworkLink *upLink; + NetworkLink *downLink; + FatTreeNode *upNode; + FatTreeNode *downNode; + +}; + +class AsClusterFatTree : public AsCluster { +public: + AsClusterFatTree(); + ~AsClusterFatTree(); + virtual void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, + sg_platf_route_cbarg_t into, + double *latency); + // virtual void getRouteAndLatency(const int src, const int dst, + // std::vector *route, + // double *latency) const; + virtual void create_links(sg_platf_cluster_cbarg_t cluster); + void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster); + void addComputeNodes(std::vector const& id); + void generateDotFile(const string& filename = "fatTree.dot") const; + +protected: + //description of a PGFT (TODO : better doc) + unsigned int levels; + std::vector lowerLevelNodesNumber; // number of children by node + std::vector upperLevelNodesNumber; // number of parents by node + std::vector lowerLevelPortsNumber; // ports between each level l and l-1 + + std::map nodes; + std::vector links; + std::vector nodesByLevel; + + void addLink(sg_platf_cluster_cbarg_t cluster, + FatTreeNode *parent, unsigned int parentPort, + FatTreeNode *child, unsigned int childPort); + int getLevelPosition(const unsigned int level); + void generateLabels(); + void generateSwitches(); + int connectNodeToParents(sg_platf_cluster_cbarg_t cluster, FatTreeNode *node); + bool areRelated(FatTreeNode *parent, FatTreeNode *child); + bool isInSubTree(FatTreeNode *root, FatTreeNode *node); +}; +#endif diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index ff091ec252..c0c04767d9 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -298,6 +298,7 @@ static xbt_dynar_t surf_parsed_filename_stack = NULL; void STag_surfxml_include(void) { + parse_after_config(); XBT_DEBUG("STag_surfxml_include '%s'",A_surfxml_include_file); xbt_dynar_push(surf_parsed_filename_stack,&surf_parsed_filename); // save old file name surf_parsed_filename = xbt_strdup(A_surfxml_include_file); @@ -568,15 +569,17 @@ void ETag_surfxml_cluster(void){ cluster.availability_trace = A_surfxml_cluster_availability___file; cluster.state_trace = A_surfxml_cluster_state___file; sg_platf_new_cluster(&cluster); - + current_property_set = NULL; } -void STag_surfxml_cluster(void){ +void STag_surfxml_cluster(void){ + parse_after_config(); xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)"); } void STag_surfxml_cabinet(void){ + parse_after_config(); s_sg_platf_cabinet_cbarg_t cabinet; memset(&cabinet,0,sizeof(cabinet)); cabinet.id = A_surfxml_cabinet_id; @@ -591,6 +594,7 @@ void STag_surfxml_cabinet(void){ } void STag_surfxml_peer(void){ + parse_after_config(); s_sg_platf_peer_cbarg_t peer; memset(&peer,0,sizeof(peer)); peer.id = A_surfxml_peer_id; @@ -832,6 +836,7 @@ void ETag_surfxml_trace(void){ } void STag_surfxml_trace___connect(void){ + parse_after_config(); s_sg_platf_trace_connect_cbarg_t trace_connect; memset(&trace_connect,0,sizeof(trace_connect)); @@ -860,6 +865,7 @@ void STag_surfxml_trace___connect(void){ } void STag_surfxml_AS(void){ + parse_after_config(); AS_TAG = 1; s_sg_platf_AS_cbarg_t AS = SG_PLATF_AS_INITIALIZER; AS.id = A_surfxml_AS_id; @@ -906,6 +912,7 @@ void ETag_surfxml_config(void){ free(cfg); } XBT_DEBUG("End configuration name = %s",A_surfxml_config_id); + xbt_dict_free(¤t_property_set); current_property_set = NULL; } @@ -982,7 +989,7 @@ void ETag_surfxml_prop(void){} void STag_surfxml_random(void){} void ETag_surfxml_random(void){} void ETag_surfxml_trace___connect(void){} -void STag_surfxml_trace(void){} +void STag_surfxml_trace(void){parse_after_config();} void ETag_surfxml_router(void){} void ETag_surfxml_host___link(void){} void ETag_surfxml_cabinet(void){} diff --git a/src/surf/surfxml_parseplatf.c b/src/surf/surfxml_parseplatf.c index 2c93389049..f8130cbecc 100644 --- a/src/surf/surfxml_parseplatf.c +++ b/src/surf/surfxml_parseplatf.c @@ -69,6 +69,25 @@ XBT_PUBLIC(void) gpu_register_callbacks(void){ } /* ***************************************** */ +static int after_config_done; +void parse_after_config() { + if (!after_config_done) { + // + #ifdef HAVE_TRACING + TRACE_start(); + #endif + + /* Register classical callbacks */ + storage_register_callbacks(); + routing_register_callbacks(); + + /* ***************************************** */ + /* TUTORIAL: New TAG */ + gpu_register_callbacks(); + /* ***************************************** */ + after_config_done = 1; + } +} /* This function acts as a main in the parsing area. */ void parse_platform_file(const char *file) @@ -77,19 +96,10 @@ void parse_platform_file(const char *file) surf_parse_init_callbacks(); - /* Register classical callbacks */ - storage_register_callbacks(); - routing_register_callbacks(); - - /* ***************************************** */ - /* TUTORIAL: New TAG */ - gpu_register_callbacks(); - /* ***************************************** */ - /* init the flex parser */ surfxml_buffer_stack_stack_ptr = 1; surfxml_buffer_stack_stack[0] = 0; - + after_config_done = 0; surf_parse_open(file); /* Init my data */ diff --git a/src/surf/trace_mgr.c b/src/surf/trace_mgr.c index 8f44eaa95d..2f0478fe18 100644 --- a/src/surf/trace_mgr.c +++ b/src/surf/trace_mgr.c @@ -339,8 +339,9 @@ tmgr_trace_t tmgr_trace_new_from_file(const char *filename) } f = surf_fopen(filename, "r"); - xbt_assert(f != NULL, "Cannot open file '%s' (path=%s)", filename, - xbt_str_join(surf_path, ":")); + if (f == NULL) + xbt_die("Cannot open file '%s' (path=%s)", filename, + xbt_str_join(surf_path, ":")); tstr = xbt_str_from_file(f); fclose(f); diff --git a/src/surf/workstation_interface.cpp b/src/surf/workstation_interface.cpp index f37bff3ae6..70f949c12b 100644 --- a/src/surf/workstation_interface.cpp +++ b/src/surf/workstation_interface.cpp @@ -268,7 +268,7 @@ ActionPtr Workstation::write(surf_file_t fd, sg_size_t size) { int Workstation::unlink(surf_file_t fd) { if (!fd){ XBT_WARN("No such file descriptor. Impossible to unlink"); - return MSG_TASK_CANCELED; + return -1; } else { StoragePtr st = findStorageOnMountList(fd->mount); @@ -276,7 +276,7 @@ int Workstation::unlink(surf_file_t fd) { if (!xbt_dict_get_or_null(st->p_content, fd->name)){ XBT_WARN("File %s is not on disk %s. Impossible to unlink", fd->name, st->getName()); - return MSG_TASK_CANCELED; + return -1; } else { XBT_DEBUG("UNLINK on disk '%s'",st->getName()); st->m_usedSize -= fd->size; @@ -287,7 +287,7 @@ int Workstation::unlink(surf_file_t fd) { xbt_free(fd->name); xbt_free(fd->mount); xbt_free(fd); - return MSG_OK; + return 0; } } } @@ -319,63 +319,49 @@ int Workstation::fileSeek(surf_file_t fd, sg_size_t offset, int origin){ switch (origin) { case SEEK_SET: - fd->current_position = 0; - return MSG_OK; + fd->current_position = offset; + return 0; case SEEK_CUR: - if(offset > fd->size) - offset = fd->size; - fd->current_position = offset; - return MSG_OK; + fd->current_position += offset; + return 0; case SEEK_END: - fd->current_position = fd->size; - return MSG_OK; + fd->current_position = fd->size + offset; + return 0; default: - return MSG_TASK_CANCELED; + return -1; } } int Workstation::fileMove(surf_file_t fd, const char* fullpath){ - /* Check if the new full path is on the same mount point */ - if(!strncmp((const char*)fd->mount, fullpath, strlen(fd->mount))) - { + if(!strncmp((const char*)fd->mount, fullpath, strlen(fd->mount))) { sg_size_t *psize, *new_psize; - psize = (sg_size_t*) xbt_dict_get_or_null(findStorageOnMountList(fd->mount)->p_content,fd->name); + psize = (sg_size_t*) + xbt_dict_get_or_null(findStorageOnMountList(fd->mount)->p_content, + fd->name); new_psize = xbt_new(sg_size_t, 1); *new_psize = *psize; if (psize){// src file exists - xbt_dict_remove(findStorageOnMountList(fd->mount)->p_content, fd->name); - - char *path = (char *) xbt_malloc ((strlen(fullpath)-strlen(fd->mount)+1));; - strncpy(path, fullpath+strlen(fd->mount), strlen(fullpath)-strlen(fd->mount)+1); - xbt_dict_set(findStorageOnMountList(fd->mount)->p_content, path, new_psize,NULL); - XBT_DEBUG("Move file from %s to %s, size '%llu'",fd->name, fullpath, *psize); - free(path); - return MSG_OK; - } - else - XBT_WARN("File %s doesn't exist", fd->name); - return MSG_TASK_CANCELED; + xbt_dict_remove(findStorageOnMountList(fd->mount)->p_content, fd->name); + char *path = (char *) xbt_malloc ((strlen(fullpath)-strlen(fd->mount)+1));; + strncpy(path, fullpath+strlen(fd->mount), + strlen(fullpath)-strlen(fd->mount)+1); + xbt_dict_set(findStorageOnMountList(fd->mount)->p_content, path, + new_psize,NULL); + XBT_DEBUG("Move file from %s to %s, size '%llu'",fd->name, fullpath, *psize); + free(path); + return 0; + } else { + XBT_WARN("File %s doesn't exist", fd->name); + return -1; } - else - { - XBT_WARN("New full path %s is not on the same mount point: %s. Action has been canceled.", fullpath, fd->mount); - return MSG_TASK_CANCELED; + } else { + XBT_WARN("New full path %s is not on the same mount point: %s. Action has been canceled.", + fullpath, fd->mount); + return -1; } } -sg_size_t Workstation::getFreeSize(const char* name) -{ - StoragePtr st = findStorageOnMountList(name); - return st->m_size - st->m_usedSize; -} - -sg_size_t Workstation::getUsedSize(const char* name) -{ - StoragePtr st = findStorageOnMountList(name); - return st->m_usedSize; -} - xbt_dynar_t Workstation::getVms() { xbt_dynar_t dyn = xbt_dynar_new(sizeof(smx_host_t), NULL); diff --git a/src/surf/workstation_interface.hpp b/src/surf/workstation_interface.hpp index 1be3e4af69..0d50aff434 100644 --- a/src/surf/workstation_interface.hpp +++ b/src/surf/workstation_interface.hpp @@ -330,23 +330,7 @@ public: virtual sg_size_t fileTell(surf_file_t fd); /** - * @brief Get the available space of the storage at the mount point - * - * @param name The mount point - * @return The amount of availble space in bytes - */ - virtual sg_size_t getFreeSize(const char* name); - - /** - * @brief Get the used space of the storage at the mount point - * - * @param name The mount point - * @return The amount of used space in bytes - */ - virtual sg_size_t getUsedSize(const char* name); - - /** - * @brief Set the position indictator assiociated with the file descriptor to a new position + * @brief Set the position indicator associated with the file descriptor to a new position * @details [long description] * * @param fd The file descriptor diff --git a/src/surf/workstation_ptask_L07.cpp b/src/surf/workstation_ptask_L07.cpp index d964ddf188..30e25d4f2c 100644 --- a/src/surf/workstation_ptask_L07.cpp +++ b/src/surf/workstation_ptask_L07.cpp @@ -287,19 +287,22 @@ xbt_dynar_t WorkstationL07Model::getRoute(WorkstationPtr src, WorkstationPtr dst return route; } -ResourcePtr CpuL07Model::createResource(const char *name, double power_scale, - double power_initial, - tmgr_trace_t power_trace, - e_surf_resource_state_t state_initial, - tmgr_trace_t state_trace, - xbt_dict_t cpu_properties) +CpuPtr CpuL07Model::createResource(const char *name, xbt_dynar_t powerPeak, + int pstate, double power_scale, + tmgr_trace_t power_trace, int core, + e_surf_resource_state_t state_initial, + tmgr_trace_t state_trace, + xbt_dict_t cpu_properties) { + double power_initial = xbt_dynar_get_as(powerPeak, pstate, double); + xbt_assert(!surf_workstation_resource_priv(surf_workstation_resource_by_name(name)), "Host '%s' declared several times in the platform file.", name); CpuL07Ptr cpu = new CpuL07(this, name, cpu_properties, - power_scale, power_initial, power_trace,state_initial, state_trace); + power_initial, power_scale, power_trace, + core, state_initial, state_trace); xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, static_cast(cpu)); @@ -357,7 +360,7 @@ void WorkstationL07Model::addTraces() xbt_assert(host, "Host %s undefined", elm); xbt_assert(trace, "Trace %s undefined", trace_name); - host->p_power.event = tmgr_history_add_trace(history, trace, 0.0, 0, static_cast(host)); + host->p_powerEvent = tmgr_history_add_trace(history, trace, 0.0, 0, static_cast(host)); } /* Connect traces relative to network */ @@ -425,21 +428,18 @@ double WorkstationL07::getConsumedEnergy() } CpuL07::CpuL07(CpuL07ModelPtr model, const char* name, xbt_dict_t props, - double power_scale, - double power_initial, tmgr_trace_t power_trace, - e_surf_resource_state_t state_initial, tmgr_trace_t state_trace) + double power_initial, double power_scale, tmgr_trace_t power_trace, + int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace) : Cpu(model, name, props, lmm_constraint_new(ptask_maxmin_system, this, power_initial * power_scale), - 1, 0, 0) + core, power_initial, power_scale) { - p_power.scale = power_scale; - xbt_assert(p_power.scale > 0, "Power has to be >0"); + xbt_assert(m_powerScale > 0, "Power has to be >0"); - m_powerCurrent = power_initial; if (power_trace) - p_power.event = tmgr_history_add_trace(history, power_trace, 0.0, 0, + p_powerEvent = tmgr_history_add_trace(history, power_trace, 0.0, 0, static_cast(this)); else - p_power.event = NULL; + p_powerEvent = NULL; setState(state_initial); if (state_trace) @@ -480,11 +480,11 @@ bool LinkL07::isUsed(){ void CpuL07::updateState(tmgr_trace_event_t event_type, double value, double /*date*/){ XBT_DEBUG("Updating cpu %s (%p) with value %g", getName(), this, value); - if (event_type == p_power.event) { - m_powerCurrent = value; - lmm_update_constraint_bound(ptask_maxmin_system, getConstraint(), m_powerCurrent * p_power.scale); + if (event_type == p_powerEvent) { + m_powerScale = value; + lmm_update_constraint_bound(ptask_maxmin_system, getConstraint(), m_powerPeak * m_powerScale); if (tmgr_trace_event_free(event_type)) - p_power.event = NULL; + p_powerEvent = NULL; } else if (event_type == p_stateEvent) { if (value > 0) setState(SURF_RESOURCE_ON); @@ -528,16 +528,6 @@ e_surf_resource_state_t WorkstationL07::getState() return p_cpu->getState(); } -double CpuL07::getSpeed(double load) -{ - return load * p_power.scale; -} - -double CpuL07::getAvailableSpeed() -{ - return m_powerCurrent; -} - ActionPtr WorkstationL07::execute(double size) { void **workstation_list = xbt_new0(void *, 1); @@ -749,21 +739,6 @@ static void ptask_parse_workstation_init(sg_platf_host_cbarg_t host) host->properties); } -static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host) -{ - double power_peak = xbt_dynar_get_as(host->power_peak, host->pstate, double); - static_cast(surf_cpu_model_pm)->createResource( - host->id, - power_peak, - host->power_scale, - host->power_trace, - host->initial_state, - host->state_trace, - host->properties); -} - - - static void ptask_parse_link_init(sg_platf_link_cbarg_t link) { if (link->policy == SURF_LINK_FULLDUPLEX) { @@ -813,7 +788,7 @@ static void ptask_add_traces(){ static void ptask_define_callbacks() { - sg_platf_host_add_cb(ptask_parse_cpu_init); + sg_platf_host_add_cb(parse_cpu_init); sg_platf_host_add_cb(ptask_parse_workstation_init); sg_platf_link_add_cb(ptask_parse_link_init); sg_platf_postparse_add_cb(ptask_add_traces); diff --git a/src/surf/workstation_ptask_L07.hpp b/src/surf/workstation_ptask_L07.hpp index 9bcac9fe0f..7dd269137c 100644 --- a/src/surf/workstation_ptask_L07.hpp +++ b/src/surf/workstation_ptask_L07.hpp @@ -75,6 +75,12 @@ public: e_surf_resource_state_t state_initial, tmgr_trace_t state_trace, xbt_dict_t cpu_properties); + CpuPtr createResource(const char *name, xbt_dynar_t powerPeak, + int pstate, double power_scale, + tmgr_trace_t power_trace, int core, + e_surf_resource_state_t state_initial, + tmgr_trace_t state_trace, + xbt_dict_t cpu_properties); void addTraces() {DIE_IMPOSSIBLE;}; WorkstationL07ModelPtr p_workstationModel; @@ -120,20 +126,16 @@ public: }; class CpuL07 : public Cpu { -public: - s_surf_metric_t p_power; + friend void WorkstationL07Model::addTraces(); tmgr_trace_event_t p_stateEvent; - + tmgr_trace_event_t p_powerEvent; public: CpuL07(CpuL07ModelPtr model, const char* name, xbt_dict_t properties, - double power_scale, - double power_initial, tmgr_trace_t power_trace, - e_surf_resource_state_t state_initial, tmgr_trace_t state_trace); + double power_scale, double power_initial, tmgr_trace_t power_trace, + int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace); bool isUsed(); //bool isUsed() {DIE_IMPOSSIBLE;}; void updateState(tmgr_trace_event_t event_type, double value, double date); - double getSpeed(double load); - double getAvailableSpeed(); CpuActionPtr execute(double /*size*/) {DIE_IMPOSSIBLE;}; CpuActionPtr sleep(double /*duration*/) {DIE_IMPOSSIBLE;}; @@ -142,8 +144,6 @@ public: int getNbPstates() {THROW_UNIMPLEMENTED;}; void setPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;}; double getConsumedEnergy() {THROW_UNIMPLEMENTED;}; - - double m_powerCurrent; }; class LinkL07 : public NetworkLink { diff --git a/src/xbt/automaton/automaton_lexer.yy.c b/src/xbt/automaton/automaton_lexer.yy.c index 9a91800cdd..d6e56e4ced 100644 --- a/src/xbt/automaton/automaton_lexer.yy.c +++ b/src/xbt/automaton/automaton_lexer.yy.c @@ -28,7 +28,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -181,7 +181,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int xbt_automaton_parser_leng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t xbt_automaton_parser_leng; extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out; @@ -190,6 +195,7 @@ extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -207,11 +213,6 @@ extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -229,7 +230,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -299,8 +300,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when xbt_automaton_parser_text is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int xbt_automaton_parser_leng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t xbt_automaton_parser_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -328,7 +329,7 @@ static void xbt_automaton_parser__init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char *bytes,yy_size_t len ); void *xbt_automaton_parser_alloc (yy_size_t ); void *xbt_automaton_parser_realloc (void *,yy_size_t ); @@ -360,7 +361,7 @@ void xbt_automaton_parser_free (void * ); /* Begin user sect3 */ -#define xbt_automaton_parser_wrap(n) 1 +#define xbt_automaton_parser_wrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -533,7 +534,7 @@ char *xbt_automaton_parser_text; extern YYSTYPE yylval; -#line 537 "automaton_lexer.yy.c" +#line 538 "automaton_lexer.yy.c" #define INITIAL 0 @@ -572,7 +573,7 @@ FILE *xbt_automaton_parser_get_out (void ); void xbt_automaton_parser_set_out (FILE * out_str ); -int xbt_automaton_parser_get_leng (void ); +yy_size_t xbt_automaton_parser_get_leng (void ); char *xbt_automaton_parser_get_text (void ); @@ -720,11 +721,6 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 34 "parserPromela.lex" - - -#line 727 "automaton_lexer.yy.c" - if ( !(yy_init) ) { (yy_init) = 1; @@ -751,6 +747,12 @@ YY_DECL xbt_automaton_parser__load_buffer_state( ); } + { +#line 34 "parserPromela.lex" + + +#line 755 "automaton_lexer.yy.c" + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -767,7 +769,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -940,7 +942,7 @@ YY_RULE_SETUP #line 77 "parserPromela.lex" ECHO; YY_BREAK -#line 944 "automaton_lexer.yy.c" +#line 946 "automaton_lexer.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1071,6 +1073,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of xbt_automaton_parser_lex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1126,21 +1129,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1171,7 +1174,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1266,7 +1269,7 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 53); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) @@ -1281,7 +1284,7 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; + register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = @@ -1330,7 +1333,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1490,10 +1493,6 @@ static void xbt_automaton_parser__load_buffer_state (void) xbt_automaton_parser_free((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a xbt_automaton_parser_restart() or at EOF. @@ -1606,7 +1605,7 @@ void xbt_automaton_parser_pop_buffer_state (void) */ static void xbt_automaton_parser_ensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -1703,12 +1702,12 @@ YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -1790,7 +1789,7 @@ FILE *xbt_automaton_parser_get_out (void) /** Get the length of the current token. * */ -int xbt_automaton_parser_get_leng (void) +yy_size_t xbt_automaton_parser_get_leng (void) { return xbt_automaton_parser_leng; } diff --git a/src/xbt/automaton/parserPromela.tab.cacc b/src/xbt/automaton/parserPromela.tab.cacc index a0cf8ed065..898e1e4bf4 100644 --- a/src/xbt/automaton/parserPromela.tab.cacc +++ b/src/xbt/automaton/parserPromela.tab.cacc @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -58,23 +58,19 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse xbt_automaton_parser_parse #define yylex xbt_automaton_parser_lex #define yyerror xbt_automaton_parser_error -#define yylval xbt_automaton_parser_lval -#define yychar xbt_automaton_parser_char #define yydebug xbt_automaton_parser_debug #define yynerrs xbt_automaton_parser_nerrs +#define yylval xbt_automaton_parser_lval +#define yychar xbt_automaton_parser_char /* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ -#line 7 "parserPromela.yacc" +#line 7 "parserPromela.yacc" /* yacc.c:339 */ #include "automaton_lexer.yy.c" @@ -83,14 +79,15 @@ void yyerror(const char *s); +#line 83 "parserPromela.tab.cacc" /* yacc.c:339 */ -/* Line 268 of yacc.c */ -#line 89 "parserPromela.tab.cacc" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -100,71 +97,74 @@ void yyerror(const char *s); # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "parserPromela.tab.hacc". */ +#ifndef YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED +# define YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int xbt_automaton_parser_debug; #endif - -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NEVER = 258, - IF = 259, - FI = 260, - IMPLIES = 261, - GOTO = 262, - AND = 263, - OR = 264, - NOT = 265, - LEFT_PAR = 266, - RIGHT_PAR = 267, - CASE = 268, - COLON = 269, - SEMI_COLON = 270, - CASE_TRUE = 271, - LEFT_BRACE = 272, - RIGHT_BRACE = 273, - LITT_ENT = 274, - LITT_CHAINE = 275, - LITT_REEL = 276, - ID = 277 - }; + enum yytokentype + { + NEVER = 258, + IF = 259, + FI = 260, + IMPLIES = 261, + GOTO = 262, + AND = 263, + OR = 264, + NOT = 265, + LEFT_PAR = 266, + RIGHT_PAR = 267, + CASE = 268, + COLON = 269, + SEMI_COLON = 270, + CASE_TRUE = 271, + LEFT_BRACE = 272, + RIGHT_BRACE = 273, + LITT_ENT = 274, + LITT_CHAINE = 275, + LITT_REEL = 276, + ID = 277 + }; #endif - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 293 of yacc.c */ -#line 16 "parserPromela.yacc" +#line 16 "parserPromela.yacc" /* yacc.c:355 */ double real; int integer; char* string; xbt_automaton_exp_label_t label; - - -/* Line 293 of yacc.c */ -#line 156 "parserPromela.tab.cacc" -} YYSTYPE; +#line 153 "parserPromela.tab.cacc" /* yacc.c:355 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif -/* Copy the second part of user declarations. */ +extern YYSTYPE xbt_automaton_parser_lval; +int xbt_automaton_parser_parse (void); + +#endif /* !YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED */ + +/* Copy the second part of user declarations. */ -/* Line 343 of yacc.c */ -#line 168 "parserPromela.tab.cacc" +#line 168 "parserPromela.tab.cacc" /* yacc.c:358 */ #ifdef short # undef short @@ -178,11 +178,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -202,8 +199,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -217,39 +213,68 @@ typedef short int yytype_int16; # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -267,9 +292,9 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -279,8 +304,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -296,7 +321,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -304,15 +329,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -322,7 +345,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -347,35 +370,35 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do +/* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -391,17 +414,19 @@ union yyalloc #define YYNNTS 6 /* YYNRULES -- Number of rules. */ #define YYNRULES 13 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 32 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 277 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -435,25 +460,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 8, 9, 10, 19, 20, 27, 31, - 35, 39, 42, 44 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 24, 0, -1, 3, 17, 25, 18, -1, -1, -1, - 22, 14, 26, 4, 27, 5, 15, 25, -1, -1, - 13, 28, 6, 7, 22, 27, -1, 11, 28, 12, - -1, 28, 9, 28, -1, 28, 8, 28, -1, 10, - 28, -1, 16, -1, 22, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 53, 53, 56, 57, 57, 60, 61, 64, 65, @@ -461,7 +468,7 @@ static const yytype_uint8 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -470,13 +477,13 @@ static const char *const yytname[] = "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE", "COLON", "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE", "LITT_ENT", "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton", "stateseq", - "$@1", "option", "exp", 0 + "$@1", "option", "exp", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -485,23 +492,29 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 23, 24, 25, 26, 25, 27, 27, 28, 28, - 28, 28, 28, 28 -}; +#define YYPACT_NINF -16 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-16))) + +#define YYTABLE_NINF -1 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int8 yypact[] = { - 0, 2, 4, 0, 0, 8, 0, 6, 3, 3, - 3, 2, 1, 1 + 0, -15, 10, -13, -16, 2, 1, -16, -16, 16, + 8, -10, 17, -10, -10, -16, -16, 9, 11, -16, + -1, 18, -10, -10, -13, -16, 5, -16, -16, -16, + 8, -16 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 0, 0, 3, 1, 0, 0, 4, 2, 0, @@ -510,33 +523,21 @@ static const yytype_uint8 yydefact[] = 6, 7 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 2, 6, 9, 12, 17 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -16 -static const yytype_int8 yypact[] = + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = { - 0, -15, 10, -13, -16, 2, 1, -16, -16, 16, - 8, -10, 17, -10, -10, -16, -16, 9, 11, -16, - -1, 18, -10, -10, -13, -16, 5, -16, -16, -16, - 8, -16 + -16, -16, 4, -16, -7, -9 }; -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = { - -16, -16, 4, -16, -7, -9 + -1, 2, 6, 9, 12, 17 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 13, 14, 3, 1, 19, 20, 15, 22, 23, 5, @@ -544,12 +545,6 @@ static const yytype_uint8 yytable[] = 10, 11, 18, 31, 0, 26, 24, 30, 29 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-16)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int8 yycheck[] = { 10, 11, 17, 3, 13, 14, 16, 8, 9, 22, @@ -557,8 +552,8 @@ static const yytype_int8 yycheck[] = 4, 13, 5, 30, -1, 7, 15, 22, 24 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 3, 24, 17, 0, 22, 25, 14, 18, 26, @@ -567,94 +562,55 @@ static const yytype_uint8 yystos[] = 22, 27 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 23, 24, 25, 26, 25, 27, 27, 28, 28, + 28, 28, 28, 28 +}; -#define YYRECOVERING() (!!yyerrstatus) + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 4, 0, 0, 8, 0, 6, 3, 3, + 3, 2, 1, 1 +}; -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 -/* This macro is provided for backward compatibility. */ +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -664,54 +620,46 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { + FILE *yyo = yyoutput; + YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -719,22 +667,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -745,16 +682,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -765,49 +694,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -821,7 +743,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -844,15 +766,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -868,16 +783,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -907,27 +814,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -950,12 +857,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = 0; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -963,10 +869,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1015,11 +917,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, break; } yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } } } } @@ -1039,10 +943,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, # undef YYCASE_ } - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } if (*yymsg_alloc < yysize) { @@ -1079,48 +985,20 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif { YYUSE (yyvaluep); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ @@ -1128,7 +1006,6 @@ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; - /* Number of syntax errors so far. */ int yynerrs; @@ -1137,37 +1014,18 @@ int yynerrs; | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (void) -#else -int -yyparse () - -#endif -#endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1185,7 +1043,7 @@ yyparse () int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -1203,9 +1061,8 @@ yyparse () Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1214,14 +1071,6 @@ yyparse () yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -1242,23 +1091,23 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1266,22 +1115,22 @@ yyparse () # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1290,10 +1139,10 @@ yyparse () yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1322,7 +1171,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (); } if (yychar <= YYEOF) @@ -1362,7 +1211,9 @@ yybackup: yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -1385,7 +1236,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1399,65 +1250,55 @@ yyreduce: switch (yyn) { case 4: - -/* Line 1806 of yacc.c */ -#line 57 "parserPromela.yacc" - { new_state((yyvsp[(1) - (2)].string), 1);} +#line 57 "parserPromela.yacc" /* yacc.c:1646 */ + { new_state((yyvsp[-1].string), 1);} +#line 1256 "parserPromela.tab.cacc" /* yacc.c:1646 */ break; case 7: - -/* Line 1806 of yacc.c */ -#line 61 "parserPromela.yacc" - { new_transition((yyvsp[(5) - (6)].string), (yyvsp[(2) - (6)].label));} +#line 61 "parserPromela.yacc" /* yacc.c:1646 */ + { new_transition((yyvsp[-1].string), (yyvsp[-4].label));} +#line 1262 "parserPromela.tab.cacc" /* yacc.c:1646 */ break; case 8: - -/* Line 1806 of yacc.c */ -#line 64 "parserPromela.yacc" - { (yyval.label) = (yyvsp[(2) - (3)].label); } +#line 64 "parserPromela.yacc" /* yacc.c:1646 */ + { (yyval.label) = (yyvsp[-1].label); } +#line 1268 "parserPromela.tab.cacc" /* yacc.c:1646 */ break; case 9: - -/* Line 1806 of yacc.c */ -#line 65 "parserPromela.yacc" - { (yyval.label) = new_label(0, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); } +#line 65 "parserPromela.yacc" /* yacc.c:1646 */ + { (yyval.label) = new_label(0, (yyvsp[-2].label), (yyvsp[0].label)); } +#line 1274 "parserPromela.tab.cacc" /* yacc.c:1646 */ break; case 10: - -/* Line 1806 of yacc.c */ -#line 66 "parserPromela.yacc" - { (yyval.label) = new_label(1, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); } +#line 66 "parserPromela.yacc" /* yacc.c:1646 */ + { (yyval.label) = new_label(1, (yyvsp[-2].label), (yyvsp[0].label)); } +#line 1280 "parserPromela.tab.cacc" /* yacc.c:1646 */ break; case 11: - -/* Line 1806 of yacc.c */ -#line 67 "parserPromela.yacc" - { (yyval.label) = new_label(2, (yyvsp[(2) - (2)].label)); } +#line 67 "parserPromela.yacc" /* yacc.c:1646 */ + { (yyval.label) = new_label(2, (yyvsp[0].label)); } +#line 1286 "parserPromela.tab.cacc" /* yacc.c:1646 */ break; case 12: - -/* Line 1806 of yacc.c */ -#line 68 "parserPromela.yacc" +#line 68 "parserPromela.yacc" /* yacc.c:1646 */ { (yyval.label) = new_label(4); } +#line 1292 "parserPromela.tab.cacc" /* yacc.c:1646 */ break; case 13: - -/* Line 1806 of yacc.c */ -#line 69 "parserPromela.yacc" - { (yyval.label) = new_label(3, (yyvsp[(1) - (1)].string)); } +#line 69 "parserPromela.yacc" /* yacc.c:1646 */ + { (yyval.label) = new_label(3, (yyvsp[0].string)); } +#line 1298 "parserPromela.tab.cacc" /* yacc.c:1646 */ break; - -/* Line 1806 of yacc.c */ -#line 1461 "parserPromela.tab.cacc" +#line 1302 "parserPromela.tab.cacc" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1479,7 +1320,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -1494,9 +1335,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -1547,20 +1388,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -1579,7 +1420,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -1592,35 +1433,37 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -1644,7 +1487,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -1663,14 +1506,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -1681,14 +1524,9 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - - -/* Line 2067 of yacc.c */ -#line 72 "parserPromela.yacc" +#line 72 "parserPromela.yacc" /* yacc.c:1906 */ @@ -1699,4 +1537,3 @@ void yyerror(const char *s){ - diff --git a/src/xbt/automaton/parserPromela.tab.hacc b/src/xbt/automaton/parserPromela.tab.hacc index 27ae7bf0cc..587506e790 100644 --- a/src/xbt/automaton/parserPromela.tab.hacc +++ b/src/xbt/automaton/parserPromela.tab.hacc @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,64 +26,69 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +#ifndef YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED +# define YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int xbt_automaton_parser_debug; +#endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NEVER = 258, - IF = 259, - FI = 260, - IMPLIES = 261, - GOTO = 262, - AND = 263, - OR = 264, - NOT = 265, - LEFT_PAR = 266, - RIGHT_PAR = 267, - CASE = 268, - COLON = 269, - SEMI_COLON = 270, - CASE_TRUE = 271, - LEFT_BRACE = 272, - RIGHT_BRACE = 273, - LITT_ENT = 274, - LITT_CHAINE = 275, - LITT_REEL = 276, - ID = 277 - }; + enum yytokentype + { + NEVER = 258, + IF = 259, + FI = 260, + IMPLIES = 261, + GOTO = 262, + AND = 263, + OR = 264, + NOT = 265, + LEFT_PAR = 266, + RIGHT_PAR = 267, + CASE = 268, + COLON = 269, + SEMI_COLON = 270, + CASE_TRUE = 271, + LEFT_BRACE = 272, + RIGHT_BRACE = 273, + LITT_ENT = 274, + LITT_CHAINE = 275, + LITT_REEL = 276, + ID = 277 + }; #endif - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 2068 of yacc.c */ -#line 16 "parserPromela.yacc" +#line 16 "parserPromela.yacc" /* yacc.c:1909 */ double real; int integer; char* string; xbt_automaton_exp_label_t label; - - -/* Line 2068 of yacc.c */ -#line 81 "parserPromela.tab.hacc" -} YYSTYPE; +#line 84 "parserPromela.tab.hacc" /* yacc.c:1909 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE xbt_automaton_parser_lval; +int xbt_automaton_parser_parse (void); +#endif /* !YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED */ diff --git a/src/xbt/graphxml.c b/src/xbt/graphxml.c index 0f5a9e4ce3..d855f6556b 100644 --- a/src/xbt/graphxml.c +++ b/src/xbt/graphxml.c @@ -27,7 +27,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -180,7 +180,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int xbt_graph_parse_leng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t xbt_graph_parse_leng; extern FILE *xbt_graph_parse_in, *xbt_graph_parse_out; @@ -202,6 +207,13 @@ extern FILE *xbt_graph_parse_in, *xbt_graph_parse_out; if ( xbt_graph_parse_text[yyl] == '\n' )\ --xbt_graph_parse_lineno;\ }while(0) + #define YY_LINENO_REWIND_TO(dst) \ + do {\ + const char *p;\ + for ( p = yy_cp-1; p >= (dst); --p)\ + if ( *p == '\n' )\ + --xbt_graph_parse_lineno;\ + }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -219,11 +231,6 @@ extern FILE *xbt_graph_parse_in, *xbt_graph_parse_out; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -241,7 +248,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -311,8 +318,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when xbt_graph_parse_text is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int xbt_graph_parse_leng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t xbt_graph_parse_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -340,7 +347,7 @@ static void xbt_graph_parse__init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE xbt_graph_parse__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE xbt_graph_parse__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char *bytes,yy_size_t len ); void *xbt_graph_parse_alloc (yy_size_t ); void *xbt_graph_parse_realloc (void *,yy_size_t ); @@ -372,7 +379,7 @@ void xbt_graph_parse_free (void * ); /* Begin user sect3 */ -#define xbt_graph_parse_wrap(n) 1 +#define xbt_graph_parse_wrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -474,8 +481,8 @@ static yyconst flex_int16_t yy_accept[564] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 14, - 0, 15, 0 + 0, 0, 0, 0, 0, 0, 15, 0, 0, 13, + 0, 14, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -1135,39 +1142,39 @@ const char graphxml_flexml_version[] = "1.9.6"; int graphxml_pcdata_ix; extern char *graphxml_bufferstack; #define graphxml_pcdata (graphxml_bufferstack + graphxml_pcdata_ix) -AT_graphxml_node_name AX_graphxml_node_name; -#define A_graphxml_node_name (graphxml_bufferstack + AX_graphxml_node_name) -short int graphxml_node_name_isset; +AT_graphxml_node_label AX_graphxml_node_label; +#define A_graphxml_node_label (graphxml_bufferstack + AX_graphxml_node_label) +short int graphxml_node_label_isset; +AT_graphxml_edge_length AX_graphxml_edge_length; +#define A_graphxml_edge_length (graphxml_bufferstack + AX_graphxml_edge_length) +short int graphxml_edge_length_isset; AT_graphxml_edge_source AX_graphxml_edge_source; #define A_graphxml_edge_source (graphxml_bufferstack + AX_graphxml_edge_source) short int graphxml_edge_source_isset; AT_graphxml_node_position___y AX_graphxml_node_position___y; #define A_graphxml_node_position___y (graphxml_bufferstack + AX_graphxml_node_position___y) short int graphxml_node_position___y_isset; -AT_graphxml_node_position___x AX_graphxml_node_position___x; -#define A_graphxml_node_position___x (graphxml_bufferstack + AX_graphxml_node_position___x) -short int graphxml_node_position___x_isset; -AT_graphxml_edge_data AX_graphxml_edge_data; -#define A_graphxml_edge_data (graphxml_bufferstack + AX_graphxml_edge_data) -short int graphxml_edge_data_isset; AT_graphxml_edge_target AX_graphxml_edge_target; #define A_graphxml_edge_target (graphxml_bufferstack + AX_graphxml_edge_target) short int graphxml_edge_target_isset; -AT_graphxml_graph_isDirected AX_graphxml_graph_isDirected; -#define A_graphxml_graph_isDirected AX_graphxml_graph_isDirected -short int graphxml_graph_isDirected_isset; -AT_graphxml_node_label AX_graphxml_node_label; -#define A_graphxml_node_label (graphxml_bufferstack + AX_graphxml_node_label) -short int graphxml_node_label_isset; AT_graphxml_node_data AX_graphxml_node_data; #define A_graphxml_node_data (graphxml_bufferstack + AX_graphxml_node_data) short int graphxml_node_data_isset; +AT_graphxml_node_name AX_graphxml_node_name; +#define A_graphxml_node_name (graphxml_bufferstack + AX_graphxml_node_name) +short int graphxml_node_name_isset; +AT_graphxml_edge_data AX_graphxml_edge_data; +#define A_graphxml_edge_data (graphxml_bufferstack + AX_graphxml_edge_data) +short int graphxml_edge_data_isset; +AT_graphxml_node_position___x AX_graphxml_node_position___x; +#define A_graphxml_node_position___x (graphxml_bufferstack + AX_graphxml_node_position___x) +short int graphxml_node_position___x_isset; AT_graphxml_edge_label AX_graphxml_edge_label; #define A_graphxml_edge_label (graphxml_bufferstack + AX_graphxml_edge_label) short int graphxml_edge_label_isset; -AT_graphxml_edge_length AX_graphxml_edge_length; -#define A_graphxml_edge_length (graphxml_bufferstack + AX_graphxml_edge_length) -short int graphxml_edge_length_isset; +AT_graphxml_graph_isDirected AX_graphxml_graph_isDirected; +#define A_graphxml_graph_isDirected AX_graphxml_graph_isDirected +short int graphxml_graph_isDirected_isset; AT_graphxml_edge_name AX_graphxml_edge_name; #define A_graphxml_edge_name (graphxml_bufferstack + AX_graphxml_edge_name) short int graphxml_edge_name_isset; @@ -1388,7 +1395,7 @@ FILE *xbt_graph_parse_get_out (void ); void xbt_graph_parse_set_out (FILE * out_str ); -int xbt_graph_parse_get_leng (void ); +yy_size_t xbt_graph_parse_get_leng (void ); char *xbt_graph_parse_get_text (void ); @@ -1542,6 +1549,34 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! xbt_graph_parse_in ) + xbt_graph_parse_in = stdin; + + if ( ! xbt_graph_parse_out ) + xbt_graph_parse_out = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + xbt_graph_parse_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); + } + + xbt_graph_parse__load_buffer_state( ); + } + + { + /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); reset_graphxml_parse_err_msg(); @@ -1593,32 +1628,6 @@ YY_DECL /* COMMENTS and PIs: handled uniformly for efficiency. */ - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! xbt_graph_parse_in ) - xbt_graph_parse_in = stdin; - - if ( ! xbt_graph_parse_out ) - xbt_graph_parse_out = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - xbt_graph_parse_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); - } - - xbt_graph_parse__load_buffer_state( ); - } - while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1635,7 +1644,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1665,7 +1674,7 @@ yy_find_action: if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - int yyl; + yy_size_t yyl; for ( yyl = 0; yyl < xbt_graph_parse_leng; ++yyl ) if ( xbt_graph_parse_text[yyl] == '\n' ) @@ -1744,17 +1753,17 @@ FAIL("Bad declaration %s.",xbt_graph_parse_text); case 13: /* rule 13 can match eol */ YY_RULE_SETUP -SET(ROOT_graphxml_edge); +SET(ROOT_graphxml_node); YY_BREAK case 14: /* rule 14 can match eol */ YY_RULE_SETUP -SET(ROOT_graphxml_node); +SET(ROOT_graphxml_graph); YY_BREAK case 15: /* rule 15 can match eol */ YY_RULE_SETUP -SET(ROOT_graphxml_graph); +SET(ROOT_graphxml_edge); YY_BREAK case 16: /* rule 16 can match eol */ @@ -1851,11 +1860,11 @@ case 30: YY_RULE_SETUP FAIL("Unexpected character `%c': `' expected.",xbt_graph_parse_text[0]); YY_BREAK +case YY_STATE_EOF(S_graphxml_graph_3): +case YY_STATE_EOF(S_graphxml_graph): case YY_STATE_EOF(S_graphxml_graph_1): case YY_STATE_EOF(E_graphxml_graph): -case YY_STATE_EOF(S_graphxml_graph_3): case YY_STATE_EOF(S_graphxml_graph_5): -case YY_STATE_EOF(S_graphxml_graph): FAIL("Premature EOF: `' expected."); YY_BREAK @@ -1951,7 +1960,7 @@ YY_RULE_SETUP if (!AX_graphxml_node_name) FAIL("Required attribute `name' not set for `node' element."); LEAVE; STag_graphxml_node(); graphxml_pcdata_ix = 0; ETag_graphxml_node(); popbuffer(); /* attribute */ switch (YY_START) { - case S_graphxml_graph_2: case S_graphxml_graph_3: case S_graphxml_graph: SET(S_graphxml_graph_3); break; + case S_graphxml_graph_3: case S_graphxml_graph: case S_graphxml_graph_2: SET(S_graphxml_graph_3); break; case ROOT_graphxml_node: SET(EPILOG); break; } } @@ -1976,7 +1985,7 @@ YY_RULE_SETUP ETag_graphxml_node(); popbuffer(); /* attribute */ switch (YY_START) { - case S_graphxml_graph_2: case S_graphxml_graph_3: case S_graphxml_graph: SET(S_graphxml_graph_3); break; + case S_graphxml_graph_3: case S_graphxml_graph: case S_graphxml_graph_2: SET(S_graphxml_graph_3); break; case ROOT_graphxml_node: SET(EPILOG); break; } } @@ -2101,7 +2110,7 @@ YY_RULE_SETUP if (!AX_graphxml_edge_target) FAIL("Required attribute `target' not set for `edge' element."); LEAVE; STag_graphxml_edge(); graphxml_pcdata_ix = 0; ETag_graphxml_edge(); popbuffer(); /* attribute */ switch (YY_START) { - case S_graphxml_graph_1: case S_graphxml_graph_3: case S_graphxml_graph_5: case S_graphxml_graph_4: case S_graphxml_graph: SET(S_graphxml_graph_5); break; + case S_graphxml_graph: case S_graphxml_graph_3: case S_graphxml_graph_1: case S_graphxml_graph_4: case S_graphxml_graph_5: SET(S_graphxml_graph_5); break; case ROOT_graphxml_edge: SET(EPILOG); break; } } @@ -2126,7 +2135,7 @@ YY_RULE_SETUP ETag_graphxml_edge(); popbuffer(); /* attribute */ switch (YY_START) { - case S_graphxml_graph_1: case S_graphxml_graph_3: case S_graphxml_graph_5: case S_graphxml_graph_4: case S_graphxml_graph: SET(S_graphxml_graph_5); break; + case S_graphxml_graph: case S_graphxml_graph_3: case S_graphxml_graph_1: case S_graphxml_graph_4: case S_graphxml_graph_5: SET(S_graphxml_graph_5); break; case ROOT_graphxml_edge: SET(EPILOG); break; } } @@ -2397,6 +2406,7 @@ case YY_STATE_EOF(IMPOSSIBLE): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of xbt_graph_parse_lex */ /* yy_get_next_buffer - try to read in a new buffer @@ -2452,21 +2462,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2497,7 +2507,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -2592,7 +2602,7 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 563); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT @@ -2619,7 +2629,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2784,10 +2794,6 @@ static void xbt_graph_parse__load_buffer_state (void) xbt_graph_parse_free((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a xbt_graph_parse_restart() or at EOF. @@ -2900,7 +2906,7 @@ void xbt_graph_parse_pop_buffer_state (void) */ static void xbt_graph_parse_ensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -2997,12 +3003,12 @@ YY_BUFFER_STATE xbt_graph_parse__scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -3116,7 +3122,7 @@ FILE *xbt_graph_parse_get_out (void) /** Get the length of the current token. * */ -int xbt_graph_parse_get_leng (void) +yy_size_t xbt_graph_parse_get_leng (void) { return xbt_graph_parse_leng; } diff --git a/src/xbt/mmalloc/mm_diff.c b/src/xbt/mmalloc/mm_diff.c index 7258e6f1b3..af5bd8853e 100644 --- a/src/xbt/mmalloc/mm_diff.c +++ b/src/xbt/mmalloc/mm_diff.c @@ -140,10 +140,16 @@ struct s_mm_diff { // Number of blocks in the heaps: size_t heapsize1, heapsize2; xbt_dynar_t to_ignore1, to_ignore2; - heap_area_t **equals_to1, **equals_to2; - dw_type_t **types1, **types2; + s_heap_area_t *equals_to1, *equals_to2; + dw_type_t *types1, *types2; + size_t available; }; +#define equals_to1_(i,j) equals_to1[ MAX_FRAGMENT_PER_BLOCK*(i) + (j)] +#define equals_to2_(i,j) equals_to2[ MAX_FRAGMENT_PER_BLOCK*(i) + (j)] +#define types1_(i,j) types1[ MAX_FRAGMENT_PER_BLOCK*(i) + (j)] +#define types2_(i,j) types2[ MAX_FRAGMENT_PER_BLOCK*(i) + (j)] + __thread struct s_mm_diff* mm_diff_info = NULL; /*********************************** Free functions ************************************/ @@ -164,11 +170,11 @@ static void heap_area_free(heap_area_t area){ /************************************************************************************/ -static heap_area_t new_heap_area(int block, int fragment){ - heap_area_t area = NULL; - area = xbt_new0(s_heap_area_t, 1); - area->block = block; - area->fragment = fragment; +static s_heap_area_t make_heap_area(int block, int fragment){ + s_heap_area_t area; + area.valid = 1; + area.block = block; + area.fragment = fragment; return area; } @@ -253,45 +259,18 @@ static void match_equals(struct s_mm_diff *state, xbt_dynar_t list){ unsigned int cursor = 0; heap_area_pair_t current_pair; - heap_area_t previous_area; xbt_dynar_foreach(list, cursor, current_pair){ if(current_pair->fragment1 != -1){ - if(state->equals_to1[current_pair->block1][current_pair->fragment1] != NULL){ - previous_area = state->equals_to1[current_pair->block1][current_pair->fragment1]; - heap_area_free(state->equals_to2[previous_area->block][previous_area->fragment]); - state->equals_to2[previous_area->block][previous_area->fragment] = NULL; - heap_area_free(previous_area); - } - if(state->equals_to2[current_pair->block2][current_pair->fragment2] != NULL){ - previous_area = state->equals_to2[current_pair->block2][current_pair->fragment2]; - heap_area_free(state->equals_to1[previous_area->block][previous_area->fragment]); - state->equals_to1[previous_area->block][previous_area->fragment] = NULL; - heap_area_free(previous_area); - } - - state->equals_to1[current_pair->block1][current_pair->fragment1] = new_heap_area(current_pair->block2, current_pair->fragment2); - state->equals_to2[current_pair->block2][current_pair->fragment2] = new_heap_area(current_pair->block1, current_pair->fragment1); + state->equals_to1_(current_pair->block1,current_pair->fragment1) = make_heap_area(current_pair->block2, current_pair->fragment2); + state->equals_to2_(current_pair->block2,current_pair->fragment2) = make_heap_area(current_pair->block1, current_pair->fragment1); }else{ - if(state->equals_to1[current_pair->block1][0] != NULL){ - previous_area = state->equals_to1[current_pair->block1][0]; - heap_area_free(state->equals_to2[previous_area->block][0]); - state->equals_to2[previous_area->block][0] = NULL; - heap_area_free(previous_area); - } - if(state->equals_to2[current_pair->block2][0] != NULL){ - previous_area = state->equals_to2[current_pair->block2][0]; - heap_area_free(state->equals_to1[previous_area->block][0]); - state->equals_to1[previous_area->block][0] = NULL; - heap_area_free(previous_area); - } - - state->equals_to1[current_pair->block1][0] = new_heap_area(current_pair->block2, current_pair->fragment2); - state->equals_to2[current_pair->block2][0] = new_heap_area(current_pair->block1, current_pair->fragment1); + state->equals_to1_(current_pair->block1,0) = make_heap_area(current_pair->block2, current_pair->fragment2); + state->equals_to2_(current_pair->block2,0) = make_heap_area(current_pair->block1, current_pair->fragment1); } @@ -307,7 +286,7 @@ static void match_equals(struct s_mm_diff *state, xbt_dynar_t list){ */ static int equal_blocks(struct s_mm_diff *state, int b1, int b2){ - if(state->equals_to1[b1][0]->block == b2 && state->equals_to2[b2][0]->block == b1) + if(state->equals_to1_(b1,0).block == b2 && state->equals_to2_(b2,0).block == b1) return 1; return 0; @@ -324,10 +303,10 @@ static int equal_blocks(struct s_mm_diff *state, int b1, int b2){ */ static int equal_fragments(struct s_mm_diff *state, int b1, int f1, int b2, int f2){ - if(state->equals_to1[b1][f1]->block == b2 - && state->equals_to1[b1][f1]->fragment == f2 - && state->equals_to2[b2][f2]->block == b1 - && state->equals_to2[b2][f2]->fragment == f1) + if(state->equals_to1_(b1,f1).block == b2 + && state->equals_to1_(b1,f1).fragment == f2 + && state->equals_to2_(b2,f2).block == b1 + && state->equals_to2_(b2,f2).fragment == f1) return 1; return 0; @@ -336,6 +315,10 @@ static int equal_fragments(struct s_mm_diff *state, int b1, int f1, int b2, int int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1, xbt_dynar_t i2){ if(mm_diff_info==NULL) { mm_diff_info = xbt_new0(struct s_mm_diff, 1); + mm_diff_info->equals_to1 = NULL; + mm_diff_info->equals_to2 = NULL; + mm_diff_info->types1 = NULL; + mm_diff_info->types2 = NULL; } struct s_mm_diff *state = mm_diff_info; @@ -343,8 +326,6 @@ int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1, || ((((struct mdesc *)heap1)->heapsize != ((struct mdesc *)heap2)->heapsize) )) return -1; - int i, j; - state->heaplimit = ((struct mdesc *)heap1)->heaplimit; state->s_heap = (char *)mmalloc_get_current_heap() - STD_HEAP_SIZE - xbt_pagesize; @@ -361,27 +342,18 @@ int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1, state->to_ignore1 = i1; state-> to_ignore2 = i2; - state->equals_to1 = malloc(state->heaplimit * sizeof(heap_area_t *)); - state->types1 = malloc(state->heaplimit * sizeof(type_name *)); - for(i=0; i<=state->heaplimit; i++){ - state->equals_to1[i] = malloc(MAX_FRAGMENT_PER_BLOCK * sizeof(heap_area_t)); - state->types1[i] = malloc(MAX_FRAGMENT_PER_BLOCK * sizeof(type_name)); - for(j=0; jequals_to1[i][j] = NULL; - state->types1[i][j] = NULL; - } + if(state->heaplimit > state->available) { + state->equals_to1 = realloc(state->equals_to1, state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(s_heap_area_t)); + state->types1 = realloc(state->types1, state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(type_name *)); + state->equals_to2 = realloc(state->equals_to2, state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(s_heap_area_t)); + state->types2 = realloc(state->types2, state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(type_name *)); + state->available = state->heaplimit; } - state->equals_to2 = malloc(state->heaplimit * sizeof(heap_area_t *)); - state->types2 = malloc(state->heaplimit * sizeof(type_name *)); - for(i=0; i<=state->heaplimit; i++){ - state->equals_to2[i] = malloc(MAX_FRAGMENT_PER_BLOCK * sizeof(heap_area_t)); - state->types2[i] = malloc(MAX_FRAGMENT_PER_BLOCK * sizeof(type_name)); - for(j=0; jequals_to2[i][j] = NULL; - state->types2[i][j] = NULL; - } - } + memset(state->equals_to1, 0, state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(s_heap_area_t)); + memset(state->equals_to2, 0, state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(s_heap_area_t)); + memset(state->types1, 0, state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(type_name *)); + memset(state->types2, 0, state->heaplimit * MAX_FRAGMENT_PER_BLOCK * sizeof(type_name *)); if(MC_is_active()){ MC_ignore_global_variable("mm_diff_info"); @@ -393,37 +365,6 @@ int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1, void reset_heap_information(){ - struct s_mm_diff *state = mm_diff_info; - - size_t i = 0, j; - - for(i=0; i<=state->heaplimit; i++){ - for(j=0; jequals_to1[i][j]); - state->equals_to1[i][j] = NULL; - heap_area_free(state->equals_to2[i][j]); - state-> equals_to2[i][j] = NULL; - state->types1[i][j] = NULL; - state->types2[i][j] = NULL; - } - free(state->equals_to1[i]); - free(state->equals_to2[i]); - free(state->types1[i]); - free(state->types2[i]); - } - - free(state->equals_to1); - free(state->equals_to2); - free(state->types1); - free(state->types2); - - state->s_heap = NULL, state->heapbase1 = NULL, state->heapbase2 = NULL; - state->heapinfo1 = NULL, state->heapinfo2 = NULL; - state->heaplimit = 0, state->heapsize1 = 0, state->heapsize2 = 0; - state->to_ignore1 = NULL, state->to_ignore2 = NULL; - state->equals_to1 = NULL, state->equals_to2 = NULL; - state->types1 = NULL, state->types2 = NULL; - } int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_mheap_t heap1, xbt_mheap_t heap2){ @@ -461,14 +402,14 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m if(is_stack(addr_block1)){ for(k=0; k < state->heapinfo1[i1].busy_block.size; k++) - state->equals_to1[i1+k][0] = new_heap_area(i1, -1); + state->equals_to1_(i1+k,0) = make_heap_area(i1, -1); for(k=0; k < state->heapinfo2[i1].busy_block.size; k++) - state->equals_to2[i1+k][0] = new_heap_area(i1, -1); + state->equals_to2_(i1+k,0) = make_heap_area(i1, -1); i1 += state->heapinfo1[i1].busy_block.size; continue; } - if(state->equals_to1[i1][0] != NULL){ + if(state->equals_to1_(i1,0).valid){ i1++; continue; } @@ -480,7 +421,7 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m /* Try first to associate to same block in the other heap */ if(state->heapinfo2[i1].type == state->heapinfo1[i1].type){ - if(state->equals_to2[i1][0] == NULL){ + if(state->equals_to2_(i1,0).valid == 0){ addr_block2 = ((void*) (((ADDR2UINT(i1)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)state->s_heap)->heapbase)); @@ -488,9 +429,9 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m if(res_compare != 1){ for(k=1; k < state->heapinfo2[i1].busy_block.size; k++) - state->equals_to2[i1+k][0] = new_heap_area(i1, -1); + state->equals_to2_(i1+k,0) = make_heap_area(i1, -1); for(k=1; k < state->heapinfo1[i1].busy_block.size; k++) - state->equals_to1[i1+k][0] = new_heap_area(i1, -1); + state->equals_to1_(i1+k,0) = make_heap_area(i1, -1); equal = 1; i1 += state->heapinfo1[i1].busy_block.size; } @@ -515,7 +456,7 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m continue; } - if(state->equals_to2[i2][0] != NULL){ + if(state->equals_to2_(i2,0).valid){ i2++; continue; } @@ -524,9 +465,9 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m if(res_compare != 1 ){ for(k=1; k < state->heapinfo2[i2].busy_block.size; k++) - state->equals_to2[i2+k][0] = new_heap_area(i1, -1); + state->equals_to2_(i2+k,0) = make_heap_area(i1, -1); for(k=1; k < state->heapinfo1[i1].busy_block.size; k++) - state->equals_to1[i1+k][0] = new_heap_area(i2, -1); + state->equals_to1_(i1+k,0) = make_heap_area(i2, -1); equal = 1; i1 += state->heapinfo1[i1].busy_block.size; } @@ -551,7 +492,7 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m if(state->heapinfo1[i1].busy_frag.frag_size[j1] == -1) /* Free fragment */ continue; - if(state->equals_to1[i1][j1] != NULL) + if(state->equals_to1_(i1,j1).valid) continue; addr_frag1 = (void*) ((char *)addr_block1 + (j1 << state->heapinfo1[i1].type)); @@ -562,7 +503,7 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m /* Try first to associate to same fragment in the other heap */ if(state->heapinfo2[i1].type == state->heapinfo1[i1].type){ - if(state->equals_to2[i1][j1] == NULL){ + if(state->equals_to2_(i1,j1).valid == 0){ addr_block2 = ((void*) (((ADDR2UINT(i1)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)state->s_heap)->heapbase)); addr_frag2 = (void*) ((char *)addr_block2 + (j1 << ((xbt_mheap_t)state->s_heap)->heapinfo[i1].type)); @@ -590,7 +531,7 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m if(i2 == i1 && j2 == j1) continue; - if(state->equals_to2[i2][j2] != NULL) + if(state->equals_to2_(i2,j2).valid) continue; addr_block2 = ((void*) (((ADDR2UINT(i2)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)state->s_heap)->heapbase)); @@ -636,7 +577,7 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m if(state->heapinfo1[i].type == 0){ if(i1 == state->heaplimit){ if(state->heapinfo1[i].busy_block.busy_size > 0){ - if(state->equals_to1[i][0] == NULL){ + if(state->equals_to1_(i,0).valid == 0){ if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){ addr_block1 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)state->heapbase1)); XBT_DEBUG("Block %zu (%p) not found (size used = %zu)", i, addr_block1, state->heapinfo1[i].busy_block.busy_size); @@ -653,7 +594,7 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m for(j=0; j < (size_t) (BLOCKSIZE >> state->heapinfo1[i].type); j++){ if(i1== state->heaplimit){ if(state->heapinfo1[i].busy_frag.frag_size[j] > 0){ - if(state->equals_to1[i][j] == NULL){ + if(state->equals_to1_(i,j).valid == 0){ if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){ addr_frag1 = (void*) ((char *)addr_block1 + (j << state->heapinfo1[i].type)); real_addr_frag1 = (void*) ((char *)real_addr_block1 + (j << ((struct mdesc *)state->s_heap)->heapinfo[i].type)); @@ -678,7 +619,7 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m if(state->heapinfo2[i].type == 0){ if(i1 == state->heaplimit){ if(state->heapinfo2[i].busy_block.busy_size > 0){ - if(state->equals_to2[i][0] == NULL){ + if(state->equals_to2_(i,0).valid == 0){ if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){ addr_block2 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)state->heapbase2)); XBT_DEBUG("Block %zu (%p) not found (size used = %zu)", i, addr_block2, state->heapinfo2[i].busy_block.busy_size); @@ -695,7 +636,7 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, xbt_m for(j=0; j < (size_t) (BLOCKSIZE >> state->heapinfo2[i].type); j++){ if(i1 == state->heaplimit){ if(state->heapinfo2[i].busy_frag.frag_size[j] > 0){ - if(state->equals_to2[i][j] == NULL){ + if(state->equals_to2_(i,j).valid == 0){ if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){ addr_frag2 = (void*) ((char *)addr_block2 + (j << state->heapinfo2[i].type)); real_addr_frag2 = (void*) ((char *)real_addr_block2 + (j << ((struct mdesc *)state->s_heap)->heapinfo[i].type)); @@ -1108,7 +1049,7 @@ int compare_heap_area(void *area1, void* area2, mc_snapshot_t snapshot1, mc_snap // TODO, lookup variable type from block type as done for fragmented blocks - if(state->equals_to1[block1][0] != NULL && state->equals_to2[block2][0] != NULL){ + if(state->equals_to1_(block1,0).valid && state->equals_to2_(block2,0).valid){ if(equal_blocks(state, block1, block2)){ if(match_pairs){ match_equals(state, previous); @@ -1157,12 +1098,10 @@ int compare_heap_area(void *area1, void* area2, mc_snapshot_t snapshot1, mc_snap // Remember (basic) type inference. // The current data structure only allows us to do this for the whole block. if (type != NULL && area1==real_addr_block1) { - xbt_free(state->types1[block1][0]); - state->types1[block1][0] = type; + state->types1_(block1,0) = type; } if (type != NULL && area2==real_addr_block2) { - xbt_free(state->types2[block2][0]); - state->types2[block2][0] = type; + state->types2_(block2,0) = type; } if(size <= 0){ @@ -1215,7 +1154,7 @@ int compare_heap_area(void *area1, void* area2, mc_snapshot_t snapshot1, mc_snap } // Check if the blocks are already matched together: - if(state->equals_to1[block1][frag1] != NULL && state->equals_to2[block2][frag2] != NULL){ + if(state->equals_to1_(block1,frag1).valid && state->equals_to2_(block2,frag2).valid){ if(equal_fragments(state, block1, frag1, block2, frag2)){ if(match_pairs){ match_equals(state, previous); @@ -1247,10 +1186,10 @@ int compare_heap_area(void *area1, void* area2, mc_snapshot_t snapshot1, mc_snap // Remember (basic) type inference. // The current data structure only allows us to do this for the whole block. if(type != NULL && area1==real_addr_frag1){ - state->types1[block1][frag1] = type; + state->types1_(block1,frag1) = type; } if(type != NULL && area2==real_addr_frag2) { - state->types2[block2][frag2] = type; + state->types2_(block2,frag2) = type; } // The type of the variable is already known: @@ -1260,20 +1199,20 @@ int compare_heap_area(void *area1, void* area2, mc_snapshot_t snapshot1, mc_snap } // Type inference from the block type. - else if(state->types1[block1][frag1] != NULL || state->types2[block2][frag2] != NULL) { + else if(state->types1_(block1,frag1) != NULL || state->types2_(block2,frag2) != NULL) { offset1 = (char *)area1 - (char *)real_addr_frag1; offset2 = (char *)area2 - (char *)real_addr_frag2; - if(state->types1[block1][frag1] != NULL && state->types2[block2][frag2] != NULL){ - new_type1 = get_offset_type(real_addr_frag1, state->types1[block1][frag1], offset1, size, snapshot1); - new_type2 = get_offset_type(real_addr_frag2, state->types2[block2][frag2], offset1, size, snapshot2); - }else if(state->types1[block1][frag1] != NULL){ - new_type1 = get_offset_type(real_addr_frag1, state->types1[block1][frag1], offset1, size, snapshot1); - new_type2 = get_offset_type(real_addr_frag2, state->types1[block1][frag1], offset2, size, snapshot2); - }else if(state->types2[block2][frag2] != NULL){ - new_type1 = get_offset_type(real_addr_frag1, state->types2[block2][frag2], offset1, size, snapshot1); - new_type2 = get_offset_type(real_addr_frag2, state->types2[block2][frag2], offset2, size, snapshot2); + if(state->types1_(block1,frag1) != NULL && state->types2_(block2,frag2) != NULL){ + new_type1 = get_offset_type(real_addr_frag1, state->types1_(block1,frag1), offset1, size, snapshot1); + new_type2 = get_offset_type(real_addr_frag2, state->types2_(block2,frag2), offset1, size, snapshot2); + }else if(state->types1_(block1,frag1) != NULL){ + new_type1 = get_offset_type(real_addr_frag1, state->types1_(block1,frag1), offset1, size, snapshot1); + new_type2 = get_offset_type(real_addr_frag2, state->types1_(block1,frag1), offset2, size, snapshot2); + }else if(state->types2_(block2,frag2) != NULL){ + new_type1 = get_offset_type(real_addr_frag1, state->types2_(block2,frag2), offset1, size, snapshot1); + new_type2 = get_offset_type(real_addr_frag2, state->types2_(block2,frag2), offset2, size, snapshot2); }else{ if(match_pairs){ match_equals(state, previous); diff --git a/src/xbt/mmalloc/mm_legacy.c b/src/xbt/mmalloc/mm_legacy.c index 0073245ad5..5fbdb042f7 100644 --- a/src/xbt/mmalloc/mm_legacy.c +++ b/src/xbt/mmalloc/mm_legacy.c @@ -40,9 +40,9 @@ void mmalloc_set_current_heap(xbt_mheap_t new_heap) #define _GNU_SOURCE 1 #include -static void * (*real_malloc) (size_t); -static void * (*real_realloc) (void*,size_t); -static void * (*real_free) (void*); +static void * (*real_malloc) (size_t) = NULL; +static void * (*real_realloc) (void*,size_t) = NULL; +static void * (*real_free) (void*) = NULL; static void mm_gnuld_legacy_init(void) { /* This function is called from mmalloc_preinit(); it works even if it's static because all mm is in mm.c */ real_malloc = (void * (*) (size_t)) dlsym(RTLD_NEXT, "malloc"); @@ -55,8 +55,10 @@ static void mm_gnuld_legacy_init(void) { /* This function is called from mmalloc * DL needs some memory while resolving the malloc symbol, that is somehow problematic * To that extend, we have a little area here living in .BSS that we return if asked for memory before the malloc is resolved. */ -int allocated_junk=0; /* keep track of whether our little area was already given to someone */ -char junkarea[4096]; +static int allocated_junk = 0; /* keep track of many blocks of our little area was already given to someone */ +#define JUNK_SIZE 8 +#define MAX_JUNK_AREAS (3*4096/JUNK_SIZE) +static char junkareas[MAX_JUNK_AREAS][JUNK_SIZE]; /* This version use mmalloc if there is a current heap, or the legacy implem if not */ void *malloc(size_t n) { @@ -79,19 +81,16 @@ void *malloc(size_t n) { #endif } else { if (!real_malloc) { - if (allocated_junk) { + size_t needed_areas = n / JUNK_SIZE; + if(needed_areas * JUNK_SIZE != n) needed_areas++; + if (allocated_junk+needed_areas>=MAX_JUNK_AREAS) { fprintf(stderr, - "Panic: real malloc symbol not resolved yet, and I already gave my little private memory chunk away. " - "Damn LD, we must extend our code to have several such areas.\n"); - exit(1); - } else if (n > sizeof junkarea) { - fprintf(stderr, - "Panic: real malloc symbol not resolved yet, and I need %zu bytes while my little private memory chunk is only %zu bytes wide. " - "Damn LD, we must fix our code to extend this area.\n", n, sizeof junkarea); + "Panic: real malloc symbol not resolved yet, and I already gave my little private memory chunk away.\n"); exit(1); } else { - allocated_junk = 1; - return junkarea; + size_t i = allocated_junk; + allocated_junk += needed_areas; + return junkareas[i]; } } #ifdef MM_LEGACY_VERBOSE @@ -133,7 +132,7 @@ void free(void *p) { if (p==NULL) return; - if (p!=junkarea) { + if (p<=(void*)junkareas || p>(void*)(junkareas[MAX_JUNK_AREAS]) ) { xbt_mheap_t mdp = __mmalloc_current_heap; if (mdp) { @@ -143,8 +142,10 @@ void free(void *p) } else { real_free(p); } + } else if(allocated_junk && p==junkareas[allocated_junk-1]) { + allocated_junk--; } else { - allocated_junk=0; + // Leaked memory. } } diff --git a/src/xbt/mmalloc/mmorecore.c b/src/xbt/mmalloc/mmorecore.c index 38f6d8b7bd..9fbf7a9704 100644 --- a/src/xbt/mmalloc/mmorecore.c +++ b/src/xbt/mmalloc/mmorecore.c @@ -124,10 +124,6 @@ void *mmorecore(struct mdesc *mdp, ssize_t size) abort(); } -#ifdef MADV_MERGEABLE - madvise(mapto, mapbytes, MADV_MERGEABLE); -#endif - if (mdp->top == 0) mdp->base = mdp->breakval = mapto; diff --git a/src/xbt/mmalloc/mmprivate.h b/src/xbt/mmalloc/mmprivate.h index 155d4cef22..37e4ea718d 100644 --- a/src/xbt/mmalloc/mmprivate.h +++ b/src/xbt/mmalloc/mmprivate.h @@ -110,6 +110,7 @@ struct mstats }; typedef struct s_heap_area{ + int valid; int block; int fragment; }s_heap_area_t, *heap_area_t; diff --git a/src/xbt/win32_ucontext.c b/src/xbt/win32_ucontext.c index b538e09fb9..d218febbb6 100644 --- a/src/xbt/win32_ucontext.c +++ b/src/xbt/win32_ucontext.c @@ -68,13 +68,13 @@ int makecontext(ucontext_t * ucp, void (*func) (), int argc, ...) #ifdef _I_X86_ ucp->uc_mcontext.Eip = (DWORD) func; ucp->uc_mcontext.Esp = (DWORD) sp - sizeof(void*); - #endif - #ifdef _IA64_ + #elif defined _IA64_ # error "_IA64_" - #endif - #ifdef _AMD64_ + #elif defined _AMD64_ ucp->uc_mcontext.Rip = (DWORD64) func; ucp->uc_mcontext.Rsp = (DWORD64) sp - sizeof(void*); + #else + #error "No architecture defined for Windows build. need either _AMD64_ or _I_X86_" #endif /* Save/Restore the full machine context */ diff --git a/src/xbt/xbt_main.c b/src/xbt/xbt_main.c index 3af5c0371d..615ad8d16b 100644 --- a/src/xbt/xbt_main.c +++ b/src/xbt/xbt_main.c @@ -22,6 +22,9 @@ #include "simgrid/sg_config.h" #include +#ifdef _XBT_WIN32 +#include +#endif XBT_LOG_NEW_CATEGORY(xbt, "All XBT categories (simgrid toolbox)"); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling"); @@ -156,13 +159,31 @@ void xbt_exit() /* these two functions belong to xbt/sysdep.h, which have no corresponding .c file */ /** @brief like free, but you can be sure that it is a function */ -XBT_PUBLIC(void) xbt_free_f(void *p) +void xbt_free_f(void *p) { free(p); } /** @brief should be given a pointer to pointer, and frees the second one */ -XBT_PUBLIC(void) xbt_free_ref(void *d) +void xbt_free_ref(void *d) { free(*(void **) d); } + +/** @brief Kill the program in silence */ +void xbt_abort(void) +{ +#ifdef COVERAGE + /* Call __gcov_flush on abort when compiling with coverage options. */ + extern void __gcov_flush(void); + __gcov_flush(); +#endif +#ifdef _XBT_WIN32 + /* It was said *in silence*. We don't want to see the error message printed + * by the Microsoft's implementation of abort(). */ + raise(SIGABRT); + signal(SIGABRT, SIG_DFL); + raise(SIGABRT); +#endif + abort(); +} diff --git a/src/xbt/xbt_replay.c b/src/xbt/xbt_replay.c index ffd80026a3..f3a9fbcb79 100644 --- a/src/xbt/xbt_replay.c +++ b/src/xbt/xbt_replay.c @@ -52,8 +52,8 @@ xbt_replay_reader_t xbt_replay_reader_new(const char *filename) { xbt_replay_reader_t res = xbt_new0(s_xbt_replay_reader_t,1); res->fp = fopen(filename, "r"); - xbt_assert(res->fp != NULL, "Cannot open %s: %s", filename, - strerror(errno)); + if (res->fp == NULL) + xbt_die("Cannot open %s: %s", filename, strerror(errno)); res->filename = xbt_strdup(filename); return res; } diff --git a/src/xbt/xbt_sg_synchro.c b/src/xbt/xbt_sg_synchro.c index 4907e6f246..724755b2ae 100644 --- a/src/xbt/xbt_sg_synchro.c +++ b/src/xbt/xbt_sg_synchro.c @@ -184,3 +184,47 @@ void xbt_cond_destroy(xbt_cond_t cond) { simcall_cond_destroy((smx_cond_t) cond); } + +/***** barrier related functions *****/ +typedef struct s_xbt_bar_ { + xbt_mutex_t mutex; + xbt_cond_t cond; + unsigned int arrived_processes; + unsigned int expected_processes; +} s_xbt_bar_; + +xbt_bar_t xbt_barrier_init(unsigned int count) +{ + xbt_bar_t bar = xbt_new0(s_xbt_bar_, 1); + bar->expected_processes = count; + bar->arrived_processes = 0; + bar->mutex = xbt_mutex_init(); + bar->cond = xbt_cond_init(); + return bar; +} + + +int xbt_barrier_wait(xbt_bar_t bar) +{ + int ret=0; + xbt_mutex_acquire(bar->mutex); + if (++bar->arrived_processes == bar->expected_processes) { + xbt_cond_broadcast(bar->cond); + xbt_mutex_release(bar->mutex); + ret=XBT_BARRIER_SERIAL_PROCESS; + bar->arrived_processes = 0; + } else { + xbt_cond_wait(bar->cond, bar->mutex); + xbt_mutex_release(bar->mutex); + } + + return ret; +} + +void xbt_barrier_destroy(xbt_bar_t bar) +{ + xbt_mutex_destroy(bar->mutex); + xbt_cond_destroy(bar->cond); + xbt_free(bar); +} + diff --git a/teshsuite/bug-17132/bug-17132.tesh b/teshsuite/bug-17132/bug-17132.tesh index a73b210f6e..16c5e008ae 100644 --- a/teshsuite/bug-17132/bug-17132.tesh +++ b/teshsuite/bug-17132/bug-17132.tesh @@ -1,6 +1,6 @@ $ ../../smpi_script/bin/smpirun -np 16 -platform ${srcdir:=.}/small_platform.xml -hostfile ${srcdir:=.}/hostfile.txt ./bug-17132 --cfg=smpi/cpu_threshold:-1 --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 2 processes in your hostfile... -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/teshsuite/mc/dwarf/CMakeLists.txt b/teshsuite/mc/dwarf/CMakeLists.txt new file mode 100644 index 0000000000..89dd9ea9f0 --- /dev/null +++ b/teshsuite/mc/dwarf/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 2.6) + +if(HAVE_MC) + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + add_executable(dwarf dwarf.c) + target_link_libraries(dwarf simgrid) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.tesh + PARENT_SCOPE + ) +set(testsuite_src + ${testsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.c + PARENT_SCOPE + ) diff --git a/testsuite/mc/dwarf.c b/teshsuite/mc/dwarf/dwarf.c similarity index 93% rename from testsuite/mc/dwarf.c rename to teshsuite/mc/dwarf/dwarf.c index 50d8ad445b..059062d589 100644 --- a/testsuite/mc/dwarf.c +++ b/teshsuite/mc/dwarf/dwarf.c @@ -63,6 +63,13 @@ static dw_variable_t find_local_variable(dw_frame_t frame, const char* argument_ return variable; } + dw_frame_t scope = NULL; + xbt_dynar_foreach(frame->scopes, cursor, scope) { + variable = find_local_variable(scope, argument_name); + if(variable) + return variable; + } + return NULL; } @@ -141,6 +148,11 @@ int main(int argc, char** argv) { test_local_variable(mc_binary_info, "main", "argc", &argc, &cursor); + { + int lexical_block_variable = 50; + test_local_variable(mc_binary_info, "main", "lexical_block_variable", &lexical_block_variable, &cursor); + } + s_foo my_foo; test_type_by_name(my_foo); diff --git a/teshsuite/mc/dwarf/dwarf.tesh b/teshsuite/mc/dwarf/dwarf.tesh new file mode 100644 index 0000000000..93e284be6d --- /dev/null +++ b/teshsuite/mc/dwarf/dwarf.tesh @@ -0,0 +1,5 @@ +#! ./tesh + +$ $SG_TEST_EXENV ${bindir:=.}/dwarf +> [0.000000] [mc_global/INFO] Get debug information ... +> [0.000000] [mc_global/INFO] Get debug information done ! diff --git a/testsuite/mc/CMakeLists.txt b/teshsuite/mc/dwarf_expression/CMakeLists.txt similarity index 75% rename from testsuite/mc/CMakeLists.txt rename to teshsuite/mc/dwarf_expression/CMakeLists.txt index df0bc0b760..435f38bb54 100644 --- a/testsuite/mc/CMakeLists.txt +++ b/teshsuite/mc/dwarf_expression/CMakeLists.txt @@ -2,16 +2,18 @@ cmake_minimum_required(VERSION 2.6) if(HAVE_MC) set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") - add_executable(dwarf dwarf.c) - target_link_libraries(dwarf simgrid) add_executable(dwarf-expression dwarf_expression.c) target_link_libraries(dwarf-expression simgrid) endif() +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/dwarf_expression.tesh + PARENT_SCOPE + ) set(testsuite_src ${testsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.c ${CMAKE_CURRENT_SOURCE_DIR}/dwarf_expression.c PARENT_SCOPE ) diff --git a/testsuite/mc/dwarf_expression.c b/teshsuite/mc/dwarf_expression/dwarf_expression.c similarity index 100% rename from testsuite/mc/dwarf_expression.c rename to teshsuite/mc/dwarf_expression/dwarf_expression.c diff --git a/teshsuite/mc/dwarf_expression/dwarf_expression.tesh b/teshsuite/mc/dwarf_expression/dwarf_expression.tesh new file mode 100644 index 0000000000..b87a8508a6 --- /dev/null +++ b/teshsuite/mc/dwarf_expression/dwarf_expression.tesh @@ -0,0 +1,4 @@ +#! ./tesh + +$ $SG_TEST_EXENV ${bindir:=.}/dwarf-expression +> diff --git a/teshsuite/msg/CMakeLists.txt b/teshsuite/msg/CMakeLists.txt index 670d9dcf5c..4a75a53042 100644 --- a/teshsuite/msg/CMakeLists.txt +++ b/teshsuite/msg/CMakeLists.txt @@ -2,54 +2,18 @@ cmake_minimum_required(VERSION 2.6) set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") -add_executable(get_sender ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.c) -add_executable(pid ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid.c) -add_executable(host_on_off ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off.c) -add_executable(task_destroy_cancel ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel.c) -add_executable(process ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process.c) - - ### Add definitions for compile -target_link_libraries(get_sender simgrid) -target_link_libraries(host_on_off simgrid) -target_link_libraries(task_destroy_cancel simgrid) -target_link_libraries(process simgrid) -if(NOT WIN32) - target_link_libraries(pid simgrid m pthread) -else() - target_link_libraries(pid simgrid) -endif() set(tesh_files ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/get_sender.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/pid.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/process.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.tesh PARENT_SCOPE ) set(xml_files ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/get_sender_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/get_sender_p.xml - ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_p.xml - ${CMAKE_CURRENT_SOURCE_DIR}/pid_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/pid_p.xml - ${CMAKE_CURRENT_SOURCE_DIR}/process_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/process_p.xml - ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_p.xml PARENT_SCOPE ) set(teshsuite_src ${teshsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/get_sender.c - ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off.c - ${CMAKE_CURRENT_SOURCE_DIR}/pid.c - ${CMAKE_CURRENT_SOURCE_DIR}/process.c - ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.c PARENT_SCOPE ) set(bin_files diff --git a/teshsuite/msg/get_sender/CMakeLists.txt b/teshsuite/msg/get_sender/CMakeLists.txt new file mode 100644 index 0000000000..d785a82f0d --- /dev/null +++ b/teshsuite/msg/get_sender/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(get_sender get_sender.c) + +### Add definitions for compile +target_link_libraries(get_sender simgrid) + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/get_sender.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/get_sender_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/get_sender_p.xml + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/get_sender.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/msg/get_sender.c b/teshsuite/msg/get_sender/get_sender.c similarity index 100% rename from teshsuite/msg/get_sender.c rename to teshsuite/msg/get_sender/get_sender.c diff --git a/teshsuite/msg/get_sender.tesh b/teshsuite/msg/get_sender/get_sender.tesh similarity index 59% rename from teshsuite/msg/get_sender.tesh rename to teshsuite/msg/get_sender/get_sender.tesh index bcb14b0e67..be07f366b2 100644 --- a/teshsuite/msg/get_sender.tesh +++ b/teshsuite/msg/get_sender/get_sender.tesh @@ -1,5 +1,5 @@ ! output sort -$ msg/get_sender ${srcdir:=.}/msg/get_sender_p.xml ${srcdir:=.}/msg/get_sender_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ ./get_sender ${srcdir:=.}/get_sender_p.xml ${srcdir:=.}/get_sender_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:send@toto) Sending > [ 0.000000] (2:receive@toto) Receiving > [ 0.000000] (2:receive@toto) Got a message sent by 'send' diff --git a/teshsuite/msg/get_sender_d.xml b/teshsuite/msg/get_sender/get_sender_d.xml similarity index 100% rename from teshsuite/msg/get_sender_d.xml rename to teshsuite/msg/get_sender/get_sender_d.xml diff --git a/teshsuite/msg/get_sender_p.xml b/teshsuite/msg/get_sender/get_sender_p.xml similarity index 100% rename from teshsuite/msg/get_sender_p.xml rename to teshsuite/msg/get_sender/get_sender_p.xml diff --git a/teshsuite/msg/host_on_off/CMakeLists.txt b/teshsuite/msg/host_on_off/CMakeLists.txt new file mode 100644 index 0000000000..5230929fbd --- /dev/null +++ b/teshsuite/msg/host_on_off/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(host_on_off host_on_off.c) + +### Add definitions for compile +target_link_libraries(host_on_off simgrid) + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_p.xml + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/msg/host_on_off.c b/teshsuite/msg/host_on_off/host_on_off.c similarity index 100% rename from teshsuite/msg/host_on_off.c rename to teshsuite/msg/host_on_off/host_on_off.c diff --git a/teshsuite/msg/host_on_off.tesh b/teshsuite/msg/host_on_off/host_on_off.tesh similarity index 88% rename from teshsuite/msg/host_on_off.tesh rename to teshsuite/msg/host_on_off/host_on_off.tesh index 2e3e45664d..0c75055be3 100644 --- a/teshsuite/msg/host_on_off.tesh +++ b/teshsuite/msg/host_on_off/host_on_off.tesh @@ -1,5 +1,5 @@ -$ msg/host_on_off ${srcdir:=.}/msg/host_on_off_p.xml ${srcdir:=.}/msg/host_on_off_d.xml +$ ./host_on_off ${srcdir:=.}/host_on_off_p.xml ${srcdir:=.}/host_on_off_d.xml > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "task on" > [Jupiter:slave:(2) 0.682345] [msg_test/INFO] Task "task on" done > [Tremblay:master:(1) 1.027003] [msg_test/INFO] Sending "task off" diff --git a/teshsuite/msg/host_on_off_d.xml b/teshsuite/msg/host_on_off/host_on_off_d.xml similarity index 100% rename from teshsuite/msg/host_on_off_d.xml rename to teshsuite/msg/host_on_off/host_on_off_d.xml diff --git a/teshsuite/msg/host_on_off_p.xml b/teshsuite/msg/host_on_off/host_on_off_p.xml similarity index 100% rename from teshsuite/msg/host_on_off_p.xml rename to teshsuite/msg/host_on_off/host_on_off_p.xml diff --git a/teshsuite/msg/pid/CMakeLists.txt b/teshsuite/msg/pid/CMakeLists.txt new file mode 100644 index 0000000000..6dee881663 --- /dev/null +++ b/teshsuite/msg/pid/CMakeLists.txt @@ -0,0 +1,37 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(pid pid.c) + +### Add definitions for compile +if(NOT WIN32) + target_link_libraries(pid simgrid m pthread) +else() + target_link_libraries(pid simgrid) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/pid.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/pid_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/pid_p.xml + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/pid.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/msg/pid.c b/teshsuite/msg/pid/pid.c similarity index 89% rename from teshsuite/msg/pid.c rename to teshsuite/msg/pid/pid.c index 6d8c14c517..0fee70ac43 100644 --- a/teshsuite/msg/pid.c +++ b/teshsuite/msg/pid/pid.c @@ -5,7 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "msg/msg.h" -#include "xbt/sysdep.h" +#include "xbt/sysdep.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); @@ -13,15 +13,15 @@ const char* mailbox = "mailbox"; #define task_comp_size 1000 #define task_comm_size 100000 -static int onexit(void* data){ - XBT_INFO("Process \"%d\" killed.", *((int*)data)); +static int onexit(smx_process_exit_status_t status, int *pid){ + XBT_INFO("Process \"%d\" killed.", *pid); return 0; } static int sendpid(int argc, char *argv[]) { int pid = MSG_process_self_PID(); - MSG_process_on_exit(onexit, &pid); + MSG_process_on_exit((int_f_pvoid_pvoid_t)onexit, &pid); msg_task_t task = MSG_task_create("pid", task_comp_size, task_comm_size, &pid); XBT_INFO("Sending pid of \"%d\".", pid); MSG_task_send(task, mailbox); diff --git a/teshsuite/msg/pid.tesh b/teshsuite/msg/pid/pid.tesh similarity index 85% rename from teshsuite/msg/pid.tesh rename to teshsuite/msg/pid/pid.tesh index a1894633d1..0a551860b1 100644 --- a/teshsuite/msg/pid.tesh +++ b/teshsuite/msg/pid/pid.tesh @@ -1,4 +1,4 @@ -$ msg/pid ${srcdir:=.}/msg/pid_p.xml ${srcdir:=.}/msg/pid_d.xml 0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ ./pid ${srcdir:=.}/pid_p.xml ${srcdir:=.}/pid_d.xml 0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:sendpid@toto) Sending pid of "1". > [ 0.000000] (2:sendpid@toto) Sending pid of "2". > [ 0.000000] (3:sendpid@toto) Sending pid of "3". @@ -12,7 +12,7 @@ $ msg/pid ${srcdir:=.}/msg/pid_p.xml ${srcdir:=.}/msg/pid_d.xml 0 "--log=root.fm > [ 0.003247] (4:killall@toto) Killing process "3". > [ 0.003247] (3:sendpid@toto) Process "3" killed. -$ msg/pid ${srcdir:=.}/msg/pid_p.xml ${srcdir:=.}/msg/pid_d.xml 2 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ ./pid ${srcdir:=.}/pid_p.xml ${srcdir:=.}/pid_d.xml 2 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (2:sendpid@toto) Sending pid of "2". > [ 0.000000] (3:sendpid@toto) Sending pid of "3". > [ 0.000000] (4:sendpid@toto) Sending pid of "4". diff --git a/teshsuite/msg/pid_d.xml b/teshsuite/msg/pid/pid_d.xml similarity index 100% rename from teshsuite/msg/pid_d.xml rename to teshsuite/msg/pid/pid_d.xml diff --git a/teshsuite/msg/pid_p.xml b/teshsuite/msg/pid/pid_p.xml similarity index 100% rename from teshsuite/msg/pid_p.xml rename to teshsuite/msg/pid/pid_p.xml diff --git a/teshsuite/msg/process/CMakeLists.txt b/teshsuite/msg/process/CMakeLists.txt new file mode 100644 index 0000000000..95b67c80a3 --- /dev/null +++ b/teshsuite/msg/process/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(process process.c) + +### Add definitions for compile +target_link_libraries(process simgrid) + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/process.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/process_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/process_p.xml + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/process.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/msg/process.c b/teshsuite/msg/process/process.c similarity index 100% rename from teshsuite/msg/process.c rename to teshsuite/msg/process/process.c diff --git a/teshsuite/msg/process.tesh b/teshsuite/msg/process/process.tesh similarity index 93% rename from teshsuite/msg/process.tesh rename to teshsuite/msg/process/process.tesh index 728b65c56f..c8ab7f7758 100644 --- a/teshsuite/msg/process.tesh +++ b/teshsuite/msg/process/process.tesh @@ -1,5 +1,5 @@ -$ msg/process ${srcdir:=.}/msg/process_p.xml ${srcdir:=.}/msg/process_d.xml +$ ./process ${srcdir:=.}/process_p.xml ${srcdir:=.}/process_d.xml > [Tremblay:slave:(2) 0.500000] [msg_test/INFO] Slave started (PID:2, PPID:0) > [Tremblay:slave:(2) 0.500000] [msg_test/INFO] Plop i am not suspended > [Tremblay:master:(1) 1.000000] [msg_test/INFO] Process(pid=1, ppid=0, name=master) diff --git a/teshsuite/msg/process_d.xml b/teshsuite/msg/process/process_d.xml similarity index 100% rename from teshsuite/msg/process_d.xml rename to teshsuite/msg/process/process_d.xml diff --git a/teshsuite/msg/process_p.xml b/teshsuite/msg/process/process_p.xml similarity index 100% rename from teshsuite/msg/process_p.xml rename to teshsuite/msg/process/process_p.xml diff --git a/teshsuite/msg/process_join/CMakeLists.txt b/teshsuite/msg/process_join/CMakeLists.txt new file mode 100644 index 0000000000..bca2830b7b --- /dev/null +++ b/teshsuite/msg/process_join/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(process_join ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process_join/process_join.c) + +### Add definitions for compile +target_link_libraries(process_join simgrid) + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/process_join.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/process_join_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/process_join_p.xml + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/process_join.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/msg/process_join/process_join.c b/teshsuite/msg/process_join/process_join.c new file mode 100644 index 0000000000..8f6e9d8ca8 --- /dev/null +++ b/teshsuite/msg/process_join/process_join.c @@ -0,0 +1,94 @@ +/* Copyright (c) 2010-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. */ + +#include +#include "msg/msg.h" /* Yeah! If you want to use msg, you need to include msg/msg.h */ +#include "xbt/sysdep.h" /* calloc, printf */ + +/* Create a log channel to have nice outputs. */ +#include "xbt/log.h" +#include "xbt/asserts.h" +XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, + "Messages specific for this msg example"); + +int master(int argc, char *argv[]); +int slave(int argc, char *argv[]); + +/** Emitter function */ +int master(int argc, char *argv[]) +{ + msg_process_t process; + + XBT_INFO("Start slave"); + process = MSG_process_create("slave from master", + slave, NULL, MSG_host_self()); + XBT_INFO("Join the slave (timeout 2)"); + MSG_process_join(process, 2); + + XBT_INFO("Start slave"); + process = MSG_process_create("slave from master", + slave, NULL, MSG_host_self()); + XBT_INFO("Join the slave (timeout 4)"); + MSG_process_join(process, 4); + + XBT_INFO("Start slave"); + process = MSG_process_create("slave from master", + slave, NULL, MSG_host_self()); + XBT_INFO("Join the slave (timeout 2)"); + MSG_process_join(process, 2); + + XBT_INFO("Goodbye now!"); + + MSG_process_sleep(1); + + XBT_INFO("Goodbye now!"); + return 0; +} /* end_of_master */ + +/** Receiver function */ +int slave(int argc, char *argv[]) +{ + XBT_INFO("Slave started"); + MSG_process_sleep(3); + XBT_INFO("I'm done. See you!"); + return 0; +} /* end_of_slave */ + +/** Main function */ +int main(int argc, char *argv[]) +{ + msg_error_t res; + const char *platform_file; + const char *application_file; + + MSG_init(&argc, argv); + if (argc != 3) { + printf("Usage: %s platform_file deployment_file\n", argv[0]); + printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); + exit(1); + } + platform_file = argv[1]; + application_file = argv[2]; + + /* MSG_config("workstation/model","KCCFLN05"); */ + { /* Simulation setting */ + MSG_create_environment(platform_file); + } + { /* Application deployment */ + MSG_function_register("master", master); + MSG_function_register("slave", slave); + + MSG_launch_application(application_file); + } + res = MSG_main(); + + XBT_INFO("Simulation time %g", MSG_get_clock()); + + if (res == MSG_OK) + return 0; + else + return 1; +} /* end_of_main */ diff --git a/teshsuite/msg/process_join/process_join.tesh b/teshsuite/msg/process_join/process_join.tesh new file mode 100644 index 0000000000..90548a5004 --- /dev/null +++ b/teshsuite/msg/process_join/process_join.tesh @@ -0,0 +1,17 @@ + +$ process_join ${srcdir:=.}/process_join_p.xml ${srcdir:=.}/process_join_d.xml +> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Start slave +> [Tremblay:slave from master:(2) 0.000000] [msg_test/INFO] Slave started +> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Join the slave (timeout 2) +> [Tremblay:master:(1) 2.000000] [msg_test/INFO] Start slave +> [Tremblay:slave from master:(3) 2.000000] [msg_test/INFO] Slave started +> [Tremblay:master:(1) 2.000000] [msg_test/INFO] Join the slave (timeout 4) +> [Tremblay:slave from master:(2) 3.000000] [msg_test/INFO] I'm done. See you! +> [Tremblay:slave from master:(3) 5.000000] [msg_test/INFO] I'm done. See you! +> [Tremblay:master:(1) 5.000000] [msg_test/INFO] Start slave +> [Tremblay:slave from master:(4) 5.000000] [msg_test/INFO] Slave started +> [Tremblay:master:(1) 5.000000] [msg_test/INFO] Join the slave (timeout 2) +> [Tremblay:master:(1) 7.000000] [msg_test/INFO] Goodbye now! +> [Tremblay:slave from master:(4) 8.000000] [msg_test/INFO] I'm done. See you! +> [Tremblay:master:(1) 8.000000] [msg_test/INFO] Goodbye now! +> [8.000000] [msg_test/INFO] Simulation time 8 diff --git a/teshsuite/msg/process_join/process_join_d.xml b/teshsuite/msg/process_join/process_join_d.xml new file mode 100644 index 0000000000..63461908fe --- /dev/null +++ b/teshsuite/msg/process_join/process_join_d.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/teshsuite/msg/process_join/process_join_p.xml b/teshsuite/msg/process_join/process_join_p.xml new file mode 100644 index 0000000000..90e976acee --- /dev/null +++ b/teshsuite/msg/process_join/process_join_p.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/teshsuite/msg/storage/platform.xml b/teshsuite/msg/storage/platform.xml index aa6b27110e..22a4876cb9 100644 --- a/teshsuite/msg/storage/platform.xml +++ b/teshsuite/msg/storage/platform.xml @@ -24,13 +24,13 @@ - + - + - - + + diff --git a/teshsuite/msg/storage/storage_basic.c b/teshsuite/msg/storage/storage_basic.c index 38e07ee6a1..d352f27363 100644 --- a/teshsuite/msg/storage/storage_basic.c +++ b/teshsuite/msg/storage/storage_basic.c @@ -36,13 +36,14 @@ void storage_info(msg_host_t host) { XBT_INFO("\tStorage name: %s, mount name: %s", storage_name, mount_name); - sg_size_t free_size = MSG_storage_get_free_size(mount_name); - sg_size_t used_size = MSG_storage_get_used_size(mount_name); + storage = MSG_storage_get_by_name(storage_name); + + sg_size_t free_size = MSG_storage_get_free_size(storage); + sg_size_t used_size = MSG_storage_get_used_size(storage); XBT_INFO("\t\tFree size: %llu bytes", free_size); XBT_INFO("\t\tUsed size: %llu bytes", used_size); - storage = MSG_storage_get_by_name(storage_name); display_storage_properties(storage); dump_storage_by_name(storage_name); } diff --git a/teshsuite/msg/storage/storage_basic.tesh b/teshsuite/msg/storage/storage_basic.tesh index 3c3c5a6120..288ebc3d37 100644 --- a/teshsuite/msg/storage/storage_basic.tesh +++ b/teshsuite/msg/storage/storage_basic.tesh @@ -1,4 +1,4 @@ -$ msg/storage/storage_basic --cfg=path:${srcdir:=.} ${srcdir:=.}/msg/storage/platform.xml ${srcdir:=.}/msg/storage/deployment.xml 0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ storage_basic --cfg=path:${srcdir:=.} ${srcdir:=.}/platform.xml ${srcdir:=.}/deployment.xml 0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:server@server) *** Storage info on server *** > [ 0.000000] (1:server@server) Storage name: sdisk1, mount name: /sd1 > [ 0.000000] (1:server@server) Free size: 322122547160 bytes diff --git a/teshsuite/msg/task_destroy_cancel/CMakeLists.txt b/teshsuite/msg/task_destroy_cancel/CMakeLists.txt new file mode 100644 index 0000000000..565498c0c9 --- /dev/null +++ b/teshsuite/msg/task_destroy_cancel/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(task_destroy_cancel task_destroy_cancel.c) + +### Add definitions for compile +target_link_libraries(task_destroy_cancel simgrid) + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_p.xml + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/msg/task_destroy_cancel.c b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c similarity index 100% rename from teshsuite/msg/task_destroy_cancel.c rename to teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c diff --git a/teshsuite/msg/task_destroy_cancel.tesh b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh similarity index 91% rename from teshsuite/msg/task_destroy_cancel.tesh rename to teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh index d125183c36..c20f5ce770 100644 --- a/teshsuite/msg/task_destroy_cancel.tesh +++ b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh @@ -1,5 +1,5 @@ -$ msg/task_destroy_cancel ${srcdir:=.}/msg/task_destroy_cancel_p.xml ${srcdir:=.}/msg/task_destroy_cancel_d.xml +$ ./task_destroy_cancel ${srcdir:=.}/task_destroy_cancel_p.xml ${srcdir:=.}/task_destroy_cancel_d.xml > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending task: "normal" > [Jupiter:slave:(2) 0.027003] [msg_test/INFO] Handling task "normal" > [Tremblay:master:(1) 0.027003] [msg_test/INFO] Canceling task "cancel directly" directly diff --git a/teshsuite/msg/task_destroy_cancel_d.xml b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel_d.xml similarity index 100% rename from teshsuite/msg/task_destroy_cancel_d.xml rename to teshsuite/msg/task_destroy_cancel/task_destroy_cancel_d.xml diff --git a/teshsuite/msg/task_destroy_cancel_p.xml b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel_p.xml similarity index 100% rename from teshsuite/msg/task_destroy_cancel_p.xml rename to teshsuite/msg/task_destroy_cancel/task_destroy_cancel_p.xml diff --git a/teshsuite/msg/trace/platform.xml b/teshsuite/msg/trace/platform.xml index 5e8b1d586a..5038245b64 100644 --- a/teshsuite/msg/trace/platform.xml +++ b/teshsuite/msg/trace/platform.xml @@ -2,6 +2,6 @@ - + diff --git a/teshsuite/msg/trace/trace.tesh b/teshsuite/msg/trace/trace.tesh index 4ad10a001d..f843ad4cb2 100644 --- a/teshsuite/msg/trace/trace.tesh +++ b/teshsuite/msg/trace/trace.tesh @@ -3,7 +3,7 @@ p Testing trace integration using file.trace and test1.xml, a < max(time), b < max(time) ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform.xml ./trace/test1.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform.xml ./test1.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' @@ -15,7 +15,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platfo p Testing trace integration using file.trace and test2.xml, a < max(time), max(time) < b < 2 max(time) ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform.xml ./trace/test2.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform.xml ./test2.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' @@ -27,7 +27,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platfo p Testing trace integration using file.trace and test3.xml, a < max(time), b > 2 max(time) ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform.xml ./trace/test3.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform.xml ./test3.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' @@ -39,7 +39,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platfo p Testing trace integration using file.trace and test4.xml, max(time) < a < 2max(time), max(time) < b < 2max(time) ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform.xml ./trace/test4.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform.xml ./test4.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' @@ -51,7 +51,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platfo p Testing trace integration using file.trace and test5.xml, max(time) < a < 2max(time), 2max(time) < b < 3max(time) ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform.xml ./trace/test5.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform.xml ./test5.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' @@ -63,7 +63,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platfo p Testing trace integration using file.trace and test6.xml, max(time) < a < 2max(time), b > 3max(time) ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform.xml ./trace/test6.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform.xml ./test6.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' @@ -75,7 +75,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platfo p Testing trace integration using file.trace and test7.xml, two process with same priority ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform.xml ./trace/test7.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform.xml ./test7.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' @@ -91,7 +91,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platfo p Testing trace integration using file.trace and test8.xml, two process with different priority ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform.xml ./trace/test8.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform.xml ./test8.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' @@ -107,7 +107,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platfo p Testing trace integration using file.trace and test9.xml, three process with same priority ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform.xml ./trace/test9.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform.xml ./test9.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' @@ -127,7 +127,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platfo p Testing trace integration using file.trace and test10.xml, three process with different priority ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform.xml ./trace/test10.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform.xml ./test10.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' @@ -147,7 +147,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platfo p Testing trace integration using file.trace and test11.xml, three process with different priority. Changed timestep to 0.1. ! output sort -$ $SG_TEST_EXENV ${bindir:=.}/trace/test_trace_integration$EXEEXT ./trace/platform_trace.xml ./trace/test11.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/test_trace_integration$EXEEXT ./platform_trace.xml ./test11.xml --cfg=workstation/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'workstation/model' to 'compound' > [ 0.000000] (0:@) Configuration change: Set 'network/model' to 'CM02' > [ 0.000000] (0:@) Configuration change: Set 'cpu/optim' to 'TI' diff --git a/teshsuite/simdag/CMakeLists.txt b/teshsuite/simdag/basic/CMakeLists.txt similarity index 87% rename from teshsuite/simdag/CMakeLists.txt rename to teshsuite/simdag/basic/CMakeLists.txt index 32d833481a..cc6c67d4a8 100644 --- a/teshsuite/simdag/CMakeLists.txt +++ b/teshsuite/simdag/basic/CMakeLists.txt @@ -9,7 +9,6 @@ add_executable(basic3 basic3.c) add_executable(basic4 basic4.c) add_executable(basic5 basic5.c) add_executable(basic6 basic6.c) -add_executable(incomplete incomplete.c) ### Add definitions for compile if(NOT WIN32) @@ -20,7 +19,6 @@ if(NOT WIN32) target_link_libraries(basic4 simgrid m pthread ) target_link_libraries(basic5 simgrid m pthread ) target_link_libraries(basic6 simgrid m pthread ) - target_link_libraries(incomplete simgrid m pthread ) else() target_link_libraries(basic0 simgrid) target_link_libraries(basic1 simgrid) @@ -29,7 +27,6 @@ else() target_link_libraries(basic4 simgrid) target_link_libraries(basic5 simgrid) target_link_libraries(basic6 simgrid) - target_link_libraries(incomplete simgrid) endif() set(tesh_files @@ -41,8 +38,6 @@ set(tesh_files ${CMAKE_CURRENT_SOURCE_DIR}/basic4.tesh ${CMAKE_CURRENT_SOURCE_DIR}/basic5.tesh ${CMAKE_CURRENT_SOURCE_DIR}/basic6.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/incomplete.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/simdag.tesh PARENT_SCOPE ) set(xml_files @@ -59,7 +54,6 @@ set(teshsuite_src ${CMAKE_CURRENT_SOURCE_DIR}/basic4.c ${CMAKE_CURRENT_SOURCE_DIR}/basic5.c ${CMAKE_CURRENT_SOURCE_DIR}/basic6.c - ${CMAKE_CURRENT_SOURCE_DIR}/incomplete.c PARENT_SCOPE ) set(bin_files diff --git a/teshsuite/simdag/basic0.c b/teshsuite/simdag/basic/basic0.c similarity index 100% rename from teshsuite/simdag/basic0.c rename to teshsuite/simdag/basic/basic0.c diff --git a/teshsuite/simdag/basic/basic0.tesh b/teshsuite/simdag/basic/basic0.tesh new file mode 100644 index 0000000000..004b5300d6 --- /dev/null +++ b/teshsuite/simdag/basic/basic0.tesh @@ -0,0 +1,3 @@ +$ ${bindir:=.}/basic0 basic_platform.xml "--log=root.fmt:[%10.6r]%e%m%n" +> [ 0.000000] surf_workstation_model_init_ptask_L07 +> [ 0.800100] Simulation time: 0.800100 diff --git a/teshsuite/simdag/basic1.c b/teshsuite/simdag/basic/basic1.c similarity index 100% rename from teshsuite/simdag/basic1.c rename to teshsuite/simdag/basic/basic1.c diff --git a/teshsuite/simdag/basic/basic1.tesh b/teshsuite/simdag/basic/basic1.tesh new file mode 100644 index 0000000000..45dfc06546 --- /dev/null +++ b/teshsuite/simdag/basic/basic1.tesh @@ -0,0 +1,3 @@ +$ ${bindir:=.}/basic1 basic_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +> [ 16.000100] (0:@) Simulation time: 16.000100 diff --git a/teshsuite/simdag/basic2.c b/teshsuite/simdag/basic/basic2.c similarity index 100% rename from teshsuite/simdag/basic2.c rename to teshsuite/simdag/basic/basic2.c diff --git a/teshsuite/simdag/basic/basic2.tesh b/teshsuite/simdag/basic/basic2.tesh new file mode 100644 index 0000000000..4d17b7bb00 --- /dev/null +++ b/teshsuite/simdag/basic/basic2.tesh @@ -0,0 +1,3 @@ +$ ${bindir:=.}/basic2 basic_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +> [ 8.800100] (0:@) Simulation time: 8.800100 diff --git a/teshsuite/simdag/basic3.c b/teshsuite/simdag/basic/basic3.c similarity index 100% rename from teshsuite/simdag/basic3.c rename to teshsuite/simdag/basic/basic3.c diff --git a/teshsuite/simdag/basic3.tesh b/teshsuite/simdag/basic/basic3.tesh similarity index 74% rename from teshsuite/simdag/basic3.tesh rename to teshsuite/simdag/basic/basic3.tesh index f1afcbddb5..f17325f9df 100644 --- a/teshsuite/simdag/basic3.tesh +++ b/teshsuite/simdag/basic/basic3.tesh @@ -1,4 +1,4 @@ -$ simdag/basic3 ${srcdir:=.}/simdag/basic_platform.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e%m%n" --log=sd_kernel.thresh:verbose +$ ${bindir:=.}/basic3 basic_platform.xml "--log=root.fmt:[%10.6r]%e%m%n" --log=sd_kernel.thresh:verbose > [ 0.000000] surf_workstation_model_init_ptask_L07 > [ 0.000000] Starting simulation... > [ 0.000000] Run simulation for -1.000000 seconds diff --git a/teshsuite/simdag/basic4.c b/teshsuite/simdag/basic/basic4.c similarity index 100% rename from teshsuite/simdag/basic4.c rename to teshsuite/simdag/basic/basic4.c diff --git a/teshsuite/simdag/basic4.tesh b/teshsuite/simdag/basic/basic4.tesh similarity index 74% rename from teshsuite/simdag/basic4.tesh rename to teshsuite/simdag/basic/basic4.tesh index f7eda80721..9e78db6d5c 100644 --- a/teshsuite/simdag/basic4.tesh +++ b/teshsuite/simdag/basic/basic4.tesh @@ -1,4 +1,4 @@ -$ simdag/basic4 ${srcdir:=.}/simdag/basic_platform.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e%m%n" --log=sd_kernel.thresh:verbose +$ ${bindir:=.}/basic4 basic_platform.xml "--log=root.fmt:[%10.6r]%e%m%n" --log=sd_kernel.thresh:verbose > [ 0.000000] surf_workstation_model_init_ptask_L07 > [ 0.000000] Starting simulation... > [ 0.000000] Run simulation for -1.000000 seconds diff --git a/teshsuite/simdag/basic5.c b/teshsuite/simdag/basic/basic5.c similarity index 100% rename from teshsuite/simdag/basic5.c rename to teshsuite/simdag/basic/basic5.c diff --git a/teshsuite/simdag/basic/basic5.tesh b/teshsuite/simdag/basic/basic5.tesh new file mode 100644 index 0000000000..c3dd97fb19 --- /dev/null +++ b/teshsuite/simdag/basic/basic5.tesh @@ -0,0 +1,3 @@ +$ ${bindir:=.}/basic5 basic_platform.xml "--log=root.fmt:[%10.6r]%e%m%n" +> [ 0.000000] surf_workstation_model_init_ptask_L07 +> [ 0.002500] Simulation time: 0.002500 diff --git a/teshsuite/simdag/basic6.c b/teshsuite/simdag/basic/basic6.c similarity index 100% rename from teshsuite/simdag/basic6.c rename to teshsuite/simdag/basic/basic6.c diff --git a/teshsuite/simdag/basic/basic6.tesh b/teshsuite/simdag/basic/basic6.tesh new file mode 100644 index 0000000000..45cee0796c --- /dev/null +++ b/teshsuite/simdag/basic/basic6.tesh @@ -0,0 +1,3 @@ +$ ${bindir:=.}/basic6 ../network/p2p/platform_2p_1sl.xml "--log=root.fmt:[%10.6r]%e%m%n" +> [ 0.000000] surf_workstation_model_init_ptask_L07 +> [ 2.000000] Simulation time: 2.000000 diff --git a/teshsuite/simdag/basic_platform.xml b/teshsuite/simdag/basic/basic_platform.xml similarity index 100% rename from teshsuite/simdag/basic_platform.xml rename to teshsuite/simdag/basic/basic_platform.xml diff --git a/teshsuite/simdag/basic0.tesh b/teshsuite/simdag/basic0.tesh deleted file mode 100644 index 6229ec2b17..0000000000 --- a/teshsuite/simdag/basic0.tesh +++ /dev/null @@ -1,3 +0,0 @@ -$ simdag/basic0 ${srcdir:=.}/simdag/basic_platform.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e%m%n" -> [ 0.000000] surf_workstation_model_init_ptask_L07 -> [ 0.800100] Simulation time: 0.800100 diff --git a/teshsuite/simdag/basic1.tesh b/teshsuite/simdag/basic1.tesh deleted file mode 100644 index c2b666d502..0000000000 --- a/teshsuite/simdag/basic1.tesh +++ /dev/null @@ -1,3 +0,0 @@ -$ simdag/basic1 ${srcdir:=.}/simdag/basic_platform.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 -> [ 16.000100] (0:@) Simulation time: 16.000100 diff --git a/teshsuite/simdag/basic2.tesh b/teshsuite/simdag/basic2.tesh deleted file mode 100644 index 9f15bc1886..0000000000 --- a/teshsuite/simdag/basic2.tesh +++ /dev/null @@ -1,3 +0,0 @@ -$ simdag/basic2 ${srcdir:=.}/simdag/basic_platform.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 -> [ 8.800100] (0:@) Simulation time: 8.800100 \ No newline at end of file diff --git a/teshsuite/simdag/basic5.tesh b/teshsuite/simdag/basic5.tesh deleted file mode 100644 index 19ba94862c..0000000000 --- a/teshsuite/simdag/basic5.tesh +++ /dev/null @@ -1,3 +0,0 @@ -$ simdag/basic5 ${srcdir:=.}/simdag/basic_platform.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e%m%n" -> [ 0.000000] surf_workstation_model_init_ptask_L07 -> [ 0.002500] Simulation time: 0.002500 diff --git a/teshsuite/simdag/basic6.tesh b/teshsuite/simdag/basic6.tesh deleted file mode 100644 index 04d782fa56..0000000000 --- a/teshsuite/simdag/basic6.tesh +++ /dev/null @@ -1,3 +0,0 @@ -$ simdag/basic6 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e%m%n" -> [ 0.000000] surf_workstation_model_init_ptask_L07 -> [ 2.000000] Simulation time: 2.000000 diff --git a/teshsuite/simdag/incomplete/CMakeLists.txt b/teshsuite/simdag/incomplete/CMakeLists.txt new file mode 100644 index 0000000000..98bff3c5e8 --- /dev/null +++ b/teshsuite/simdag/incomplete/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(incomplete incomplete.c) + +### Add definitions for compile +if(NOT WIN32) + target_link_libraries(incomplete simgrid m pthread ) +else() + target_link_libraries(incomplete simgrid) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/incomplete.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/incomplete.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/simdag/incomplete.c b/teshsuite/simdag/incomplete/incomplete.c similarity index 100% rename from teshsuite/simdag/incomplete.c rename to teshsuite/simdag/incomplete/incomplete.c diff --git a/teshsuite/simdag/incomplete.tesh b/teshsuite/simdag/incomplete/incomplete.tesh similarity index 73% rename from teshsuite/simdag/incomplete.tesh rename to teshsuite/simdag/incomplete/incomplete.tesh index bd81be91a7..533641125a 100644 --- a/teshsuite/simdag/incomplete.tesh +++ b/teshsuite/simdag/incomplete/incomplete.tesh @@ -1,4 +1,4 @@ -$ simdag/incomplete ${srcdir:=.}/simdag/basic_platform.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e%m%n" +$ ${bindir:=.}/incomplete ../basic/basic_platform.xml "--log=root.fmt:[%10.6r]%e%m%n" > [ 0.000000] surf_workstation_model_init_ptask_L07 > [ 8.000100] Simulation is finished but 3 tasks are still not done > [ 8.000100] Task C is in SD_NOT_SCHEDULED state diff --git a/teshsuite/simdag/platforms/bogus_disk_attachment.tesh b/teshsuite/simdag/platforms/bogus_disk_attachment.tesh index 534cd7fcea..02e5e4aae3 100644 --- a/teshsuite/simdag/platforms/bogus_disk_attachment.tesh +++ b/teshsuite/simdag/platforms/bogus_disk_attachment.tesh @@ -1,4 +1,4 @@ ! expect signal SIGABRT $ ${bindir:=.}/flatifier bogus_disk_attachment.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" > [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 -> [ 0.000000] [0:@] Parse error at bogus_disk_attachment.xml:26: Enable to attach storage cdisk: host plouf doesn't exist. +> [ 0.000000] [0:@] Parse error at bogus_disk_attachment.xml:26: Unable to attach storage cdisk: host plouf doesn't exist. diff --git a/teshsuite/simdag/platforms/flatifier.c b/teshsuite/simdag/platforms/flatifier.c index e0762b0f07..5c33f70653 100644 --- a/teshsuite/simdag/platforms/flatifier.c +++ b/teshsuite/simdag/platforms/flatifier.c @@ -116,7 +116,7 @@ int main(int argc, char **argv) if (parse_cmdline(&timings, &downgrade, &platformFile, argc, argv) || !platformFile) { xbt_die("Invalid command line arguments: expected [--timings|--downgrade] platformFile"); } - + XBT_DEBUG("%d,%d,%s", timings, downgrade, platformFile); if (downgrade) { @@ -148,7 +148,7 @@ int main(int argc, char **argv) SD_workstation_get_power(hosts[i])); props = SD_workstation_get_properties(hosts[i]); if (SD_workstation_get_cores(hosts[i])>1) { - printf(" cores=\"%d\"", SD_workstation_get_cores(hosts[i])); + printf(" core=\"%d\"", SD_workstation_get_cores(hosts[i])); } if (props && !xbt_dict_is_empty(props)) { printf(">\n"); diff --git a/teshsuite/simdag/platforms/flatifier.tesh b/teshsuite/simdag/platforms/flatifier.tesh index fe5f803561..260c38edd2 100644 --- a/teshsuite/simdag/platforms/flatifier.tesh +++ b/teshsuite/simdag/platforms/flatifier.tesh @@ -143,11 +143,11 @@ $ ${bindir:=.}/flatifier$EXEEXT one_cluster_multicore.xml "--log=root.fmt:[%10.6 > > > -> -> -> -> -> +> +> +> +> +> > > > diff --git a/teshsuite/simdag/simdag.tesh b/teshsuite/simdag/simdag.tesh deleted file mode 100644 index 5d99382372..0000000000 --- a/teshsuite/simdag/simdag.tesh +++ /dev/null @@ -1,16 +0,0 @@ -#! ./tesh - -# Description of this tesh file -D This tesh file contains all the tesh files relative with SimDag - -# SimDag tesh suite - -! suite Simdag tests this suite contains all the tesh files relative with SimDag -! include basic0.tesh -! include basic1.tesh -! include basic2.tesh -! include basic3.tesh -! include basic4.tesh -! include basic5.tesh -! include basic6.tesh -! include incomplete.tesh diff --git a/teshsuite/simix/CMakeLists.txt b/teshsuite/simix/check_defaults/CMakeLists.txt similarity index 72% rename from teshsuite/simix/CMakeLists.txt rename to teshsuite/simix/check_defaults/CMakeLists.txt index 8a22a1af57..4c789622b0 100644 --- a/teshsuite/simix/CMakeLists.txt +++ b/teshsuite/simix/check_defaults/CMakeLists.txt @@ -5,26 +5,20 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") add_executable(check_defaults check_defaults.c) target_link_libraries(check_defaults simgrid) -add_executable(stack_overflow stack_overflow.c) -target_link_libraries(stack_overflow simgrid) - set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/factory_raw.tesh ${CMAKE_CURRENT_SOURCE_DIR}/factory_thread.tesh ${CMAKE_CURRENT_SOURCE_DIR}/factory_ucontext.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/stack_overflow.tesh PARENT_SCOPE ) set(xml_files ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/stack_overflow.xml PARENT_SCOPE ) set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/check_defaults.c - ${CMAKE_CURRENT_SOURCE_DIR}/stack_overflow.c PARENT_SCOPE ) set(bin_files diff --git a/teshsuite/simix/check_defaults.c b/teshsuite/simix/check_defaults/check_defaults.c similarity index 100% rename from teshsuite/simix/check_defaults.c rename to teshsuite/simix/check_defaults/check_defaults.c diff --git a/teshsuite/simix/factory_raw.tesh b/teshsuite/simix/check_defaults/factory_raw.tesh similarity index 76% rename from teshsuite/simix/factory_raw.tesh rename to teshsuite/simix/check_defaults/factory_raw.tesh index 7fc2525b19..7cfb7c196d 100644 --- a/teshsuite/simix/factory_raw.tesh +++ b/teshsuite/simix/check_defaults/factory_raw.tesh @@ -1,2 +1,2 @@ -$ ./simix/check_defaults +$ ${bindir:=.}/check_defaults > [simix_context/VERBOSE] Using raw contexts. Because the glibc is just not good enough for us. diff --git a/teshsuite/simix/factory_thread.tesh b/teshsuite/simix/check_defaults/factory_thread.tesh similarity index 66% rename from teshsuite/simix/factory_thread.tesh rename to teshsuite/simix/check_defaults/factory_thread.tesh index fdb9520fad..8acbd401e7 100644 --- a/teshsuite/simix/factory_thread.tesh +++ b/teshsuite/simix/check_defaults/factory_thread.tesh @@ -1,2 +1,2 @@ -$ ./simix/check_defaults +$ ${bindir:=.}/check_defaults > [simix_context/VERBOSE] Activating thread context factory diff --git a/teshsuite/simix/factory_ucontext.tesh b/teshsuite/simix/check_defaults/factory_ucontext.tesh similarity index 65% rename from teshsuite/simix/factory_ucontext.tesh rename to teshsuite/simix/check_defaults/factory_ucontext.tesh index bf4130af82..8652bb4f20 100644 --- a/teshsuite/simix/factory_ucontext.tesh +++ b/teshsuite/simix/check_defaults/factory_ucontext.tesh @@ -1,2 +1,2 @@ -$ ./simix/check_defaults +$ ${bindir:=.}/check_defaults > [simix_context/VERBOSE] Activating SYSV context factory diff --git a/teshsuite/simix/stack_overflow/CMakeLists.txt b/teshsuite/simix/stack_overflow/CMakeLists.txt new file mode 100644 index 0000000000..e03954506f --- /dev/null +++ b/teshsuite/simix/stack_overflow/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(stack_overflow stack_overflow.c) +target_link_libraries(stack_overflow simgrid) + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/stack_overflow.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/stack_overflow.xml + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/stack_overflow.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/simix/stack_overflow.c b/teshsuite/simix/stack_overflow/stack_overflow.c similarity index 100% rename from teshsuite/simix/stack_overflow.c rename to teshsuite/simix/stack_overflow/stack_overflow.c diff --git a/teshsuite/simix/stack_overflow.tesh b/teshsuite/simix/stack_overflow/stack_overflow.tesh similarity index 86% rename from teshsuite/simix/stack_overflow.tesh rename to teshsuite/simix/stack_overflow/stack_overflow.tesh index a0df41eb0f..aaff9b2de2 100644 --- a/teshsuite/simix/stack_overflow.tesh +++ b/teshsuite/simix/stack_overflow/stack_overflow.tesh @@ -1,5 +1,5 @@ ! expect signal SIGSEGV -$ ./simix/stack_overflow --cfg=contexts/stack_size:96 ${srcdir:=.}/simix/stack_overflow.xml +$ ${bindir:=.}/stack_overflow --cfg=contexts/stack_size:96 stack_overflow.xml > [Tremblay:master:(0) 0.000000] [test/INFO] Launching our nice bugged recursive function... > Access violation detected. > This can result from a programming error in your code or, although less likely, diff --git a/teshsuite/simix/stack_overflow.xml b/teshsuite/simix/stack_overflow/stack_overflow.xml similarity index 100% rename from teshsuite/simix/stack_overflow.xml rename to teshsuite/simix/stack_overflow/stack_overflow.xml diff --git a/teshsuite/smpi/CMakeLists.txt b/teshsuite/smpi/CMakeLists.txt index e24465cf88..e1316e536b 100644 --- a/teshsuite/smpi/CMakeLists.txt +++ b/teshsuite/smpi/CMakeLists.txt @@ -6,102 +6,12 @@ if(enable_smpi) else() set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") endif() - set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") - - include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") - add_executable(gather_coll gather_coll.c) - add_executable(allgather_coll allgather_coll.c) - add_executable(allgatherv_coll allgatherv_coll.c) - add_executable(alltoall2 alltoall2.c) - add_executable(alltoall_basic alltoall_basic.c) - add_executable(alltoall_coll alltoall_coll.c) - add_executable(alltoallv_coll alltoallv_coll.c) - add_executable(allreduce allreduce.c) - add_executable(allreduce_coll allreduce_coll.c) - add_executable(bcast bcast.c) - add_executable(bcast_coll bcast_coll.c) - add_executable(barrier_coll barrier.c ) - add_executable(compute compute.c) - add_executable(compute2 compute2.c) - add_executable(compute3 compute3.c) - add_executable(pingpong pingpong.c) - add_executable(scatter scatter.c) - add_executable(reduce reduce.c) - add_executable(reduce_coll reduce_coll.c) - add_executable(reduce_scatter_coll reduce_scatter_coll.c) - add_executable(split split.c) - add_executable(smpi_sendrecv sendrecv.c) - add_executable(ttest01 ttest01.c) - add_executable(vector_test vector_test.c) - add_executable(hvector_test hvector_test.c) - add_executable(indexed_test indexed_test.c) - add_executable(struct_test struct_test.c) - add_executable(dsend dsend.c) - - target_link_libraries(gather_coll simgrid) - target_link_libraries(allgather_coll simgrid) - target_link_libraries(allgatherv_coll simgrid) - target_link_libraries(alltoall2 simgrid) - target_link_libraries(alltoall_basic simgrid) - target_link_libraries(alltoall_coll simgrid) - target_link_libraries(alltoallv_coll simgrid) - target_link_libraries(allreduce simgrid) - target_link_libraries(allreduce_coll simgrid) - target_link_libraries(bcast simgrid) - target_link_libraries(bcast_coll simgrid) - target_link_libraries(barrier_coll simgrid) - target_link_libraries(compute simgrid) - target_link_libraries(compute2 simgrid) - target_link_libraries(compute3 simgrid) - target_link_libraries(pingpong simgrid) - target_link_libraries(scatter simgrid) - target_link_libraries(reduce simgrid) - target_link_libraries(reduce_coll simgrid) - target_link_libraries(reduce_scatter_coll simgrid) - target_link_libraries(split simgrid) - target_link_libraries(smpi_sendrecv simgrid) - target_link_libraries(ttest01 simgrid) - target_link_libraries(vector_test simgrid) - target_link_libraries(hvector_test simgrid) - target_link_libraries(indexed_test simgrid) - target_link_libraries(struct_test simgrid) - target_link_libraries(dsend simgrid) - - set_target_properties(smpi_sendrecv PROPERTIES RENAME sendrecv) - - if(NOT WIN32) - add_executable(shared shared.c) - target_link_libraries(shared simgrid) - endif() - endif() set(tesh_files ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/gather_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/allgather_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll_large.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/alltoall_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/scatter_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/barrier_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/bcast.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/bcast_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/compute.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/shared.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/hvector.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/indexed.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/reduce.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/reduce_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/struct.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/vector.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/TI_output.tesh PARENT_SCOPE ) set(xml_files @@ -110,38 +20,6 @@ set(xml_files ) set(examples_src ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/gather_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/allgather_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/alltoall_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/bcast_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/reduce_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/get_processor_name.c - ${CMAKE_CURRENT_SOURCE_DIR}/pingpong.c - ${CMAKE_CURRENT_SOURCE_DIR}/bcast.c - ${CMAKE_CURRENT_SOURCE_DIR}/allreduce.c - ${CMAKE_CURRENT_SOURCE_DIR}/alltoall_basic.c - ${CMAKE_CURRENT_SOURCE_DIR}/sendrecv.c - ${CMAKE_CURRENT_SOURCE_DIR}/reduce.c - ${CMAKE_CURRENT_SOURCE_DIR}/compute2.c - ${CMAKE_CURRENT_SOURCE_DIR}/shared.c - ${CMAKE_CURRENT_SOURCE_DIR}/split.c - ${CMAKE_CURRENT_SOURCE_DIR}/dsend.c - ${CMAKE_CURRENT_SOURCE_DIR}/ttest01.c - ${CMAKE_CURRENT_SOURCE_DIR}/compute.c - ${CMAKE_CURRENT_SOURCE_DIR}/compute3.c - ${CMAKE_CURRENT_SOURCE_DIR}/alltoall2.c - ${CMAKE_CURRENT_SOURCE_DIR}/scatter.c - ${CMAKE_CURRENT_SOURCE_DIR}/sendtest.c - ${CMAKE_CURRENT_SOURCE_DIR}/barrier.c - ${CMAKE_CURRENT_SOURCE_DIR}/vector_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/hvector_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/indexed_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/struct_test.c PARENT_SCOPE ) set(bin_files diff --git a/teshsuite/smpi/allgather/CMakeLists.txt b/teshsuite/smpi/allgather/CMakeLists.txt new file mode 100644 index 0000000000..ecdaa81fc3 --- /dev/null +++ b/teshsuite/smpi/allgather/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(allgather_coll allgather_coll.c) + target_link_libraries(allgather_coll simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/allgather_coll.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/allgather_coll.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/allgather_coll.c b/teshsuite/smpi/allgather/allgather_coll.c similarity index 100% rename from teshsuite/smpi/allgather_coll.c rename to teshsuite/smpi/allgather/allgather_coll.c diff --git a/teshsuite/smpi/allgather_coll.tesh b/teshsuite/smpi/allgather/allgather_coll.tesh similarity index 92% rename from teshsuite/smpi/allgather_coll.tesh rename to teshsuite/smpi/allgather/allgather_coll.tesh index 3e23a6b6e0..1908b13a6c 100644 --- a/teshsuite/smpi/allgather_coll.tesh +++ b/teshsuite/smpi/allgather/allgather_coll.tesh @@ -3,7 +3,7 @@ ! output sort p Test all to all -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allgather_coll --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allgather_coll --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [rank 0] -> Tremblay > [rank 1] -> Jupiter diff --git a/teshsuite/smpi/allgatherv/CMakeLists.txt b/teshsuite/smpi/allgatherv/CMakeLists.txt new file mode 100644 index 0000000000..8e1693c5fa --- /dev/null +++ b/teshsuite/smpi/allgatherv/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(allgatherv_coll allgatherv_coll.c) + target_link_libraries(allgatherv_coll simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv_coll.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv_coll.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/allgatherv_coll.c b/teshsuite/smpi/allgatherv/allgatherv_coll.c similarity index 100% rename from teshsuite/smpi/allgatherv_coll.c rename to teshsuite/smpi/allgatherv/allgatherv_coll.c diff --git a/teshsuite/smpi/allgatherv_coll.tesh b/teshsuite/smpi/allgatherv/allgatherv_coll.tesh similarity index 97% rename from teshsuite/smpi/allgatherv_coll.tesh rename to teshsuite/smpi/allgatherv/allgatherv_coll.tesh index a4a9e46ee7..beb6429fbf 100644 --- a/teshsuite/smpi/allgatherv_coll.tesh +++ b/teshsuite/smpi/allgatherv/allgatherv_coll.tesh @@ -3,7 +3,7 @@ ! output sort p Test allgatherv -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allgatherv_coll --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allgatherv_coll --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [rank 0] -> Tremblay > [rank 1] -> Jupiter diff --git a/teshsuite/smpi/allreduce/CMakeLists.txt b/teshsuite/smpi/allreduce/CMakeLists.txt new file mode 100644 index 0000000000..a4ad62cb9a --- /dev/null +++ b/teshsuite/smpi/allreduce/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(allreduce allreduce.c) + add_executable(allreduce_coll allreduce_coll.c) + target_link_libraries(allreduce simgrid) + target_link_libraries(allreduce_coll simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll_large.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/allreduce.c + ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/allreduce.c b/teshsuite/smpi/allreduce/allreduce.c similarity index 100% rename from teshsuite/smpi/allreduce.c rename to teshsuite/smpi/allreduce/allreduce.c diff --git a/teshsuite/smpi/allreduce_coll.c b/teshsuite/smpi/allreduce/allreduce_coll.c similarity index 100% rename from teshsuite/smpi/allreduce_coll.c rename to teshsuite/smpi/allreduce/allreduce_coll.c diff --git a/teshsuite/smpi/allreduce_coll.tesh b/teshsuite/smpi/allreduce/allreduce_coll.tesh similarity index 94% rename from teshsuite/smpi/allreduce_coll.tesh rename to teshsuite/smpi/allreduce/allreduce_coll.tesh index b797b2e0aa..e7aaae0d34 100644 --- a/teshsuite/smpi/allreduce_coll.tesh +++ b/teshsuite/smpi/allreduce/allreduce_coll.tesh @@ -3,7 +3,7 @@ ! output sort p Test allreduce -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allreduce_coll --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allreduce_coll --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [rank 0] -> Tremblay > [rank 1] -> Jupiter diff --git a/teshsuite/smpi/allreduce_coll_large.tesh b/teshsuite/smpi/allreduce/allreduce_coll_large.tesh similarity index 99% rename from teshsuite/smpi/allreduce_coll_large.tesh rename to teshsuite/smpi/allreduce/allreduce_coll_large.tesh index e13e40c43a..a96dc87666 100644 --- a/teshsuite/smpi/allreduce_coll_large.tesh +++ b/teshsuite/smpi/allreduce/allreduce_coll_large.tesh @@ -4,7 +4,7 @@ ! timeout 20 p Test allreduce -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allreduce_coll 30000 --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allreduce_coll 30000 --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [rank 0] -> Tremblay > [rank 1] -> Jupiter diff --git a/teshsuite/smpi/alltoall/CMakeLists.txt b/teshsuite/smpi/alltoall/CMakeLists.txt new file mode 100644 index 0000000000..371e7d6964 --- /dev/null +++ b/teshsuite/smpi/alltoall/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(alltoall2 alltoall2.c) + add_executable(alltoall_basic alltoall_basic.c) + add_executable(alltoall_coll alltoall_coll.c) + target_link_libraries(alltoall2 simgrid) + target_link_libraries(alltoall_basic simgrid) + target_link_libraries(alltoall_coll simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/alltoall_coll.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/alltoall_coll.c + ${CMAKE_CURRENT_SOURCE_DIR}/alltoall_basic.c + ${CMAKE_CURRENT_SOURCE_DIR}/alltoall2.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/alltoall2.c b/teshsuite/smpi/alltoall/alltoall2.c similarity index 100% rename from teshsuite/smpi/alltoall2.c rename to teshsuite/smpi/alltoall/alltoall2.c diff --git a/teshsuite/smpi/alltoall_basic.c b/teshsuite/smpi/alltoall/alltoall_basic.c similarity index 100% rename from teshsuite/smpi/alltoall_basic.c rename to teshsuite/smpi/alltoall/alltoall_basic.c diff --git a/teshsuite/smpi/alltoall_coll.c b/teshsuite/smpi/alltoall/alltoall_coll.c similarity index 100% rename from teshsuite/smpi/alltoall_coll.c rename to teshsuite/smpi/alltoall/alltoall_coll.c diff --git a/teshsuite/smpi/alltoall_coll.tesh b/teshsuite/smpi/alltoall/alltoall_coll.tesh similarity index 93% rename from teshsuite/smpi/alltoall_coll.tesh rename to teshsuite/smpi/alltoall/alltoall_coll.tesh index a99b590346..3946dc2def 100644 --- a/teshsuite/smpi/alltoall_coll.tesh +++ b/teshsuite/smpi/alltoall/alltoall_coll.tesh @@ -3,7 +3,7 @@ ! output sort p Test all to all -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./alltoall_coll -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/alltoall_coll -q --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [rank 0] -> Tremblay > [rank 1] -> Jupiter diff --git a/teshsuite/smpi/alltoallv/CMakeLists.txt b/teshsuite/smpi/alltoallv/CMakeLists.txt new file mode 100644 index 0000000000..00ba90cb9a --- /dev/null +++ b/teshsuite/smpi/alltoallv/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(alltoallv_coll alltoallv_coll.c) + target_link_libraries(alltoallv_coll simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv_coll.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv_coll.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/alltoallv_coll.c b/teshsuite/smpi/alltoallv/alltoallv_coll.c similarity index 100% rename from teshsuite/smpi/alltoallv_coll.c rename to teshsuite/smpi/alltoallv/alltoallv_coll.c diff --git a/teshsuite/smpi/alltoallv_coll.tesh b/teshsuite/smpi/alltoallv/alltoallv_coll.tesh similarity index 99% rename from teshsuite/smpi/alltoallv_coll.tesh rename to teshsuite/smpi/alltoallv/alltoallv_coll.tesh index 3346488ea1..7815af12ca 100644 --- a/teshsuite/smpi/alltoallv_coll.tesh +++ b/teshsuite/smpi/alltoallv/alltoallv_coll.tesh @@ -3,7 +3,7 @@ ! output sort p Test all to all -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./alltoallv_coll --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/alltoallv_coll --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [rank 0] -> Tremblay > [rank 1] -> Jupiter @@ -118,6 +118,6 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ > [15] sbuf: (#256): [1500][1501][1502][1503][1504][1505][1506][1507][1508][1509][1510][1511][1512][1513][1514][1515][1516][1517][1518][1519][1520][1521][1522][1523][1524][1525][1526][1527][1528][1529][1530][1531][1532][1533][1534][1535][1536][1537][1538][1539][1540][1541][1542][1543][1544][1545][1546][1547][1548][1549][1550][1551][1552][1553][1554][1555][1556][1557][1558][1559][1560][1561][1562][1563][1564][1565][1566][1567][1568][1569][1570][1571][1572][1573][1574][1575][1576][1577][1578][1579][1580][1581][1582][1583][1584][1585][1586][1587][1588][1589][1590][1591][1592][1593][1594][1595][1596][1597][1598][1599][1600][1601][1602][1603][1604][1605][1606][1607][1608][1609][1610][1611][1612][1613][1614][1615][1616][1617][1618][1619][1620][1621][1622][1623][1624][1625][1626][1627][1628][1629][1630][1631][1632][1633][1634][1635][1636][1637][1638][1639][1640][1641][1642][1643][1644][1645][1646][1647][1648][1649][1650][1651][1652][1653][1654][1655][1656][1657][1658][1659][1660][1661][1662][1663][1664][1665][1666][1667][1668][1669][1670][1671][1672][1673][1674][1675][1676][1677][1678][1679][1680][1681][1682][1683][1684][1685][1686][1687][1688][1689][1690][1691][1692][1693][1694][1695][1696][1697][1698][1699][1700][1701][1702][1703][1704][1705][1706][1707][1708][1709][1710][1711][1712][1713][1714][1715][1716][1717][1718][1719][1720][1721][1722][1723][1724][1725][1726][1727][1728][1729][1730][1731][1732][1733][1734][1735][1736][1737][1738][1739][1740][1741][1742][1743][1744][1745][1746][1747][1748][1749][1750][1751][1752][1753][1754][1755] > [15] scount: (#16): [0][1][2][3][4][5][6][7][8][9][10][11][12][13][14][15] > [15] sdisp: (#16): [0][1][3][6][10][15][21][28][36][45][55][66][78][91][105][120] -> +> > Alltoallv TEST COMPLETE. diff --git a/teshsuite/smpi/barrier/CMakeLists.txt b/teshsuite/smpi/barrier/CMakeLists.txt new file mode 100644 index 0000000000..2d7d550cca --- /dev/null +++ b/teshsuite/smpi/barrier/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(barrier_coll barrier.c ) + target_link_libraries(barrier_coll simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/barrier_coll.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/barrier.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/barrier.c b/teshsuite/smpi/barrier/barrier.c similarity index 100% rename from teshsuite/smpi/barrier.c rename to teshsuite/smpi/barrier/barrier.c diff --git a/teshsuite/smpi/barrier_coll.tesh b/teshsuite/smpi/barrier/barrier_coll.tesh similarity index 76% rename from teshsuite/smpi/barrier_coll.tesh rename to teshsuite/smpi/barrier/barrier_coll.tesh index a58751e5a2..e1e4b80bd0 100644 --- a/teshsuite/smpi/barrier_coll.tesh +++ b/teshsuite/smpi/barrier/barrier_coll.tesh @@ -3,7 +3,7 @@ ! output sort p Test barrier -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./barrier_coll --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/barrier_coll --log=smpi_kernel.thres:warning > ... Barrier .... > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) diff --git a/teshsuite/smpi/bcast/CMakeLists.txt b/teshsuite/smpi/bcast/CMakeLists.txt new file mode 100644 index 0000000000..0ad7183b57 --- /dev/null +++ b/teshsuite/smpi/bcast/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(bcast bcast.c) + add_executable(bcast_coll bcast_coll.c) + target_link_libraries(bcast simgrid) + target_link_libraries(bcast_coll simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/bcast.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/bcast_coll.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/bcast.c + ${CMAKE_CURRENT_SOURCE_DIR}/bcast_coll.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/bcast.c b/teshsuite/smpi/bcast/bcast.c similarity index 100% rename from teshsuite/smpi/bcast.c rename to teshsuite/smpi/bcast/bcast.c diff --git a/teshsuite/smpi/bcast.tesh b/teshsuite/smpi/bcast/bcast.tesh similarity index 79% rename from teshsuite/smpi/bcast.tesh rename to teshsuite/smpi/bcast/bcast.tesh index 352f56c78e..0065be4cbc 100644 --- a/teshsuite/smpi/bcast.tesh +++ b/teshsuite/smpi/bcast/bcast.tesh @@ -2,11 +2,11 @@ # (since we want to pass it to the child, it has to be redefined before each command) # Go for the first test p Test Broadcast with less processes than hosts -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 3 ./bcast -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 3 ${bindir:=.}/bcast -q --log=smpi_kernel.thres:warning > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -15,13 +15,13 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ # second test p Test Broadcast with as much processes than hosts ! setenv LD_LIBRARY_PATH=../../lib -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 5 ./bcast -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 5 ${bindir:=.}/bcast -q --log=smpi_kernel.thres:warning > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard > [rank 3] -> Ginette > [rank 4] -> Bourassa -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -30,7 +30,7 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ # Another test p Test Broadcast with more processes than hosts ! setenv LD_LIBRARY_PATH=../../lib -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 12 ./bcast -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 12 ${bindir:=.}/bcast -q --log=smpi_kernel.thres:warning > You requested to use 12 processes, but there is only 5 processes in your hostfile... > [rank 0] -> Tremblay > [rank 1] -> Jupiter @@ -44,7 +44,7 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ > [rank 9] -> Bourassa > [rank 10] -> Tremblay > [rank 11] -> Jupiter -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/teshsuite/smpi/bcast_coll.c b/teshsuite/smpi/bcast/bcast_coll.c similarity index 100% rename from teshsuite/smpi/bcast_coll.c rename to teshsuite/smpi/bcast/bcast_coll.c diff --git a/teshsuite/smpi/bcast_coll.tesh b/teshsuite/smpi/bcast/bcast_coll.tesh similarity index 90% rename from teshsuite/smpi/bcast_coll.tesh rename to teshsuite/smpi/bcast/bcast_coll.tesh index 641e8d2dcf..6163065f74 100644 --- a/teshsuite/smpi/bcast_coll.tesh +++ b/teshsuite/smpi/bcast/bcast_coll.tesh @@ -2,7 +2,7 @@ p Test Broadcast with more processes than hosts ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./bcast_coll --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/bcast_coll --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [rank 0] -> Tremblay > [rank 1] -> Jupiter diff --git a/teshsuite/smpi/compute/CMakeLists.txt b/teshsuite/smpi/compute/CMakeLists.txt new file mode 100644 index 0000000000..1f259147b5 --- /dev/null +++ b/teshsuite/smpi/compute/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(compute compute.c) + add_executable(compute2 compute2.c) + add_executable(compute3 compute3.c) + target_link_libraries(compute simgrid) + target_link_libraries(compute2 simgrid) + target_link_libraries(compute3 simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/compute.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/compute.c + ${CMAKE_CURRENT_SOURCE_DIR}/compute2.c + ${CMAKE_CURRENT_SOURCE_DIR}/compute3.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/compute.c b/teshsuite/smpi/compute/compute.c similarity index 100% rename from teshsuite/smpi/compute.c rename to teshsuite/smpi/compute/compute.c diff --git a/teshsuite/smpi/compute.tesh b/teshsuite/smpi/compute/compute.tesh similarity index 71% rename from teshsuite/smpi/compute.tesh rename to teshsuite/smpi/compute/compute.tesh index 8e74bb9b7e..4864e4b842 100644 --- a/teshsuite/smpi/compute.tesh +++ b/teshsuite/smpi/compute/compute.tesh @@ -1,19 +1,19 @@ p Test compute ! timeout 5 -$ ../../smpi_script/bin/smpirun -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 3 --log=root.thres:warning ./compute 7 --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -hostfile ../hostfile -platform ../../../examples/msg/small_platform_with_routers.xml -np 3 --log=root.thres:warning ${bindir:=.}/compute 7 --log=smpi_kernel.thres:warning > 7 16.000000 > 7 16.000000 > 7 16.000000 p Test compute only once ! timeout 5 -$ ../../smpi_script/bin/smpirun -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 3 --log=root.thres:warning ./compute2 7 --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -hostfile ../hostfile -platform ../../../examples/msg/small_platform_with_routers.xml -np 3 --log=root.thres:warning ${bindir:=.}/compute2 7 --log=smpi_kernel.thres:warning > 7 16.000000 p Test compute and bench ! output sort ! timeout 45 -$ ../../smpi_script/bin/smpirun -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 3 --log=root.thres:warning ./compute3 quiet --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -hostfile ../hostfile -platform ../../../examples/msg/small_platform_with_routers.xml -np 3 --log=root.thres:warning ${bindir:=.}/compute3 quiet --log=smpi_kernel.thres:warning > (0) Run the first computation. It's globally benched, and I want no more than 4 benchmarks (thres<0) > (0) Run the first computation. It's globally benched, and I want no more than 4 benchmarks (thres<0) > (0) Run the first computation. It's globally benched, and I want no more than 4 benchmarks (thres<0) diff --git a/teshsuite/smpi/compute2.c b/teshsuite/smpi/compute/compute2.c similarity index 100% rename from teshsuite/smpi/compute2.c rename to teshsuite/smpi/compute/compute2.c diff --git a/teshsuite/smpi/compute3.c b/teshsuite/smpi/compute/compute3.c similarity index 100% rename from teshsuite/smpi/compute3.c rename to teshsuite/smpi/compute/compute3.c diff --git a/teshsuite/smpi/gather/CMakeLists.txt b/teshsuite/smpi/gather/CMakeLists.txt new file mode 100644 index 0000000000..386a6641fe --- /dev/null +++ b/teshsuite/smpi/gather/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(gather_coll gather_coll.c) + target_link_libraries(gather_coll simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/gather_coll.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/gather_coll.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/gather_coll.c b/teshsuite/smpi/gather/gather_coll.c similarity index 100% rename from teshsuite/smpi/gather_coll.c rename to teshsuite/smpi/gather/gather_coll.c diff --git a/teshsuite/smpi/gather_coll.tesh b/teshsuite/smpi/gather/gather_coll.tesh similarity index 84% rename from teshsuite/smpi/gather_coll.tesh rename to teshsuite/smpi/gather/gather_coll.tesh index 9498cf1db7..2ca27518a5 100644 --- a/teshsuite/smpi/gather_coll.tesh +++ b/teshsuite/smpi/gather/gather_coll.tesh @@ -4,7 +4,7 @@ ! timeout 30 p Test all to all -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./gather_coll --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/gather_coll --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [rank 0] -> Tremblay > [rank 1] -> Jupiter diff --git a/teshsuite/smpi/get_processor_name.c b/teshsuite/smpi/get_processor_name.c deleted file mode 100644 index 90b9a0bb0e..0000000000 --- a/teshsuite/smpi/get_processor_name.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) 2010, 2012-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. */ - -#include -#include - -int main(int argc, char **argv) -{ - int size, rank; - - char name[MPI_MAX_PROCESSOR_NAME]; - int len; - - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &size); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - MPI_Get_processor_name(name, &len); - printf("rank %d is running on host %s\n", rank, name); - MPI_Finalize(); - return 0; -} diff --git a/teshsuite/smpi/hvector/CMakeLists.txt b/teshsuite/smpi/hvector/CMakeLists.txt new file mode 100644 index 0000000000..fe240c2d74 --- /dev/null +++ b/teshsuite/smpi/hvector/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(hvector_test hvector_test.c) + target_link_libraries(hvector_test simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/hvector.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/hvector_test.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/hvector.tesh b/teshsuite/smpi/hvector/hvector.tesh similarity index 87% rename from teshsuite/smpi/hvector.tesh rename to teshsuite/smpi/hvector/hvector.tesh index b5f789e252..221eb599fd 100644 --- a/teshsuite/smpi/hvector.tesh +++ b/teshsuite/smpi/hvector/hvector.tesh @@ -1,9 +1,9 @@ p Test hvector ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./hvector_test -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 2 ${bindir:=.}/hvector_test -q --log=smpi_kernel.thres:warning > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/teshsuite/smpi/hvector_test.c b/teshsuite/smpi/hvector/hvector_test.c similarity index 100% rename from teshsuite/smpi/hvector_test.c rename to teshsuite/smpi/hvector/hvector_test.c diff --git a/teshsuite/smpi/indexed/CMakeLists.txt b/teshsuite/smpi/indexed/CMakeLists.txt new file mode 100644 index 0000000000..e6c9af4e82 --- /dev/null +++ b/teshsuite/smpi/indexed/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(indexed_test indexed_test.c) + target_link_libraries(indexed_test simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/indexed.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/indexed_test.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/indexed.tesh b/teshsuite/smpi/indexed/indexed.tesh similarity index 83% rename from teshsuite/smpi/indexed.tesh rename to teshsuite/smpi/indexed/indexed.tesh index f8777fb597..32d7378503 100644 --- a/teshsuite/smpi/indexed.tesh +++ b/teshsuite/smpi/indexed/indexed.tesh @@ -1,9 +1,9 @@ p Test indexed ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./indexed_test -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 2 ${bindir:=.}/indexed_test -q --log=smpi_kernel.thres:warning > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/teshsuite/smpi/indexed_test.c b/teshsuite/smpi/indexed/indexed_test.c similarity index 100% rename from teshsuite/smpi/indexed_test.c rename to teshsuite/smpi/indexed/indexed_test.c diff --git a/teshsuite/smpi/mpich3-test/f77/coll/redscatf.f b/teshsuite/smpi/mpich3-test/f77/coll/redscatf.f index b19b1e7903..efd6c06040 100644 --- a/teshsuite/smpi/mpich3-test/f77/coll/redscatf.f +++ b/teshsuite/smpi/mpich3-test/f77/coll/redscatf.f @@ -9,11 +9,14 @@ C integer cin(*), cout(*) integer count, datatype integer i - -! if (datatype .ne. MPI_INTEGER) then -! write(6,*) 'Invalid datatype ',datatype,' passed to user_op()' -! return -! endif + + if (.false.) then + if (datatype .ne. MPI_INTEGER) then + write(6,*) 'Invalid datatype ',datatype, + & ' passed to user_op()' + return + endif + endif do i=1, count cout(i) = cin(i) + cout(i) diff --git a/teshsuite/smpi/mpich3-test/f77/util/mtestf.f b/teshsuite/smpi/mpich3-test/f77/util/mtestf.f index 81edc25f71..2c54d76f5c 100644 --- a/teshsuite/smpi/mpich3-test/f77/util/mtestf.f +++ b/teshsuite/smpi/mpich3-test/f77/util/mtestf.f @@ -56,6 +56,9 @@ C A simple get intracomm for now save myindex data myindex /0/ + if (.false.) then + qsmaller = qsmaller + endif comm = MPI_COMM_NULL if (myindex .eq. 0) then comm = MPI_COMM_WORLD diff --git a/teshsuite/smpi/mpich3-test/f90/coll/redscatf90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/redscatf90.f90 index 2230ac2fa6..496d178277 100644 --- a/teshsuite/smpi/mpich3-test/f90/coll/redscatf90.f90 +++ b/teshsuite/smpi/mpich3-test/f90/coll/redscatf90.f90 @@ -10,10 +10,12 @@ integer count, datatype integer i -! if (datatype .ne. MPI_INTEGER) then -! write(6,*) 'Invalid datatype ',datatype,' passed to user_op()' -! return -! endif + if (.false.) then + if (datatype .ne. MPI_INTEGER) then + write(6,*) 'Invalid datatype ',datatype,' passed to user_op()' + return + endif + endif do i=1, count cout(i) = cin(i) + cout(i) diff --git a/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 b/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 index 56b76b7e88..bb12b29e24 100644 --- a/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 +++ b/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 @@ -54,6 +54,9 @@ save myindex data myindex /0/ + if (.false.) then + qsmaller = qsmaller + endif comm = MPI_COMM_NULL if (myindex .eq. 0) then comm = MPI_COMM_WORLD diff --git a/teshsuite/smpi/mpich3-test/testlist b/teshsuite/smpi/mpich3-test/testlist index 2110a22696..900c9194ab 100644 --- a/teshsuite/smpi/mpich3-test/testlist +++ b/teshsuite/smpi/mpich3-test/testlist @@ -13,7 +13,7 @@ init pt2pt # #spawn -#topo +topo #perf #io f77 diff --git a/teshsuite/smpi/mpich3-test/topo/CMakeLists.txt b/teshsuite/smpi/mpich3-test/topo/CMakeLists.txt index 6bc6b43270..0a0bc87c9c 100644 --- a/teshsuite/smpi/mpich3-test/topo/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/topo/CMakeLists.txt @@ -13,28 +13,28 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/") -# add_executable(cartcreates cartcreates.c) -# add_executable(cartmap1 cartmap1.c) -# add_executable(cartshift1 cartshift1.c) -# add_executable(cartsuball cartsuball.c) -# add_executable(cartzero cartzero.c) +add_executable(cartcreates cartcreates.c) + #add_executable(cartmap1 cartmap1.c) +add_executable(cartshift1 cartshift1.c) +add_executable(cartsuball cartsuball.c) +add_executable(cartzero cartzero.c) # add_executable(dgraph_unwgt dgraph_unwgt.c) -# add_executable(dims1 dims1.c) -# add_executable(dims2 dims2.c) +#add_executable(dims1 dims1.c) +#add_executable(dims2 dims2.c) # add_executable(distgraph1 distgraph1.c) # add_executable(graphcr2 graphcr2.c) # add_executable(graphcr graphcr.c) # add_executable(graphmap1 graphmap1.c) -# add_executable(neighb_coll neighb_coll.c) +#add_executable(neighb_coll neighb_coll.c) # add_executable(topodup topodup.c) -# add_executable(topotest topotest.c) +#add_executable(topotest topotest.c) -# target_link_libraries(cartcreates simgrid mtest_c) -# target_link_libraries(cartmap1 simgrid mtest_c) -# target_link_libraries(cartshift1 simgrid mtest_c) -# target_link_libraries(cartsuball simgrid mtest_c) -# target_link_libraries(cartzero simgrid mtest_c) +target_link_libraries(cartcreates simgrid mtest_c) +# target_link_libraries(cartmap1 simgrid mtest_c) +target_link_libraries(cartshift1 simgrid mtest_c) +target_link_libraries(cartsuball simgrid mtest_c) +target_link_libraries(cartzero simgrid mtest_c) # target_link_libraries(dgraph_unwgt simgrid mtest_c) # target_link_libraries(dims1 simgrid mtest_c) # target_link_libraries(dims2 simgrid mtest_c) diff --git a/teshsuite/smpi/mpich3-test/topo/testlist b/teshsuite/smpi/mpich3-test/topo/testlist index 0ec8867d09..ba25d597b2 100644 --- a/teshsuite/smpi/mpich3-test/topo/testlist +++ b/teshsuite/smpi/mpich3-test/topo/testlist @@ -1,9 +1,9 @@ #need Cart implem #cartmap1 4 -#cartzero 4 -#cartshift1 4 -#cartsuball 4 -#cartcreates 4 +cartzero 4 +cartshift1 4 +cartsuball 4 +cartcreates 4 #need MPI_Dims_create #dims1 4 #dims2 1 diff --git a/teshsuite/smpi/pingpong/CMakeLists.txt b/teshsuite/smpi/pingpong/CMakeLists.txt new file mode 100644 index 0000000000..a7e154741c --- /dev/null +++ b/teshsuite/smpi/pingpong/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(pingpong pingpong.c) + add_executable(dsend dsend.c) + target_link_libraries(pingpong simgrid) + target_link_libraries(dsend simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/TI_output.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/dsend.c + ${CMAKE_CURRENT_SOURCE_DIR}/pingpong.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/TI_output.tesh b/teshsuite/smpi/pingpong/TI_output.tesh similarity index 70% rename from teshsuite/smpi/TI_output.tesh rename to teshsuite/smpi/pingpong/TI_output.tesh index 3ebd98277f..2d0f1a50d0 100644 --- a/teshsuite/smpi/TI_output.tesh +++ b/teshsuite/smpi/pingpong/TI_output.tesh @@ -2,10 +2,10 @@ $ rm -rf ./out_ti.txt_files $ rm -rf ./out_in_ti.txt_files p Test output of time independent tracing -p generate a trace with pingpong, and replay itself, then check that output trace of the second run is the same as in the first (once sorted) +p generate a trace with pingpong, and replay itself, then check that output trace of the second run is the same as in the first (once sorted) ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=smpi/cpu_threshold:-1 -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 4 ./pingpong -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=smpi/cpu_threshold:-1 -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning > *** Ping-pong test (MPI_Send/MPI_Recv) *** > == pivot=0 : pingpong [0] <--> [1] > == pivot=1 : pingpong [1] <--> [2] @@ -16,33 +16,33 @@ $ ../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt - > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/format' to 'TI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/computing' to 'yes' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'out_in_ti.txt' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' -> [0] About to send 1st message '99' to process [1] -> [0] Received reply message '100' from process [1] -> [1] About to send 1st message '100' to process [2] -> [1] About to send back message '100' to process [0] -> [1] Received 1st message '99' from process [0] -> [1] Received reply message '101' from process [2] +> [0] About to send 1st message '99' to process [1] +> [0] Received reply message '100' from process [1] +> [1] About to send 1st message '100' to process [2] +> [1] About to send back message '100' to process [0] +> [1] Received 1st message '99' from process [0] +> [1] Received reply message '101' from process [2] > [1] increment message's value to '100' -> [2] About to send 1st message '101' to process [3] -> [2] About to send back message '101' to process [1] -> [2] Received 1st message '100' from process [1] -> [2] Received reply message '102' from process [3] +> [2] About to send 1st message '101' to process [3] +> [2] About to send back message '101' to process [1] +> [2] Received 1st message '100' from process [1] +> [2] Received reply message '102' from process [3] > [2] increment message's value to '101' -> [3] About to send back message '102' to process [2] -> [3] Received 1st message '101' from process [2] +> [3] About to send back message '102' to process [2] +> [3] Received 1st message '101' from process [2] > [3] increment message's value to '102' > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard > [rank 3] -> Ginette -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=smpi/cpu_threshold:-1 -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 4 ../../examples/smpi/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=smpi/cpu_threshold:-1 -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard @@ -52,7 +52,7 @@ $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.:critical -trace-t > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/format' to 'TI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/computing' to 'yes' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -62,7 +62,7 @@ $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.:critical -trace-t > [Jupiter:1:(0) 0.016798] [smpi_replay/INFO] Simulation time 0.016798 ! output sort -$ find ./out_ti.txt_files -type f -exec cat {} \; +$ sh -c "cat ./out_ti.txt_files/*" > 0 init > 0 send 1 1 1 > 0 recv 1 1 1 @@ -85,7 +85,7 @@ $ find ./out_ti.txt_files -type f -exec cat {} \; > 3 finalize ! output sort -$ find ./out_in_ti.txt_files -type f -exec cat {} \; +$ sh -c "cat ./out_in_ti.txt_files/*" > 0 init > 0 send 1 1 1 > 0 recv 1 1 1 @@ -115,9 +115,9 @@ $ rm out_in_ti.txt p Same test, but only using one output file for all processes -p generate a trace with pingpong, and replay itself, then check that output trace of the second run is the same as in the first (once sorted) +p generate a trace with pingpong, and replay itself, then check that output trace of the second run is the same as in the first (once sorted) ! output sort -$ ../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=tracing/smpi/format/ti_one_file:yes -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 4 ./pingpong -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=tracing/smpi/format/ti_one_file:yes -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning > *** Ping-pong test (MPI_Send/MPI_Recv) *** > == pivot=0 : pingpong [0] <--> [1] > == pivot=1 : pingpong [1] <--> [2] @@ -128,33 +128,33 @@ $ ../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt - > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/format' to 'TI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/computing' to 'yes' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'out_in_ti.txt' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/format/ti_one_file' to 'yes' -> [0] About to send 1st message '99' to process [1] -> [0] Received reply message '100' from process [1] -> [1] About to send 1st message '100' to process [2] -> [1] About to send back message '100' to process [0] -> [1] Received 1st message '99' from process [0] -> [1] Received reply message '101' from process [2] +> [0] About to send 1st message '99' to process [1] +> [0] Received reply message '100' from process [1] +> [1] About to send 1st message '100' to process [2] +> [1] About to send back message '100' to process [0] +> [1] Received 1st message '99' from process [0] +> [1] Received reply message '101' from process [2] > [1] increment message's value to '100' -> [2] About to send 1st message '101' to process [3] -> [2] About to send back message '101' to process [1] -> [2] Received 1st message '100' from process [1] -> [2] Received reply message '102' from process [3] +> [2] About to send 1st message '101' to process [3] +> [2] About to send back message '101' to process [1] +> [2] Received 1st message '100' from process [1] +> [2] Received reply message '102' from process [3] > [2] increment message's value to '101' -> [3] About to send back message '102' to process [2] -> [3] Received 1st message '101' from process [2] +> [3] About to send back message '102' to process [2] +> [3] Received 1st message '101' from process [2] > [3] increment message's value to '102' > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard > [rank 3] -> Ginette -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=tracing/smpi/format/ti_one_file:yes -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 4 ../../examples/smpi/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=tracing/smpi/format/ti_one_file:yes -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard @@ -164,7 +164,7 @@ $ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.:critical -trace-t > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/format' to 'TI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/computing' to 'yes' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/teshsuite/smpi/dsend.c b/teshsuite/smpi/pingpong/dsend.c similarity index 100% rename from teshsuite/smpi/dsend.c rename to teshsuite/smpi/pingpong/dsend.c diff --git a/teshsuite/smpi/pingpong.c b/teshsuite/smpi/pingpong/pingpong.c similarity index 95% rename from teshsuite/smpi/pingpong.c rename to teshsuite/smpi/pingpong/pingpong.c index 7d2677f008..ab3f440761 100644 --- a/teshsuite/smpi/pingpong.c +++ b/teshsuite/smpi/pingpong/pingpong.c @@ -43,23 +43,23 @@ int main(int argc, char *argv[]) pivot + 1); int dst = rank + 1; - printf("[%d] About to send 1st message '%d' to process [%d] \n", + printf("[%d] About to send 1st message '%d' to process [%d]\n", rank, msg, dst); err = MPI_Send(&msg, 1, MPI_INT, dst, tag1, MPI_COMM_WORLD); err = MPI_Recv(&msg, 1, MPI_INT, dst, tag2, MPI_COMM_WORLD, &status); /* Receive a message */ - printf("[%d] Received reply message '%d' from process [%d] \n", rank, + printf("[%d] Received reply message '%d' from process [%d]\n", rank, msg, dst); } if ((pivot + 1) == rank) { int src = rank - 1; err = MPI_Recv(&msg, 1, MPI_INT, src, tag1, MPI_COMM_WORLD, &status); /* Receive a message */ - printf("[%d] Received 1st message '%d' from process [%d] \n", rank, + printf("[%d] Received 1st message '%d' from process [%d]\n", rank, msg, src); msg++; printf("[%d] increment message's value to '%d'\n", rank, msg); - printf("[%d] About to send back message '%d' to process [%d] \n", + printf("[%d] About to send back message '%d' to process [%d]\n", rank, msg, src); err = MPI_Send(&msg, 1, MPI_INT, src, tag2, MPI_COMM_WORLD); } diff --git a/teshsuite/smpi/pt2pt.tesh b/teshsuite/smpi/pingpong/pt2pt.tesh similarity index 59% rename from teshsuite/smpi/pt2pt.tesh rename to teshsuite/smpi/pingpong/pt2pt.tesh index a67ee17558..cd3a00cb4f 100644 --- a/teshsuite/smpi/pt2pt.tesh +++ b/teshsuite/smpi/pingpong/pt2pt.tesh @@ -1,9 +1,9 @@ p Test dsend ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./dsend -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 2 ${bindir:=.}/dsend -q --log=smpi_kernel.thres:warning > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -16,30 +16,30 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ p Test pingpong ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 4 ./pingpong -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning > *** Ping-pong test (MPI_Send/MPI_Recv) *** > == pivot=0 : pingpong [0] <--> [1] > == pivot=1 : pingpong [1] <--> [2] > == pivot=2 : pingpong [2] <--> [3] > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0] About to send 1st message '99' to process [1] -> [0] Received reply message '100' from process [1] -> [1] About to send 1st message '100' to process [2] -> [1] About to send back message '100' to process [0] -> [1] Received 1st message '99' from process [0] -> [1] Received reply message '101' from process [2] +> [0] About to send 1st message '99' to process [1] +> [0] Received reply message '100' from process [1] +> [1] About to send 1st message '100' to process [2] +> [1] About to send back message '100' to process [0] +> [1] Received 1st message '99' from process [0] +> [1] Received reply message '101' from process [2] > [1] increment message's value to '100' -> [2] About to send 1st message '101' to process [3] -> [2] About to send back message '101' to process [1] -> [2] Received 1st message '100' from process [1] -> [2] Received reply message '102' from process [3] +> [2] About to send 1st message '101' to process [3] +> [2] About to send back message '101' to process [1] +> [2] Received 1st message '100' from process [1] +> [2] Received reply message '102' from process [3] > [2] increment message's value to '101' -> [3] About to send back message '102' to process [2] -> [3] Received 1st message '101' from process [2] +> [3] About to send back message '102' to process [2] +> [3] Received 1st message '101' from process [2] > [3] increment message's value to '102' > [rank 0] -> Tremblay > [rank 1] -> Jupiter diff --git a/teshsuite/smpi/reduce/CMakeLists.txt b/teshsuite/smpi/reduce/CMakeLists.txt new file mode 100644 index 0000000000..8e36392306 --- /dev/null +++ b/teshsuite/smpi/reduce/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(reduce reduce.c) + add_executable(reduce_coll reduce_coll.c) + add_executable(reduce_scatter_coll reduce_scatter_coll.c) + target_link_libraries(reduce simgrid) + target_link_libraries(reduce_coll simgrid) + target_link_libraries(reduce_scatter_coll simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/reduce.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/reduce_coll.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter_coll.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/reduce.c + ${CMAKE_CURRENT_SOURCE_DIR}/reduce_coll.c + ${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter_coll.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/reduce.c b/teshsuite/smpi/reduce/reduce.c similarity index 98% rename from teshsuite/smpi/reduce.c rename to teshsuite/smpi/reduce/reduce.c index 92436c9021..09671e6781 100644 --- a/teshsuite/smpi/reduce.c +++ b/teshsuite/smpi/reduce/reduce.c @@ -11,7 +11,7 @@ * MESSAGE PASSING INTERFACE TEST CASE SUITE * * Copyright IBM Corp. 1995 - * + * * IBM Corp. hereby grants a non-exclusive license to use, copy, modify, and *distribute this software for any purpose and without fee provided that the *above copyright notice and the following paragraphs appear in all copies. @@ -117,7 +117,7 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); if (0 == rank) - printf("** IBM Test Result: ... \n"); + printf("** IBM Test Result: ...\n"); if (!ibm_test(rank, size)) printf("\t[%d] failed.\n", rank); else if (!quiet) diff --git a/teshsuite/smpi/reduce.tesh b/teshsuite/smpi/reduce/reduce.tesh similarity index 80% rename from teshsuite/smpi/reduce.tesh rename to teshsuite/smpi/reduce/reduce.tesh index 1d3e74cf2c..1fe05f53cf 100644 --- a/teshsuite/smpi/reduce.tesh +++ b/teshsuite/smpi/reduce/reduce.tesh @@ -3,11 +3,11 @@ # Go for the first test p Test Reduce with 3 processes ! output sort -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 3 ./reduce -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 3 ${bindir:=.}/reduce -q --log=smpi_kernel.thres:warning > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -16,7 +16,7 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ > [0] sum=6 ... validation ok. > [0] min=1 ... validation ok. > [0] max=3 ... validation ok. -> ** IBM Test Result: ... +> ** IBM Test Result: ... > ok. > ok. > ok. @@ -25,13 +25,13 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ ! setenv LD_LIBRARY_PATH=../../lib ! output sort p Test Reduce with 5 processes -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 5 ./reduce -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 5 ${bindir:=.}/reduce -q --log=smpi_kernel.thres:warning > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard > [rank 3] -> Ginette > [rank 4] -> Bourassa -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -40,7 +40,7 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ > [0] sum=15 ... validation ok. > [0] min=1 ... validation ok. > [0] max=5 ... validation ok. -> ** IBM Test Result: ... +> ** IBM Test Result: ... > ok. > ok. > ok. @@ -51,7 +51,7 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ ! output sort ! setenv LD_LIBRARY_PATH=../../lib p Test Reduce with 12 processes -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 12 ./reduce -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 12 ${bindir:=.}/reduce -q --log=smpi_kernel.thres:warning > You requested to use 12 processes, but there is only 5 processes in your hostfile... > [rank 0] -> Tremblay > [rank 1] -> Jupiter @@ -65,7 +65,7 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ > [rank 9] -> Bourassa > [rank 10] -> Tremblay > [rank 11] -> Jupiter -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' @@ -74,7 +74,7 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ > [0] sum=78 ... validation ok. > [0] min=1 ... validation ok. > [0] max=12 ... validation ok. -> ** IBM Test Result: ... +> ** IBM Test Result: ... > ok. > ok. > ok. diff --git a/teshsuite/smpi/reduce_coll.c b/teshsuite/smpi/reduce/reduce_coll.c similarity index 100% rename from teshsuite/smpi/reduce_coll.c rename to teshsuite/smpi/reduce/reduce_coll.c diff --git a/teshsuite/smpi/reduce_coll.tesh b/teshsuite/smpi/reduce/reduce_coll.tesh similarity index 91% rename from teshsuite/smpi/reduce_coll.tesh rename to teshsuite/smpi/reduce/reduce_coll.tesh index 0edfdc7a03..2612688325 100644 --- a/teshsuite/smpi/reduce_coll.tesh +++ b/teshsuite/smpi/reduce/reduce_coll.tesh @@ -3,7 +3,7 @@ ! output sort p Test allreduce -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./reduce_coll --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/reduce_coll --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) > [0] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] diff --git a/teshsuite/smpi/reduce_scatter_coll.c b/teshsuite/smpi/reduce/reduce_scatter_coll.c similarity index 100% rename from teshsuite/smpi/reduce_scatter_coll.c rename to teshsuite/smpi/reduce/reduce_scatter_coll.c diff --git a/teshsuite/smpi/reduce_scatter_coll.tesh b/teshsuite/smpi/reduce/reduce_scatter_coll.tesh similarity index 75% rename from teshsuite/smpi/reduce_scatter_coll.tesh rename to teshsuite/smpi/reduce/reduce_scatter_coll.tesh index 249f686ff9..5ef7ce1502 100644 --- a/teshsuite/smpi/reduce_scatter_coll.tesh +++ b/teshsuite/smpi/reduce/reduce_scatter_coll.tesh @@ -3,7 +3,7 @@ ! output sort p Test reduce_scatter -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./reduce_scatter_coll --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/reduce_scatter_coll --log=smpi_kernel.thres:warning > No Errors > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) diff --git a/teshsuite/smpi/scatter/CMakeLists.txt b/teshsuite/smpi/scatter/CMakeLists.txt new file mode 100644 index 0000000000..ca5efd0c64 --- /dev/null +++ b/teshsuite/smpi/scatter/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(scatter scatter.c) + target_link_libraries(scatter simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/scatter_coll.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/scatter.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/scatter.c b/teshsuite/smpi/scatter/scatter.c similarity index 96% rename from teshsuite/smpi/scatter.c rename to teshsuite/smpi/scatter/scatter.c index fda82e1724..94d88d355a 100644 --- a/teshsuite/smpi/scatter.c +++ b/teshsuite/smpi/scatter/scatter.c @@ -8,7 +8,7 @@ * MESSAGE PASSING INTERFACE TEST CASE SUITE * * Copyright IBM Corp. 1995 - * + * * IBM Corp. hereby grants a non-exclusive license to use, copy, modify, and *distribute this software for any purpose and without fee provided that the *above copyright notice and the following paragraphs appear in all copies. @@ -80,7 +80,7 @@ static int small_test(int rank, int size) int i; double *sndbuf = NULL; double rcvd; - int root = 0; // arbitrary choice + int root = 0; // arbitrary choice // on root, initialize sendbuf if (root == rank) { @@ -122,7 +122,7 @@ int main(int argc, char **argv) /* test 1 */ if (0 == rank) - printf("** Small Test Result: ... \n"); + printf("** Small Test Result: ...\n"); if (!small_test(rank, size)) printf("\t[%d] failed.\n", rank); else @@ -133,7 +133,7 @@ int main(int argc, char **argv) /* test 2 */ if (0 == rank) - printf("** IBM Test Result: ... \n"); + printf("** IBM Test Result: ...\n"); if (!ibm_test(rank, size)) printf("\t[%d] failed.\n", rank); else diff --git a/teshsuite/smpi/scatter_coll.tesh b/teshsuite/smpi/scatter/scatter_coll.tesh similarity index 79% rename from teshsuite/smpi/scatter_coll.tesh rename to teshsuite/smpi/scatter/scatter_coll.tesh index 043ec55a09..84a41c5f56 100644 --- a/teshsuite/smpi/scatter_coll.tesh +++ b/teshsuite/smpi/scatter/scatter_coll.tesh @@ -3,7 +3,7 @@ ! output sort p Test scatter -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./scatter --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/scatter --log=smpi_kernel.thres:warning > [0] ok. > [0] ok. > [10] ok. @@ -36,8 +36,8 @@ $ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform $ > [8] ok. > [9] ok. > [9] ok. -> ** IBM Test Result: ... -> ** Small Test Result: ... +> ** IBM Test Result: ... +> ** Small Test Result: ... > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) > [rank 0] -> Tremblay diff --git a/teshsuite/smpi/sendrecv.c b/teshsuite/smpi/sendrecv.c deleted file mode 100644 index 5a55887039..0000000000 --- a/teshsuite/smpi/sendrecv.c +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright (c) 2009-2010, 2012-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. */ - -#include -#include "mpi.h" - -static int test(int myid, int numprocs) -{ -// The tags should match on the sender and receiver side. -// The distinction between sendtag and recvtag is mainly -// useful to make some other Recv or Send calls match the sendrecv. -#define TAG_RCV 999 -#define TAG_SND 999 - - -#define BUFLEN 10 - int left, right; - int buffer[BUFLEN], buffer2[BUFLEN]; - int i; - MPI_Status status; - - for (i = 0; i < BUFLEN; i++) { - buffer[i] = myid; - } - - right = (myid + 1) % numprocs; - left = myid - 1; - if (left < 0) - left = numprocs - 1; - - /* performs a right-to-left shift of vectors */ - MPI_Sendrecv(buffer, 10, MPI_INT, left, TAG_SND, buffer2, 10, MPI_INT, - right, TAG_RCV, MPI_COMM_WORLD, &status); - - for (i = 0; i < BUFLEN; i++) { - if (buffer2[i] != right) { - fprintf(stderr, "[%d] error: should have values %d, has %d\n", myid, - right, buffer2[i]); - return (0); - } - } - return (1); -} - -int main(int argc, char *argv[]) -{ - - int myid, numprocs; - - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &numprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &myid); - - - if (0 == myid) - printf("\n *** MPI_Sendrecv test ***\n\n"); - - if (test(myid, numprocs)) { - fprintf(stderr, "[%d] ok.\n", myid); - } else { - fprintf(stderr, "[%d] failed.\n", myid); - } - - - MPI_Finalize(); - return 0; -} diff --git a/teshsuite/smpi/sendtest.c b/teshsuite/smpi/sendtest.c deleted file mode 100644 index bb5c4803d8..0000000000 --- a/teshsuite/smpi/sendtest.c +++ /dev/null @@ -1,92 +0,0 @@ -/* A simple example pingpong pogram to test MPI_Send and MPI_Recv */ - -/* Copyright (c) 2009-2010, 2012-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. */ - -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - int rank; - int size; - MPI_Status status; - - int n = 0, m = 0, bytes = 0, workusecs = 0; - int currusecs; - - char *buf = NULL; - int i, j; - struct timeval start_time, stop_time; - struct timeval start_pause, curr_pause; - unsigned long usecs; - - MPI_Init(&argc, &argv); /* Initialize MPI */ - MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */ - MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ - - if (size != 2) { - printf("run this program with exactly 2 processes (-np 2)\n"); - MPI_Finalize(); - exit(0); - } - - if (0 == rank) { - if (argc > 1 && isdigit(argv[1][0])) { - n = atoi(argv[1]); - } - if (argc > 2 && isdigit(argv[2][0])) { - m = atoi(argv[2]); - } - if (argc > 3 && isdigit(argv[3][0])) { - bytes = atoi(argv[3]); - } - if (argc > 4 && isdigit(argv[4][0])) { - workusecs = atoi(argv[4]); - } - buf = malloc(sizeof(char) * bytes); - for (i = 0; i < bytes; i++) buf[i] = i % 256; - MPI_Send(&n, 1, MPI_INT, 1, 0, MPI_COMM_WORLD); - MPI_Send(&m, 1, MPI_INT, 1, 0, MPI_COMM_WORLD); - MPI_Send(&bytes, 1, MPI_INT, 1, 0, MPI_COMM_WORLD); - MPI_Send(&workusecs, 1, MPI_INT, 1, 0, MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); - gettimeofday(&start_time, NULL); - for (i = 0; i < n; i++) { - for (j = 0; j < m; j++) { - MPI_Send(buf, bytes, MPI_CHAR, 1, 0, MPI_COMM_WORLD); - gettimeofday(&start_pause, NULL); - currusecs = 0; - while (currusecs < workusecs) { - gettimeofday(&curr_pause, NULL); - currusecs = (curr_pause.tv_sec - start_pause.tv_sec) * 1e6 + curr_pause.tv_usec - start_pause.tv_usec; - } - } - MPI_Recv(buf, bytes, MPI_CHAR, 1, 0, MPI_COMM_WORLD, &status); - } - gettimeofday(&stop_time, NULL); - usecs = (stop_time.tv_sec - start_time.tv_sec) * 1e6 + stop_time.tv_usec - start_time.tv_usec; - printf("n: %d m: %d bytes: %d sleep: %d usecs: %u\n", n, m, bytes, workusecs, usecs); - } else { - MPI_Recv(&n, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status); - MPI_Recv(&m, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status); - MPI_Recv(&bytes, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status); - MPI_Recv(&workusecs, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status); - buf = malloc(sizeof(char) * bytes); - MPI_Barrier(MPI_COMM_WORLD); - for (i = 0; i < n; i++) { - for (j = 0; j < m; j++) { - MPI_Recv(buf, bytes, MPI_CHAR, 0, 0, MPI_COMM_WORLD, &status); - } - MPI_Send(buf, bytes, MPI_CHAR, 0, 0, MPI_COMM_WORLD); - } - } - free(buf); - MPI_Finalize(); - return 0; -} diff --git a/teshsuite/smpi/shared/CMakeLists.txt b/teshsuite/smpi/shared/CMakeLists.txt new file mode 100644 index 0000000000..0e44008dbc --- /dev/null +++ b/teshsuite/smpi/shared/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + if(NOT WIN32) + add_executable(shared shared.c) + target_link_libraries(shared simgrid) + endif() +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/shared.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/shared.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/shared.c b/teshsuite/smpi/shared/shared.c similarity index 100% rename from teshsuite/smpi/shared.c rename to teshsuite/smpi/shared/shared.c diff --git a/teshsuite/smpi/shared.tesh b/teshsuite/smpi/shared/shared.tesh similarity index 82% rename from teshsuite/smpi/shared.tesh rename to teshsuite/smpi/shared/shared.tesh index 64d932aace..16022df631 100644 --- a/teshsuite/smpi/shared.tesh +++ b/teshsuite/smpi/shared/shared.tesh @@ -2,9 +2,9 @@ p Test compute ! setenv LD_LIBRARY_PATH=../../lib ! output sort ! timeout 5 -$ ../../smpi_script/bin/smpirun -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 4 ./shared --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 4 ${bindir:=.}/shared --log=smpi_kernel.thres:warning > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/teshsuite/smpi/split.c b/teshsuite/smpi/split.c deleted file mode 100644 index 64a4a862d6..0000000000 --- a/teshsuite/smpi/split.c +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (c) 2009-2010, 2012-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. */ - -#include -#include - -int main(int argc, char *argv[]) -{ - int worldrank; - int localrank; - MPI_Comm localcomm; - - MPI_Init(&argc, &argv); - MPI_Comm_rank(MPI_COMM_WORLD, &worldrank); - MPI_Comm_split(MPI_COMM_WORLD, worldrank % 2, worldrank, &localcomm); - MPI_Comm_rank(localcomm, &localrank); - printf("node with world rank %d has local rank %d\n", worldrank, localrank); - MPI_Finalize(); - return 0; -} diff --git a/teshsuite/smpi/struct/CMakeLists.txt b/teshsuite/smpi/struct/CMakeLists.txt new file mode 100644 index 0000000000..b8b2a830aa --- /dev/null +++ b/teshsuite/smpi/struct/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(struct_test struct_test.c) + target_link_libraries(struct_test simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/struct.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/struct_test.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/struct.tesh b/teshsuite/smpi/struct/struct.tesh similarity index 77% rename from teshsuite/smpi/struct.tesh rename to teshsuite/smpi/struct/struct.tesh index ebeb8c65af..2e19b434b3 100644 --- a/teshsuite/smpi/struct.tesh +++ b/teshsuite/smpi/struct/struct.tesh @@ -1,11 +1,11 @@ p Test struct ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./struct_test -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 2 ${bindir:=.}/struct_test -q --log=smpi_kernel.thres:warning > Process 0 got -2 (-2?) and 8.000000 (8.0?), tab (should be all 0): 0 0 0 0 0 0 > Process 1 got -2 (-2?) and 8.000000 (8.0?), tab (should be all 0): 0 0 0 0 0 0 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/teshsuite/smpi/struct_test.c b/teshsuite/smpi/struct/struct_test.c similarity index 100% rename from teshsuite/smpi/struct_test.c rename to teshsuite/smpi/struct/struct_test.c diff --git a/teshsuite/smpi/ttest01.c b/teshsuite/smpi/ttest01.c deleted file mode 100644 index c01db5b7a6..0000000000 --- a/teshsuite/smpi/ttest01.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2009-2010, 2012-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. */ - -#include -#include "mpi.h" -#include "instr/instr.h" - -#define DATATOSENT 100000000 - -int main(int argc, char *argv[]) -{ - MPI_Status status; - int rank, numprocs, tag = 0; - int *r = malloc(sizeof(int) * DATATOSENT); - - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &numprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - - int i; - for (i = 0; i < 10; i++) { - TRACE_smpi_set_category("A"); - if (rank == 0) { - MPI_Send(r, DATATOSENT, MPI_INT, 1, tag, MPI_COMM_WORLD); - } else if (rank == 1) { - MPI_Recv(r, DATATOSENT, MPI_INT, 0, tag, MPI_COMM_WORLD, &status); - } else { - //do nothing - } - - TRACE_smpi_set_category("B"); - if (rank == 0) { - MPI_Recv(r, DATATOSENT, MPI_INT, 1, tag, MPI_COMM_WORLD, &status); - } else if (rank == 1) { - MPI_Send(r, DATATOSENT, MPI_INT, 0, tag, MPI_COMM_WORLD); - } else { - //do nothing - } - } - TRACE_smpi_set_category("C"); - MPI_Barrier(MPI_COMM_WORLD); - MPI_Finalize(); - return 0; -} diff --git a/teshsuite/smpi/vector/CMakeLists.txt b/teshsuite/smpi/vector/CMakeLists.txt new file mode 100644 index 0000000000..0eb0ee2b25 --- /dev/null +++ b/teshsuite/smpi/vector/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") + add_executable(vector_test vector_test.c) + target_link_libraries(vector_test simgrid) +endif() + + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/vector.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(examples_src + ${examples_src} + ${CMAKE_CURRENT_SOURCE_DIR}/vector_test.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + + PARENT_SCOPE + ) diff --git a/teshsuite/smpi/vector.tesh b/teshsuite/smpi/vector/vector.tesh similarity index 87% rename from teshsuite/smpi/vector.tesh rename to teshsuite/smpi/vector/vector.tesh index e9a31a65db..95311e5d52 100644 --- a/teshsuite/smpi/vector.tesh +++ b/teshsuite/smpi/vector/vector.tesh @@ -1,9 +1,9 @@ p Test vector ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./vector_test -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/msg/small_platform.xml -np 2 ${bindir:=.}/vector_test -q --log=smpi_kernel.thres:warning > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' diff --git a/teshsuite/smpi/vector_test.c b/teshsuite/smpi/vector/vector_test.c similarity index 100% rename from teshsuite/smpi/vector_test.c rename to teshsuite/smpi/vector/vector_test.c diff --git a/teshsuite/surf/CMakeLists.txt b/teshsuite/surf/CMakeLists.txt new file mode 100644 index 0000000000..8c44e073f0 --- /dev/null +++ b/teshsuite/surf/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + ${CMAKE_CURRENT_SOURCE_DIR}/trace_A_failure.txt + ${CMAKE_CURRENT_SOURCE_DIR}/trace_A.txt + ${CMAKE_CURRENT_SOURCE_DIR}/trace_B.txt + PARENT_SCOPE + ) diff --git a/teshsuite/surf/lmm_usage/CMakeLists.txt b/teshsuite/surf/lmm_usage/CMakeLists.txt new file mode 100644 index 0000000000..aa20eb3f3a --- /dev/null +++ b/teshsuite/surf/lmm_usage/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(lmm_usage ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/lmm_usage/lmm_usage.c) + +### Add definitions for compile +if(NOT WIN32) + target_link_libraries(lmm_usage simgrid m ) +else() + target_link_libraries(lmm_usage simgrid ) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/lmm_usage.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(testsuite_src + ${testsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/lmm_usage.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/testsuite/surf/lmm_usage.c b/teshsuite/surf/lmm_usage/lmm_usage.c similarity index 100% rename from testsuite/surf/lmm_usage.c rename to teshsuite/surf/lmm_usage/lmm_usage.c diff --git a/teshsuite/surf/lmm_usage/lmm_usage.tesh b/teshsuite/surf/lmm_usage/lmm_usage.tesh new file mode 100644 index 0000000000..377da7a4d8 --- /dev/null +++ b/teshsuite/surf/lmm_usage/lmm_usage.tesh @@ -0,0 +1,12 @@ +#! ./tesh + +$ $SG_TEST_EXENV ${bindir:=.}/lmm_usage +> [0.000000] [surf_test/INFO] ***** Test 1 (Max-Min) +> [0.000000] [surf_test/INFO] ***** Test 1 (Lagrange - Vegas) +> [0.000000] [surf_test/INFO] ***** Test 1 (Lagrange - Reno) +> [0.000000] [surf_test/INFO] ***** Test 2 (Max-Min) +> [0.000000] [surf_test/INFO] ***** Test 2 (Lagrange - Vegas) +> [0.000000] [surf_test/INFO] ***** Test 2 (Lagrange - Reno) +> [0.000000] [surf_test/INFO] ***** Test 3 (Max-Min) +> [0.000000] [surf_test/INFO] ***** Test 3 (Lagrange - Vegas) +> [0.000000] [surf_test/INFO] ***** Test 3 (Lagrange - Reno) diff --git a/teshsuite/surf/maxmin_bench/CMakeLists.txt b/teshsuite/surf/maxmin_bench/CMakeLists.txt new file mode 100644 index 0000000000..c58f9c69c4 --- /dev/null +++ b/teshsuite/surf/maxmin_bench/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(maxmin_bench ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/maxmin_bench/maxmin_bench.c) + +### Add definitions for compile +if(NOT WIN32) + target_link_libraries(maxmin_bench simgrid m ) +else() + target_link_libraries(maxmin_bench simgrid ) + set_target_properties(maxmin_bench PROPERTIES COMPILE_FLAGS "-DDLL_STATIC") +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/maxmin_bench.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(testsuite_src + ${testsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/maxmin_bench.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/testsuite/surf/maxmin_bench.c b/teshsuite/surf/maxmin_bench/maxmin_bench.c similarity index 100% rename from testsuite/surf/maxmin_bench.c rename to teshsuite/surf/maxmin_bench/maxmin_bench.c diff --git a/teshsuite/surf/maxmin_bench/maxmin_bench.tesh b/teshsuite/surf/maxmin_bench/maxmin_bench.tesh new file mode 100644 index 0000000000..4a2fb5511d --- /dev/null +++ b/teshsuite/surf/maxmin_bench/maxmin_bench.tesh @@ -0,0 +1,6 @@ +#! ./tesh + +! output display +$ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench +> Starting to solve +> One shot execution time for a total of 2000 constraints, 2000 variables with 80 active constraint each : 66293 microsecondes diff --git a/testsuite/surf/platform.xml b/teshsuite/surf/platform.xml similarity index 100% rename from testsuite/surf/platform.xml rename to teshsuite/surf/platform.xml diff --git a/teshsuite/surf/surf_usage/CMakeLists.txt b/teshsuite/surf/surf_usage/CMakeLists.txt new file mode 100644 index 0000000000..7f1a3093f8 --- /dev/null +++ b/teshsuite/surf/surf_usage/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(surf_usage ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/surf_usage/surf_usage.c) +add_executable(surf_usage2 ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/surf_usage/surf_usage2.c) + +### Add definitions for compile +if(NOT WIN32) + target_link_libraries(surf_usage simgrid m ) + target_link_libraries(surf_usage2 simgrid m ) +else() + target_link_libraries(surf_usage simgrid ) + target_link_libraries(surf_usage2 simgrid ) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/surf_usage.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(testsuite_src + ${testsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/surf_usage.c + ${CMAKE_CURRENT_SOURCE_DIR}/surf_usage2.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/testsuite/surf/surf_usage.c b/teshsuite/surf/surf_usage/surf_usage.c similarity index 100% rename from testsuite/surf/surf_usage.c rename to teshsuite/surf/surf_usage/surf_usage.c diff --git a/teshsuite/surf/surf_usage/surf_usage.tesh b/teshsuite/surf/surf_usage/surf_usage.tesh new file mode 100644 index 0000000000..5010663652 --- /dev/null +++ b/teshsuite/surf/surf_usage/surf_usage.tesh @@ -0,0 +1,11 @@ +#! ./tesh + +$ $SG_TEST_EXENV ${bindir:=.}/surf_usage platform.xml +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02' +> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) + +$ $SG_TEST_EXENV ${bindir:=.}/surf_usage2 platform.xml +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01' +> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) diff --git a/testsuite/surf/surf_usage2.c b/teshsuite/surf/surf_usage/surf_usage2.c similarity index 100% rename from testsuite/surf/surf_usage2.c rename to teshsuite/surf/surf_usage/surf_usage2.c diff --git a/testsuite/surf/trace_A.txt b/teshsuite/surf/trace_A.txt similarity index 100% rename from testsuite/surf/trace_A.txt rename to teshsuite/surf/trace_A.txt diff --git a/testsuite/surf/trace_A_failure.txt b/teshsuite/surf/trace_A_failure.txt similarity index 100% rename from testsuite/surf/trace_A_failure.txt rename to teshsuite/surf/trace_A_failure.txt diff --git a/testsuite/surf/trace_B.txt b/teshsuite/surf/trace_B.txt similarity index 100% rename from testsuite/surf/trace_B.txt rename to teshsuite/surf/trace_B.txt diff --git a/teshsuite/surf/trace_usage/CMakeLists.txt b/teshsuite/surf/trace_usage/CMakeLists.txt new file mode 100644 index 0000000000..c7ed9b55d4 --- /dev/null +++ b/teshsuite/surf/trace_usage/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(trace_usage ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/trace_usage/trace_usage.c) + +### Add definitions for compile +if(NOT WIN32) + target_link_libraries(trace_usage simgrid m ) +else() + target_link_libraries(trace_usage simgrid ) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/trace_usage.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(testsuite_src + ${testsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/trace_usage.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/testsuite/surf/trace_usage.c b/teshsuite/surf/trace_usage/trace_usage.c similarity index 100% rename from testsuite/surf/trace_usage.c rename to teshsuite/surf/trace_usage/trace_usage.c diff --git a/teshsuite/surf/trace_usage/trace_usage.tesh b/teshsuite/surf/trace_usage/trace_usage.tesh new file mode 100644 index 0000000000..7f5b633398 --- /dev/null +++ b/teshsuite/surf/trace_usage/trace_usage.tesh @@ -0,0 +1,4 @@ +#! ./tesh + +$ $SG_TEST_EXENV ${bindir:=.}/trace_usage +> diff --git a/teshsuite/xbt/CMakeLists.txt b/teshsuite/xbt/CMakeLists.txt deleted file mode 100644 index a7e923586f..0000000000 --- a/teshsuite/xbt/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") - -add_executable(log_large_test log_large_test.c) -add_executable(parallel_log_crashtest parallel_log_crashtest.c) -if(HAVE_MMALLOC) - add_executable(mmalloc_test mmalloc_test.c) -endif() -add_executable(parmap_test parmap_test.c) - - -### Add definitions for compile -target_link_libraries(log_large_test simgrid) -target_link_libraries(parallel_log_crashtest simgrid) -if(HAVE_MMALLOC) - target_link_libraries(mmalloc_test simgrid) -endif() -target_link_libraries(parmap_test simgrid) - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/log_large_test.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/parallel_log_crashtest.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/xbt.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc_64.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc_32.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/parmap_test.tesh - PARENT_SCOPE - ) -set(xml_files - ${xml_files} - PARENT_SCOPE - ) -set(teshsuite_src - ${teshsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/log_large_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/parallel_log_crashtest.c - ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc_test.c - ${CMAKE_CURRENT_SOURCE_DIR}/parmap_test.c - PARENT_SCOPE - ) -set(bin_files - ${bin_files} - PARENT_SCOPE - ) -set(txt_files - ${txt_files} - PARENT_SCOPE - ) diff --git a/testsuite/xbt/CMakeLists.txt b/teshsuite/xbt/graphxml_usage/CMakeLists.txt similarity index 50% rename from testsuite/xbt/CMakeLists.txt rename to teshsuite/xbt/graphxml_usage/CMakeLists.txt index fa6aaef695..b2850adb3d 100644 --- a/testsuite/xbt/CMakeLists.txt +++ b/teshsuite/xbt/graphxml_usage/CMakeLists.txt @@ -2,26 +2,18 @@ cmake_minimum_required(VERSION 2.6) set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") -add_executable(log_usage "log_usage.c") -add_executable(graphxml_usage "graphxml_usage.c") -add_executable(heap_bench "heap_bench.c") -add_executable(parmap_bench "parmap_bench.c") +add_executable(graphxml_usage ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/graphxml_usage/graphxml_usage.c) ### Add definitions for compile if(NOT WIN32) - target_link_libraries(log_usage simgrid m ) target_link_libraries(graphxml_usage simgrid m ) - target_link_libraries(heap_bench simgrid m ) - target_link_libraries(parmap_bench simgrid m ) else() - target_link_libraries(log_usage simgrid ) target_link_libraries(graphxml_usage simgrid ) - target_link_libraries(heap_bench simgrid ) - target_link_libraries(parmap_bench simgrid ) endif() set(tesh_files ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/graphxml_usage.tesh PARENT_SCOPE ) set(xml_files @@ -32,9 +24,6 @@ set(xml_files set(testsuite_src ${testsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/graphxml_usage.c - ${CMAKE_CURRENT_SOURCE_DIR}/heap_bench.c - ${CMAKE_CURRENT_SOURCE_DIR}/log_usage.c - ${CMAKE_CURRENT_SOURCE_DIR}/parmap_bench.c PARENT_SCOPE ) set(bin_files diff --git a/testsuite/xbt/graph.xml b/teshsuite/xbt/graphxml_usage/graph.xml similarity index 100% rename from testsuite/xbt/graph.xml rename to teshsuite/xbt/graphxml_usage/graph.xml diff --git a/testsuite/xbt/graphxml_usage.c b/teshsuite/xbt/graphxml_usage/graphxml_usage.c similarity index 98% rename from testsuite/xbt/graphxml_usage.c rename to teshsuite/xbt/graphxml_usage/graphxml_usage.c index 5a23fbe54f..7c4fe73c33 100644 --- a/testsuite/xbt/graphxml_usage.c +++ b/teshsuite/xbt/graphxml_usage/graphxml_usage.c @@ -116,7 +116,7 @@ void test(char *graph_file) sorted = xbt_graph_topo_sort(graph); for (i = 0; i < n; i++) { if (sorted[i]) { - XBT_INFO("sorted[%lu] = %s (%p)", i, node_name(sorted[i]), sorted[i]); + XBT_INFO("sorted[%lu] = %s", i, node_name(sorted[i])); } } free(sorted); diff --git a/teshsuite/xbt/graphxml_usage/graphxml_usage.tesh b/teshsuite/xbt/graphxml_usage/graphxml_usage.tesh new file mode 100644 index 0000000000..fac32045fa --- /dev/null +++ b/teshsuite/xbt/graphxml_usage/graphxml_usage.tesh @@ -0,0 +1,32 @@ +#! ./tesh + +$ $SG_TEST_EXENV ${bindir:=.}/graphxml_usage graph.xml +> [0.000000] [test/INFO] ---- Testing XML export. Exporting to testgraph.xml ---- +> [0.000000] [test/INFO] ---- Testing GraphViz export. Exporting to testgraph.dot ---- +> [0.000000] [test/INFO] ---- Dumping Edge lengths ---- +> [0.000000] [test/INFO] 0.000000e+00 4.100000e-01 -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 +> [0.000000] [test/INFO] -1.000000e+00 0.000000e+00 5.100000e-01 -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 +> [0.000000] [test/INFO] -1.000000e+00 -1.000000e+00 0.000000e+00 5.000000e-01 -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 +> [0.000000] [test/INFO] -1.000000e+00 -1.000000e+00 -1.000000e+00 0.000000e+00 -1.000000e+00 3.800000e-01 -1.000000e+00 -1.000000e+00 +> [0.000000] [test/INFO] -1.000000e+00 -1.000000e+00 -1.000000e+00 3.600000e-01 0.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 +> [0.000000] [test/INFO] -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 0.000000e+00 -1.000000e+00 -1.000000e+00 +> [0.000000] [test/INFO] -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 3.800000e-01 -1.000000e+00 0.000000e+00 -1.000000e+00 +> [0.000000] [test/INFO] -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 -1.000000e+00 0.000000e+00 +> [0.000000] [test/INFO] ---- Testing Shortest Paths ---- +> [0.000000] [test/INFO] A B B B B +> [0.000000] [test/INFO] B C C C +> [0.000000] [test/INFO] C D D +> [0.000000] [test/INFO] D F +> [0.000000] [test/INFO] D E D +> [0.000000] [test/INFO] F +> [0.000000] [test/INFO] E E E M +> [0.000000] [test/INFO] P +> [0.000000] [test/INFO] ---- Testing Topological Sort ---- +> [0.000000] [test/INFO] sorted[0] = P +> [0.000000] [test/INFO] sorted[1] = M +> [0.000000] [test/INFO] sorted[2] = E +> [0.000000] [test/INFO] sorted[3] = A +> [0.000000] [test/INFO] sorted[4] = B +> [0.000000] [test/INFO] sorted[5] = C +> [0.000000] [test/INFO] sorted[6] = D +> [0.000000] [test/INFO] sorted[7] = F diff --git a/teshsuite/xbt/heap_bench/CMakeLists.txt b/teshsuite/xbt/heap_bench/CMakeLists.txt new file mode 100644 index 0000000000..d80764e622 --- /dev/null +++ b/teshsuite/xbt/heap_bench/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(heap_bench ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/heap_bench/heap_bench.c) + +### Add definitions for compile +if(NOT WIN32) + target_link_libraries(heap_bench simgrid m ) +else() + target_link_libraries(heap_bench simgrid ) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/heap_bench.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(testsuite_src + ${testsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/heap_bench.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/testsuite/xbt/heap_bench.c b/teshsuite/xbt/heap_bench/heap_bench.c similarity index 100% rename from testsuite/xbt/heap_bench.c rename to teshsuite/xbt/heap_bench/heap_bench.c diff --git a/teshsuite/xbt/heap_bench/heap_bench.tesh b/teshsuite/xbt/heap_bench/heap_bench.tesh new file mode 100644 index 0000000000..a07abd42a8 --- /dev/null +++ b/teshsuite/xbt/heap_bench/heap_bench.tesh @@ -0,0 +1,10 @@ +#! ./tesh + +! output display +$ $SG_TEST_EXENV ${bindir:=.}/heap_bench +> Validity test complete! +> Creation time 100 size heap : 6 +> Mean access time for a 100 size heap : 0.14687 +> Validity test complete! +> Creation time 1000 size heap : 38 +> Mean access time for a 1000 size heap : 0.179765 diff --git a/teshsuite/xbt/log_large/CMakeLists.txt b/teshsuite/xbt/log_large/CMakeLists.txt new file mode 100644 index 0000000000..120c86448c --- /dev/null +++ b/teshsuite/xbt/log_large/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(log_large_test log_large_test.c) + +### Add definitions for compile +target_link_libraries(log_large_test simgrid) + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/log_large_test.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/log_large_test.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/xbt/log_large_test.c b/teshsuite/xbt/log_large/log_large_test.c similarity index 100% rename from teshsuite/xbt/log_large_test.c rename to teshsuite/xbt/log_large/log_large_test.c diff --git a/teshsuite/xbt/log_large_test.tesh b/teshsuite/xbt/log_large/log_large_test.tesh similarity index 99% rename from teshsuite/xbt/log_large_test.tesh rename to teshsuite/xbt/log_large/log_large_test.tesh index 2c749d5caf..32a8cf992c 100644 --- a/teshsuite/xbt/log_large_test.tesh +++ b/teshsuite/xbt/log_large/log_large_test.tesh @@ -1,6 +1,6 @@ p Check that the dynamic version of the log simple layout works -$ $SG_EXENV_TEST xbt/log_large_test "--log=root.fmt:%m%n" +$ $SG_EXENV_TEST ${bindir:=.}/log_large_test "--log=root.fmt:%m%n" > This is a very large message: > 0 > 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0 @@ -112,11 +112,11 @@ $ $SG_EXENV_TEST xbt/log_large_test "--log=root.fmt:%m%n" > 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0 > 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0 > 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0 -> +> > Done (strlen>10210) p Check that the dynamic version of the log formated layout works -$ $SG_EXENV_TEST xbt/log_large_test "--log=root.fmt:%m%n" +$ $SG_EXENV_TEST ${bindir:=.}/log_large_test "--log=root.fmt:%m%n" > This is a very large message: > 0 > 1.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0 @@ -228,5 +228,5 @@ $ $SG_EXENV_TEST xbt/log_large_test "--log=root.fmt:%m%n" > 8.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0 > 9.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0 > 0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........0 -> +> > Done (strlen>10210) diff --git a/teshsuite/xbt/log_usage/CMakeLists.txt b/teshsuite/xbt/log_usage/CMakeLists.txt new file mode 100644 index 0000000000..b271c983dc --- /dev/null +++ b/teshsuite/xbt/log_usage/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(log_usage ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_usage/log_usage.c) + +### Add definitions for compile +if(NOT WIN32) + target_link_libraries(log_usage simgrid m ) +else() + target_link_libraries(log_usage simgrid ) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/log_usage.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(testsuite_src + ${testsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/log_usage.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/testsuite/xbt/log_usage.c b/teshsuite/xbt/log_usage/log_usage.c similarity index 100% rename from testsuite/xbt/log_usage.c rename to teshsuite/xbt/log_usage/log_usage.c diff --git a/teshsuite/xbt/log_usage/log_usage.tesh b/teshsuite/xbt/log_usage/log_usage.tesh new file mode 100644 index 0000000000..1df8cbbb60 --- /dev/null +++ b/teshsuite/xbt/log_usage/log_usage.tesh @@ -0,0 +1,21 @@ +#! ./tesh + +$ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" +> [ 0.000000] [0:@] Test with the settings '' +> [ 0.000000] [0:@] val=2 +> [ 0.000000] [0:@] false alarm! +> [ 0.000000] [0:@] Test with the settings ' ' +> [ 0.000000] [0:@] val=2 +> [ 0.000000] [0:@] false alarm! +> [ 0.000000] [0:@] Test with the settings ' test.thres:info root.thres:info ' +> [ 0.000000] [0:@] val=2 +> [ 0.000000] [0:@] false alarm! +> [ 0.000000] [0:@] Test with the settings ' test.thres:debug ' +> [ 0.000000] [0:@] val=1 +> [ 0.000000] [0:@] val=2 +> [ 0.000000] [0:@] false alarm! +> [ 0.000000] [0:@] Test with the settings ' test.thres:verbose root.thres:error ' +> [ 0.000000] [0:@] val=2 +> [ 0.000000] [0:@] false alarm! +> [ 0.000000] [0:@] Test with the settings ' test.thres:critical ' +> [ 0.000000] [0:@] false alarm! diff --git a/teshsuite/xbt/mmalloc/CMakeLists.txt b/teshsuite/xbt/mmalloc/CMakeLists.txt new file mode 100644 index 0000000000..729cb04202 --- /dev/null +++ b/teshsuite/xbt/mmalloc/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +if(HAVE_MMALLOC) + add_executable(mmalloc_test mmalloc_test.c) + target_link_libraries(mmalloc_test simgrid) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc_64.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc_32.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc_test.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/xbt/mmalloc_32.tesh b/teshsuite/xbt/mmalloc/mmalloc_32.tesh similarity index 98% rename from teshsuite/xbt/mmalloc_32.tesh rename to teshsuite/xbt/mmalloc/mmalloc_32.tesh index b64d9eccb7..449049d43b 100644 --- a/teshsuite/xbt/mmalloc_32.tesh +++ b/teshsuite/xbt/mmalloc/mmalloc_32.tesh @@ -1,4 +1,4 @@ -$ ./xbt/mmalloc_test --log=root.fmt:%m%n +$ ${bindir:=.}/mmalloc_test --log=root.fmt:%m%n > Allocating a new heap > HeapA allocated > 100 bytes allocated with offset 45000 diff --git a/teshsuite/xbt/mmalloc_64.tesh b/teshsuite/xbt/mmalloc/mmalloc_64.tesh similarity index 98% rename from teshsuite/xbt/mmalloc_64.tesh rename to teshsuite/xbt/mmalloc/mmalloc_64.tesh index 83108e6459..343e2a4a98 100644 --- a/teshsuite/xbt/mmalloc_64.tesh +++ b/teshsuite/xbt/mmalloc/mmalloc_64.tesh @@ -1,4 +1,4 @@ -$ ./xbt/mmalloc_test --log=root.fmt:%m%n +$ ${bindir:=.}/mmalloc_test --log=root.fmt:%m%n > Allocating a new heap > HeapA allocated > 100 bytes allocated with offset 39000 diff --git a/teshsuite/xbt/mmalloc_test.c b/teshsuite/xbt/mmalloc/mmalloc_test.c similarity index 100% rename from teshsuite/xbt/mmalloc_test.c rename to teshsuite/xbt/mmalloc/mmalloc_test.c diff --git a/teshsuite/xbt/parallel_log/CMakeLists.txt b/teshsuite/xbt/parallel_log/CMakeLists.txt new file mode 100644 index 0000000000..069181a9ae --- /dev/null +++ b/teshsuite/xbt/parallel_log/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(parallel_log_crashtest parallel_log_crashtest.c) + +### Add definitions for compile +target_link_libraries(parallel_log_crashtest simgrid) + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/parallel_log_crashtest.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/parallel_log_crashtest.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/xbt/parallel_log_crashtest.c b/teshsuite/xbt/parallel_log/parallel_log_crashtest.c similarity index 100% rename from teshsuite/xbt/parallel_log_crashtest.c rename to teshsuite/xbt/parallel_log/parallel_log_crashtest.c diff --git a/teshsuite/xbt/parallel_log_crashtest.tesh b/teshsuite/xbt/parallel_log/parallel_log_crashtest.tesh similarity index 99% rename from teshsuite/xbt/parallel_log_crashtest.tesh rename to teshsuite/xbt/parallel_log/parallel_log_crashtest.tesh index cb7605e3d4..5715e7e4c2 100644 --- a/teshsuite/xbt/parallel_log_crashtest.tesh +++ b/teshsuite/xbt/parallel_log/parallel_log_crashtest.tesh @@ -1,7 +1,7 @@ ! timeout 20 p Try to crash the log mecanism by using it in parallel with a lot of threads -$ xbt/parallel_log_crashtest "--log=root.fmt:%m%n" +$ ${bindir:=.}/parallel_log_crashtest "--log=root.fmt:%m%n" > XXX (XX|XX|XX|XX|XX|XX|XX|XX|XX) > XXX (XX|XX|XX|XX|XX|XX|XX|XX|XX) > XXX (XX|XX|XX|XX|XX|XX|XX|XX|XX) diff --git a/teshsuite/xbt/parmap_bench/CMakeLists.txt b/teshsuite/xbt/parmap_bench/CMakeLists.txt new file mode 100644 index 0000000000..1a096363c5 --- /dev/null +++ b/teshsuite/xbt/parmap_bench/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(parmap_bench ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parmap_bench/parmap_bench.c) + +### Add definitions for compile +if(NOT WIN32) + target_link_libraries(parmap_bench simgrid m ) +else() + target_link_libraries(parmap_bench simgrid ) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/parmap_bench.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(testsuite_src + ${testsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/parmap_bench.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/testsuite/xbt/parmap_bench.c b/teshsuite/xbt/parmap_bench/parmap_bench.c similarity index 100% rename from testsuite/xbt/parmap_bench.c rename to teshsuite/xbt/parmap_bench/parmap_bench.c diff --git a/teshsuite/xbt/parmap_bench/parmap_bench.tesh b/teshsuite/xbt/parmap_bench/parmap_bench.tesh new file mode 100644 index 0000000000..ebd0bf93b4 --- /dev/null +++ b/teshsuite/xbt/parmap_bench/parmap_bench.tesh @@ -0,0 +1,4 @@ +#! ./tesh + +$ $SG_TEST_EXENV ${bindir:=.}/parmap_bench +> diff --git a/teshsuite/xbt/parmap_test/CMakeLists.txt b/teshsuite/xbt/parmap_test/CMakeLists.txt new file mode 100644 index 0000000000..1f8d63daeb --- /dev/null +++ b/teshsuite/xbt/parmap_test/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(parmap_test parmap_test.c) + +### Add definitions for compile +target_link_libraries(parmap_test simgrid) + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/parmap_test.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/parmap_test.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/xbt/parmap_test.c b/teshsuite/xbt/parmap_test/parmap_test.c similarity index 100% rename from teshsuite/xbt/parmap_test.c rename to teshsuite/xbt/parmap_test/parmap_test.c diff --git a/teshsuite/xbt/parmap_test.tesh b/teshsuite/xbt/parmap_test/parmap_test.tesh similarity index 77% rename from teshsuite/xbt/parmap_test.tesh rename to teshsuite/xbt/parmap_test/parmap_test.tesh index 2b85ff664a..d389a737f1 100644 --- a/teshsuite/xbt/parmap_test.tesh +++ b/teshsuite/xbt/parmap_test/parmap_test.tesh @@ -1,5 +1,5 @@ ! timeout 120 -$ ./xbt/parmap_test --log=root.fmt:%m%n +$ ${bindir:=.}/parmap_test --log=root.fmt:%m%n > Basic testing posix > Basic testing futex > Basic testing busy wait diff --git a/teshsuite/xbt/xbt.tesh b/teshsuite/xbt/xbt.tesh deleted file mode 100644 index 23c95332f9..0000000000 --- a/teshsuite/xbt/xbt.tesh +++ /dev/null @@ -1,6 +0,0 @@ -#! ./tesh - -# Description of this tesh file -! D This tesh file contains all the tesh files relative with the xbt framework - -! include parallel_log_crashtest.tesh diff --git a/testsuite/surf/CMakeLists.txt b/testsuite/surf/CMakeLists.txt deleted file mode 100644 index f9eee1c2cf..0000000000 --- a/testsuite/surf/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") - -add_executable(lmm_usage "lmm_usage.c") -add_executable(maxmin_bench "maxmin_bench.c") -add_executable(surf_usage "surf_usage.c") -add_executable(surf_usage2 "surf_usage2.c") -add_executable(trace_usage "trace_usage.c") - -### Add definitions for compile -if(NOT WIN32) - target_link_libraries(lmm_usage simgrid m ) - target_link_libraries(maxmin_bench simgrid m ) - target_link_libraries(surf_usage simgrid m ) - target_link_libraries(surf_usage2 simgrid m ) - target_link_libraries(trace_usage simgrid m ) -else() - target_link_libraries(lmm_usage simgrid ) - target_link_libraries(maxmin_bench simgrid ) - set_target_properties(maxmin_bench PROPERTIES COMPILE_FLAGS "-DDLL_STATIC") - target_link_libraries(surf_usage simgrid ) - target_link_libraries(surf_usage2 simgrid ) - target_link_libraries(trace_usage simgrid ) -endif() - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/simeng_usage.tesh - PARENT_SCOPE - ) -set(xml_files - ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml - PARENT_SCOPE - ) -set(testsuite_src - ${testsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/lmm_usage.c - ${CMAKE_CURRENT_SOURCE_DIR}/maxmin_bench.c - ${CMAKE_CURRENT_SOURCE_DIR}/surf_usage.c - ${CMAKE_CURRENT_SOURCE_DIR}/surf_usage2.c - ${CMAKE_CURRENT_SOURCE_DIR}/trace_usage.c - PARENT_SCOPE - ) -set(bin_files - ${bin_files} - PARENT_SCOPE - ) -set(txt_files - ${txt_files} - ${CMAKE_CURRENT_SOURCE_DIR}/trace_A_failure.txt - ${CMAKE_CURRENT_SOURCE_DIR}/trace_A.txt - ${CMAKE_CURRENT_SOURCE_DIR}/trace_B.txt - PARENT_SCOPE - ) diff --git a/testsuite/surf/simeng_usage.tesh b/testsuite/surf/simeng_usage.tesh deleted file mode 100644 index d48b40d76d..0000000000 --- a/testsuite/surf/simeng_usage.tesh +++ /dev/null @@ -1,96 +0,0 @@ -#! ./tesh - -p Testing the surf network maxmin fairness model - -$ $SG_TEST_EXENV surf/simeng_usage$EXEEXT --log=surf_test.thres:debug -> [0.000000] xbt/log.c:607: [surf_test/DEBUG] Apply settings for category 'surf_test': set threshold to DEBUG (=2) -> [0.000000] surf/simeng_usage.c:473: [surf_test/DEBUG] **************************** -> [0.000000] surf/simeng_usage.c:474: [surf_test/DEBUG] ***** ***** -> [0.000000] surf/simeng_usage.c:475: [surf_test/DEBUG] ***** TEST 1 ***** -> [0.000000] surf/simeng_usage.c:476: [surf_test/DEBUG] ***** ***** -> [0.000000] surf/simeng_usage.c:477: [surf_test/DEBUG] **************************** -> [0.000000] surf/simeng_usage.c:480: [surf_test/DEBUG] ***** Test 1 (Max-Min) ***** -> [0.000000] surf/simeng_usage.c:223: [surf_test/DEBUG] R_1_2_3 = 0.5 -> [0.000000] surf/simeng_usage.c:224: [surf_test/DEBUG] R_1 = 0.5 -> [0.000000] surf/simeng_usage.c:225: [surf_test/DEBUG] R_2 = 9.5 -> [0.000000] surf/simeng_usage.c:226: [surf_test/DEBUG] R_3 = 0.5 -> [0.000000] surf/simeng_usage.c:486: [surf_test/DEBUG] ***** Test 1 (Lagrange - Vegas) ***** -> [0.000000] surf/simeng_usage.c:223: [surf_test/DEBUG] R_1_2_3 = 0.325765 -> [0.000000] surf/simeng_usage.c:224: [surf_test/DEBUG] R_1 = 0.674234 -> [0.000000] surf/simeng_usage.c:225: [surf_test/DEBUG] R_2 = 9.67423 -> [0.000000] surf/simeng_usage.c:226: [surf_test/DEBUG] R_3 = 0.674235 -> [0.000000] surf/simeng_usage.c:488: [surf_test/DEBUG] ***** Test 1 (Lagrange - Reno) ***** -> [0.000000] surf/simeng_usage.c:223: [surf_test/DEBUG] R_1_2_3 = 0.150452 -> [0.000000] surf/simeng_usage.c:224: [surf_test/DEBUG] R_1 = 0.849552 -> [0.000000] surf/simeng_usage.c:225: [surf_test/DEBUG] R_2 = 9.84955 -> [0.000000] surf/simeng_usage.c:226: [surf_test/DEBUG] R_3 = 0.849548 -> [0.000000] surf/simeng_usage.c:492: [surf_test/DEBUG] **************************** -> [0.000000] surf/simeng_usage.c:493: [surf_test/DEBUG] ***** ***** -> [0.000000] surf/simeng_usage.c:494: [surf_test/DEBUG] ***** TEST 2 ***** -> [0.000000] surf/simeng_usage.c:495: [surf_test/DEBUG] ***** ***** -> [0.000000] surf/simeng_usage.c:496: [surf_test/DEBUG] **************************** -> [0.000000] surf/simeng_usage.c:499: [surf_test/DEBUG] ***** Test 2 (Max-Min) ***** -> [0.000000] surf/simeng_usage.c:277: [surf_test/DEBUG] T1 = 200 -> [0.000000] surf/simeng_usage.c:278: [surf_test/DEBUG] T2 = 100 -> [0.000000] surf/simeng_usage.c:505: [surf_test/DEBUG] ***** Test 2 (Lagrange - Vegas) ***** -> [0.000000] surf/simeng_usage.c:277: [surf_test/DEBUG] T1 = 200 -> [0.000000] surf/simeng_usage.c:278: [surf_test/DEBUG] T2 = 100 -> [0.000000] surf/simeng_usage.c:507: [surf_test/DEBUG] ***** Test 2 (Lagrange - Reno) ***** -> [0.000000] surf/simeng_usage.c:277: [surf_test/DEBUG] T1 = 200 -> [0.000000] surf/simeng_usage.c:278: [surf_test/DEBUG] T2 = 100 -> [0.000000] surf/simeng_usage.c:512: [surf_test/DEBUG] **************************** -> [0.000000] surf/simeng_usage.c:513: [surf_test/DEBUG] ***** ***** -> [0.000000] surf/simeng_usage.c:514: [surf_test/DEBUG] ***** TEST 3 ***** -> [0.000000] surf/simeng_usage.c:515: [surf_test/DEBUG] ***** ***** -> [0.000000] surf/simeng_usage.c:516: [surf_test/DEBUG] **************************** -> [0.000000] surf/simeng_usage.c:519: [surf_test/DEBUG] ***** Test 3 (Max-Min) ***** -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.33333 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 2 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 2 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 6 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 2 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.33333 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.33333 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 2 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 2 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:525: [surf_test/DEBUG] ***** Test 3 (Lagrange - Vegas) ***** -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.61019 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.33333 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 2.65418 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.61019 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1.52962 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 6.83798 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1.91202 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.33333 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.33333 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1.25 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 2.65418 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:527: [surf_test/DEBUG] ***** Test 3 (Lagrange - Reno) ***** -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.27888 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.33333 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 2.24092 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.27888 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1.76921 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 6.25105 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 2.07592 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.33333 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 3.33333 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1.67303 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 2.24092 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1 -> [0.000000] surf/simeng_usage.c:455: [surf_test/DEBUG] tmp_var[j] = 1