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 = ...@@ -10,6 +10,7 @@ DEF =
# Final binary # Final binary
BIN = a.out BIN = a.out
CONFIG = config.txt
# Put all auto generated stuff to this build dir. # Put all auto generated stuff to this build dir.
BUILD_DIR = ./build BUILD_DIR = ./build
...@@ -27,6 +28,14 @@ DEP = $(OBJ:%.o=%.d) ...@@ -27,6 +28,14 @@ DEP = $(OBJ:%.o=%.d)
# Default target named after the binary. # Default target named after the binary.
$(BIN) : $(BUILD_DIR)/$(BIN) $(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. # Actual target of the binary - depends on all .o files.
$(BUILD_DIR)/$(BIN) : $(OBJ) $(BUILD_DIR)/$(BIN) : $(OBJ)
$(MCC) $(C_FLAGS) $^ -o $@ $(LD_FLAGS) $(MCC) $(C_FLAGS) $^ -o $@ $(LD_FLAGS)
...@@ -45,12 +54,12 @@ $(BUILD_DIR)/%.o : %.c ...@@ -45,12 +54,12 @@ $(BUILD_DIR)/%.o : %.c
$(MCC) $(C_FLAGS) $(DEF) -MMD -c $< -o $@ $(MCC) $(C_FLAGS) $(DEF) -MMD -c $< -o $@
clean: clean:
-rm $(BUILD_DIR)/$(BIN) $(OBJ) $(DEP) -rm $(BUILD_DIR)/$(BIN) $(BUILD_DIR)/$(CONFIG) $(OBJ) $(DEP)
clear: clear:
-rm -rf $(BUILDDIR) -rm -rf $(BUILDDIR)
install: $(BIN) install: $(BIN) $(CONFIG)
echo "Done" echo "Done"
# Builds target with slurm # Builds target with slurm
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
#SBATCH -N 1 #SBATCH -N 1
#SBATCH --exclude=c01,c00,c02 #SBATCH --exclude=c01,c00,c02
dir="/home/martini/malleability_benchmark"
partition='P1' partition='P1'
scriptDir="$(dirname "$0")"
source $scriptDir/build/config.txt
codeDir="/Codes" codeDir="/Codes"
execDir="/Exec" execDir="/Exec"
cores=$(bash $dir$execDir/BashScripts/getCores.sh $partition) cores=$(bash $dir$execDir/BashScripts/getCores.sh $partition)
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
#SBATCH -N 1 #SBATCH -N 1
#SBATCH --exclude=c01,c00,c02 #SBATCH --exclude=c01,c00,c02
dir="/home/martini/malleability_benchmark" scriptDir="$(dirname "$0")"
source $scriptDir/build/config.txt
codeDir="/Codes/build" codeDir="/Codes/build"
resultsDir="/Results" resultsDir="/Results"
execDir="/Exec" execDir="/Exec"
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
#SBATCH -N 1 #SBATCH -N 1
#SBATCH --exclude=c01,c00,c02 #SBATCH --exclude=c01,c00,c02
dir="/home/martini/malleability_benchmark" scriptDir="$(dirname "$0")"
source $scriptDir/build/config.txt
codeDir="/Codes" codeDir="/Codes"
execDir="/Exec" execDir="/Exec"
......
#!/bin/bash #!/bin/bash
dir="/home/martini/malleability_benchmark" #FIXME Obtain from another way
# Runs in a given current directory all .ini files # Runs in a given current directory all .ini files
# Parameter 1(Optional) - Amount of executions per file. Must be a positive number # Parameter 1(Optional) - Amount of executions per file. Must be a positive number
#====== Do not modify these values ======= #====== Do not modify these values =======
......
File mode changed from 100644 to 100755
#!/bin/bash #!/bin/bash
dir="/home/martini/malleability_benchmark" #FIXME Obtain from another way
# Runs in a given current directory all .ini files # Runs in a given current directory all .ini files
# Parameter 1(Optional) - Amount of executions per file. Must be a positive number # Parameter 1(Optional) - Amount of executions per file. Must be a positive number
#====== Do not modify these values ======= #====== Do not modify these values =======
......
#!/bin/bash #!/bin/bash
dir="/home/martini/malleability_benchmark/"
partition="P1" partition="P1"
# Checks if all the runs in the current working directory performed under a # Checks if all the runs in the current working directory performed under a
...@@ -18,6 +17,8 @@ partition="P1" ...@@ -18,6 +17,8 @@ partition="P1"
# Must be a positive integer. # Must be a positive integer.
#====== Do not modify the following values ======= #====== Do not modify the following values =======
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
codeDir="Codes/" codeDir="Codes/"
execDir="Exec/" execDir="Exec/"
ResultsDir="Results/" ResultsDir="Results/"
...@@ -68,7 +69,7 @@ fi ...@@ -68,7 +69,7 @@ fi
# then the scripts exits. # then the scripts exits.
#The user must figure out what to do with those runs. #The user must figure out what to do with those runs.
qtyG=$(ls R*_Global.out | wc -l) qtyG=$(ls R*_Global.out | wc -l)
qtyG=$(($qtyG * 2)) qtyG=$(($qtyG * $total_groups))
qtyL=$(ls R*_G*N*.out | wc -l) qtyL=$(ls R*_G*N*.out | wc -l)
if [ "$qtyG" == "$qtyL" ] if [ "$qtyG" == "$qtyL" ]
then then
......
#!/bin/bash #!/bin/bash
dir="/home/martini/malleability_benchmark" scriptDir="$(dirname "$0")"
source $scriptDir/../../Codes/build/config.txt
codeDir="/Codes/build" codeDir="/Codes/build"
export EXTRAE_CONFIG_FILE=extrae.xml export EXTRAE_CONFIG_FILE=extrae.xml
......
#!/bin/bash #!/bin/bash
dir="/home/martini/malleability_benchmark/"
# Creates a directory with all possible and valid combinations of configuration files # Creates a directory with all possible and valid combinations of configuration files
# that can be created from a given complex configuration file. # that can be created from a given complex configuration file.
# Parameter 1: Complex configuration file name. # 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. # 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 ======= #====== Do not modify these values =======
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
codeDir="Codes/" codeDir="Codes/"
execDir="Exec/" execDir="Exec/"
ResultsDir="Results/" ResultsDir="Results/"
......
#!/bin/bash #!/bin/bash
dir="/home/martini/malleability_benchmark"
partition="P1" partition="P1"
exclude="c00,c01,c02" exclude="c00,c01,c02"
...@@ -9,6 +8,8 @@ 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. # 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 ======= #====== Do not modify these values =======
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
codeDir="/Codes/build" codeDir="/Codes/build"
execDir="/Exec" execDir="/Exec"
ResultsDir="/Results" ResultsDir="/Results"
......
#!/bin/bash #!/bin/bash
dir="/home/martini/malleability_benchmark"
partition="P1" partition="P1"
exclude="c00,c01,c02" exclude="c00,c01,c02"
...@@ -14,6 +13,8 @@ exclude="c00,c01,c02" ...@@ -14,6 +13,8 @@ exclude="c00,c01,c02"
# Parameter 6(Optional): Path where the output files should be saved. # Parameter 6(Optional): Path where the output files should be saved.
#====== Do not modify these values ======= #====== Do not modify these values =======
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
codeDir="/Codes/build" codeDir="/Codes/build"
execDir="/Exec" execDir="/Exec"
ResultsDir="/Results" ResultsDir="/Results"
......
#!/bin/bash #!/bin/bash
dir="/home/martini/malleability_benchmark"
cores=20 cores=20
# Executes a given configuration file. This script can be called with Slurm commands to # Executes a given configuration file. This script can be called with Slurm commands to
...@@ -12,6 +11,8 @@ cores=20 ...@@ -12,6 +11,8 @@ cores=20
# Parameter 5(Optional): Path where the output files should be saved. # Parameter 5(Optional): Path where the output files should be saved.
#====== Do not modify these values ======= #====== Do not modify these values =======
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
codeDir="/Codes/build" codeDir="/Codes/build"
execDir="/Exec" execDir="/Exec"
ResultsDir="/Results" 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