Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Have smpirun, smpicc and friends display the simgrid git hash version on --git-version
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 16 Feb 2015 18:03:08 +0000 (19:03 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 16 Feb 2015 18:03:08 +0000 (19:03 +0100)
ChangeLog
buildtools/Cmake/CompleteInFiles.cmake
src/smpi/smpicc.in
src/smpi/smpicxx.in
src/smpi/smpif90.in
src/smpi/smpiff.in
src/smpi/smpirun.in

index e4d2474..5cdf3a6 100644 (file)
--- 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/).
index 9600214..786550e 100644 (file)
@@ -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)
index 6902a25..41ece46 100755 (executable)
@@ -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
             ;;
index b23a274..cec9115 100755 (executable)
@@ -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
             ;;
index 1a33ba1..1e6a7e6 100644 (file)
@@ -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
             ;;
index 1c6308d..8cb4bf4 100644 (file)
@@ -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
             ;;
index 570d1ed..812acdb 100755 (executable)
@@ -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 <tracefile>    # name of the tracefile (simgrid_smpi.trace)
   -ext <value>               # 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 <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] 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#*=}