ceci 2.4__tar.gz → 2.5__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.
- {ceci-2.4 → ceci-2.5}/.github/workflows/ci.yml +1 -1
- {ceci-2.4 → ceci-2.5}/PKG-INFO +1 -1
- ceci-2.5/ceci/_version.py +24 -0
- {ceci-2.4 → ceci-2.5}/ceci/file_types.py +25 -6
- {ceci-2.4 → ceci-2.5}/ceci/stage.py +9 -2
- {ceci-2.4 → ceci-2.5}/ceci.egg-info/PKG-INFO +1 -1
- {ceci-2.4 → ceci-2.5}/ceci.egg-info/SOURCES.txt +1 -0
- ceci-2.5/tests/test_io.py +24 -0
- ceci-2.4/ceci/_version.py +0 -34
- {ceci-2.4 → ceci-2.5}/.coveragerc +0 -0
- {ceci-2.4 → ceci-2.5}/.github/workflows/publish.yml +0 -0
- {ceci-2.4 → ceci-2.5}/.gitignore +0 -0
- {ceci-2.4 → ceci-2.5}/.pylintrc +0 -0
- {ceci-2.4 → ceci-2.5}/.readthedocs.yml +0 -0
- {ceci-2.4 → ceci-2.5}/LICENSE +0 -0
- {ceci-2.4 → ceci-2.5}/README.md +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/__init__.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/__main__.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/config.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/errors.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/main.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/minirunner.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/monitor.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/pipeline/__init__.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/pipeline/dry_run.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/pipeline/file_manager.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/pipeline/flow_chart.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/pipeline/graph.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/pipeline/mini.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/pipeline/parsl.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/pipeline/pipeline.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/pipeline/sec.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/pipeline/templates.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/sites/__init__.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/sites/ccin2p3.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/sites/local.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/sites/nersc.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/sites/site.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/tools/__init__.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/tools/ancestors.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/update_pipelines_for_ceci_2.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci/utils.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci.egg-info/dependency_links.txt +0 -0
- {ceci-2.4 → ceci-2.5}/ceci.egg-info/entry_points.txt +0 -0
- {ceci-2.4 → ceci-2.5}/ceci.egg-info/requires.txt +0 -0
- {ceci-2.4 → ceci-2.5}/ceci.egg-info/top_level.txt +0 -0
- {ceci-2.4 → ceci-2.5}/ceci.png +0 -0
- {ceci-2.4 → ceci-2.5}/ceci_example/__init__.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci_example/__main__.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci_example/example_stages.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci_example/types.py +0 -0
- {ceci-2.4 → ceci-2.5}/ceci_example_namespace/example_stages.py +0 -0
- {ceci-2.4 → ceci-2.5}/do_cover.sh +0 -0
- {ceci-2.4 → ceci-2.5}/docs/Makefile +0 -0
- {ceci-2.4 → ceci-2.5}/docs/conf.py +0 -0
- {ceci-2.4 → ceci-2.5}/docs/config.rst +0 -0
- {ceci-2.4 → ceci-2.5}/docs/config2.rst +0 -0
- {ceci-2.4 → ceci-2.5}/docs/index.rst +0 -0
- {ceci-2.4 → ceci-2.5}/docs/installation.rst +0 -0
- {ceci-2.4 → ceci-2.5}/docs/launchers.rst +0 -0
- {ceci-2.4 → ceci-2.5}/docs/logo.png +0 -0
- {ceci-2.4 → ceci-2.5}/docs/overview.rst +0 -0
- {ceci-2.4 → ceci-2.5}/docs/requirements.txt +0 -0
- {ceci-2.4 → ceci-2.5}/docs/sites.rst +0 -0
- {ceci-2.4 → ceci-2.5}/docs/stages.rst +0 -0
- {ceci-2.4 → ceci-2.5}/docs/tutorial.rst +0 -0
- {ceci-2.4 → ceci-2.5}/nb/ceci_interactive_example.ipynb +0 -0
- {ceci-2.4 → ceci-2.5}/pyproject.toml +0 -0
- {ceci-2.4 → ceci-2.5}/setup.cfg +0 -0
- {ceci-2.4 → ceci-2.5}/setup.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/__init__.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/config.yml +0 -0
- {ceci-2.4 → ceci-2.5}/tests/config_nm.yml +0 -0
- {ceci-2.4 → ceci-2.5}/tests/create_registry_entries.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/inputs/dm.txt +0 -0
- {ceci-2.4 → ceci-2.5}/tests/inputs/fiducial_cosmology.txt +0 -0
- {ceci-2.4 → ceci-2.5}/tests/north.yml +0 -0
- {ceci-2.4 → ceci-2.5}/tests/template.yml +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test.hdf5 +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test.yml +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_cmd.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_dask.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_dataregistry.yml +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_executables.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_flow_chart.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_graph.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_helpers.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_interactive.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_main.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_minirunner.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_monitor.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_namespace.yml +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_pipeline.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_python_paths.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_site.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_snapshot.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_stage.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_update_script.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/test_utils.py +0 -0
- {ceci-2.4 → ceci-2.5}/tests/update_test_files/config.yml +0 -0
- {ceci-2.4 → ceci-2.5}/tests/update_test_files/pipeline1.yml +0 -0
- {ceci-2.4 → ceci-2.5}/tests/update_test_files/pipeline2.yml +0 -0
{ceci-2.4 → ceci-2.5}/PKG-INFO
RENAMED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '2.5'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 5)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = 'gfccc21033'
|
|
@@ -39,6 +39,11 @@ class DataFile:
|
|
|
39
39
|
self.path = path
|
|
40
40
|
self.mode = mode
|
|
41
41
|
|
|
42
|
+
# store whether we are in parallel mode
|
|
43
|
+
# for later use.
|
|
44
|
+
self.parallel = kwargs.get("parallel", False)
|
|
45
|
+
self.comm = kwargs.get("comm", None)
|
|
46
|
+
|
|
42
47
|
if mode not in ["r", "w"]:
|
|
43
48
|
raise ValueError(f"File 'mode' argument must be 'r' or 'w' not '{mode}'")
|
|
44
49
|
|
|
@@ -343,15 +348,24 @@ class YamlFile(DataFile):
|
|
|
343
348
|
|
|
344
349
|
class Directory(DataFile):
|
|
345
350
|
suffix = ""
|
|
351
|
+
supports_parallel_write = True
|
|
346
352
|
|
|
347
353
|
@classmethod
|
|
348
|
-
def open(self, path, mode):
|
|
354
|
+
def open(self, path, mode, comm=None, parallel=False):
|
|
349
355
|
p = pathlib.Path(path)
|
|
350
356
|
|
|
351
357
|
if mode == "w":
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
358
|
+
# Make it so that only one process
|
|
359
|
+
# tries to create the directory if running
|
|
360
|
+
# in parallel
|
|
361
|
+
if (not parallel) or (parallel and comm.rank == 0):
|
|
362
|
+
if p.exists():
|
|
363
|
+
shutil.rmtree(p)
|
|
364
|
+
p.mkdir(parents=True)
|
|
365
|
+
# Then once that one process as done it all the others
|
|
366
|
+
# should wait to avoid race conditions.
|
|
367
|
+
if parallel:
|
|
368
|
+
comm.Barrier()
|
|
355
369
|
else:
|
|
356
370
|
if not p.is_dir():
|
|
357
371
|
raise ValueError(f"Directory input {path} does not exist")
|
|
@@ -365,8 +379,13 @@ class Directory(DataFile):
|
|
|
365
379
|
Write provenance information to a new group,
|
|
366
380
|
called 'provenance'
|
|
367
381
|
"""
|
|
368
|
-
#
|
|
369
|
-
#
|
|
382
|
+
# Directories can be opened in parallel, but only
|
|
383
|
+
# the rank 0 process should write the provenance.
|
|
384
|
+
# This is unlike HDF5 where all the processes have to
|
|
385
|
+
# cooperate to write it.
|
|
386
|
+
if (self.comm is not None) and (self.comm.rank != 0):
|
|
387
|
+
return
|
|
388
|
+
|
|
370
389
|
if self.mode == "r":
|
|
371
390
|
raise UnsupportedOperation(f"Cannot write provenance to a directory opened in read-only mode ({self.mode})")
|
|
372
391
|
|
|
@@ -16,6 +16,7 @@ from . import errors
|
|
|
16
16
|
from .monitor import MemoryMonitor
|
|
17
17
|
from .config import StageParameter, StageConfig, cast_to_streamable
|
|
18
18
|
from .utils import activate_tracing
|
|
19
|
+
from . import file_types
|
|
19
20
|
|
|
20
21
|
SERIAL = "serial"
|
|
21
22
|
MPI_PARALLEL = "mpi"
|
|
@@ -1131,13 +1132,19 @@ I currently know about these stages:
|
|
|
1131
1132
|
path = self.get_output(tag, final_name=final_name)
|
|
1132
1133
|
output_class = self.get_output_type(tag)
|
|
1133
1134
|
|
|
1134
|
-
# HDF files can be opened for parallel writing
|
|
1135
|
+
# HDF files and directory outputs can be opened for parallel writing
|
|
1135
1136
|
# under MPI. This checks if:
|
|
1136
1137
|
# - we have been told to open in parallel
|
|
1137
1138
|
# - we are actually running under MPI
|
|
1138
1139
|
# and adds the flags required if all these are true
|
|
1139
1140
|
run_parallel = kwargs.pop("parallel", False) and self.is_mpi()
|
|
1140
|
-
if run_parallel:
|
|
1141
|
+
if run_parallel and issubclass(output_class, file_types.Directory):
|
|
1142
|
+
kwargs["parallel"] = True
|
|
1143
|
+
kwargs["comm"] = self.comm
|
|
1144
|
+
|
|
1145
|
+
# otherwise must be HDF5. Ideally we would check more carefully
|
|
1146
|
+
# here, but I don't want to mess up any RAIL HDF stuff by accident.
|
|
1147
|
+
elif run_parallel:
|
|
1141
1148
|
kwargs["driver"] = "mpio"
|
|
1142
1149
|
kwargs["comm"] = self.comm
|
|
1143
1150
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import ceci.file_types as file_types
|
|
2
|
+
import tempfile
|
|
3
|
+
import os
|
|
4
|
+
import mockmpi
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _test_directory_parallel(comm, tmpdir):
|
|
8
|
+
print(comm.rank, tmpdir)
|
|
9
|
+
d = file_types.Directory(tmpdir + "/test_dir", "w", parallel=True, comm=comm)
|
|
10
|
+
comm.Barrier()
|
|
11
|
+
assert d.path == tmpdir + "/test_dir"
|
|
12
|
+
assert os.path.exists(tmpdir + "/test_dir/provenance.yml")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_directory():
|
|
16
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
17
|
+
d = file_types.Directory(tmpdir + "/test_dir", "w", parallel=False)
|
|
18
|
+
assert d.path == tmpdir + "/test_dir"
|
|
19
|
+
assert os.path.exists(tmpdir + "/test_dir/provenance.yml")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_directory_parallel():
|
|
23
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
24
|
+
mockmpi.mock_mpiexec(2, _test_directory_parallel, tmpdir)
|
ceci-2.4/ceci/_version.py
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# file generated by setuptools-scm
|
|
2
|
-
# don't change, don't track in version control
|
|
3
|
-
|
|
4
|
-
__all__ = [
|
|
5
|
-
"__version__",
|
|
6
|
-
"__version_tuple__",
|
|
7
|
-
"version",
|
|
8
|
-
"version_tuple",
|
|
9
|
-
"__commit_id__",
|
|
10
|
-
"commit_id",
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
TYPE_CHECKING = False
|
|
14
|
-
if TYPE_CHECKING:
|
|
15
|
-
from typing import Tuple
|
|
16
|
-
from typing import Union
|
|
17
|
-
|
|
18
|
-
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
-
COMMIT_ID = Union[str, None]
|
|
20
|
-
else:
|
|
21
|
-
VERSION_TUPLE = object
|
|
22
|
-
COMMIT_ID = object
|
|
23
|
-
|
|
24
|
-
version: str
|
|
25
|
-
__version__: str
|
|
26
|
-
__version_tuple__: VERSION_TUPLE
|
|
27
|
-
version_tuple: VERSION_TUPLE
|
|
28
|
-
commit_id: COMMIT_ID
|
|
29
|
-
__commit_id__: COMMIT_ID
|
|
30
|
-
|
|
31
|
-
__version__ = version = '2.4'
|
|
32
|
-
__version_tuple__ = version_tuple = (2, 4)
|
|
33
|
-
|
|
34
|
-
__commit_id__ = commit_id = 'g727f0fadf'
|
|
File without changes
|
|
File without changes
|
{ceci-2.4 → ceci-2.5}/.gitignore
RENAMED
|
File without changes
|
{ceci-2.4 → ceci-2.5}/.pylintrc
RENAMED
|
File without changes
|
|
File without changes
|
{ceci-2.4 → ceci-2.5}/LICENSE
RENAMED
|
File without changes
|
{ceci-2.4 → ceci-2.5}/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ceci-2.4 → ceci-2.5}/ceci.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ceci-2.4 → ceci-2.5}/setup.cfg
RENAMED
|
File without changes
|
{ceci-2.4 → ceci-2.5}/setup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|