scisoftdev-tmp-HiPOP 1.0.10__tar.gz → 1.0.12__tar.gz

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 (48) hide show
  1. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/.github/workflows/ci.yaml +21 -5
  2. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/.github/workflows/deploy.yaml +2 -2
  3. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/PKG-INFO +1 -1
  4. scisoftdev_tmp_hipop-1.0.12/VERSION.txt +1 -0
  5. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/src/shortest_path.cpp +18 -7
  6. scisoftdev_tmp_hipop-1.0.12/python/hipop/shortest_path.py +1 -0
  7. scisoftdev_tmp_hipop-1.0.10/VERSION.txt +0 -1
  8. scisoftdev_tmp_hipop-1.0.10/python/hipop/shortest_path.py +0 -68
  9. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/.gitignore +0 -0
  10. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/CMakeLists.txt +0 -0
  11. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/LICENSE +0 -0
  12. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/README.md +0 -0
  13. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/conda/env.yaml +0 -0
  14. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/CMakeLists.txt +0 -0
  15. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/cmake/HipopConfig.cmake.in +0 -0
  16. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/examples/CMakeLists.txt +0 -0
  17. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/examples/ParallelKShortestPath.cpp +0 -0
  18. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/include/hipop/create.h +0 -0
  19. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/include/hipop/graph.h +0 -0
  20. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/include/hipop/shortest_path.h +0 -0
  21. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/src/create.cpp +0 -0
  22. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/src/graph.cpp +0 -0
  23. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/CMakeLists.txt +0 -0
  24. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/helpers.h +0 -0
  25. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/testCopyGraph.cpp +0 -0
  26. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/testDijkstra1.cpp +0 -0
  27. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/testDijkstra2.cpp +0 -0
  28. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/testGraph.cpp +0 -0
  29. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/testGraphMerge.cpp +0 -0
  30. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/testKShortestPath.cpp +0 -0
  31. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/testManhattan.cpp +0 -0
  32. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/testYenKShortestPath.cpp +0 -0
  33. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/cpp/tests/testparallelKShortestPath.cpp +0 -0
  34. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/pyproject.toml +0 -0
  35. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/pytest.toml +0 -0
  36. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/CMakeLists.txt +0 -0
  37. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/examples/UpdateCosts.py +0 -0
  38. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/examples/ksp.py +0 -0
  39. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/examples/merge.py +0 -0
  40. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/examples/test.py +0 -0
  41. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/hipop/__init__.py.template +0 -0
  42. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/hipop/cpp/graph.cpp +0 -0
  43. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/hipop/cpp/main.cpp +0 -0
  44. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/hipop/cpp/shortest_path.cpp +0 -0
  45. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/hipop/graph.py +0 -0
  46. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/hipop/render.py +0 -0
  47. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/tests/test_Graph.py +0 -0
  48. {scisoftdev_tmp_hipop-1.0.10 → scisoftdev_tmp_hipop-1.0.12}/python/tests/test_VersionConsistency.py +0 -0
@@ -1,17 +1,14 @@
1
1
  name: Continuous integration checks
2
2
 
3
3
  on:
4
- push:
5
- branches:
6
- - 'feature/**' # TODO remove feature/* once the workflow is stable
7
4
  pull_request:
8
5
  branches:
9
6
  - main
10
7
  workflow_dispatch: # Manual trigger
11
8
 
12
9
  jobs:
13
- build-and-test:
14
10
 
11
+ build-and-test:
15
12
  name: Build & test (py ${{ matrix.python-version }} on ${{ matrix.os }})
16
13
  runs-on: ${{ matrix.os }}
17
14
 
@@ -40,7 +37,6 @@ jobs:
40
37
  # (CMake uses this variable as a search hint).
41
38
  run: |
42
39
  brew install libomp
43
- echo "OpenMP_ROOT=$(brew --prefix libomp)" >> "$GITHUB_ENV"
44
40
 
45
41
  - name: C++ core library - Configure
46
42
  run: cmake -S . -B build-cpponly -G Ninja
@@ -56,3 +52,23 @@ jobs:
56
52
 
57
53
  - name: Python wrapper - Run tests
58
54
  run: pytest
55
+
56
+ # This final job acts as a gate to ensure all the previous jobs have succeeded.
57
+ # It is provided to be registered as a status check for pull requests.
58
+ ci-passed:
59
+ name: CI checks all OK
60
+ runs-on: ubuntu-slim
61
+ if: always()
62
+ needs:
63
+ - build-and-test
64
+
65
+ steps:
66
+ - name: Ensure all CI jobs passed
67
+ run: |
68
+ for result in ${{ join(needs.*.result, ' ') }}; do
69
+ if [[ "$result" != "success" ]]; then
70
+ echo "At least one CI job did not succeed."
71
+ exit 1
72
+ fi
73
+ done
74
+ echo "All CI jobs succeeded."
@@ -9,7 +9,7 @@ jobs:
9
9
 
10
10
  check-version:
11
11
  name: Check git tag
12
- runs-on: ubuntu-latest
12
+ runs-on: ubuntu-slim
13
13
 
14
14
  steps:
15
15
  - uses: actions/checkout@v7
@@ -19,7 +19,7 @@ jobs:
19
19
  project_version="v$(tr -d '[:space:]' < VERSION.txt)"
20
20
  echo "Git tag = [$GITHUB_REF_NAME]"
21
21
  echo "Project version = [$project_version]"
22
- if [ "$GITHUB_REF_NAME" != "$project_version" ]; then
22
+ if [[ "$GITHUB_REF_NAME" != "$project_version" ]]; then
23
23
  echo "Mismatch between git tag and project version (VERSION.txt), aborting deployment..."
24
24
  exit 1
25
25
  fi
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scisoftdev-tmp-HiPOP
3
- Version: 1.0.10
3
+ Version: 1.0.12
4
4
  Summary: High Performance Optimal Path module
5
5
  Keywords: graph,graph-theory,shortest-path,dijkstra
6
6
  License-Expression: LGPL-3.0-only
@@ -0,0 +1 @@
1
+ 1.0.12
@@ -381,10 +381,12 @@ namespace hipop
381
381
  std::vector<std::string> origins,
382
382
  std::vector<std::string> destinations,
383
383
  std::vector<std::unordered_map<std::string, std::string> > vecMapLabelCosts,
384
- std::string cost,
385
- int,
384
+ std::string cost,
385
+ int threadNumber,
386
386
  std::vector<setstring> vecAvailableLabels)
387
387
  {
388
+ omp_set_num_threads(threadNumber);
389
+
388
390
  int nbPath = origins.size();
389
391
  std::vector<int> emptyV;
390
392
  std::vector<int> uniqueIndices;
@@ -434,9 +436,11 @@ namespace hipop
434
436
  std::vector<std::string> origins,
435
437
  std::vector<std::unordered_map<std::string, std::string> > vecMapLabelCosts,
436
438
  std::string cost,
437
- int,
439
+ int threadNumber,
438
440
  std::vector<setstring> vecAvailableLabels)
439
441
  {
442
+ omp_set_num_threads(threadNumber);
443
+
440
444
  int nbSPTs = origins.size();
441
445
  std::vector<ShortestPathsTree> res(nbSPTs);
442
446
 
@@ -474,9 +478,11 @@ namespace hipop
474
478
  std::vector<std::string> destinations,
475
479
  std::vector<std::unordered_map<std::string, std::string> > vecMapLabelCosts,
476
480
  std::vector<std::string> costs,
477
- int,
481
+ int threadNumber,
478
482
  std::vector<setstring> vecAvailableLabels)
479
483
  {
484
+ omp_set_num_threads(threadNumber);
485
+
480
486
  std::vector<int> emptyV;
481
487
  std::vector<int> uniqueIndices;
482
488
  std::unordered_map<int, int> duplicateIndices;
@@ -698,8 +704,9 @@ namespace hipop
698
704
  const std::vector<std::vector<std::vector<std::string>>> &paths,
699
705
  const std::string &cost,
700
706
  const std::unordered_map<std::string, std::string> mapLabelCost,
701
- int)
707
+ int threadNumber)
702
708
  {
709
+ omp_set_num_threads(threadNumber);
703
710
  int nbBatches = paths.size();
704
711
 
705
712
  std::vector<std::vector<double>> res(nbBatches);
@@ -1099,8 +1106,10 @@ namespace hipop
1099
1106
  double costMultiplier,
1100
1107
  int maxRetry,
1101
1108
  const std::vector<int> &kPaths,
1102
- int)
1109
+ int threadNumber)
1103
1110
  {
1111
+ omp_set_num_threads(threadNumber);
1112
+
1104
1113
  int nbODs = origins.size();
1105
1114
  std::vector<std::vector<pathCost>> res(nbODs);
1106
1115
  OrientedGraph *privateG;
@@ -1308,7 +1317,7 @@ namespace hipop
1308
1317
  std::vector<std::string> destinations,
1309
1318
  std::vector<std::unordered_map<std::string, std::string> > vecMapLabelCosts,
1310
1319
  std::string cost,
1311
- int,
1320
+ int threadNumber,
1312
1321
  std::pair<std::unordered_set<std::string>, std::unordered_set<std::string>> pairMandatoryLabels,
1313
1322
  double maxDiffCost,
1314
1323
  double maxDistInCommon,
@@ -1438,6 +1447,8 @@ namespace hipop
1438
1447
  }
1439
1448
 
1440
1449
  // Launch dijkstra algo for each OD in parallel
1450
+ omp_set_num_threads(threadNumber);
1451
+
1441
1452
  int nbOD = origins.size();
1442
1453
  std::vector<std::vector<pathCost>> res(nbOD);
1443
1454
 
@@ -0,0 +1 @@
1
+ from hipop.cpp.shortest_path import (dijkstra, dijkstra_single_source, floyd_warshall, parallel_dijkstra, parallel_dijkstra_single_source, parallel_dijkstra_heterogeneous_costs, parallel_k_intermodal_shortest_path, k_shortest_path, parallel_k_shortest_path, astar_euclidian_dist, compute_path_length, compute_path_cost, compute_paths_costs)
@@ -1 +0,0 @@
1
- 1.0.10
@@ -1,68 +0,0 @@
1
- import functools
2
- import time
3
-
4
- from hipop.cpp.shortest_path import (
5
- dijkstra,
6
- dijkstra_single_source,
7
- floyd_warshall,
8
- parallel_dijkstra,
9
- parallel_dijkstra_single_source,
10
- parallel_dijkstra_heterogeneous_costs,
11
- parallel_k_intermodal_shortest_path,
12
- k_shortest_path,
13
- parallel_k_shortest_path,
14
- astar_euclidian_dist,
15
- compute_path_length,
16
- compute_path_cost,
17
- compute_paths_costs,
18
- )
19
-
20
- _EXPORTED_FUNCTIONS = (
21
- "dijkstra",
22
- "dijkstra_single_source",
23
- "floyd_warshall",
24
- "parallel_dijkstra",
25
- "parallel_dijkstra_single_source",
26
- "parallel_dijkstra_heterogeneous_costs",
27
- "parallel_k_intermodal_shortest_path",
28
- "k_shortest_path",
29
- "parallel_k_shortest_path",
30
- "astar_euclidian_dist",
31
- "compute_path_length",
32
- "compute_path_cost",
33
- "compute_paths_costs",
34
- )
35
-
36
- _stats = {name: {"calls": 0, "total_time": 0.0} for name in _EXPORTED_FUNCTIONS}
37
-
38
-
39
- def _track_calls(func):
40
-
41
- @functools.wraps(func)
42
- def wrapper(*args, **kwargs):
43
- stats = _stats[func.__name__]
44
- start = time.perf_counter()
45
- try:
46
- return func(*args, **kwargs)
47
- finally:
48
- stats["calls"] += 1
49
- stats["total_time"] += time.perf_counter() - start
50
-
51
- return wrapper
52
-
53
-
54
- for _name in _EXPORTED_FUNCTIONS:
55
- globals()[_name] = _track_calls(globals()[_name])
56
- del _name
57
-
58
-
59
- def report_hipop_call_stats():
60
- """Log the number of invocations and cumulative C++ execution time for each
61
- exported function that has been called at least once."""
62
- at_least_one_call = False
63
- for name, stats in _stats.items():
64
- if stats["calls"] > 0:
65
- at_least_one_call = True
66
- print(f"HiPOP fun {name:<40}: #calls = {stats['calls']:>7}, run time = {stats['total_time']:>12.6f}")
67
- if not at_least_one_call:
68
- print("No HiPOP functions were called.")