qupled 1.3.2__cp312-cp312-macosx_14_0_arm64.whl → 1.3.4__cp312-cp312-macosx_14_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. qupled/.dylibs/libSQLiteCpp.0.dylib +0 -0
  2. qupled/.dylibs/{libsqlite3.3.50.1.dylib → libsqlite3.3.50.2.dylib} +0 -0
  3. qupled/database.py +66 -28
  4. qupled/esa.py +11 -5
  5. qupled/hf.py +134 -73
  6. qupled/include/fmt/args.h +235 -0
  7. qupled/include/fmt/chrono.h +2240 -0
  8. qupled/include/fmt/color.h +643 -0
  9. qupled/include/fmt/compile.h +535 -0
  10. qupled/include/fmt/core.h +2969 -0
  11. qupled/include/fmt/format-inl.h +1678 -0
  12. qupled/include/fmt/format.h +4535 -0
  13. qupled/include/fmt/os.h +455 -0
  14. qupled/include/fmt/ostream.h +245 -0
  15. qupled/include/fmt/printf.h +675 -0
  16. qupled/include/fmt/ranges.h +738 -0
  17. qupled/include/fmt/std.h +537 -0
  18. qupled/include/fmt/xchar.h +259 -0
  19. qupled/lib/cmake/fmt/fmt-config-version.cmake +43 -0
  20. qupled/lib/cmake/fmt/fmt-config.cmake +31 -0
  21. qupled/lib/cmake/fmt/fmt-targets-release.cmake +19 -0
  22. qupled/lib/cmake/fmt/fmt-targets.cmake +116 -0
  23. qupled/lib/libfmt.a +0 -0
  24. qupled/lib/pkgconfig/fmt.pc +11 -0
  25. qupled/mpi.py +104 -69
  26. qupled/native.cpython-312-darwin.so +0 -0
  27. qupled/qstls.py +13 -10
  28. qupled/qstlsiet.py +13 -10
  29. qupled/qvsstls.py +13 -11
  30. qupled/rpa.py +11 -7
  31. qupled/serialize.py +43 -0
  32. qupled/stls.py +29 -26
  33. qupled/stlsiet.py +34 -25
  34. qupled/timer.py +33 -0
  35. qupled/vsstls.py +44 -42
  36. {qupled-1.3.2.dist-info → qupled-1.3.4.dist-info}/METADATA +1 -1
  37. qupled-1.3.4.dist-info/RECORD +45 -0
  38. qupled-1.3.2.dist-info/RECORD +0 -24
  39. {qupled-1.3.2.dist-info → qupled-1.3.4.dist-info}/WHEEL +0 -0
  40. {qupled-1.3.2.dist-info → qupled-1.3.4.dist-info}/licenses/LICENSE +0 -0
  41. {qupled-1.3.2.dist-info → qupled-1.3.4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,259 @@
1
+ // Formatting library for C++ - optional wchar_t and exotic character support
2
+ //
3
+ // Copyright (c) 2012 - present, Victor Zverovich
4
+ // All rights reserved.
5
+ //
6
+ // For the license information refer to format.h.
7
+
8
+ #ifndef FMT_XCHAR_H_
9
+ #define FMT_XCHAR_H_
10
+
11
+ #include <cwchar>
12
+
13
+ #include "format.h"
14
+
15
+ #ifndef FMT_STATIC_THOUSANDS_SEPARATOR
16
+ # include <locale>
17
+ #endif
18
+
19
+ FMT_BEGIN_NAMESPACE
20
+ namespace detail {
21
+
22
+ template <typename T>
23
+ using is_exotic_char = bool_constant<!std::is_same<T, char>::value>;
24
+
25
+ inline auto write_loc(std::back_insert_iterator<detail::buffer<wchar_t>> out,
26
+ loc_value value, const format_specs<wchar_t>& specs,
27
+ locale_ref loc) -> bool {
28
+ #ifndef FMT_STATIC_THOUSANDS_SEPARATOR
29
+ auto& numpunct =
30
+ std::use_facet<std::numpunct<wchar_t>>(loc.get<std::locale>());
31
+ auto separator = std::wstring();
32
+ auto grouping = numpunct.grouping();
33
+ if (!grouping.empty()) separator = std::wstring(1, numpunct.thousands_sep());
34
+ return value.visit(loc_writer<wchar_t>{out, specs, separator, grouping, {}});
35
+ #endif
36
+ return false;
37
+ }
38
+ } // namespace detail
39
+
40
+ FMT_BEGIN_EXPORT
41
+
42
+ using wstring_view = basic_string_view<wchar_t>;
43
+ using wformat_parse_context = basic_format_parse_context<wchar_t>;
44
+ using wformat_context = buffer_context<wchar_t>;
45
+ using wformat_args = basic_format_args<wformat_context>;
46
+ using wmemory_buffer = basic_memory_buffer<wchar_t>;
47
+
48
+ #if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
49
+ // Workaround broken conversion on older gcc.
50
+ template <typename... Args> using wformat_string = wstring_view;
51
+ inline auto runtime(wstring_view s) -> wstring_view { return s; }
52
+ #else
53
+ template <typename... Args>
54
+ using wformat_string = basic_format_string<wchar_t, type_identity_t<Args>...>;
55
+ inline auto runtime(wstring_view s) -> runtime_format_string<wchar_t> {
56
+ return {{s}};
57
+ }
58
+ #endif
59
+
60
+ template <> struct is_char<wchar_t> : std::true_type {};
61
+ template <> struct is_char<detail::char8_type> : std::true_type {};
62
+ template <> struct is_char<char16_t> : std::true_type {};
63
+ template <> struct is_char<char32_t> : std::true_type {};
64
+
65
+ template <typename... T>
66
+ constexpr auto make_wformat_args(const T&... args)
67
+ -> format_arg_store<wformat_context, T...> {
68
+ return {args...};
69
+ }
70
+
71
+ inline namespace literals {
72
+ #if FMT_USE_USER_DEFINED_LITERALS && !FMT_USE_NONTYPE_TEMPLATE_ARGS
73
+ constexpr auto operator""_a(const wchar_t* s, size_t)
74
+ -> detail::udl_arg<wchar_t> {
75
+ return {s};
76
+ }
77
+ #endif
78
+ } // namespace literals
79
+
80
+ template <typename It, typename Sentinel>
81
+ auto join(It begin, Sentinel end, wstring_view sep)
82
+ -> join_view<It, Sentinel, wchar_t> {
83
+ return {begin, end, sep};
84
+ }
85
+
86
+ template <typename Range>
87
+ auto join(Range&& range, wstring_view sep)
88
+ -> join_view<detail::iterator_t<Range>, detail::sentinel_t<Range>,
89
+ wchar_t> {
90
+ return join(std::begin(range), std::end(range), sep);
91
+ }
92
+
93
+ template <typename T>
94
+ auto join(std::initializer_list<T> list, wstring_view sep)
95
+ -> join_view<const T*, const T*, wchar_t> {
96
+ return join(std::begin(list), std::end(list), sep);
97
+ }
98
+
99
+ template <typename Char, FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
100
+ auto vformat(basic_string_view<Char> format_str,
101
+ basic_format_args<buffer_context<type_identity_t<Char>>> args)
102
+ -> std::basic_string<Char> {
103
+ auto buf = basic_memory_buffer<Char>();
104
+ detail::vformat_to(buf, format_str, args);
105
+ return to_string(buf);
106
+ }
107
+
108
+ template <typename... T>
109
+ auto format(wformat_string<T...> fmt, T&&... args) -> std::wstring {
110
+ return vformat(fmt::wstring_view(fmt), fmt::make_wformat_args(args...));
111
+ }
112
+
113
+ // Pass char_t as a default template parameter instead of using
114
+ // std::basic_string<char_t<S>> to reduce the symbol size.
115
+ template <typename S, typename... T, typename Char = char_t<S>,
116
+ FMT_ENABLE_IF(!std::is_same<Char, char>::value &&
117
+ !std::is_same<Char, wchar_t>::value)>
118
+ auto format(const S& format_str, T&&... args) -> std::basic_string<Char> {
119
+ return vformat(detail::to_string_view(format_str),
120
+ fmt::make_format_args<buffer_context<Char>>(args...));
121
+ }
122
+
123
+ template <typename Locale, typename S, typename Char = char_t<S>,
124
+ FMT_ENABLE_IF(detail::is_locale<Locale>::value&&
125
+ detail::is_exotic_char<Char>::value)>
126
+ inline auto vformat(
127
+ const Locale& loc, const S& format_str,
128
+ basic_format_args<buffer_context<type_identity_t<Char>>> args)
129
+ -> std::basic_string<Char> {
130
+ return detail::vformat(loc, detail::to_string_view(format_str), args);
131
+ }
132
+
133
+ template <typename Locale, typename S, typename... T, typename Char = char_t<S>,
134
+ FMT_ENABLE_IF(detail::is_locale<Locale>::value&&
135
+ detail::is_exotic_char<Char>::value)>
136
+ inline auto format(const Locale& loc, const S& format_str, T&&... args)
137
+ -> std::basic_string<Char> {
138
+ return detail::vformat(loc, detail::to_string_view(format_str),
139
+ fmt::make_format_args<buffer_context<Char>>(args...));
140
+ }
141
+
142
+ template <typename OutputIt, typename S, typename Char = char_t<S>,
143
+ FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
144
+ detail::is_exotic_char<Char>::value)>
145
+ auto vformat_to(OutputIt out, const S& format_str,
146
+ basic_format_args<buffer_context<type_identity_t<Char>>> args)
147
+ -> OutputIt {
148
+ auto&& buf = detail::get_buffer<Char>(out);
149
+ detail::vformat_to(buf, detail::to_string_view(format_str), args);
150
+ return detail::get_iterator(buf, out);
151
+ }
152
+
153
+ template <typename OutputIt, typename S, typename... T,
154
+ typename Char = char_t<S>,
155
+ FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
156
+ detail::is_exotic_char<Char>::value)>
157
+ inline auto format_to(OutputIt out, const S& fmt, T&&... args) -> OutputIt {
158
+ return vformat_to(out, detail::to_string_view(fmt),
159
+ fmt::make_format_args<buffer_context<Char>>(args...));
160
+ }
161
+
162
+ template <typename Locale, typename S, typename OutputIt, typename... Args,
163
+ typename Char = char_t<S>,
164
+ FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
165
+ detail::is_locale<Locale>::value&&
166
+ detail::is_exotic_char<Char>::value)>
167
+ inline auto vformat_to(
168
+ OutputIt out, const Locale& loc, const S& format_str,
169
+ basic_format_args<buffer_context<type_identity_t<Char>>> args) -> OutputIt {
170
+ auto&& buf = detail::get_buffer<Char>(out);
171
+ vformat_to(buf, detail::to_string_view(format_str), args,
172
+ detail::locale_ref(loc));
173
+ return detail::get_iterator(buf, out);
174
+ }
175
+
176
+ template <typename OutputIt, typename Locale, typename S, typename... T,
177
+ typename Char = char_t<S>,
178
+ bool enable = detail::is_output_iterator<OutputIt, Char>::value &&
179
+ detail::is_locale<Locale>::value &&
180
+ detail::is_exotic_char<Char>::value>
181
+ inline auto format_to(OutputIt out, const Locale& loc, const S& format_str,
182
+ T&&... args) ->
183
+ typename std::enable_if<enable, OutputIt>::type {
184
+ return vformat_to(out, loc, detail::to_string_view(format_str),
185
+ fmt::make_format_args<buffer_context<Char>>(args...));
186
+ }
187
+
188
+ template <typename OutputIt, typename Char, typename... Args,
189
+ FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
190
+ detail::is_exotic_char<Char>::value)>
191
+ inline auto vformat_to_n(
192
+ OutputIt out, size_t n, basic_string_view<Char> format_str,
193
+ basic_format_args<buffer_context<type_identity_t<Char>>> args)
194
+ -> format_to_n_result<OutputIt> {
195
+ using traits = detail::fixed_buffer_traits;
196
+ auto buf = detail::iterator_buffer<OutputIt, Char, traits>(out, n);
197
+ detail::vformat_to(buf, format_str, args);
198
+ return {buf.out(), buf.count()};
199
+ }
200
+
201
+ template <typename OutputIt, typename S, typename... T,
202
+ typename Char = char_t<S>,
203
+ FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
204
+ detail::is_exotic_char<Char>::value)>
205
+ inline auto format_to_n(OutputIt out, size_t n, const S& fmt, T&&... args)
206
+ -> format_to_n_result<OutputIt> {
207
+ return vformat_to_n(out, n, detail::to_string_view(fmt),
208
+ fmt::make_format_args<buffer_context<Char>>(args...));
209
+ }
210
+
211
+ template <typename S, typename... T, typename Char = char_t<S>,
212
+ FMT_ENABLE_IF(detail::is_exotic_char<Char>::value)>
213
+ inline auto formatted_size(const S& fmt, T&&... args) -> size_t {
214
+ auto buf = detail::counting_buffer<Char>();
215
+ detail::vformat_to(buf, detail::to_string_view(fmt),
216
+ fmt::make_format_args<buffer_context<Char>>(args...));
217
+ return buf.count();
218
+ }
219
+
220
+ inline void vprint(std::FILE* f, wstring_view fmt, wformat_args args) {
221
+ auto buf = wmemory_buffer();
222
+ detail::vformat_to(buf, fmt, args);
223
+ buf.push_back(L'\0');
224
+ if (std::fputws(buf.data(), f) == -1)
225
+ FMT_THROW(system_error(errno, FMT_STRING("cannot write to file")));
226
+ }
227
+
228
+ inline void vprint(wstring_view fmt, wformat_args args) {
229
+ vprint(stdout, fmt, args);
230
+ }
231
+
232
+ template <typename... T>
233
+ void print(std::FILE* f, wformat_string<T...> fmt, T&&... args) {
234
+ return vprint(f, wstring_view(fmt), fmt::make_wformat_args(args...));
235
+ }
236
+
237
+ template <typename... T> void print(wformat_string<T...> fmt, T&&... args) {
238
+ return vprint(wstring_view(fmt), fmt::make_wformat_args(args...));
239
+ }
240
+
241
+ template <typename... T>
242
+ void println(std::FILE* f, wformat_string<T...> fmt, T&&... args) {
243
+ return print(f, L"{}\n", fmt::format(fmt, std::forward<T>(args)...));
244
+ }
245
+
246
+ template <typename... T> void println(wformat_string<T...> fmt, T&&... args) {
247
+ return print(L"{}\n", fmt::format(fmt, std::forward<T>(args)...));
248
+ }
249
+
250
+ /**
251
+ Converts *value* to ``std::wstring`` using the default format for type *T*.
252
+ */
253
+ template <typename T> inline auto to_wstring(const T& value) -> std::wstring {
254
+ return format(FMT_STRING(L"{}"), value);
255
+ }
256
+ FMT_END_EXPORT
257
+ FMT_END_NAMESPACE
258
+
259
+ #endif // FMT_XCHAR_H_
@@ -0,0 +1,43 @@
1
+ # This is a basic version file for the Config-mode of find_package().
2
+ # It is used by write_basic_package_version_file() as input file for configure_file()
3
+ # to create a version-file which can be installed along a config.cmake file.
4
+ #
5
+ # The created file sets PACKAGE_VERSION_EXACT if the current version string and
6
+ # the requested version string are exactly the same and it sets
7
+ # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
8
+ # The variable CVF_VERSION must be set before calling configure_file().
9
+
10
+ set(PACKAGE_VERSION "10.2.1")
11
+
12
+ if (PACKAGE_FIND_VERSION_RANGE)
13
+ # Package version must be in the requested version range
14
+ if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
15
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
16
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
17
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
18
+ else()
19
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
20
+ endif()
21
+ else()
22
+ if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
23
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
24
+ else()
25
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
26
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
27
+ set(PACKAGE_VERSION_EXACT TRUE)
28
+ endif()
29
+ endif()
30
+ endif()
31
+
32
+
33
+ # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
34
+ if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
35
+ return()
36
+ endif()
37
+
38
+ # check that the installed version has the same 32/64bit-ness as the one which is currently searching:
39
+ if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
40
+ math(EXPR installedBits "8 * 8")
41
+ set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
42
+ set(PACKAGE_VERSION_UNSUITABLE TRUE)
43
+ endif()
@@ -0,0 +1,31 @@
1
+
2
+ ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
3
+ ####### Any changes to this file will be overwritten by the next CMake run ####
4
+ ####### The input file was fmt-config.cmake.in ########
5
+
6
+ get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
7
+
8
+ macro(set_and_check _var _file)
9
+ set(${_var} "${_file}")
10
+ if(NOT EXISTS "${_file}")
11
+ message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
12
+ endif()
13
+ endmacro()
14
+
15
+ macro(check_required_components _NAME)
16
+ foreach(comp ${${_NAME}_FIND_COMPONENTS})
17
+ if(NOT ${_NAME}_${comp}_FOUND)
18
+ if(${_NAME}_FIND_REQUIRED_${comp})
19
+ set(${_NAME}_FOUND FALSE)
20
+ endif()
21
+ endif()
22
+ endforeach()
23
+ endmacro()
24
+
25
+ ####################################################################################
26
+
27
+ if (NOT TARGET fmt::fmt)
28
+ include(${CMAKE_CURRENT_LIST_DIR}/fmt-targets.cmake)
29
+ endif ()
30
+
31
+ check_required_components(fmt)
@@ -0,0 +1,19 @@
1
+ #----------------------------------------------------------------
2
+ # Generated CMake target import file for configuration "Release".
3
+ #----------------------------------------------------------------
4
+
5
+ # Commands may need to know the format version.
6
+ set(CMAKE_IMPORT_FILE_VERSION 1)
7
+
8
+ # Import target "fmt::fmt" for configuration "Release"
9
+ set_property(TARGET fmt::fmt APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
10
+ set_target_properties(fmt::fmt PROPERTIES
11
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
12
+ IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libfmt.a"
13
+ )
14
+
15
+ list(APPEND _cmake_import_check_targets fmt::fmt )
16
+ list(APPEND _cmake_import_check_files_for_fmt::fmt "${_IMPORT_PREFIX}/lib/libfmt.a" )
17
+
18
+ # Commands beyond this point should not need to know the version.
19
+ set(CMAKE_IMPORT_FILE_VERSION)
@@ -0,0 +1,116 @@
1
+ # Generated by CMake
2
+
3
+ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
4
+ message(FATAL_ERROR "CMake >= 3.0.0 required")
5
+ endif()
6
+ if(CMAKE_VERSION VERSION_LESS "3.0.0")
7
+ message(FATAL_ERROR "CMake >= 3.0.0 required")
8
+ endif()
9
+ cmake_policy(PUSH)
10
+ cmake_policy(VERSION 3.0.0...3.30)
11
+ #----------------------------------------------------------------
12
+ # Generated CMake target import file.
13
+ #----------------------------------------------------------------
14
+
15
+ # Commands may need to know the format version.
16
+ set(CMAKE_IMPORT_FILE_VERSION 1)
17
+
18
+ # Protect against multiple inclusion, which would fail when already imported targets are added once more.
19
+ set(_cmake_targets_defined "")
20
+ set(_cmake_targets_not_defined "")
21
+ set(_cmake_expected_targets "")
22
+ foreach(_cmake_expected_target IN ITEMS fmt::fmt fmt::fmt-header-only)
23
+ list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
24
+ if(TARGET "${_cmake_expected_target}")
25
+ list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
26
+ else()
27
+ list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
28
+ endif()
29
+ endforeach()
30
+ unset(_cmake_expected_target)
31
+ if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
32
+ unset(_cmake_targets_defined)
33
+ unset(_cmake_targets_not_defined)
34
+ unset(_cmake_expected_targets)
35
+ unset(CMAKE_IMPORT_FILE_VERSION)
36
+ cmake_policy(POP)
37
+ return()
38
+ endif()
39
+ if(NOT _cmake_targets_defined STREQUAL "")
40
+ string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
41
+ string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
42
+ message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
43
+ endif()
44
+ unset(_cmake_targets_defined)
45
+ unset(_cmake_targets_not_defined)
46
+ unset(_cmake_expected_targets)
47
+
48
+
49
+ # Compute the installation prefix relative to this file.
50
+ get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
51
+ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
52
+ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
53
+ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
54
+ if(_IMPORT_PREFIX STREQUAL "/")
55
+ set(_IMPORT_PREFIX "")
56
+ endif()
57
+
58
+ # Create imported target fmt::fmt
59
+ add_library(fmt::fmt STATIC IMPORTED)
60
+
61
+ set_target_properties(fmt::fmt PROPERTIES
62
+ INTERFACE_COMPILE_FEATURES "cxx_std_11"
63
+ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
64
+ )
65
+
66
+ # Create imported target fmt::fmt-header-only
67
+ add_library(fmt::fmt-header-only INTERFACE IMPORTED)
68
+
69
+ set_target_properties(fmt::fmt-header-only PROPERTIES
70
+ INTERFACE_COMPILE_DEFINITIONS "FMT_HEADER_ONLY=1"
71
+ INTERFACE_COMPILE_FEATURES "cxx_std_11"
72
+ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
73
+ )
74
+
75
+ # Load information for each installed configuration.
76
+ file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/fmt-targets-*.cmake")
77
+ foreach(_cmake_config_file IN LISTS _cmake_config_files)
78
+ include("${_cmake_config_file}")
79
+ endforeach()
80
+ unset(_cmake_config_file)
81
+ unset(_cmake_config_files)
82
+
83
+ # Cleanup temporary variables.
84
+ set(_IMPORT_PREFIX)
85
+
86
+ # Loop over all imported files and verify that they actually exist
87
+ foreach(_cmake_target IN LISTS _cmake_import_check_targets)
88
+ if(CMAKE_VERSION VERSION_LESS "3.28"
89
+ OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
90
+ OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
91
+ foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
92
+ if(NOT EXISTS "${_cmake_file}")
93
+ message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
94
+ \"${_cmake_file}\"
95
+ but this file does not exist. Possible reasons include:
96
+ * The file was deleted, renamed, or moved to another location.
97
+ * An install or uninstall procedure did not complete successfully.
98
+ * The installation package was faulty and contained
99
+ \"${CMAKE_CURRENT_LIST_FILE}\"
100
+ but not all the files it references.
101
+ ")
102
+ endif()
103
+ endforeach()
104
+ endif()
105
+ unset(_cmake_file)
106
+ unset("_cmake_import_check_files_for_${_cmake_target}")
107
+ endforeach()
108
+ unset(_cmake_target)
109
+ unset(_cmake_import_check_targets)
110
+
111
+ # This file does not depend on other imported targets which have
112
+ # been exported from the same project but in a separate export set.
113
+
114
+ # Commands beyond this point should not need to know the version.
115
+ set(CMAKE_IMPORT_FILE_VERSION)
116
+ cmake_policy(POP)
qupled/lib/libfmt.a ADDED
Binary file
@@ -0,0 +1,11 @@
1
+ prefix=/Users/runner/work/qupled/qupled/build/lib.macosx-11.0-arm64-cpython-312/qupled
2
+ exec_prefix=/Users/runner/work/qupled/qupled/build/lib.macosx-11.0-arm64-cpython-312/qupled
3
+ libdir=${exec_prefix}/lib
4
+ includedir=${prefix}/include
5
+
6
+ Name: fmt
7
+ Description: A modern formatting library
8
+ Version: 10.2.1
9
+ Libs: -L${libdir} -lfmt
10
+ Cflags: -I${includedir}
11
+
qupled/mpi.py CHANGED
@@ -1,69 +1,104 @@
1
- import functools
2
-
3
- from qupled import native
4
-
5
-
6
- class MPI:
7
- """Class to handle the calls to the MPI API"""
8
-
9
- def rank(self):
10
- """Get rank of the process"""
11
- return native.MPI.rank()
12
-
13
- def is_root(self):
14
- """Check if the current process is root (rank 0)"""
15
- return native.MPI.is_root()
16
-
17
- def barrier(self):
18
- """Setup an MPI barrier"""
19
- native.MPI.barrier()
20
-
21
- def timer(self):
22
- """Get wall time"""
23
- return native.MPI.timer()
24
-
25
- @staticmethod
26
- def run_only_on_root(func):
27
- """Python decorator for all methods that have to be run only by root"""
28
-
29
- @functools.wraps(func)
30
- def wrapper(*args, **kwargs):
31
- if native.MPI.is_root():
32
- return func(*args, **kwargs)
33
-
34
- return wrapper
35
-
36
- @staticmethod
37
- def synchronize_ranks(func):
38
- """Python decorator for all methods that need rank synchronization"""
39
-
40
- @functools.wraps(func)
41
- def wrapper(*args, **kwargs):
42
- func(*args, **kwargs)
43
- native.MPI.barrier()
44
-
45
- return wrapper
46
-
47
- @staticmethod
48
- def record_time(func):
49
- """Python decorator for all methods that have to be timed"""
50
-
51
- @functools.wraps(func)
52
- def wrapper(*args, **kwargs):
53
- mpi = native.MPI
54
- tic = mpi.timer()
55
- func(*args, **kwargs)
56
- toc = mpi.timer()
57
- dt = toc - tic
58
- hours = dt // 3600
59
- minutes = (dt % 3600) // 60
60
- seconds = dt % 60
61
- if mpi.is_root():
62
- if hours > 0:
63
- print("Elapsed time: %d h, %d m, %d s." % (hours, minutes, seconds))
64
- elif minutes > 0:
65
- print("Elapsed time: %d m, %d s." % (minutes, seconds))
66
- else:
67
- print("Elapsed time: %.1f s." % seconds)
68
-
69
- return wrapper
1
+ import json
2
+ import subprocess
3
+ import shutil
4
+
5
+ from pathlib import Path
6
+ from . import native
7
+
8
+ # MPI command
9
+ MPI_COMMAND = "mpiexec"
10
+
11
+ # Temporary files used for MPI executions
12
+ INPUT_FILE = Path("input.json")
13
+ RESULT_FILE = Path("results.json")
14
+ STATUS_FILE = Path("status.json")
15
+
16
+
17
+ def launch_mpi_execution(module, nproc):
18
+ """
19
+ Launches the execution of a Python module using MPI if available, otherwise defaults to serial execution.
20
+
21
+ Args:
22
+ module (str): The name of the Python module to execute (as used with the '-m' flag).
23
+ nproc (int): The number of processes to use for MPI execution.
24
+
25
+ Behavior:
26
+ - Checks if the MPI command is available and if native MPI usage is enabled.
27
+ - If MPI is available, runs the module with the specified number of processes using MPI.
28
+ - If MPI is not available, prints a warning and runs the module in serial mode.
29
+
30
+ Raises:
31
+ subprocess.CalledProcessError: If the subprocess execution fails.
32
+ """
33
+ call_mpi = shutil.which(MPI_COMMAND) is not None and native.uses_mpi
34
+ if call_mpi:
35
+ subprocess.run(
36
+ [MPI_COMMAND, "-n", str(nproc), "python", "-m", module], check=True
37
+ )
38
+ else:
39
+ print("WARNING: Could not call MPI, defaulting to serial execution.")
40
+ subprocess.run(["python", "-m", module], check=True)
41
+
42
+
43
+ def write_inputs(inputs):
44
+ """
45
+ Writes the input data to the INPUT_FILE in JSON format.
46
+ """
47
+ with INPUT_FILE.open("w") as f:
48
+ json.dump(inputs.to_dict(), f)
49
+
50
+
51
+ def read_inputs(InputCls):
52
+ """
53
+ Reads input data from a predefined input file and constructs an instance of the specified input class.
54
+ """
55
+ with INPUT_FILE.open() as f:
56
+ input_dict = json.load(f)
57
+ return InputCls.from_dict(input_dict)
58
+
59
+
60
+ def write_results(scheme, ResultCls):
61
+ """
62
+ Writes the results of a computation to a JSON file if the current process is the root.
63
+ """
64
+ if scheme.is_root:
65
+ results = ResultCls()
66
+ results.from_native(scheme)
67
+ with RESULT_FILE.open("w") as f:
68
+ json.dump(results.to_dict(), f)
69
+
70
+
71
+ def read_results(ResultsCls):
72
+ """
73
+ Reads results from a JSON file and returns an instance of the specified ResultsCls.
74
+ """
75
+ with RESULT_FILE.open() as f:
76
+ result_dict = json.load(f)
77
+ return ResultsCls.from_dict(result_dict)
78
+
79
+
80
+ def write_status(scheme, status):
81
+ """
82
+ Writes the status of a computation to a JSON file if the current process is the root.
83
+ """
84
+ if scheme.is_root:
85
+ with STATUS_FILE.open("w") as f:
86
+ json.dump(status, f)
87
+
88
+
89
+ def read_status():
90
+ """
91
+ Reads status from a JSON file and returns an instance of the specified ResultsCls.
92
+ """
93
+ with STATUS_FILE.open() as f:
94
+ status = json.load(f)
95
+ return status
96
+
97
+
98
+ def clean_files():
99
+ """
100
+ Removes the input and result files if they exist.
101
+ """
102
+ for file in [INPUT_FILE, RESULT_FILE, STATUS_FILE]:
103
+ if file.exists():
104
+ file.unlink()
Binary file