Commit 7b80c0d2 authored by iker_martin's avatar iker_martin
Browse files

Automatic directory finder when making the installation

parent 8984a81d
......@@ -10,6 +10,7 @@ DEF =
# Final binary
BIN = a.out
CONFIG = config.txt
# Put all auto generated stuff to this build dir.
BUILD_DIR = ./build
......@@ -27,6 +28,14 @@ DEP = $(OBJ:%.o=%.d)
# Default target named after the binary.
$(BIN) : $(BUILD_DIR)/$(BIN)
# Default configuration file
$(CONFIG) : $(BUILD_DIR)/$(CONFIG)
$(BUILD_DIR)/$(CONFIG) :
mkdir -p $(@D)
@ echo -n "dir=\"" > $(BUILD_DIR)/$(CONFIG)
@ realpath -z $$(echo "$$(pwd)/..") >> $(BUILD_DIR)/$(CONFIG)
@ echo "\"" >> $(BUILD_DIR)/$(CONFIG)
# Actual target of the binary - depends on all .o files.
$(BUILD_DIR)/$(BIN) : $(OBJ)
$(MCC) $(C_FLAGS) $^ -o $@ $(LD_FLAGS)
......@@ -45,12 +54,12 @@ $(BUILD_DIR)/%.o : %.c
$(MCC) $(C_FLAGS) $(DEF) -MMD -c $< -o $@
clean:
-rm $(BUILD_DIR)/$(BIN) $(OBJ) $(DEP)
-rm $(BUILD_DIR)/$(BIN) $(BUILD_DIR)/$(CONFIG) $(OBJ) $(DEP)
clear:
-rm -rf $(BUILDDIR)
install: $(BIN)
install: $(BIN) $(CONFIG)
echo "Done"
# Builds target with slurm
......
......@@ -4,9 +4,10 @@
#SBATCH -N 1
#SBATCH --exclude=c01,c00,c02
dir="/home/martini/malleability_benchmark"
partition='P1'
scriptDir="$(dirname "$0")"
source $scriptDir/build/config.txt
codeDir="/Codes"
execDir="/Exec"
cores=$(bash $dir$execDir/BashScripts/getCores.sh $partition)
......
......@@ -4,7 +4,8 @@
#SBATCH -N 1
#SBATCH --exclude=c01,c00,c02
dir="/home/martini/malleability_benchmark"
scriptDir="$(dirname "$0")"
source $scriptDir/build/config.txt
codeDir="/Codes/build"
resultsDir="/Results"
execDir="/Exec"
......
......@@ -4,7 +4,8 @@
#SBATCH -N 1
#SBATCH --exclude=c01,c00,c02
dir="/home/martini/malleability_benchmark"
scriptDir="$(dirname "$0")"
source $scriptDir/build/config.txt
codeDir="/Codes"
execDir="/Exec"
......
#!/bin/bash
dir="/home/martini/malleability_benchmark" #FIXME Obtain from another way
# Runs in a given current directory all .ini files
# Parameter 1(Optional) - Amount of executions per file. Must be a positive number
#====== Do not modify these values =======
......
File mode changed from 100644 to 100755
#!/bin/bash
dir="/home/martini/malleability_benchmark" #FIXME Obtain from another way
# Runs in a given current directory all .ini files
# Parameter 1(Optional) - Amount of executions per file. Must be a positive number
#====== Do not modify these values =======
......
#!/bin/bash
dir="/home/martini/malleability_benchmark/"
partition="P1"
# Checks if all the runs in the current working directory performed under a
......@@ -18,6 +17,8 @@ partition="P1"
# Must be a positive integer.
#====== Do not modify the following values =======
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
codeDir="Codes/"
execDir="Exec/"
ResultsDir="Results/"
......@@ -68,7 +69,7 @@ fi
# then the scripts exits.
#The user must figure out what to do with those runs.
qtyG=$(ls R*_Global.out | wc -l)
qtyG=$(($qtyG * 2))
qtyG=$(($qtyG * $total_groups))
qtyL=$(ls R*_G*N*.out | wc -l)
if [ "$qtyG" == "$qtyL" ]
then
......
#!/bin/bash
dir="/home/martini/malleability_benchmark"
scriptDir="$(dirname "$0")"
source $scriptDir/../../Codes/build/config.txt
codeDir="/Codes/build"
export EXTRAE_CONFIG_FILE=extrae.xml
......
#!/bin/bash
dir="/home/martini/malleability_benchmark/"
# Creates a directory with all possible and valid combinations of configuration files
# that can be created from a given complex configuration file.
# Parameter 1: Complex configuration file name.
# Parameter 2: Common output name of the output configuration files. It will be appended an index to each of them.
#====== Do not modify these values =======
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
codeDir="Codes/"
execDir="Exec/"
ResultsDir="Results/"
......
#!/bin/bash
dir="/home/martini/malleability_benchmark"
partition="P1"
exclude="c00,c01,c02"
......@@ -9,6 +8,8 @@ exclude="c00,c01,c02"
# Parameter 2(Optional) - Maximum amount of time in seconds needed by a single execution. Default value is 0, which indicates infinite time. Must be a positive integer.
#====== Do not modify these values =======
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
codeDir="/Codes/build"
execDir="/Exec"
ResultsDir="/Results"
......
#!/bin/bash
dir="/home/martini/malleability_benchmark"
partition="P1"
exclude="c00,c01,c02"
......@@ -14,6 +13,8 @@ exclude="c00,c01,c02"
# Parameter 6(Optional): Path where the output files should be saved.
#====== Do not modify these values =======
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
codeDir="/Codes/build"
execDir="/Exec"
ResultsDir="/Results"
......
#!/bin/bash
dir="/home/martini/malleability_benchmark"
cores=20
# Executes a given configuration file. This script can be called with Slurm commands to
......@@ -12,6 +11,8 @@ cores=20
# Parameter 5(Optional): Path where the output files should be saved.
#====== Do not modify these values =======
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
codeDir="/Codes/build"
execDir="/Exec"
ResultsDir="/Results"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment