Skip to content

Commit

Permalink
Merge pull request #412 from wannier-developers/libdev_error-handling
Browse files Browse the repository at this point in the history
Library development: error handling
  • Loading branch information
jryates authored May 23, 2022
2 parents 3cdb803 + 9bd7a73 commit 897a527
Show file tree
Hide file tree
Showing 51 changed files with 13,578 additions and 6,468 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/config/make.inc.gfort
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ F90 = gfortran
#MPIF90 = mpgfortran #mpif90

# Options for debugging When we move to 4.9 add -fsanitize=leak
FCOPTS = -fprofile-arcs -ftest-coverage -fstrict-aliasing -fno-omit-frame-pointer -fno-realloc-lhs -fcheck=bounds,do,recursion,pointer -ffree-form -Wall -Waliasing -Wsurprising -Wline-truncation -Wno-tabs -Wno-uninitialized -Wno-unused-dummy-argument -Wno-unused -Wno-character-truncation -O1 -g -fbacktrace
LDOPTS = -fprofile-arcs -ftest-coverage -fstrict-aliasing -fno-omit-frame-pointer -fno-realloc-lhs -fcheck=bounds,do,recursion,pointer -ffree-form -Wall -Waliasing -Wsurprising -Wline-truncation -Wno-tabs -Wno-uninitialized -Wno-unused-dummy-argument -Wno-unused -Wno-character-truncation -O1 -g -fbacktrace
FCOPTS = -fprofile-arcs -ftest-coverage -fstrict-aliasing -fno-omit-frame-pointer -fno-realloc-lhs -fcheck=bounds,do,recursion,pointer -ffree-form -Wall -Waliasing -Wsurprising -Wline-truncation -Wno-tabs -Wno-uninitialized -Wno-unused-dummy-argument -Wno-unused -Wno-character-truncation -O1 -g -fbacktrace -std=f2008
LDOPTS = -fprofile-arcs -ftest-coverage -fstrict-aliasing -fno-omit-frame-pointer -fno-realloc-lhs -fcheck=bounds,do,recursion,pointer -ffree-form -Wall -Waliasing -Wsurprising -Wline-truncation -Wno-tabs -Wno-uninitialized -Wno-unused-dummy-argument -Wno-unused -Wno-character-truncation -O1 -g -fbacktrace -std=f2008

#=======================
# System LAPACK and BLAS
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ then
echo "**************************"
# I hardcode the numprocs to four, in case change it or set it as an ENV
# var in the .travis.yml
./run_tests --category=default --numprocs=2
./run_tests --category=par --numprocs=2
fi
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ dist-legacy:
test-serial: w90chk2chk wannier post
(cd $(ROOTDIR)/test-suite && ./run_tests --category=default )

test-parallel: w90chk2chk wannier post
(cd $(ROOTDIR)/test-suite && ./run_tests --category=default --numprocs=4 )
test-parallel: w90chk2chk wannier post
(cd $(ROOTDIR)/test-suite && ./run_tests --category=par --numprocs=4 )

# Alias
tests: test-serial test-parallel
Expand Down
33 changes: 18 additions & 15 deletions src/Makefile.2
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ w90chk2chk: ../../w90chk2chk.x
w90spn2spn: ../../w90spn2spn.x

../../w90chk2chk.x: $(OBJS) ../w90chk2chk.F90
$(COMPILER) $(POSTOPTS) ../w90chk2chk.F90 $(LDOPTS) $(OBJS) $(LIBS) -o ../../w90chk2chk.x
$(COMPILER) $(POSTOPTS) $(FCOPTS) ../w90chk2chk.F90 $(LDOPTS) $(OBJS) $(LIBS) -o ../../w90chk2chk.x

../../w90spn2spn.x: $(OBJS) ../w90spn2spn.F90
$(COMPILER) $(POSTOPTS) ../w90spn2spn.F90 $(LDOPTS) $(OBJS) $(LIBS) -o ../../w90spn2spn.x
$(COMPILER) $(POSTOPTS) $(FCOPTS) ../w90spn2spn.F90 $(LDOPTS) $(OBJS) $(LIBS) -o ../../w90spn2spn.x

../../wannier90.x: $(LIBRARYV2) ../wannier_prog.F90
$(COMPILER) ../wannier_prog.F90 $(POSTOPTS) $(LDOPTS) $(LIBRARYV2) $(LIBS) -o ../../wannier90.x
$(COMPILER) $(POSTOPTS) $(FCOPTS) ../wannier_prog.F90 $(LDOPTS) $(LIBRARYV2) $(LIBS) -o ../../wannier90.x

$(LIBRARYV2): $(OBJS)
$(AR) $(ARFLAGS) $(LIBRARYV2) $(OBJS)
Expand All @@ -57,7 +57,7 @@ post: COMPILER = $(TEMP2)
post: mpi_test ../../postw90.x

../../postw90.x: $(OBJS_POST) $(POSTDIR)postw90.F90
$(COMPILER) $(POSTDIR)postw90.F90 $(POSTOPTS) $(LDOPTS) $(OBJS_POST) $(LIBS) -o ../../postw90.x
$(COMPILER) $(POSTOPTS) $(FCOPTS) $(POSTDIR)postw90.F90 $(LDOPTS) $(OBJS_POST) $(LIBS) -o ../../postw90.x

mpi_test :
ifeq ($(COMMS),mpi)
Expand Down Expand Up @@ -96,13 +96,10 @@ clean:
constants.o: ../constants.F90
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../constants.F90

comms-abort.o: ../comms-abort.F90 ../../make.inc
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../comms-abort.F90

io.o: ../io.F90 constants.o comms-abort.o
io.o: ../io.F90 types.o constants.o error.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../io.F90

utility.o: ../utility.F90 constants.o io.o
utility.o: ../utility.F90 constants.o io.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../utility.F90

wannier90_types.o: ../wannier90_types.F90 constants.o io.o
Expand All @@ -114,25 +111,31 @@ wannier90_readwrite.o: ../wannier90_readwrite.F90 constants.o io.o types.o wanni
readwrite.o: ../readwrite.F90 types.o constants.o io.o utility.o comms.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../readwrite.F90

types.o: ../types.F90 constants.o io.o utility.o comms.o
types.o: ../types.F90 constants.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../types.F90

hamiltonian.o: ../hamiltonian.F90 ws_distance.o constants.o io.o utility.o types.o wannier90_types.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../hamiltonian.F90

overlap.o: ../overlap.F90 constants.o io.o utility.o types.o sitesym.o wannier90_types.o
overlap.o: ../overlap.F90 constants.o io.o utility.o types.o sitesym.o wannier90_types.o comms.o error.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../overlap.F90

kmesh.o: ../kmesh.F90 constants.o io.o utility.o types.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../kmesh.F90

error_base.o: ../error_base.F90
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../error_base.F90

error.o: ../error.F90 error_base.o comms.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../error.F90

disentangle.o: ../disentangle.F90 constants.o io.o types.o sitesym.o comms.o wannier90_types.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../disentangle.F90

wannierise.o: ../wannierise.F90 hamiltonian.o constants.o io.o utility.o types.o sitesym.o comms.o wannier90_types.o wannier90_readwrite.o
wannierise.o: ../wannierise.F90 hamiltonian.o constants.o io.o utility.o types.o sitesym.o comms.o wannier90_types.o wannier90_readwrite.o error.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../wannierise.F90

plot.o: ../plot.F90 constants.o io.o utility.o types.o hamiltonian.o ws_distance.o wannier90_types.o
plot.o: ../plot.F90 constants.o io.o utility.o types.o hamiltonian.o ws_distance.o wannier90_types.o comms.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../plot.F90

ws_distance.o: ../ws_distance.F90 constants.o io.o types.o
Expand All @@ -144,7 +147,7 @@ transport.o: ../transport.F90 constants.o io.o types.o hamiltonian.o wannier90_t
sitesym.o : ../sitesym.F90 utility.o types.o constants.o wannier90_types.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../sitesym.F90

comms.o: ../comms.F90 constants.o io.o ../../make.inc
comms.o: ../comms.F90 constants.o error_base.o ../../make.inc
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c ../comms.F90

boltzwann.o: $(POSTDIR)boltzwann.F90 constants.o types.o io.o utility.o postw90_common.o get_oper.o wan_ham.o comms.o spin.o dos.o postw90_types.o ws_distance.o
Expand Down Expand Up @@ -183,7 +186,7 @@ postw90_common.o: $(POSTDIR)postw90_common.F90 postw90_types.o ws_distance.o com
postw90_types.o: $(POSTDIR)postw90_types.F90 comms.o types.o utility.o constants.o io.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c $(POSTDIR)postw90_types.F90

postw90_readwrite.o: $(POSTDIR)postw90_readwrite.F90 comms.o postw90_types.o types.o utility.o constants.o io.o
postw90_readwrite.o: $(POSTDIR)postw90_readwrite.F90 comms.o postw90_types.o types.o utility.o constants.o io.o error.o
$(COMPILER) $(POSTOPTS) $(FCOPTS) -c $(POSTDIR)postw90_readwrite.F90

wannier_lib.o: ./constants.o ./io.o ./utility.o ./types.o \
Expand Down
5 changes: 3 additions & 2 deletions src/Makefile.header
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
OBJS = constants.o io.o utility.o types.o hamiltonian.o overlap.o kmesh.o disentangle.o \
ws_distance.o wannierise.o plot.o transport.o sitesym.o comms.o wannier90_types.o \
wannier90_readwrite.o comms-abort.o readwrite.o
wannier90_readwrite.o readwrite.o error.o error_base.o

OBJS_LIBV1 = wannier_lib.o

OBJS_POST = ws_distance.o types.o kmesh.o io.o comms.o utility.o get_oper.o constants.o \
postw90_common.o wan_ham.o spin.o dos.o berry.o gyrotropic.o kpath.o kslice.o \
boltzwann.o geninterp.o postw90_types.o postw90_readwrite.o comms-abort.o readwrite.o
boltzwann.o geninterp.o postw90_types.o postw90_readwrite.o readwrite.o \
error.o error_base.o

LIBRARY = ../../libwannier.a
LIBRARYV2 = ../../libwan2.a
Expand Down
86 changes: 0 additions & 86 deletions src/comms-abort.F90

This file was deleted.

Loading

0 comments on commit 897a527

Please sign in to comment.