Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take Version and PicsarVersion out of the WarpX class #4967

Open
wants to merge 7 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Source/Diagnostics/WarpXOpenPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "Utils/RelativeCellPosition.H"
#include "Utils/WarpXAlgorithmSelection.H"
#include "Utils/WarpXProfilerWrapper.H"
#include "Utils/WarpXGetVersion.H"
#include "WarpX.H"
#include "OpenPMDHelpFunction.H"

Expand Down Expand Up @@ -518,7 +519,7 @@ WarpXOpenPMDPlot::Init (openPMD::Access access, bool isBTD)
uint32_t const openPMD_ED_PIC = 1u;
m_Series->setOpenPMDextension( openPMD_ED_PIC );
// meta info
m_Series->setSoftware( "WarpX", WarpX::Version() );
m_Series->setSoftware( "WarpX", warpx::Version() );
}

void
Expand Down
5 changes: 3 additions & 2 deletions Source/Initialization/WarpXInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "Utils/WarpXConst.H"
#include "Utils/WarpXProfilerWrapper.H"
#include "Utils/WarpXUtil.H"
#include "Utils/WarpXGetVersion.H"
#include "Python/callbacks.H"

#include <ablastr/fields/MultiFabRegister.H>
Expand Down Expand Up @@ -514,10 +515,10 @@ WarpX::InitData ()
ablastr::parallelization::check_mpi_thread_level();

#ifdef WARPX_QED
Print() << "PICSAR (" << WarpX::PicsarVersion() << ")\n";
Print() << "PICSAR (" << warpx::PicsarVersion() << ")\n";
#endif

Print() << "WarpX (" << WarpX::Version() << ")\n";
Print() << "WarpX (" << warpx::Version() << ")\n";

Print() << utils::logo::get_logo();

Expand Down
2 changes: 1 addition & 1 deletion Source/Python/pyWarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ PYBIND11_MODULE(PYWARPX_MODULE_NAME, m) {
m.attr("__version__") = MACRO_STRINGIFY(PYWARPX_VERSION_INFO);
#else
// note: not necessarily PEP-440 compliant
m.attr("__version__") = WarpX::Version();
m.attr("__version__") = warpx::Version();
#endif

// authors
Expand Down
2 changes: 1 addition & 1 deletion Source/Utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ foreach(D IN LISTS WarpX_DIMS)
WarpXMovingWindow.cpp
WarpXTagging.cpp
WarpXUtil.cpp
WarpXVersion.cpp
WarpXGetVersion.cpp
)
endforeach()

Expand Down
2 changes: 1 addition & 1 deletion Source/Utils/Make.package
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CEXE_sources += WarpXMovingWindow.cpp
CEXE_sources += WarpXTagging.cpp
CEXE_sources += WarpXUtil.cpp
CEXE_sources += WarpXVersion.cpp
CEXE_sources += WarpXGetVersion.cpp
CEXE_sources += Interpolate.cpp
CEXE_sources += IntervalsParser.cpp
CEXE_sources += RelativeCellPosition.cpp
Expand Down
19 changes: 19 additions & 0 deletions Source/Utils/WarpXGetVersion.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Copyright 2025 Axel Huebl, Luca Fedeli
*
* This file is part of WarpX.
*
* License: BSD-3-Clause-LBNL
*/
#include <string>

#ifndef WARPX_GET_VERSION_H_
#define WARPX_GET_VERSION_H_

namespace warpx
{
[[nodiscard]] std::string Version () noexcept; //!< Version of WarpX executable

[[nodiscard]] std::string PicsarVersion () noexcept; //!< Version of PICSAR dependency
}

#endif //WARPX_GET_VERSION_H_
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/* Copyright 2022 Axel Huebl
/* Copyright 2025 Axel Huebl, Luca Fedeli
*
* This file is part of WarpX.
*
* License: BSD-3-Clause-LBNL
*/
#include "WarpX.H"
#include "Utils/WarpXVersion.H"

#include <string>
#include "Utils/WarpXGetVersion.H"

#include "Utils/WarpXVersion.H"

std::string
WarpX::Version ()
std::string warpx::Version () noexcept
{
std::string version;
#ifdef WARPX_GIT_VERSION
Expand All @@ -24,8 +22,7 @@ WarpX::Version ()
}
}

std::string
WarpX::PicsarVersion ()
std::string warpx::PicsarVersion () noexcept
{
std::string version;
#ifdef PICSAR_GIT_VERSION
Expand Down
3 changes: 0 additions & 3 deletions Source/WarpX.H
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ public:
/** Move operator */
WarpX& operator= ( WarpX && ) = delete;

static std::string Version (); //!< Version of WarpX executable
static std::string PicsarVersion (); //!< Version of PICSAR dependency

[[nodiscard]] int Verbose () const { return verbose; }

[[nodiscard]] const amrex::Array<FieldBoundaryType,AMREX_SPACEDIM>& GetFieldBoundaryLo () const
Expand Down
Loading