2
# test makefile template
3
# for creating different tests with different
6
# This makefile implements a simplistic way of
7
# running a list of elements.
9
# The list of elements must be provided in the
12
# while the fdf-flag to be runned should be named
17
SIESTA=../../../siesta
19
# Example for BSC runs
22
#SIESTA= ../../../siesta
24
# Make compatibility layer for old test-runs
25
ifeq ($(strip $(firstword $(SIESTA))),mpirun)
28
ifeq ($(strip $(firstword $(SIESTA))),mpiexec)
32
#----------------------------------------------------------------------------
33
REFERENCE_DIR?=../../../Tests/Reference
34
REFERENCE_CHECKER?=../cmp_digest.sh
42
_JOBS = $(addprefix completed_$(label)_,$(LIST))
44
# Create completed jobs target
49
$(_JOBS): completed_$(label)_%:
50
@echo ">>>> Running $(name)_$* test..."
51
@if [ -d $(label)_$* ] ; then rm -rf $(label)_$* ; fi; mkdir $(label)_$*
52
@if [ -n "$(EXTRAFILES)" ] ; then cp -f $(EXTRAFILES) $(label)_$* ; fi
53
@for i in `cat $(name).pseudos` ; do \
54
echo " ==> Copying pseudopotential file for $$i..." ;\
55
ln ../Pseudos/$$i.psf $(label)_$*/$$i.psf ;\
57
@echo " ==> Running SIESTA as $(MPI) $(SIESTA) -L $(name)_$* -fdf XML.Write -fdf $(FDF_LIST):$* ../$(name).fdf"
58
@(cd $(label)_$* ; $(MPI) $(SIESTA) -L $(name)_$* -fdf XML.Write -fdf $(FDF_LIST):$* ../$(name).fdf 2>&1 > $(name)_$*.out ) \
59
&& touch completed_$(label)_$*
60
@if [ -f completed_$(label)_$* ] ; then cp $(label)_$*/$(name)_$*.out $(label)_$*/$(name)_$*.xml .;\
61
echo " ===> SIESTA finished successfully";\
63
echo " **** Test $(name)_$* did not complete successfully";\
66
check: completed check-only
69
_CHECK_JOBS = $(addprefix check-only-,$(LIST))
71
check-only: $(_CHECK_JOBS)
72
$(_CHECK_JOBS): check-only-%:
73
@echo " ==> Running check for system $(name)_$*"
74
@REFERENCE_DIR=$(REFERENCE_DIR) sh $(REFERENCE_CHECKER) $(name)_$*.out
76
_CLEAN_JOBS = $(addprefix clean-,$(LIST))
79
$(_CLEAN_JOBS): clean-%:
80
@echo ">>>> Cleaning $(name)_$* test..."
81
rm -rf $(label)_$* completed_$(label)_$* $(name)_$*.out $(name)_$*.xml