From a93c2086b9c85158ae2421ac81c74bf9998fbcc1 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 7 Jun 2023 17:46:53 +0200 Subject: [PATCH 01/16] Add script to test S1 performance --- scripts/test_S1_performance.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 scripts/test_S1_performance.sh diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh new file mode 100644 index 0000000..cfc3ce7 --- /dev/null +++ b/scripts/test_S1_performance.sh @@ -0,0 +1,30 @@ +#!/bin/bash +function join_by { + local d=${1-} f=${2-} + if shift 2; then + printf %s "$f" "${@/#/$d}" + fi +} +# Initialise EESSI +source /cvmfs/pilot.eessi-hpc.org/latest/init/bash > /dev/null +# Grab the date we do this and use that as out key for json output +date=$(date -I) +echo "{ \"$date\":[" +json_array=() +for s1server in `grep CVMFS_SERVER_URL /etc/cvmfs/domain.d/eessi-hpc.org.conf | grep -o '".*"' | sed 's/"//g' | tr ';' '\n'`; do + # Edit the config file to point to a single S1 option, e.g., + echo 'CVMFS_SERVER_URL="'"$s1server"'"' | sudo tee /etc/cvmfs/domain.d/eessi-hpc.org.local > /dev/null + # Reconfigure CVMFS + sudo cvmfs_config setup + # Wipe the cache and run the example (I used Tensorflow from github.com/EESSI/eessi-demo) + sudo cvmfs_config wipecache >& /dev/null + # Run the TensorFlow example + cd ../TensorFlow + # Just print the real time + realtime=$({ ./run.sh > /dev/null ; } 2> >(grep real | awk '{print $2}')) + KB_per_sec=$(cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20 | tail -1) + # Print json output + json_array+=("{\"$s1server\": [{\"time\":\"$realtime\"},{\"speed\":\"${KB_per_sec}KB/sec\"}]}") +done +join_by ,$'\n' "${json_array[@]}" +echo -e "\n]}" From 65733d81f379a3ccf57bbe04f1c1c2c444514c4e Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 8 Jun 2023 17:31:38 +0200 Subject: [PATCH 02/16] Refactor and improve --- scripts/test_S1_performance.sh | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh index cfc3ce7..57f806c 100644 --- a/scripts/test_S1_performance.sh +++ b/scripts/test_S1_performance.sh @@ -1,30 +1,37 @@ #!/bin/bash + function join_by { local d=${1-} f=${2-} if shift 2; then printf %s "$f" "${@/#/$d}" fi } -# Initialise EESSI -source /cvmfs/pilot.eessi-hpc.org/latest/init/bash > /dev/null -# Grab the date we do this and use that as out key for json output -date=$(date -I) -echo "{ \"$date\":[" -json_array=() -for s1server in `grep CVMFS_SERVER_URL /etc/cvmfs/domain.d/eessi-hpc.org.conf | grep -o '".*"' | sed 's/"//g' | tr ';' '\n'`; do + +function test_S1 { # Edit the config file to point to a single S1 option, e.g., - echo 'CVMFS_SERVER_URL="'"$s1server"'"' | sudo tee /etc/cvmfs/domain.d/eessi-hpc.org.local > /dev/null + echo 'CVMFS_SERVER_URL="'"$1"'"' | sudo tee /etc/cvmfs/domain.d/eessi-hpc.org.local > /dev/null # Reconfigure CVMFS sudo cvmfs_config setup - # Wipe the cache and run the example (I used Tensorflow from github.com/EESSI/eessi-demo) + # Wipe the cache and run the example (from github.com/EESSI/eessi-demo) sudo cvmfs_config wipecache >& /dev/null - # Run the TensorFlow example - cd ../TensorFlow + # Run the example + cd ../$2 # Just print the real time realtime=$({ ./run.sh > /dev/null ; } 2> >(grep real | awk '{print $2}')) KB_per_sec=$(cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20 | tail -1) # Print json output - json_array+=("{\"$s1server\": [{\"time\":\"$realtime\"},{\"speed\":\"${KB_per_sec}KB/sec\"}]}") + echo -n "{\"$1\": {\"time\":\"$realtime\",\"speed\":\"${KB_per_sec}\",\"speed_unit\":\"KB/sec\",\"application\":\"$2\"}}" +} + +# Initialise EESSI +source /cvmfs/pilot.eessi-hpc.org/latest/init/bash > /dev/null +# Grab the date we do this and use that as out key for json output +application="${APPLICATION:-TensorFlow}" +date=$(date -I) +json_array=() +for s1server in `grep CVMFS_SERVER_URL /etc/cvmfs/domain.d/eessi-hpc.org.conf | grep -o '".*"' | sed 's/"//g' | tr ';' '\n'`; do +json_array+=("$(test_S1 "$s1server" "$application")") done +echo -e "{\"$date\":[" join_by ,$'\n' "${json_array[@]}" echo -e "\n]}" From 2b94a66b4740378a22eaad94aa6d6b9971813866 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 8 Jun 2023 17:32:20 +0200 Subject: [PATCH 03/16] Update run.sh --- TensorFlow/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TensorFlow/run.sh b/TensorFlow/run.sh index ffa4535..173c6c7 100755 --- a/TensorFlow/run.sh +++ b/TensorFlow/run.sh @@ -2,4 +2,4 @@ module load TensorFlow/2.3.1-foss-2020a-Python-3.8.2 -time python TensorFlow-2.x_mnist-test.py +time -p python TensorFlow-2.x_mnist-test.py From ee000601fa3c17bd824264ff3665df732d77cb3a Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 8 Jun 2023 17:32:38 +0200 Subject: [PATCH 04/16] Update run.sh --- GROMACS/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GROMACS/run.sh b/GROMACS/run.sh index e7b7814..bb461e9 100755 --- a/GROMACS/run.sh +++ b/GROMACS/run.sh @@ -12,4 +12,4 @@ fi rm -f ener.edr logfile.log # note: downscaled to just 1k steps (full run is 10k steps) -time gmx mdrun -s ion_channel.tpr -maxh 0.50 -resethway -noconfout -nsteps 1000 -g logfile +time -p gmx mdrun -s ion_channel.tpr -maxh 0.50 -resethway -noconfout -nsteps 1000 -g logfile From 559dffa4386406405360342cd93e83f08e2f3839 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 8 Jun 2023 17:32:56 +0200 Subject: [PATCH 05/16] Update run.sh --- Bioconductor/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bioconductor/run.sh b/Bioconductor/run.sh index 6aa670a..fb2ac7d 100755 --- a/Bioconductor/run.sh +++ b/Bioconductor/run.sh @@ -2,4 +2,4 @@ module load R-bundle-Bioconductor/3.11-foss-2020a-R-4.0.0 -time Rscript dna.R +time -p Rscript dna.R From 811e45ce3a1e89ba55e9c0970594ccaa4c599acd Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 8 Jun 2023 17:33:26 +0200 Subject: [PATCH 06/16] Update run.sh --- OpenFOAM/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenFOAM/run.sh b/OpenFOAM/run.sh index d3febd0..18a5edd 100755 --- a/OpenFOAM/run.sh +++ b/OpenFOAM/run.sh @@ -90,7 +90,7 @@ foamDictionary -entry runTimeModifiable -set "false" system/controlDict foamDictionary -entry functions -set "{}" system/controlDict mpirun --oversubscribe -np $NP potentialFoam -parallel 2>&1 | tee log.potentialFoam -time mpirun --oversubscribe -np $NP simpleFoam -parallel 2>&1 | tee log.simpleFoam +time -p mpirun --oversubscribe -np $NP simpleFoam -parallel 2>&1 | tee log.simpleFoam echo "cleanup..." rm -rf $WORKDIR From 5b990cbdffa8de0c3acbde0901b292d0139b0fb8 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Fri, 9 Jun 2023 16:10:23 +0200 Subject: [PATCH 07/16] Update test_S1_performance.sh --- scripts/test_S1_performance.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh index 57f806c..0dd7615 100644 --- a/scripts/test_S1_performance.sh +++ b/scripts/test_S1_performance.sh @@ -18,9 +18,10 @@ function test_S1 { cd ../$2 # Just print the real time realtime=$({ ./run.sh > /dev/null ; } 2> >(grep real | awk '{print $2}')) - KB_per_sec=$(cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20 | tail -1) + bandwidth=( $(cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20 ) ) + cache_usage=( $( cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20 )) # Print json output - echo -n "{\"$1\": {\"time\":\"$realtime\",\"speed\":\"${KB_per_sec}\",\"speed_unit\":\"KB/sec\",\"application\":\"$2\"}}" + echo -n "{\"$1\": {\"time\":\"$realtime\",\"speed\":\"${bandwidth[1]}\",\"speed_unit\":\"${bandwidth[0]}\",\"data\":\"${cache_usage[1]}\",\"data_unit\":\"${cache_usage[0]}\",\"application\":\"$2\"}}" } # Initialise EESSI From 50771b45c1824a623c1a493a2fb4456327573e67 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Fri, 9 Jun 2023 16:23:46 +0200 Subject: [PATCH 08/16] Also save arch --- scripts/test_S1_performance.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh index 0dd7615..6befb12 100644 --- a/scripts/test_S1_performance.sh +++ b/scripts/test_S1_performance.sh @@ -21,7 +21,7 @@ function test_S1 { bandwidth=( $(cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20 ) ) cache_usage=( $( cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20 )) # Print json output - echo -n "{\"$1\": {\"time\":\"$realtime\",\"speed\":\"${bandwidth[1]}\",\"speed_unit\":\"${bandwidth[0]}\",\"data\":\"${cache_usage[1]}\",\"data_unit\":\"${cache_usage[0]}\",\"application\":\"$2\"}}" + echo -n "{\"$1\": {\"time\":\"$realtime\",\"speed\":\"${bandwidth[1]}\",\"speed_unit\":\"${bandwidth[0]}\",\"data\":\"${cache_usage[1]}\",\"data_unit\":\"${cache_usage[0]}\",\"application\":\"$2\",\"arch\":\"$EESSI_SOFTWARE_SUBDIR\" }}" } # Initialise EESSI From 7a21f4eb0063174d01be1c7b3bea5fab9d3601ea Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 9 Jun 2023 16:44:44 +0200 Subject: [PATCH 09/16] Make script executable --- scripts/test_S1_performance.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/test_S1_performance.sh diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh old mode 100644 new mode 100755 From 29286eda273cc3b9c7add71b0c06526ab32c43f2 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 Jul 2023 10:25:40 +0200 Subject: [PATCH 10/16] Try to make S1 performance test restore previous setup, and run it in CI --- .github/workflows/test_S1_performance.yml | 29 +++++++++++++++++++++ scripts/test_S1_performance.sh | 31 +++++++++++++++++++++-- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test_S1_performance.yml diff --git a/.github/workflows/test_S1_performance.yml b/.github/workflows/test_S1_performance.yml new file mode 100644 index 0000000..18cbaa1 --- /dev/null +++ b/.github/workflows/test_S1_performance.yml @@ -0,0 +1,29 @@ +# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions +name: Test performance of public S1 servers (native access) +on: [push, pull_request] +# Declare default permissions as read only. +permissions: read-all +jobs: + pilot_repo_native: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + APPLICATION: + - TensorFlow + steps: + - name: Check out repository + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 + with: + persist-credentials: false + + - name: Mount EESSI CernVM-FS pilot repository + uses: cvmfs-contrib/github-action-cvmfs@d4641d0d591c9a5c3be23835ced2fb648b44c04b # v3.1 + with: + cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb + cvmfs_http_proxy: DIRECT + cvmfs_repositories: pilot.eessi-hpc.org + + - name: Run public S1 performance test + run: | + APPLICATION=${{matrix.APPLICATION}} ./scripts/test_S1_performance.sh diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh index 6befb12..ac36f51 100755 --- a/scripts/test_S1_performance.sh +++ b/scripts/test_S1_performance.sh @@ -1,5 +1,31 @@ #!/bin/bash +# Check for pre-existing configuration +local_eessi_config="/etc/cvmfs/domain.d/eessi-hpc.org.local" +if [ -f $local_eessi_config ]; then + echo "File $local_eessi_config exists, moving it temporarily" + sudo mv $local_eessi_config ${local_eessi_config}.tmp + restore_eessi_config=true +else + echo "File $local_eessi_config does not exist." + restore_eessi_config=false +fi + +# Add the capability to clean up after ourselves +function cleanup() +{ + if [ "$restore_eessi_config" = true ] ; then + echo "Restoring original $local_eessi_config" + sudo mv ${local_eessi_config}.tmp $local_eessi_config + else + echo "Removing $local_eessi_config" + sudo rm $local_eessi_config + fi +} +trap cleanup SIGINT +trap cleanup EXIT + +# Function used to help stitch json objects together function join_by { local d=${1-} f=${2-} if shift 2; then @@ -7,9 +33,10 @@ function join_by { fi } +# Test a particular S1 and return a valid json object function test_S1 { # Edit the config file to point to a single S1 option, e.g., - echo 'CVMFS_SERVER_URL="'"$1"'"' | sudo tee /etc/cvmfs/domain.d/eessi-hpc.org.local > /dev/null + echo 'CVMFS_SERVER_URL="'"$1"'"' | sudo tee $local_eessi_config > /dev/null # Reconfigure CVMFS sudo cvmfs_config setup # Wipe the cache and run the example (from github.com/EESSI/eessi-demo) @@ -30,7 +57,7 @@ source /cvmfs/pilot.eessi-hpc.org/latest/init/bash > /dev/null application="${APPLICATION:-TensorFlow}" date=$(date -I) json_array=() -for s1server in `grep CVMFS_SERVER_URL /etc/cvmfs/domain.d/eessi-hpc.org.conf | grep -o '".*"' | sed 's/"//g' | tr ';' '\n'`; do +for s1server in $(grep CVMFS_SERVER_URL /etc/cvmfs/domain.d/eessi-hpc.org.conf | grep -o '".*"' | sed 's/"//g' | tr ';' '\n'); do json_array+=("$(test_S1 "$s1server" "$application")") done echo -e "{\"$date\":[" From c38ad93f383dedf4bd3e91367999d03811bf82fc Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 Jul 2023 10:32:47 +0200 Subject: [PATCH 11/16] Be more careful about our location --- .github/workflows/test_S1_performance.yml | 2 +- scripts/test_S1_performance.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_S1_performance.yml b/.github/workflows/test_S1_performance.yml index 18cbaa1..5aeff31 100644 --- a/.github/workflows/test_S1_performance.yml +++ b/.github/workflows/test_S1_performance.yml @@ -1,6 +1,6 @@ # documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions name: Test performance of public S1 servers (native access) -on: [push, pull_request] +on: [pull_request] # Declare default permissions as read only. permissions: read-all jobs: diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh index ac36f51..4c9dd18 100755 --- a/scripts/test_S1_performance.sh +++ b/scripts/test_S1_performance.sh @@ -42,7 +42,7 @@ function test_S1 { # Wipe the cache and run the example (from github.com/EESSI/eessi-demo) sudo cvmfs_config wipecache >& /dev/null # Run the example - cd ../$2 + cd $(dirname $(realpath $BASH_SOURCE))/../$2 # Just print the real time realtime=$({ ./run.sh > /dev/null ; } 2> >(grep real | awk '{print $2}')) bandwidth=( $(cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20 ) ) From 3ca2347614788a820754311a515bd262df81d93a Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 Jul 2023 10:42:53 +0200 Subject: [PATCH 12/16] Only cleanup once! --- scripts/test_S1_performance.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh index 4c9dd18..c9d1109 100755 --- a/scripts/test_S1_performance.sh +++ b/scripts/test_S1_performance.sh @@ -21,6 +21,12 @@ function cleanup() echo "Removing $local_eessi_config" sudo rm $local_eessi_config fi + # disable our traps + trap - SIGINT + trap - EXIT + # exit as normal + echo "Finished cleaning up, exiting" + exit } trap cleanup SIGINT trap cleanup EXIT From 19840e54b8ec2cce8e243d1e9d64ef08ee2f51b7 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 Jul 2023 11:01:18 +0200 Subject: [PATCH 13/16] Keep a copy of the json output in a file --- scripts/test_S1_performance.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh index c9d1109..a7f8845 100755 --- a/scripts/test_S1_performance.sh +++ b/scripts/test_S1_performance.sh @@ -66,6 +66,7 @@ json_array=() for s1server in $(grep CVMFS_SERVER_URL /etc/cvmfs/domain.d/eessi-hpc.org.conf | grep -o '".*"' | sed 's/"//g' | tr ';' '\n'); do json_array+=("$(test_S1 "$s1server" "$application")") done -echo -e "{\"$date\":[" -join_by ,$'\n' "${json_array[@]}" -echo -e "\n]}" +# Store all the (json) output in a single string so we can also stick it in a file +json_output="$(echo -e "{\"$date\":[")$(join_by ,$'\n' "${json_array[@]}")$(echo -e "\n]}")" +echo -e "$json_output" > $(dirname $(realpath $BASH_SOURCE))/../S1_performance_check.json +echo -e "$json_output" \ No newline at end of file From 28d3c0310918874d8fd5aaa587bf7d5463c5d7d6 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 Jul 2023 11:48:42 +0200 Subject: [PATCH 14/16] Upload a copy of the performance results as an artifact --- .github/workflows/test_S1_performance.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test_S1_performance.yml b/.github/workflows/test_S1_performance.yml index 5aeff31..91185f4 100644 --- a/.github/workflows/test_S1_performance.yml +++ b/.github/workflows/test_S1_performance.yml @@ -27,3 +27,9 @@ jobs: - name: Run public S1 performance test run: | APPLICATION=${{matrix.APPLICATION}} ./scripts/test_S1_performance.sh + + - name: Archive S1 performance results + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: S1-performance-results + path: S1_performance_check.json \ No newline at end of file From 199801f2566ac5909c887f943a79c08b1ed685d4 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 Jul 2023 11:50:14 +0200 Subject: [PATCH 15/16] Tweak the output a tiny bit for readability --- scripts/test_S1_performance.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh index a7f8845..a40ccec 100755 --- a/scripts/test_S1_performance.sh +++ b/scripts/test_S1_performance.sh @@ -67,6 +67,6 @@ for s1server in $(grep CVMFS_SERVER_URL /etc/cvmfs/domain.d/eessi-hpc.org.conf | json_array+=("$(test_S1 "$s1server" "$application")") done # Store all the (json) output in a single string so we can also stick it in a file -json_output="$(echo -e "{\"$date\":[")$(join_by ,$'\n' "${json_array[@]}")$(echo -e "\n]}")" +json_output="$(echo -e "{\"$date\":[\n")$(join_by ,$'\n' "${json_array[@]}")$(echo -e "\n]}")" echo -e "$json_output" > $(dirname $(realpath $BASH_SOURCE))/../S1_performance_check.json echo -e "$json_output" \ No newline at end of file From e378f8b5936e56ae1ea5bd8857514cd9813c4a2e Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 28 Sep 2023 15:53:26 +0200 Subject: [PATCH 16/16] Add number of files to json output --- scripts/test_S1_performance.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh index a40ccec..af24d62 100755 --- a/scripts/test_S1_performance.sh +++ b/scripts/test_S1_performance.sh @@ -53,8 +53,10 @@ function test_S1 { realtime=$({ ./run.sh > /dev/null ; } 2> >(grep real | awk '{print $2}')) bandwidth=( $(cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20 ) ) cache_usage=( $( cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20 )) + total_files=$(sudo cvmfs_talk -i pilot.eessi-hpc.org cache list |wc -l) + software_files=$(sudo cvmfs_talk -i pilot.eessi-hpc.org cache list | grep '/software/'|wc -l) # Print json output - echo -n "{\"$1\": {\"time\":\"$realtime\",\"speed\":\"${bandwidth[1]}\",\"speed_unit\":\"${bandwidth[0]}\",\"data\":\"${cache_usage[1]}\",\"data_unit\":\"${cache_usage[0]}\",\"application\":\"$2\",\"arch\":\"$EESSI_SOFTWARE_SUBDIR\" }}" + echo -n "{\"$1\": {\"time\":\"$realtime\",\"speed\":\"${bandwidth[1]}\",\"speed_unit\":\"${bandwidth[0]}\",\"data\":\"${cache_usage[1]}\",\"data_unit\":\"${cache_usage[0]}\",\"application\":\"$2\",\"total_files\":\"${total_files}\",\"software_files\":\"${software_files}\",\"arch\":\"$EESSI_SOFTWARE_SUBDIR\" }}" } # Initialise EESSI @@ -69,4 +71,4 @@ done # Store all the (json) output in a single string so we can also stick it in a file json_output="$(echo -e "{\"$date\":[\n")$(join_by ,$'\n' "${json_array[@]}")$(echo -e "\n]}")" echo -e "$json_output" > $(dirname $(realpath $BASH_SOURCE))/../S1_performance_check.json -echo -e "$json_output" \ No newline at end of file +echo -e "$json_output"