From: Martin Quinson Date: Sat, 28 Sep 2013 20:54:19 +0000 (-0700) Subject: Merge pull request #2 from cemsbr/master X-Git-Tag: v3_9_90~63 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8f5616991169add56ea7c07404728ffd9bc45097?hp=ef1902f4b17a042c1bc361c4e5d102cd9dcf66dd Merge pull request #2 from cemsbr/master Fixing introduction.doc links --- diff --git a/.gitignore b/.gitignore index b2295cc6cb..dbcfa12dc4 100644 --- a/.gitignore +++ b/.gitignore @@ -619,7 +619,7 @@ teshsuite/smpi/mpich3-test/f77/datatype/gaddressf teshsuite/smpi/mpich3-test/f77/datatype/hindex1f teshsuite/smpi/mpich3-test/f77/datatype/hindexed_blockf teshsuite/smpi/mpich3-test/f77/datatype/packef -teshsuite/smpi/mpich3-test/f77/datatype/typeaints +teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h teshsuite/smpi/mpich3-test/f77/datatype/typecntsf teshsuite/smpi/mpich3-test/f77/datatype/typem2f teshsuite/smpi/mpich3-test/f77/datatype/typename3f diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index 9e20f9f351..668798b517 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -139,8 +139,8 @@ if(NOT enable_memcheck) ADD_TEST(msg-energy-pstates ${CMAKE_BINARY_DIR}/bin/tesh ${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 ${CMAKE_BINARY_DIR}/bin/tesh ${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 ${CMAKE_BINARY_DIR}/bin/tesh ${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) - - + ADD_TEST(msg-storage ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage/storage.tesh) + if(CONTEXT_UCONTEXT) ADD_TEST(msg-sendrecv-CLM03-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${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 ${CMAKE_BINARY_DIR}/bin/tesh ${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) diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index 319f8f0fc9..e8120d2867 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -56,6 +56,12 @@ ELSE() #PROCESSOR NOT FOUND ENDIF() +if(ARCH_32_BITS) + set(MPI_ADDRESS_SIZE 4) +else() + set(MPI_ADDRESS_SIZE 8) +endif() + message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}") include(CheckFunctionExists) @@ -779,6 +785,7 @@ set(includedir "${CMAKE_INSTALL_PREFIX}/include") set(libdir ${exec_prefix}/lib) set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${GTNETS_LIB_PATH}:${HAVE_NS3_LIB}:$LD_LIBRARY_PATH") +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/smpif2c.in ${CMAKE_BINARY_DIR}/bin/smpif2c @ONLY) @@ -816,6 +823,7 @@ if(NOT WIN32) endif() set(generated_headers_to_install + ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/mpif.h ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h ) diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index 940acdb8d7..18e7e44e27 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -534,7 +534,6 @@ set(headers_to_install include/simgrid/platf_generator.h include/simgrid/simix.h include/smpi/mpi.h - include/smpi/mpif.h include/smpi/smpi.h include/smpi/smpi_cocci.h include/smpi/smpi_main.h @@ -580,6 +579,7 @@ set(headers_to_install ) set(source_of_generated_headers include/simgrid_config.h.in + include/smpi/mpif.h.in include/smpi/smpif.h.in src/context_sysv_config.h.in) @@ -904,6 +904,7 @@ set(EXAMPLES_CMAKEFILES_TXT set(TESHSUITE_CMAKEFILES_TXT teshsuite/CMakeLists.txt teshsuite/msg/CMakeLists.txt + teshsuite/msg/storage/CMakeLists.txt teshsuite/msg/trace/CMakeLists.txt teshsuite/simdag/CMakeLists.txt teshsuite/simdag/availability/CMakeLists.txt diff --git a/buildtools/Cmake/Flags.cmake b/buildtools/Cmake/Flags.cmake index c573f8151a..68cae01b69 100644 --- a/buildtools/Cmake/Flags.cmake +++ b/buildtools/Cmake/Flags.cmake @@ -4,6 +4,7 @@ set(optCFLAGS "") if(NOT __VISUALC__ AND NOT __BORLANDC__) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-g3") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-g3") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g") else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}/Zi") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}/Zi") @@ -18,7 +19,7 @@ if(enable_compile_warnings) string(REPLACE "-Wclobbered " "" warnCFLAGS "${warnCFLAGS}") endif() - set(CMAKE_Fortran_FLAGS "-Wall") # FIXME: Q&D hack + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall") # FIXME: Q&D hack set(CMAKE_JAVA_COMPILE_FLAGS "-Xlint") endif() diff --git a/buildtools/Cmake/GenerateDocWin.cmake b/buildtools/Cmake/GenerateDocWin.cmake index a7bc518d4f..71b7f8dba0 100644 --- a/buildtools/Cmake/GenerateDocWin.cmake +++ b/buildtools/Cmake/GenerateDocWin.cmake @@ -16,8 +16,8 @@ endif() if(NSIS_PATH) ADD_CUSTOM_TARGET(nsis COMMENT "Generating the SimGrid installor for Windows..." - DEPENDS simgrid simgrid graphicator tesh simgrid-colorizer simgrid_update_xml + DEPENDS simgrid simgrid graphicator simgrid-colorizer simgrid_update_xml COMMAND ${NSIS_PATH}/makensis.exe simgrid.nsi WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/ ) -endif() \ No newline at end of file +endif() diff --git a/buildtools/Cmake/MakeExe.cmake b/buildtools/Cmake/MakeExe.cmake index 11deec72e3..8248638b2c 100644 --- a/buildtools/Cmake/MakeExe.cmake +++ b/buildtools/Cmake/MakeExe.cmake @@ -78,6 +78,7 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/MM) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/availability) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network) diff --git a/buildtools/Cmake/MakeJava.cmake b/buildtools/Cmake/MakeJava.cmake index 86d7dd372d..e8f3de6a29 100644 --- a/buildtools/Cmake/MakeJava.cmake +++ b/buildtools/Cmake/MakeJava.cmake @@ -36,7 +36,7 @@ if(WIN32) message(STATUS "pexports: ${PEXPORTS_PATH}") if(PEXPORTS_PATH) add_custom_command(TARGET SG_java POST_BUILD - COMMAND ${PEXPORTS_PATH}/pexports.exe ${CMAKE_BINARY_DIR}/SG_java.dll > ${CMAKE_BINARY_DIR}/SG_java.def) + COMMAND ${PEXPORTS_PATH}/pexports.exe ${CMAKE_BINARY_DIR}/lib/SG_java.dll > ${CMAKE_BINARY_DIR}/lib/SG_java.def) endif(PEXPORTS_PATH) endif() diff --git a/buildtools/Cmake/MakeLibWin.cmake b/buildtools/Cmake/MakeLibWin.cmake index 206ab5ca34..f596b1f901 100644 --- a/buildtools/Cmake/MakeLibWin.cmake +++ b/buildtools/Cmake/MakeLibWin.cmake @@ -1,6 +1,9 @@ ### Make Libs #>gcc c:\simgrid-trunk\examples\msg\icomms\peer.c -static -Lc:\simgrid-trunk\lib -lsimgrid -Ic:\simgrid-trunk\include -lwsock32 +if(enable_java) + include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MakeJava.cmake) +endif() add_library(simgrid SHARED ${simgrid_sources}) diff --git a/buildtools/Cmake/Scripts/tesh.pl b/buildtools/Cmake/Scripts/tesh.pl index a5b53c437a..cbdc724554 100755 --- a/buildtools/Cmake/Scripts/tesh.pl +++ b/buildtools/Cmake/Scripts/tesh.pl @@ -13,9 +13,10 @@ tesh -- testing shell B [I] I =cut -my($bindir); -my($srcdir); +my($bindir)="."; +my($srcdir)="."; my $path = $0; +my $OS; $path =~ s|[^/]*$||; push @INC,$path; @@ -24,14 +25,22 @@ use strict; use Term::ANSIColor; use IPC::Open3; -my($OS)=`echo %OS%`; -if($OS eq "%OS%"){ +if($^O eq "linux"){ $OS = "UNIX"; } else{ $OS = "WIN"; } + +sub trim($) +{ + my $string = shift; + $string =~ s/^\s+//; + $string =~ s/\s+$//; + return $string; +} + print "OS: ".$OS."\n"; # make sure we received a tesh file @@ -59,8 +68,14 @@ sub cd_cmd { } sub setenv_cmd { - if ($_[1] =~ /^(.*)=(.*)$/) { - my($var,$ctn)=($1,$2); + my($var,$ctn); + if ($_[0] =~ /^(.*)=(.*)$/) { + ($var,$ctn)=($1,$2); + }elsif ($_[1] =~ /^(.*)=(.*)$/) { + ($var,$ctn)=($1,$2); + } else { + die "[Tesh/CRITICAL] Malformed argument to setenv: expected 'name=value' but got '$_[1]'\n"; + } if($var =~ /bindir/){ print "[Tesh/INFO] setenv $var=$ctn\n"; @@ -76,9 +91,6 @@ sub setenv_cmd { print "[Tesh/INFO] setenv $var=$ctn\n"; } } - } else { - die "[Tesh/CRITICAL] Malformed argument to setenv: expected 'name=value' but got '$_[1]'\n"; - } } # Main option parsing sub @@ -220,12 +232,25 @@ sub exec_cmd { my @got; while(defined(my $got=)) { $got =~ s/\r//g; - #$got =~ s/^( )*//g; + $got =~ s/^( )*//g; chomp $got; - push @got, "$got"; + $got=trim($got); + if( $got ne ""){ + push @got, "$got"; + } } close OUT; - + + if ($sort){ + sub mysort{ + $a cmp $b + } + use sort qw(defaults _quicksort); # force quicksort + @got = sort mysort @got; + #also resort the other one, as perl sort is not the same as the C one used to generate teshes + @{$cmd{'out'}}=sort mysort @{$cmd{'out'}}; + } + # Cleanup the executing child, and kill the timeouter brother on need $cmd{'return'} = 0 unless defined($cmd{'return'}); my $wantret = "returned code ".(defined($cmd{'return'})? $cmd{'return'} : 0); @@ -304,7 +329,10 @@ LINE: while (defined(my $line=)) { if ($cmd =~ /^#/) { #comment } elsif ($cmd eq '> '){ #expected result line print "[TESH/debug] push expected result\n" if $opts{'debug'}; - push @{$cmd{'out'}}, $arg; + $arg=trim($arg); + if($arg ne ""){ + push @{$cmd{'out'}}, $arg; + } } elsif ($cmd eq '< ') { # provided input print "[TESH/debug] push provided input\n" if $opts{'debug'}; @@ -346,6 +374,7 @@ LINE: while (defined(my $line=)) { $cmd{'cmd'} = $arg; } elsif($line =~ /^! output sort/){ #output sort + $sort=1; $cmd{'sort'} = 1; } elsif($line =~ /^! output ignore/){ #output ignore diff --git a/buildtools/Cmake/src/simgrid.nsi.in b/buildtools/Cmake/src/simgrid.nsi.in index 2105d4d1c9..c53efe4e43 100644 --- a/buildtools/Cmake/src/simgrid.nsi.in +++ b/buildtools/Cmake/src/simgrid.nsi.in @@ -201,9 +201,9 @@ Section "SMPI Library" SMPISection setOutPath $INSTDIR\include\smpi file @CMAKE_HOME_DIRECTORY@\include\smpi\smpi.h file @CMAKE_HOME_DIRECTORY@\include\smpi\mpi.h - file @CMAKE_HOME_DIRECTORY@\include\smpi\mpif.h file @CMAKE_HOME_DIRECTORY@\include\smpi\smpi_cocci.h file @CMAKE_HOME_DIRECTORY@\include\smpi\smpi_main.h + file include\smpi\mpif.h file include\smpi\smpif.h CreateDirectory $INSTDIR\examples\smpi diff --git a/examples/simdag/io/sd_io.c b/examples/simdag/io/sd_io.c index c64fe6ac94..5d3070350b 100644 --- a/examples/simdag/io/sd_io.c +++ b/examples/simdag/io/sd_io.c @@ -14,11 +14,13 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(sd_io, "Logging specific to this SimDag example"); int main(int argc, char **argv) { - unsigned int ctr, ctr2; + unsigned int ctr; const SD_workstation_t *workstations; int total_nworkstations; - xbt_dynar_t current_storage_list; + xbt_dict_t current_storage_list; char *mount_name; + char *storage_name; + xbt_dict_cursor_t cursor = NULL; SD_init(&argc, argv); /* Set the workstation model to default, as storage is not supported by the @@ -31,10 +33,10 @@ int main(int argc, char **argv) for (ctr=0; ctr msg_storage_t) */ -xbt_dynar_t MSG_host_get_storage_list(msg_host_t host) +xbt_dict_t MSG_host_get_storage_list(msg_host_t host) { xbt_assert((host != NULL), "Invalid parameters"); return (simcall_host_get_storage_list(host)); @@ -354,18 +354,31 @@ xbt_dynar_t MSG_host_get_storage_list(msg_host_t host) * \param host a host * \return a dynar containing content (as a dict) of all storages mounted on the host */ -xbt_dynar_t MSG_host_get_storage_content(msg_host_t host) +xbt_dict_t MSG_host_get_storage_content(msg_host_t host) { xbt_assert((host != NULL), "Invalid parameters"); - xbt_dynar_t contents = xbt_dynar_new(sizeof(void *),NULL); + xbt_dict_t contents = xbt_dict_new(); + msg_storage_t storage; char* storage_name; - unsigned int i; - xbt_dynar_t storage_list = simcall_host_get_storage_list(host); - xbt_dynar_foreach(storage_list, i, storage_name){ - storage = xbt_lib_get_elm_or_null(storage_lib,storage_name); + char* mount_name; + xbt_dict_cursor_t cursor = NULL; + xbt_dict_cursor_t cursor2 = NULL; + char* file; + size_t size; + + xbt_dict_t storage_list = simcall_host_get_storage_list(host); + + xbt_dict_foreach(storage_list,cursor,mount_name,storage_name){ + storage = (msg_storage_t)xbt_lib_get_elm_or_null(storage_lib,storage_name); + + XBT_INFO("mount name => %s", mount_name); xbt_dict_t content = simcall_storage_get_content(storage); - xbt_dynar_push(contents, &content); + xbt_dict_foreach(content,cursor2,file,size){ + XBT_INFO("\t\t%s size: %zu bytes", file, size); + } + + xbt_dict_set(contents,mount_name,(void *)content,NULL); } return contents; } diff --git a/src/simdag/sd_workstation.c b/src/simdag/sd_workstation.c index f035d13ed9..574c99c586 100644 --- a/src/simdag/sd_workstation.c +++ b/src/simdag/sd_workstation.c @@ -482,7 +482,7 @@ void SD_workstation_set_access_mode(SD_workstation_t workstation, * \param workstation a workstation * \return a dynar containing all mounted storages on the workstation */ -xbt_dynar_t SD_workstation_get_storage_list(SD_workstation_t workstation){ +xbt_dict_t SD_workstation_get_storage_list(SD_workstation_t workstation){ return surf_workstation_model->extension.workstation.get_storage_list(workstation); } diff --git a/src/simix/smx_host.c b/src/simix/smx_host.c index 5b7b0e9767..5ef2bd9e5c 100644 --- a/src/simix/smx_host.c +++ b/src/simix/smx_host.c @@ -626,10 +626,10 @@ void SIMIX_set_category(smx_action_t action, const char *category) } #endif -xbt_dynar_t SIMIX_pre_host_get_storage_list(smx_simcall_t simcall, smx_host_t host){ +xbt_dict_t SIMIX_pre_host_get_storage_list(smx_simcall_t simcall, smx_host_t host){ return SIMIX_host_get_storage_list(host); } -xbt_dynar_t SIMIX_host_get_storage_list(smx_host_t host){ +xbt_dict_t SIMIX_host_get_storage_list(smx_host_t host){ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)"); return surf_workstation_model->extension.workstation.get_storage_list(host); diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index c5099bdba9..f91d19df29 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -60,7 +60,7 @@ double SIMIX_host_execution_get_remains(smx_action_t action); e_smx_state_t SIMIX_host_execution_get_state(smx_action_t action); void SIMIX_host_execution_set_priority(smx_action_t action, double priority); void SIMIX_pre_host_execution_wait(smx_simcall_t simcall, smx_action_t action); -xbt_dynar_t SIMIX_host_get_storage_list(smx_host_t host); +xbt_dict_t SIMIX_host_get_storage_list(smx_host_t host); // pre prototypes smx_host_t SIMIX_pre_host_get_by_name(smx_simcall_t, const char*); @@ -93,7 +93,7 @@ void SIMIX_host_execution_suspend(smx_action_t action); void SIMIX_host_execution_resume(smx_action_t action); void SIMIX_post_host_execute(smx_action_t action); -xbt_dynar_t SIMIX_pre_host_get_storage_list(smx_simcall_t, smx_host_t); +xbt_dict_t SIMIX_pre_host_get_storage_list(smx_simcall_t, smx_host_t); #ifdef HAVE_TRACING void SIMIX_pre_set_category(smx_simcall_t simcall, smx_action_t action, const char *category); diff --git a/src/simix/smx_smurf_private.h b/src/simix/smx_smurf_private.h index 084a6bb515..0b57815dc4 100644 --- a/src/simix/smx_smurf_private.h +++ b/src/simix/smx_smurf_private.h @@ -282,7 +282,7 @@ ACTION(SIMCALL_HOST_EXECUTION_GET_REMAINS, host_execution_get_remains, WITH_ANSW ACTION(SIMCALL_HOST_EXECUTION_GET_STATE, host_execution_get_state, WITH_ANSWER, TINT(result), TSPEC(execution, smx_action_t)) sep \ ACTION(SIMCALL_HOST_EXECUTION_SET_PRIORITY, host_execution_set_priority, WITH_ANSWER, TVOID(result), TSPEC(execution, smx_action_t), TDOUBLE(priority)) sep \ ACTION(SIMCALL_HOST_EXECUTION_WAIT, host_execution_wait, WITHOUT_ANSWER, TINT(result), TSPEC(execution, smx_action_t)) sep \ -ACTION(SIMCALL_HOST_GET_STORAGE_LIST, host_get_storage_list, WITH_ANSWER, TSPEC(result, xbt_dynar_t), TSPEC(host, smx_host_t)) sep \ +ACTION(SIMCALL_HOST_GET_STORAGE_LIST, host_get_storage_list, WITH_ANSWER, TSPEC(result, xbt_dict_t), TSPEC(host, smx_host_t)) sep \ ACTION(SIMCALL_PROCESS_CREATE, process_create, WITH_ANSWER, TVOID(result), TSPEC(process, smx_process_t*), TSTRING(name), TSPEC(code, xbt_main_func_t), TPTR(data), TSTRING(hostname), TDOUBLE(kill_time), TINT(argc), TSPEC(argv, char**), TSPEC(properties, xbt_dict_t), TINT(auto_restart)) sep \ ACTION(SIMCALL_PROCESS_KILL, process_kill, WITH_ANSWER, TVOID(result), TSPEC(process, smx_process_t)) sep \ ACTION(SIMCALL_PROCESS_KILLALL, process_killall, WITH_ANSWER, TVOID(result), TINT(reset_pid)) sep \ diff --git a/src/simix/smx_user.c b/src/simix/smx_user.c index 4b873f93f8..75e467b88d 100644 --- a/src/simix/smx_user.c +++ b/src/simix/smx_user.c @@ -1293,9 +1293,9 @@ size_t simcall_storage_get_used_size (const char* name){ * \ingroup simix_storage_management * \brief Returns the list of storages mounted on an host. * \param host A SIMIX host - * \return a dynar containing all storages mounted on the host + * \return a dict containing all storages mounted on the host */ -xbt_dynar_t simcall_host_get_storage_list(smx_host_t host) +xbt_dict_t simcall_host_get_storage_list(smx_host_t host) { return simcall_BODY_host_get_storage_list(host); } diff --git a/src/surf/storage.c b/src/surf/storage.c index 416cadfc5c..17ed2b164c 100644 --- a/src/surf/storage.c +++ b/src/surf/storage.c @@ -206,9 +206,9 @@ static xbt_dict_t storage_get_content(void *storage) xbt_dict_t content_dict = xbt_dict_new(); xbt_dict_cursor_t cursor = NULL; char *file; - size_t size; + char *size; xbt_dict_foreach(((storage_t)st)->content, cursor, file, size){ - xbt_dict_set(content_dict,file,&size,NULL); + xbt_dict_set(content_dict,file,(void*)size,NULL); } return content_dict; } diff --git a/src/surf/workstation.c b/src/surf/workstation.c index 86f6619d19..e328332fee 100644 --- a/src/surf/workstation.c +++ b/src/surf/workstation.c @@ -365,18 +365,20 @@ static storage_t find_storage_on_mount_list(void *workstation,const char* mount) return st; } -static xbt_dynar_t ws_get_storage_list(void *workstation) +static xbt_dict_t ws_get_storage_list(void *workstation) { s_mount_t mnt; unsigned int i; - xbt_dynar_t storage_list = xbt_dynar_new(sizeof(char*), NULL); + xbt_dict_t storage_list = xbt_dict_new(); + char *storage_name = NULL; workstation_CLM03_t ws = (workstation_CLM03_t) surf_workstation_resource_priv(workstation); xbt_dynar_t storages = ws->storage; xbt_dynar_foreach(storages,i,mnt) { - xbt_dynar_push(storage_list, &mnt.name); + storage_name = ((storage_t)mnt.storage)->generic_resource.name; + xbt_dict_set(storage_list,mnt.name,storage_name,NULL); } return storage_list; } diff --git a/teshsuite/msg/storage/CMakeLists.txt b/teshsuite/msg/storage/CMakeLists.txt new file mode 100644 index 0000000000..8f2c3fc13b --- /dev/null +++ b/teshsuite/msg/storage/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(storage storage.c) + +### Add definitions for compile +if(NOT WIN32) + target_link_libraries(storage simgrid m pthread ) +else() + target_link_libraries(storage simgrid) +endif() + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/storage.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml + ${CMAKE_CURRENT_SOURCE_DIR}/deployment.xml + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/storage.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + ${CMAKE_CURRENT_SOURCE_DIR}/storage_content_c.txt + ${CMAKE_CURRENT_SOURCE_DIR}/storage_content_s1.txt + ${CMAKE_CURRENT_SOURCE_DIR}/storage_content_s2.txt + PARENT_SCOPE + ) diff --git a/teshsuite/msg/storage/deployment.xml b/teshsuite/msg/storage/deployment.xml new file mode 100644 index 0000000000..4ff8c10ded --- /dev/null +++ b/teshsuite/msg/storage/deployment.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/teshsuite/msg/storage/platform.xml b/teshsuite/msg/storage/platform.xml new file mode 100644 index 0000000000..c288fb51fd --- /dev/null +++ b/teshsuite/msg/storage/platform.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/teshsuite/msg/storage/storage.c b/teshsuite/msg/storage/storage.c new file mode 100644 index 0000000000..8512d6ef8a --- /dev/null +++ b/teshsuite/msg/storage/storage.c @@ -0,0 +1,89 @@ +#include "msg/msg.h" +#include "xbt/log.h" + +XBT_LOG_NEW_DEFAULT_CATEGORY(storage,"Messages specific for this simulation"); + +void storage_info(msg_host_t host); +void display_storage_properties(msg_storage_t storage); +int client(int argc, char *argv[]); +int server(int argc, char *argv[]); + + +int client(int argc, char *argv[]) +{ + storage_info(MSG_host_self()); + return 1; +} + +int server(int argc, char *argv[]) +{ + //display_storage_info(); + return 1; +} + +void storage_info(msg_host_t host){ + + const char* host_name = MSG_host_get_name(host); + XBT_INFO("** Storage info on %s:", host_name); + + xbt_dict_cursor_t cursor = NULL; + char* mount_name; + char* storage_name; + msg_storage_t storage; + + xbt_dict_t storage_list = MSG_host_get_storage_list(MSG_host_self()); + + xbt_dict_foreach(storage_list,cursor,mount_name,storage_name) + { + XBT_INFO("\tStorage mount name: %s", mount_name); + + size_t free_size = MSG_storage_get_free_size(mount_name); + size_t used_size = MSG_storage_get_used_size(mount_name); + + XBT_INFO("\t\tFree size: %zu octets", free_size); + XBT_INFO("\t\tUsed size: %zu octets", used_size); + + storage = MSG_storage_get_by_name(storage_name); + display_storage_properties(storage); + } +} + +void display_storage_properties(msg_storage_t storage){ + xbt_dict_cursor_t cursor = NULL; + char *key, *data; + xbt_dict_t props = MSG_storage_get_properties(storage); + if (props){ + XBT_INFO("\tProperties of mounted storage: %s", MSG_storage_get_name(storage)); + xbt_dict_foreach(props, cursor, key, data) + XBT_INFO("\t\t'%s' -> '%s'", key, data); + }else{ + XBT_INFO("\t\tNo property attached."); + } +} + +int main(int argc, char *argv[]) +{ + MSG_init(&argc, argv); + + /* Check the arguments */ + if (argc < 3) { + printf("Usage: %s platform_file deployment_file \n", argv[0]); + return -1; + } + + const char *platform_file = argv[1]; + const char *deployment_file = argv[2]; + + MSG_create_environment(platform_file); + + MSG_function_register("client", client); + MSG_function_register("server", server); + MSG_launch_application(deployment_file); + + msg_error_t res = MSG_main(); + + if (res == MSG_OK) + return 0; + else + return 1; +} diff --git a/teshsuite/msg/storage/storage.tesh b/teshsuite/msg/storage/storage.tesh new file mode 100644 index 0000000000..5cc7fe4fe4 --- /dev/null +++ b/teshsuite/msg/storage/storage.tesh @@ -0,0 +1,8 @@ +$ msg/storage/storage --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" +> [ 0.000000] (1:client@client) ** Storage info on client: +> [ 0.000000] (1:client@client) Storage mount name: /sd1 +> [ 0.000000] (1:client@client) Free size: 536774599000 octets +> [ 0.000000] (1:client@client) Used size: 96313000 octets +> [ 0.000000] (1:client@client) Properties of mounted storage: cdisk +> [ 0.000000] (1:client@client) 'date' -> '31-08-13' +> [ 0.000000] (1:client@client) 'usage' -> 'scratch' diff --git a/teshsuite/msg/storage/storage_content_c.txt b/teshsuite/msg/storage/storage_content_c.txt new file mode 100644 index 0000000000..d461c10821 --- /dev/null +++ b/teshsuite/msg/storage/storage_content_c.txt @@ -0,0 +1,5 @@ +./doc/simgrid/examples/cxx/autoDestination/FinalizeTask.cxx 71000 +./doc/simgrid/examples/cxx/autoDestination/autoDestination_deployment.xml 1262000 +./doc/simgrid/examples/cxx/autoDestination/Main.cxx 1480000 +./doc/simgrid/examples/cxx/autoDestination/Slave.cxx 87000000 +./doc/simgrid/examples/cxx/autoDestination/BasicTask.cxx 6500000 diff --git a/teshsuite/msg/storage/storage_content_s1.txt b/teshsuite/msg/storage/storage_content_s1.txt new file mode 100644 index 0000000000..004f34bd65 --- /dev/null +++ b/teshsuite/msg/storage/storage_content_s1.txt @@ -0,0 +1,4 @@ +./doc/simgrid/examples/cxx/autoDestination/Master.cxx 18910000 +./doc/simgrid/examples/cxx/autoDestination/autoDestination_platform.xml 21339320000 +./doc/simgrid/examples/cxx/autoDestination/Forwarder.cxx 113700000 +./doc/simgrid/examples/cxx/basic/FinalizeTask.cxx 710000000 diff --git a/teshsuite/msg/storage/storage_content_s2.txt b/teshsuite/msg/storage/storage_content_s2.txt new file mode 100644 index 0000000000..98d37e0103 --- /dev/null +++ b/teshsuite/msg/storage/storage_content_s2.txt @@ -0,0 +1,2 @@ +./doc/simgrid/examples/cxx/basic/Main.cxx 14800000 +./doc/simgrid/examples/cxx/basic/Slave.cxx 69300000 \ No newline at end of file diff --git a/teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c b/teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c index 4d4c39a233..db9d165315 100644 --- a/teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c +++ b/teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c @@ -11,7 +11,6 @@ static int verbose = 0; -int main(int argc, char *argv[]); int parse_args(int argc, char **argv); int hindexed_zerotype_test(void); int hindexed_sparsetype_test(void); diff --git a/teshsuite/smpi/mpich3-test/datatype/localpack.c b/teshsuite/smpi/mpich3-test/datatype/localpack.c index 5348d55f14..11e165a082 100644 --- a/teshsuite/smpi/mpich3-test/datatype/localpack.c +++ b/teshsuite/smpi/mpich3-test/datatype/localpack.c @@ -20,7 +20,6 @@ static int verbose = 0; #define BUF_SIZE 16384 -int main(int argc, char *argv[]); int parse_args(int argc, char **argv); int main(int argc, char *argv[]) diff --git a/teshsuite/smpi/mpich3-test/datatype/lots-of-types.c b/teshsuite/smpi/mpich3-test/datatype/lots-of-types.c index 9722167b7e..418ff0bce8 100644 --- a/teshsuite/smpi/mpich3-test/datatype/lots-of-types.c +++ b/teshsuite/smpi/mpich3-test/datatype/lots-of-types.c @@ -18,7 +18,6 @@ */ static int verbose = 1; -int main(int argc, char *argv[]); int parse_args(int argc, char **argv); int lots_of_types_test(void); diff --git a/teshsuite/smpi/mpich3-test/datatype/slice-pack-external.c b/teshsuite/smpi/mpich3-test/datatype/slice-pack-external.c index 8f4c004f93..25038fc192 100644 --- a/teshsuite/smpi/mpich3-test/datatype/slice-pack-external.c +++ b/teshsuite/smpi/mpich3-test/datatype/slice-pack-external.c @@ -12,7 +12,6 @@ static int verbose = 0; int a[100][100][100], e[9][9][9]; -int main(int argc, char *argv[]); /* helper functions */ static int parse_args(int argc, char **argv); diff --git a/teshsuite/smpi/mpich3-test/datatype/slice-pack.c b/teshsuite/smpi/mpich3-test/datatype/slice-pack.c index 8fcd3b596d..ef8c3c97a8 100644 --- a/teshsuite/smpi/mpich3-test/datatype/slice-pack.c +++ b/teshsuite/smpi/mpich3-test/datatype/slice-pack.c @@ -16,7 +16,6 @@ static int verbose = 0; int a[100][100][100], e[9][9][9]; -int main(int argc, char *argv[]); /* helper functions */ static int parse_args(int argc, char **argv); diff --git a/teshsuite/smpi/mpich3-test/datatype/struct-empty-el.c b/teshsuite/smpi/mpich3-test/datatype/struct-empty-el.c index 3704293a61..d0c57bd55d 100644 --- a/teshsuite/smpi/mpich3-test/datatype/struct-empty-el.c +++ b/teshsuite/smpi/mpich3-test/datatype/struct-empty-el.c @@ -11,7 +11,6 @@ static int verbose = 0; -int main(int argc, char *argv[]); int parse_args(int argc, char **argv); int single_struct_test(void); diff --git a/teshsuite/smpi/mpich3-test/datatype/struct-pack.c b/teshsuite/smpi/mpich3-test/datatype/struct-pack.c index d7b5719a44..cf16e6a279 100644 --- a/teshsuite/smpi/mpich3-test/datatype/struct-pack.c +++ b/teshsuite/smpi/mpich3-test/datatype/struct-pack.c @@ -11,7 +11,6 @@ static int verbose = 0; -int main(int argc, char *argv[]); int parse_args(int argc, char **argv); int single_struct_test(void); int array_of_structs_test(void); diff --git a/teshsuite/smpi/mpich3-test/datatype/transpose-pack.c b/teshsuite/smpi/mpich3-test/datatype/transpose-pack.c index 1cd22028d5..18e2c59273 100644 --- a/teshsuite/smpi/mpich3-test/datatype/transpose-pack.c +++ b/teshsuite/smpi/mpich3-test/datatype/transpose-pack.c @@ -15,7 +15,6 @@ static int verbose = 0; -int main(int argc, char *argv[]); int parse_args(int argc, char **argv); int main(int argc, char *argv[]) diff --git a/teshsuite/smpi/mpich3-test/datatype/triangular-pack.c b/teshsuite/smpi/mpich3-test/datatype/triangular-pack.c index 0720524d59..dde6eda4ce 100644 --- a/teshsuite/smpi/mpich3-test/datatype/triangular-pack.c +++ b/teshsuite/smpi/mpich3-test/datatype/triangular-pack.c @@ -10,8 +10,6 @@ #include "mpi.h" #include "mpitest.h" -int main(int argc, char *argv[]); - /* helper functions */ int parse_args(int argc, char **argv); diff --git a/teshsuite/smpi/mpich3-test/datatype/unusual-noncontigs.c b/teshsuite/smpi/mpich3-test/datatype/unusual-noncontigs.c index 5c608f8ee8..d6fd63cf1e 100644 --- a/teshsuite/smpi/mpich3-test/datatype/unusual-noncontigs.c +++ b/teshsuite/smpi/mpich3-test/datatype/unusual-noncontigs.c @@ -18,7 +18,6 @@ */ static int verbose = 1; -int main(int argc, char *argv[]); int parse_args(int argc, char **argv); int struct_negdisp_test(void); int vector_negstride_test(void); diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt index 11202e8928..0b7c83630f 100644 --- a/teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt @@ -12,12 +12,13 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C) include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/") + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h.in ${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h @ONLY) + add_executable(allctypesf allctypesf.f ../util/mtestf.f) add_executable(gaddressf gaddressf.f ../util/mtestf.f) add_executable(hindex1f hindex1f.f ../util/mtestf.f) add_executable(hindexed_blockf hindexed_blockf.f ../util/mtestf.f) add_executable(packef packef.f ../util/mtestf.f) - add_executable(typeaints typeaints.h ../util/mtestf.f) add_executable(typecntsf typecntsf.f ../util/mtestf.f) add_executable(typem2f typem2f.f ../util/mtestf.f) add_executable(typename3f typename3f.f ../util/mtestf.f) @@ -30,7 +31,6 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C) target_link_libraries(hindex1f simgrid) target_link_libraries(hindexed_blockf simgrid) target_link_libraries(packef simgrid) - target_link_libraries(typeaints simgrid) target_link_libraries(typecntsf simgrid) target_link_libraries(typem2f simgrid) target_link_libraries(typename3f simgrid) @@ -55,7 +55,7 @@ set(examples_src ${CMAKE_CURRENT_SOURCE_DIR}/hindex1f.f ${CMAKE_CURRENT_SOURCE_DIR}/hindexed_blockf.f ${CMAKE_CURRENT_SOURCE_DIR}/packef.f - ${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h + ${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h.in ${CMAKE_CURRENT_SOURCE_DIR}/typecntsf.f ${CMAKE_CURRENT_SOURCE_DIR}/typem2f.f ${CMAKE_CURRENT_SOURCE_DIR}/typename3f.f diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h b/teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h.in similarity index 53% rename from teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h rename to teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h.in index ded63b03fc..5cfae7b30f 100644 --- a/teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h +++ b/teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h.in @@ -1,6 +1,6 @@ -C -*- Mode: Fortran; -*- +C -*- Mode: Fortran; -*- C C (C) 2003 by Argonne National Laboratory. C See COPYRIGHT in top-level directory. C - integer aint, aintv(max_asizev) + integer*@MPI_ADDRESS_SIZE@ aint, aintv(max_asizev) diff --git a/teshsuite/smpi/mpich3-test/include/mpitestconf.h b/teshsuite/smpi/mpich3-test/include/mpitestconf.h index eb39223af5..4eb4bb2c7a 100644 --- a/teshsuite/smpi/mpich3-test/include/mpitestconf.h +++ b/teshsuite/smpi/mpich3-test/include/mpitestconf.h @@ -57,8 +57,9 @@ //#define HAVE_FORTRAN_BINDING 0 /* Define to 1 if you have the `getrusage' function. */ +#ifndef WIN32 #define HAVE_GETRUSAGE 1 - +#endif /* Define if struct hostent contains h_addr_list */ #define HAVE_H_ADDR_LIST 1 @@ -141,8 +142,9 @@ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ +#ifndef WIN32 #define HAVE_SYS_RESOURCE_H 1 - +#endif /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 diff --git a/teshsuite/smpi/mpich3-test/pt2pt/waitany-null.c b/teshsuite/smpi/mpich3-test/pt2pt/waitany-null.c index 9ba1eefa91..98df8ef8df 100644 --- a/teshsuite/smpi/mpich3-test/pt2pt/waitany-null.c +++ b/teshsuite/smpi/mpich3-test/pt2pt/waitany-null.c @@ -13,7 +13,6 @@ static int verbose = 0; -int main(int argc, char *argv[]); int parse_args(int argc, char **argv); int main(int argc, char *argv[]) diff --git a/tools/tesh/CMakeLists.txt b/tools/tesh/CMakeLists.txt index c099aa1d48..467c8e3d68 100644 --- a/tools/tesh/CMakeLists.txt +++ b/tools/tesh/CMakeLists.txt @@ -1,16 +1,20 @@ cmake_minimum_required(VERSION 2.6) if(WIN32) - #add_custom_target(tesh ALL - # DEPENDS ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl - # COMMENT "Install ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl" - # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl ${CMAKE_BINARY_DIR}/bin/tesh - # ) +# add_custom_target(tesh ALL +# DEPENDS ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl +# COMMENT "Install ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl" +# COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl ${CMAKE_BINARY_DIR}/bin/tesh +# ) file(COPY ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl DESTINATION ${CMAKE_BINARY_DIR}/bin/ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ) + file(COPY ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/Diff.pm + DESTINATION ${CMAKE_BINARY_DIR} + FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ) file(RENAME ${CMAKE_BINARY_DIR}/bin/tesh.pl ${CMAKE_BINARY_DIR}/bin/tesh) else() set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")