From: Martin Quinson Date: Mon, 16 Feb 2015 18:03:08 +0000 (+0100) Subject: Have smpirun, smpicc and friends display the simgrid git hash version on --git-version X-Git-Tag: v3_12~760^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/717c4b31876300acbf14a58196b5b57538d8ce46?hp=491af463998597b43a8b9c68c126f97f0089ab5e Have smpirun, smpicc and friends display the simgrid git hash version on --git-version --- diff --git a/ChangeLog b/ChangeLog index e4d2474514..5cdf3a6b5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,7 @@ SimGrid (3.12) NOT RELEASED; urgency=low - Constant times can be injected inside MPI_Wtime and MPI_Test through options smpi/wtime and smpi/test - InfiniBand network model added : Based on the works of Jerome Vienne (http://mescal.imag.fr/membres/jean-marc.vincent/index.html/PhD/Vienne.pdf ) - When smpi/display_timing is set, also display global simulation time and application times + - Have smpirun, smpicc and friends display the simgrid git hash version on --git-version * Collective communications - SMP-aware algorithms are now dynamically handled. An internal communicator is created for each node, and an external one to handle communications between "leaders" of each node - MVAPICH2 (1.9) collective algorithms selector : normal and SMP algorithms are handled, and selection logic is based on the one used on TACC's Stampede cluster (https://www.tacc.utexas.edu/stampede/). diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index 9600214c05..786550e17e 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -549,6 +549,14 @@ if(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/) string(REPLACE "\n" "" GIT_DATE "${GIT_DATE}") message(STATUS "Git date: ${GIT_DATE}") string(REGEX REPLACE " .*" "" GIT_VERSION "${GIT_VERSION}") + + execute_process(COMMAND git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --pretty=format:%H -1 + WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/ + OUTPUT_VARIABLE SIMGRID_GITHASH + RESULT_VARIABLE ret + ) + string(REPLACE "\n" "" SIMGRID_GITHASH "${SIMGRID_GITHASH}") + endif() elseif(EXISTS ${CMAKE_HOME_DIRECTORY}/.gitversion) FILE(STRINGS ${CMAKE_HOME_DIRECTORY}/.gitversion GIT_VERSION) diff --git a/src/smpi/smpicc.in b/src/smpi/smpicc.in index 6902a25e2f..41ece46fcb 100755 --- a/src/smpi/smpicc.in +++ b/src/smpi/smpicc.in @@ -1,12 +1,13 @@ #! /bin/sh -# Copyright (c) 2007-2014. The SimGrid Team. +# Copyright (c) 2007-2015. 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. SIMGRID_VERSION="@SIMGRID_VERSION_STRING@" +SIMGRID_GITHASH="@SIMGRID_GITHASH@" CC=@CMAKE_C_COMPILER@ @@ -46,6 +47,10 @@ while [ $# -gt 0 ]; do printf '%b\n' "$SIMGRID_VERSION" exit 0 ;; + "-git-version" | "--git-version") + printf '%b\n' "$SIMGRID_GITHASH" + exit 0 + ;; '-compiler-version' | '--compiler-version') ${CC} --version ;; diff --git a/src/smpi/smpicxx.in b/src/smpi/smpicxx.in index b23a2740ff..cec91154d9 100755 --- a/src/smpi/smpicxx.in +++ b/src/smpi/smpicxx.in @@ -1,12 +1,13 @@ #! /bin/sh -# Copyright (c) 2014. The SimGrid Team. +# Copyright (c) 2014-2015. 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. SIMGRID_VERSION="@SIMGRID_VERSION_STRING@" +SIMGRID_GITHASH="@SIMGRID_GITHASH@" CXX=@CMAKE_CXX_COMPILER@ @@ -46,6 +47,10 @@ while [ $# -gt 0 ]; do printf '%b\n' "$SIMGRID_VERSION" exit 0 ;; + "-git-version" | "--git-version") + printf '%b\n' "$SIMGRID_GITHASH" + exit 0 + ;; '-compiler-version' | '--compiler-version') ${CXX} --version ;; diff --git a/src/smpi/smpif90.in b/src/smpi/smpif90.in index 1a33ba1430..1e6a7e6703 100644 --- a/src/smpi/smpif90.in +++ b/src/smpi/smpif90.in @@ -1,12 +1,13 @@ #! /bin/sh -# Copyright (c) 2012-2014. The SimGrid Team. +# Copyright (c) 2012-2015. 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. SIMGRID_VERSION="@SIMGRID_VERSION_STRING@" +SIMGRID_GITHASH="@SIMGRID_GITHASH@" F90=@GFORTRAN_EXE@ @@ -49,6 +50,10 @@ while [ $# -gt 0 ]; do printf '%b\n' "$SIMGRID_VERSION" exit 0 ;; + "-git-version" | "--git-version") + printf '%b\n' "$SIMGRID_GITHASH" + exit 0 + ;; '-compiler-version' | '--compiler-version') ${F90} --version ;; diff --git a/src/smpi/smpiff.in b/src/smpi/smpiff.in index 1c6308dfc6..8cb4bf4ca2 100644 --- a/src/smpi/smpiff.in +++ b/src/smpi/smpiff.in @@ -1,12 +1,13 @@ #! /bin/sh -# Copyright (c) 2012-2014. The SimGrid Team. +# Copyright (c) 2012-2015. 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. SIMGRID_VERSION="@SIMGRID_VERSION_STRING@" +SIMGRID_GITHASH="@SIMGRID_GITHASH@" F77=@GFORTRAN_EXE@ @@ -53,6 +54,10 @@ while [ $# -gt 0 ]; do printf '%b\n' "$SIMGRID_VERSION" exit 0 ;; + "-git-version" | "--git-version") + printf '%b\n' "$SIMGRID_GITHASH" + exit 0 + ;; '-compiler-version' | '--compiler-version') ${F77} --version ;; diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 570d1ed49c..812acdbdfc 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (c) 2007-2014. The SimGrid Team. +# Copyright (c) 2007-2015. The SimGrid Team. # All rights reserved. # This program is free software; you can redistribute it and/or modify it @@ -9,6 +9,7 @@ @CMAKE_SMPI_COMMAND@ SIMGRID_VERSION="@SIMGRID_VERSION_STRING@" +SIMGRID_GITHASH="@SIMGRID_GITHASH@" DEFAULT_LOOPBACK_BANDWIDTH="498000000" DEFAULT_LOOPBACK_LATENCY="0.000004" @@ -44,6 +45,9 @@ Options: -trace-viva # generate configuration for Viva's GraphView -trace-file # name of the tracefile (simgrid_smpi.trace) -ext # additional parameter (reserved) + + -version # Displays the SimGrid version (human readable) + -git-version # Displays the git hash of SimGrid or (deprecated usage): $0 [-keep-temps] [-np ] [-bandwidth ] [-latency ] program [program-options] @@ -172,6 +176,11 @@ while true; do printf '%b\n' "$SIMGRID_VERSION" exit 0 ;; + + "-git-version" | "--git-version") + printf '%b\n' "$SIMGRID_GITHASH" + exit 0 + ;; "--cfg="*|"--log="*) for OPT in ${1#*=}