-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
36 lines (29 loc) · 2.41 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
PROJECT_DIR := $(PWD)
RESULTS_DIR := $(PROJECT_DIR)/results
THIS_DIR := $(PROJECT_DIR)/test_cases/verif_mtd_pp
THIS_DIR_REL := test_cases/verif_mtd_pp
SINGULARITY := /share/apps/singularity/3.6.3/bin/singularity
EPLUS_VERSION := 9.0.1
INPUT_DIR := $(THIS_DIR)
OUTPUT_DIR := $(THIS_DIR)/idfs
OUTPUT_DIR_REL := $(THIS_DIR_REL)/idfs
IN_FILES := $(notdir $(wildcard $(INPUT_DIR)/ASHRAE*.json))
OUT_FILES := $(subst .json,_md.json,$(IN_FILES))
SIM_FOLDERS := $(subst .json,_injected_BatchVerification,$(IN_FILES))
$(OUTPUT_DIR)/%_injected_BatchVerification: $(INPUT_DIR)/%.json
@cd ./src/; python ./run_sim_for_cases.py $(INPUT_DIR)/$(basename $(<F)).json
@mkdir $(subst .json,,./test_cases/verif_mtd_pp/idfs/$(basename $(<F))_injected_BatchVerification)
$(RESULTS_DIR)/%_md.json: $(INPUT_DIR)/%.json
@/qfs/projects/BECP/bin/qwait -A animate $(SINGULARITY) exec -B $(PROJECT_DIR):/tmp ./energyplus_$(EPLUS_VERSION).sif energyplus -w /tmp/$(OUTPUT_DIR_REL)/$(basename $(<F))_injected_BatchVerification.epw -r -p eplus -d /tmp/$(OUTPUT_DIR_REL)/$(basename $(<F))_injected_BatchVerification /tmp/$(OUTPUT_DIR_REL)/$(basename $(<F))_injected_BatchVerification.idf
@mv $(OUTPUT_DIR)/$(basename $(<F))_injected_BatchVerification.idf $(OUTPUT_DIR)/$(basename $(<F))_injected_BatchVerification/in.idf
@cd ./src/; cp ./run_verification_case.py ./run_verification_case_$(basename $(<F)).py; python ./run_verification_case_$(basename $(<F)).py $(INPUT_DIR)/$(basename $(<F)).json
prep: $(addprefix $(OUTPUT_DIR)/,$(SIM_FOLDERS))
sims_verifs: $(addprefix $(RESULTS_DIR)/,$(OUT_FILES))
all:
cd $(THIS_DIR); python ./create_test_cases.py # Create verification
cd ./src/; python ./verification_cases_split.py; # Split verification cases
mv $(THIS_DIR)/verification_cases.json ./results/verification_cases.json # Move verification cases
$(MAKE) -k -j 240 prep # Initialize verification cases
$(SINGULARITY) pull docker://nrel/energyplus:$(EPLUS_VERSION) # Retrieve EnergyPlus Singularity image (only works on constance7a)
$(MAKE) -k -j 240 sims_verifs # Run "injected" simulations and perform verifications
cd ./src/; python ./summarize_md.py # Create summary