From f658b9b28eba3567199a7a1741dd71339bfb4c1f Mon Sep 17 00:00:00 2001 From: AdamOrmondroyd Date: Thu, 5 Oct 2023 20:27:18 +0100 Subject: [PATCH 1/6] no idea why recvbuf.dtype was int, and is only not empty for rank 0 --- pypolychord/polychord.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pypolychord/polychord.py b/pypolychord/polychord.py index 88f4199b..66036d12 100644 --- a/pypolychord/polychord.py +++ b/pypolychord/polychord.py @@ -250,16 +250,16 @@ def make_resume_file(settings, loglikelihood, prior): sendbuf = np.array(lives).flatten() sendcounts = np.array(comm.gather(len(sendbuf))) if rank == 0: - recvbuf = np.empty(sum(sendcounts), dtype=int) + recvbuf = np.empty(sum(sendcounts)) else: recvbuf = None comm.Gatherv(sendbuf=sendbuf, recvbuf=(recvbuf, sendcounts), root=0) - lives = np.reshape(sendbuf, (len(settings.cube_samples), len(lives[0]))) - else: - lives = np.array(lives) - if rank == 0: + if MPI: + lives = np.reshape(recvbuf, (len(settings.cube_samples), len(lives[0]))) + else: + lives = np.array(lives) with open(resume_filename,"w") as f: def write(var): var = np.atleast_1d(var) From e8508d9a0dfeb7e1dd5c08d021f61f1a957d185d Mon Sep 17 00:00:00 2001 From: AdamOrmondroyd Date: Fri, 6 Oct 2023 13:34:26 +0100 Subject: [PATCH 2/6] add optional dependency fortranformat for cube_samples --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 4973c843..b2102b71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ [build-system] requires = ["setuptools", "wheel", "numpy"] build-backend = "setuptools.build_meta" + +[project.optional_dependencies] +cube_samples = ["fortranformat"] From a13b01a4f8b621527341b7297112534ffa68fcc3 Mon Sep 17 00:00:00 2001 From: AdamOrmondroyd Date: Fri, 6 Oct 2023 13:50:58 +0100 Subject: [PATCH 3/6] minimal changed to pyproject toml to get optional dependencies to work --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b2102b71..7f06eb66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,5 +2,12 @@ requires = ["setuptools", "wheel", "numpy"] build-backend = "setuptools.build_meta" +[project] +name = "pypolychord" +dynamic = ["version"] + [project.optional_dependencies] cube_samples = ["fortranformat"] + +[tool.setuptools.dynamic] +version = {attr = "pypolychord.__version__"} From b2eaa3197aca140feab2899d7390dce3f8b6214e Mon Sep 17 00:00:00 2001 From: Adam Ormondroyd <52655393+AdamOrmondroyd@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:04:38 +0100 Subject: [PATCH 4/6] toml typo --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7f06eb66..0b9d43bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" name = "pypolychord" dynamic = ["version"] -[project.optional_dependencies] +[project.optional-dependencies] cube_samples = ["fortranformat"] [tool.setuptools.dynamic] From c6d8e50935ca4c5842f043820ad8aae087004a69 Mon Sep 17 00:00:00 2001 From: AdamOrmondroyd Date: Tue, 10 Oct 2023 18:02:18 +0100 Subject: [PATCH 5/6] version bump --- README.rst | 2 +- pypolychord/__init__.py | 2 +- src/polychord/feedback.f90 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 0c154185..02c06267 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ :target: https://arxiv.org/abs/1506.00171 :alt: Open-access paper -PolyChord v 1.20.2 +PolyChord v 1.20.3 Will Handley, Mike Hobson & Anthony Lasenby diff --git a/pypolychord/__init__.py b/pypolychord/__init__.py index 16f2deef..3083aca5 100644 --- a/pypolychord/__init__.py +++ b/pypolychord/__init__.py @@ -1,3 +1,3 @@ -__version__ = "1.20.2" +__version__ = "1.20.3" from pypolychord.settings import PolyChordSettings from pypolychord.polychord import run_polychord diff --git a/src/polychord/feedback.f90 b/src/polychord/feedback.f90 index 42d4fc0c..84a57589 100644 --- a/src/polychord/feedback.f90 +++ b/src/polychord/feedback.f90 @@ -28,7 +28,7 @@ subroutine write_opening_statement(settings) write(stdout_unit,'("")') write(stdout_unit,'("PolyChord: Next Generation Nested Sampling")') write(stdout_unit,'("copyright: Will Handley, Mike Hobson & Anthony Lasenby")') - write(stdout_unit,'(" version: 1.20.2")') + write(stdout_unit,'(" version: 1.20.3")') write(stdout_unit,'(" release: 1st June 2021")') write(stdout_unit,'(" email: wh260@mrao.cam.ac.uk")') write(stdout_unit,'("")') From 7132c2a9956d28107d148f01453473eb67edcd86 Mon Sep 17 00:00:00 2001 From: AdamOrmondroyd Date: Tue, 9 Jan 2024 13:51:59 +0000 Subject: [PATCH 6/6] revert changes to pyproject.toml --- pyproject.toml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0b9d43bf..4973c843 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,3 @@ [build-system] requires = ["setuptools", "wheel", "numpy"] build-backend = "setuptools.build_meta" - -[project] -name = "pypolychord" -dynamic = ["version"] - -[project.optional-dependencies] -cube_samples = ["fortranformat"] - -[tool.setuptools.dynamic] -version = {attr = "pypolychord.__version__"}