Skip to content

Commit 5ddd3df

Browse files
Merge pull request #14 from jl-wynen/devel
Version 0.2
2 parents 1db89e7 + 855b04f commit 5ddd3df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+4856
-2440
lines changed

.gitignore

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@
22
*.h5
33
*.hdf5
44

5+
# log files
6+
*.log
7+
58
# Python binaries
69
__pycache__
710
*.pyc
811
*.egg-info
912
dist
1013

14+
# Python virtual environments
15+
Pipfile
16+
1117
# C++ binaries
1218
*.so
1319
*.dSYM
1420
.DS_Store
1521

1622
# build directory
1723
build
18-
19-
# Pyhton virtual environments
20-
Pipfile

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ endif ()
3030
project(isle CXX)
3131

3232
# look for 3rd party packages
33+
find_package(OpenMP REQUIRED)
3334
find_package(Pybind11 REQUIRED)
34-
find_package(blaze REQUIRED)
35-
find_package(OMP REQUIRED)
35+
find_package(blaze 3.4 REQUIRED)
3636

3737
get_filename_component(SOURCE_DIR "src/isle/cpp"
3838
REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ It's thought that the Hubbard model approximates carbon nanostructures, such as
1313

1414
## C++
1515
- C++14 compiler (tested with recent versions of gcc and clang)
16-
- [Python 3](https://www.python.org/) version 3.7 or later
1716
- [blaze](https://bitbucket.org/blaze-lib/blaze)
1817
- BLAS/LAPACK
1918

2019
## Python
20+
- [Python 3](https://www.python.org/) version 3.7 or later
2121
- [Pybind11](https://github.com/pybind/pybind11) >= 2.2.4
2222
- [numpy](http://www.numpy.org/)
23+
- [SciPy](https://www.scipy.org/scipylib/index.html) library
2324
- [h5py](http://www.h5py.org/)
2425
- [scikit-learn](http://scikit-learn.org/stable/) (optional)
2526
- [matplotlib](https://matplotlib.org/) (optional)

benchmarks/logdet.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,14 @@ def nx_scaling():
6868

6969
times = {"logdetM": []}
7070

71+
nxs = []
7172
for lat in lattices:
7273
print(f"lat = {lat.name}")
7374
nx = lat.nx()
75+
if nx in nxs:
76+
continue
77+
78+
nxs.append(nx)
7479
lat.nt(NT)
7580

7681
# make random auxilliary field and HFM
@@ -86,7 +91,7 @@ def nx_scaling():
8691
# save benchmark to file
8792
pickle.dump({"xlabel": "Nx",
8893
"ylabel": "time / s",
89-
"xvalues": [lat.nx() for lat in lattices],
94+
"xvalues": nxs,
9095
"results": times},
9196
open("logdet.ben", "wb"))
9297

benchmarks/solver.py

-56
This file was deleted.

cmake/Modules/FindOMP.cmake

-28
This file was deleted.

cmake/Modules/Findblaze.cmake

+31-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Find blaze and BLAS/LAPACK of specified vendor
22
#
3-
# blaze_FOUND - True if blaze was found
4-
# blaze_INCLUDE_DIRS - Include directories for blaze
5-
# blaze_CXX_FLAGS - Flags for CXX compiler
6-
# blaze_LIBRARIES - Libraries to link against
7-
# blaze_LINKER_FLAGS - Flags for linker
3+
# blaze_FOUND - True if blaze was found
4+
# blaze_VERSION_STRING - The version of blaze
5+
# blaze_VERSION_MAJOR - The major version of blaze
6+
# blaze_VERSION_MINOR - The minor version of blaze
7+
# blaze_INCLUDE_DIRS - Include directories for blaze
8+
# blaze_CXX_FLAGS - Flags for CXX compiler
9+
# blaze_LIBRARIES - Libraries to link against
10+
# blaze_LINKER_FLAGS - Flags for linker
811
#
912

1013

@@ -16,6 +19,21 @@ set(BLAZE_PARALLELISM "NONE" CACHE STRING "Kind of parallelism used by blaze. Ca
1619
find_path(BLAZE_INCLUDE_DIR blaze/Blaze.h PATHS ${BLAZE} NO_DEFAULT_PATH)
1720
find_path(BLAZE_INCLUDE_DIR blaze/Blaze.h)
1821

22+
if (BLAZE_INCLUDE_DIR)
23+
# detect version
24+
file(READ ${BLAZE_INCLUDE_DIR}/blaze/system/Version.h BLAZE_VERSION_FILE)
25+
26+
string(REGEX MATCH "#define BLAZE_MAJOR_VERSION ([0-9]*)" dummy ${BLAZE_VERSION_FILE})
27+
unset(dummy)
28+
set(blaze_VERSION_MAJOR ${CMAKE_MATCH_1})
29+
30+
string(REGEX MATCH "#define BLAZE_MINOR_VERSION ([0-9]*)" dummy ${BLAZE_VERSION_FILE})
31+
unset(dummy)
32+
set(blaze_VERSION_MINOR ${CMAKE_MATCH_1})
33+
34+
set(blaze_VERSION_STRING "${blaze_VERSION_MAJOR}.${blaze_VERSION_MINOR}")
35+
endif ()
36+
1937

2038
### search for BLAS and LAPACK ###
2139
set(BLAS_VENDOR "Generic" CACHE STRING "Implementation of BLAS library to use")
@@ -58,12 +76,12 @@ endif ()
5876
if ("${BLAZE_PARALLELISM}" STREQUAL "NONE")
5977
set(blaze_CXX_FLAGS "${blaze_CXX_FLAGS};-DBLAZE_USE_SHARED_MEMORY_PARALLELIZATION=0")
6078
elseif ("${BLAZE_PARALLELISM}" STREQUAL "OMP")
61-
if (NOT DEFINED ${OMP_FOUND})
62-
find_package(OMP REQUIRED) # search for OMP if not already done
79+
if (NOT DEFINED OpenMP_FOUND)
80+
find_package(OpenMP REQUIRED) # search for OMP if not already done
6381
endif ()
64-
set(blaze_CXX_FLAGS "${blaze_CXX_FLAGS};${OMP_CXX_FLAGS}")
65-
set(blaze_LIBRARIES "${blaze_LIBRARIES};${OMP_LIBRARIES}")
66-
set(blaze_LINKER_FLAGS "${blaze_LINKER_FLAGS} ${OMP_LINKER_FLAGS}")
82+
set(blaze_CXX_FLAGS "${blaze_CXX_FLAGS};${OpenMP_CXX_FLAGS}")
83+
set(blaze_LIBRARIES "${blaze_LIBRARIES};${OpenMP_CXX_LIBRARIES}")
84+
set(blaze_LINKER_FLAGS "${blaze_LINKER_FLAGS} ${OpenMP_LINKER_FLAGS}")
6785
elseif ("${BLAZE_PARALLELISM}" STREQUAL "CPP")
6886
set(blaze_CXX_FLAGS "${blaze_CXX_FLAGS};-DBLAZE_USE_CPP_THREADS")
6987
else()
@@ -72,7 +90,9 @@ endif ()
7290

7391

7492
include(FindPackageHandleStandardArgs)
75-
find_package_handle_standard_args(blaze DEFAULT_MSG BLAZE_INCLUDE_DIR BLAZE_CXX_FLAGS)
93+
find_package_handle_standard_args(blaze
94+
REQUIRED_VARS BLAZE_INCLUDE_DIR
95+
VERSION_VAR blaze_VERSION_STRING)
7696
mark_as_advanced(BLAZE_INCLUDE_DIR)
7797

7898
set(blaze_INCLUDE_DIRS ${BLAZE_INCLUDE_DIR})

docs/doxyfile.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ EXCLUDE_SYMBOLS =
869869
# that contain example code fragments that are included (see the \include
870870
# command).
871871

872-
EXAMPLE_PATH =
872+
EXAMPLE_PATH = ./examples
873873

874874
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
875875
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and

docs/examples/basic-hmc.py

-63
This file was deleted.

docs/examples/basic-meas.py

-35
This file was deleted.

0 commit comments

Comments
 (0)