Commit bef7387b authored by Marco Govoni's avatar Marco Govoni
Browse files

Simplified Makefile

parent 52184c93
# Makefile
#
testdirs:= test001 test002 test003 test003
default: title all
all: \
test001_all \
test002_all \
test003_all \
test004_all
clean: \
test001_clean \
test002_clean \
test003_clean \
test004_clean
test001_all:
if test -d test001 ; then \
( cd test001 ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
else $(MAKE) $(MFLAGS) all ; fi ) ; fi
test001_clean:
if test -d test001 ; then \
( cd test001 ; if test "$(MAKE)" = "" ; then make clean ; \
else $(MAKE) clean ; fi ) ; fi
test002_all:
if test -d test002 ; then \
( cd test002 ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
else $(MAKE) $(MFLAGS) all ; fi ) ; fi
test002_clean:
if test -d test002 ; then \
( cd test002 ; if test "$(MAKE)" = "" ; then make clean ; \
else $(MAKE) clean ; fi ) ; fi
test003_all:
if test -d test003 ; then \
( cd test003 ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
else $(MAKE) $(MFLAGS) all ; fi ) ; fi
test003_clean:
if test -d test003 ; then \
( cd test003 ; if test "$(MAKE)" = "" ; then make clean ; \
else $(MAKE) clean ; fi ) ; fi
test004_all:
if test -d test004 ; then \
( cd test004 ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
else $(MAKE) $(MFLAGS) all ; fi ) ; fi
test004_clean:
if test -d test004 ; then \
( cd test004 ; if test "$(MAKE)" = "" ; then make clean ; \
else $(MAKE) clean ; fi ) ; fi
default: title all
all:
for d in $(testdirs); do (cd $$d; $(MAKE) all); done
clean:
for d in $(testdirs); do (cd $$d; $(MAKE) clean); done
title :
@echo " "
......@@ -58,4 +15,3 @@ title :
@echo "################"
@echo " "
WEST test-suite
1) Edit the file maketest.inc
2) make
#
# Parallel execution knobs
#
NP = 2
NI = 1
NT = 1
NP = 2 # Number of MPI processes
NI = 1 # NUmber of images
NT = 1 # Number of OPENMP threads
#
# Commands needed by the scripts
#
# Directory where the executables (*.x) are located
BINDIR = ../../../bin
# How to run in a parallel executable with MPI
PARA_PREFIX = mpirun -np ${NP} --allow-run-as-root
# How to download files
WGET = wget -N -q
###### DO NOT TOUCH BELOW ######
NIMAGE = ${NI}
OMP_NUM_THREADS = ${NT}
PARA_PREFIX = mpirun -np ${NP} --allow-run-as-root
WGET = wget -N -q
BINDIR = ../../../bin
# Makefile
#
default: title all
all: \
test001_all
run: \
test001_run
clean: \
test001_clean
test001_all:
if test -d test001 ; then \
( cd test001 ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
else $(MAKE) $(MFLAGS) all ; fi ) ; fi
test001_run:
if test -d test001 ; then \
( cd test001 ; if test "$(MAKE)" = "" ; then make $(MFLAGS) run; \
else $(MAKE) $(MFLAGS) run ; fi ) ; fi
test001_clean:
if test -d test001 ; then \
( cd test001 ; if test "$(MAKE)" = "" ; then make clean ; \
else $(MAKE) clean ; fi ) ; fi
title :
@echo " "
@echo "#############"
@echo "## Testing ##"
@echo "#############"
@echo " "
NP = 2
NI = 1
NT = 1
NIMAGE = ${NI}
OMP_NUM_THREADS = ${NT}
PARA_PREFIX = mpirun -np ${NP} --allow-run-as-root
WGET = wget
BINDIR = ../../../bin
# Makefile
include ../maketest.inc
default: title all
all: prepare_input run
prepare_input:
-wget -N -q http://www.quantum-simulation.org/potentials/sg15_oncv/upf/H_ONCV_PBE-1.0.upf
-wget -N -q http://www.quantum-simulation.org/potentials/sg15_oncv/upf/Si_ONCV_PBE-1.1.upf
-wget -N -q http://www.west-code.org/doc/training/silane/pw.in
-wget -N -q http://www.west-code.org/doc/training/silane/wstat.in
-wget -N -q http://www.west-code.org/doc/training/silane/wfreq.in
run:
- ${PARA_PREFIX} ${BINDIR}/pw.x -i pw.in > pw.out
- tail -5 pw.out
- ${PARA_PREFIX} ${BINDIR}/wstat.x -nimage ${NIMAGE} -i wstat.in > wstat.out
- tail -5 wstat.out
- ${PARA_PREFIX} ${BINDIR}/wfreq.x -nimage ${NIMAGE} -i wfreq.in > wfreq.out
- tail -5 wfreq.out
clean:
- /bin/rm -rf *out *in *upf *save >& /dev/null
title:
@echo " "
@echo "###############"
@echo "### test001 ###"
@echo "###############"
@echo " "
Markdown is supported
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