Skip to content

Commit

Permalink
Upgrade ADIOS2 to 2.10.0-rc1 (#19228) (#19251)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinPrivitera committed Jan 18, 2024
1 parent ecc9b7c commit 2170b2a
Show file tree
Hide file tree
Showing 18 changed files with 358 additions and 259 deletions.
3 changes: 3 additions & 0 deletions data/adios2_v2.10.0-rc1_bp5_test_data.tar.xz
Git LFS file not shown
9 changes: 5 additions & 4 deletions src/CMake/FindADIOS2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# Justin Privitera, Wed Apr 27 17:46:52 PDT 2022
# Updated adios2 to 2.7.1 and added all the libraries it creates to the
# installation as well as additional logic for parallel building.
#
# Justin Privitera, Thu Jan 18 09:56:51 PST 2024
# adios2 libs have changed so I removed many of the old ones.
#
#****************************************************************************/

Expand All @@ -28,12 +31,10 @@
if(NOT WIN32)
SET_UP_THIRD_PARTY(ADIOS2 LIBS
adios2_c adios2_atl adios2_dill adios2_evpath adios2_ffs
adios2_taustubs adios2_cmenet adios2_cmzplenet adios2_cmepoll
adios2_core adios2_cmmulticast adios2_enet adios2_cmselect
adios2_cxx11 adios2_cmsockets adios2_cmudp)
adios2_perfstubs adios2_cxx11 adios2_core adios2_enet)
else()
SET_UP_THIRD_PARTY(ADIOS2 LIBS
adios2_c adios2_cxx11 adios2_core adios2_taustubs)
adios2_c adios2_cxx11 adios2_core adios2_perfstubs)
endif()

if(VISIT_PARALLEL)
Expand Down
22 changes: 20 additions & 2 deletions src/databases/ADIOS2/ADIOS2HelperFuncs.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include <ADIOS2HelperFuncs.h>
#include <visit-config.h>
#include <iostream>
#include <fstream>

std::string ADIOS2Helper_GetEngineName(const std::string &fname)
{
Expand All @@ -13,8 +16,23 @@ std::string ADIOS2Helper_GetEngineName(const std::string &fname)
if (fname.find(".bp/md.0") != std::string::npos)
return "BPFile";

if (ADIOS2Helper_FileIsDirectory(fname))
return "BP4";
if (ADIOS2Helper_FileIsDirectory(fname))
{
std::string engine_name;
std::string bp5_special_file = fname + VISIT_SLASH_STRING + "mmd.0";
std::ifstream ifs;
ifs.open(bp5_special_file.c_str());
if(!ifs.is_open())
{
engine_name = "BP4";
}
else
{
engine_name = "BP5";
}
ifs.close();
return engine_name;
}
else
return "BPFile";
}
Expand Down
7 changes: 6 additions & 1 deletion src/databases/ADIOS2/avtADIOS2BaseFileFormat.C
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,17 @@ avtADIOS2BaseFileFormat::CreateInterfaceADIOS2(
//
// Programmer: pugmire -- generated by xml2avt
// Creation: Thu Apr 12 08:39:47 PDT 2018
//
// Modifications:
// Justin Privitera, Thu Jan 18 09:56:51 PST 2024
// Removed adios2::DebugON since it is not present in newer versions of
// adios2.
//
// ****************************************************************************


avtADIOS2BaseFileFormat::avtADIOS2BaseFileFormat(const char *filename)
: adios(std::make_shared<adios2::ADIOS>(adios2::DebugON)),
: adios(std::make_shared<adios2::ADIOS>()),
numTimeSteps(1),
isClosed(false),
avtMTSDFileFormat(&filename, 1)
Expand Down
15 changes: 12 additions & 3 deletions src/databases/ADIOS2/avtADIOS2FileFormat.C
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
//
// Dave Pugmire, Thu Oct 30 11:59:40 EDT 2014
// Added a LAMMPS reader. Modified the flavor flag to an enum for clarity.
//
// Justin Privitera, Thu Jan 18 09:56:51 PST 2024
// Removed adios2::DebugON since it is not present in newer versions of
// adios2.
// Added special logic for BP5 files.
//
// ****************************************************************************

Expand All @@ -66,7 +71,7 @@ ADIOS2_CreateFileFormatInterface(const char * const *list, int nList, int nBlock
Flavor flavor = FAIL;
if (list != NULL || nList > 0)
{
std::shared_ptr<adios2::ADIOS> adios(std::make_shared<adios2::ADIOS>(adios2::DebugON));
std::shared_ptr<adios2::ADIOS> adios(std::make_shared<adios2::ADIOS>());
adios2::IO io(adios->DeclareIO("ReadBP"));
adios2::Engine reader;
std::map<std::string, adios2::Params> variables, attributes;
Expand All @@ -81,8 +86,12 @@ ADIOS2_CreateFileFormatInterface(const char * const *list, int nList, int nBlock

io.SetEngine(engineName);
//cout<<__FILE__<<" "<<__LINE__<<" Connect to stream "<<fileName<<" ..."
// <<" engine "<<engineName<<" ..."<<endl;
reader = io.Open(fileName, adios2::Mode::Read);
// <<" engine "<<engineName<<" ..."<<endl;
if (engineName == "BP5")
reader = io.Open(fileName, adios2::Mode::ReadRandomAccess);
else
reader = io.Open(fileName, adios2::Mode::Read);

if (stagingMode)
{
cout<<__FILE__<<" "<<__LINE__<<" Get first step "<<endl;
Expand Down
7 changes: 6 additions & 1 deletion src/databases/ADIOS2/avtADIOS2SSTFileFormat.C
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,16 @@ avtADIOS2SSTFileFormat::CreateInterface(const char *const *list,
//
// Programmer: pugmire -- generated by xml2avt
// Creation: Thu Apr 12 08:39:47 PDT 2018
//
// Modifications:
// Justin Privitera, Thu Jan 18 09:56:51 PST 2024
// Removed adios2::DebugON since it is not present in newer versions of
// adios2.
//
// ****************************************************************************

avtADIOS2SSTFileFormat::avtADIOS2SSTFileFormat(const char *filename)
: adios(std::make_shared<adios2::ADIOS>(adios2::DebugON)),
: adios(std::make_shared<adios2::ADIOS>()),
io(adios->DeclareIO("sstIO")),
numTimeSteps(1),
avtMTSDFileFormat(&filename, 1)
Expand Down
7 changes: 6 additions & 1 deletion src/databases/ADIOS2/avtGTCFileFormat.C
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,16 @@ avtGTCFileFormat::CreateInterfaceADIOS2(
//
// Programmer: pugmire -- generated by xml2avt
// Creation: Thu Apr 12 08:39:47 PDT 2018
//
// Modifications:
// Justin Privitera, Thu Jan 18 09:56:51 PST 2024
// Removed adios2::DebugON since it is not present in newer versions of
// adios2.
//
// ****************************************************************************

avtGTCFileFormat::avtGTCFileFormat(const char *filename)
: adios(std::make_shared<adios2::ADIOS>(adios2::DebugON)),
: adios(std::make_shared<adios2::ADIOS>()),
io(adios->DeclareIO("ReadBP")),
numTimeSteps(1),
avtMTSDFileFormat(&filename, 1),
Expand Down
9 changes: 7 additions & 2 deletions src/databases/ADIOS2/avtLAMMPSFileFormat.C
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using namespace std;
bool
avtLAMMPSFileFormat::Identify(const char *fname)
{
shared_ptr<adios2::ADIOS> adios = std::make_shared<adios2::ADIOS>(adios2::DebugON);
shared_ptr<adios2::ADIOS> adios = std::make_shared<adios2::ADIOS>();
adios2::IO io = adios2::IO(adios->DeclareIO("ReadBPLAMMPS"));
io.SetEngine("BP");
adios2::Engine reader = io.Open(fname, adios2::Mode::Read);
Expand Down Expand Up @@ -123,11 +123,16 @@ avtLAMMPSFileFormat::CreateInterfaceADIOS2(
//
// Programmer: pugmire -- generated by xml2avt
// Creation: Thu Apr 12 08:39:47 PDT 2018
//
// Modifications:
// Justin Privitera, Thu Jan 18 09:56:51 PST 2024
// Removed adios2::DebugON since it is not present in newer versions of
// adios2.
//
// ****************************************************************************

avtLAMMPSFileFormat::avtLAMMPSFileFormat(const char *filename)
: adios(std::make_shared<adios2::ADIOS>(adios2::DebugON)),
: adios(std::make_shared<adios2::ADIOS>()),
numTimeSteps(1),
currentTimestep(-1),
numAtoms(-1),
Expand Down
7 changes: 6 additions & 1 deletion src/databases/ADIOS2/avtMEUMMAPSFileFormat.C
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,16 @@ avtMEUMMAPSFileFormat::CreateInterfaceADIOS2(
//
// Programmer: dpn -- generated by xml2avt
// Creation: Tue Sep 11 13:23:54 PST 2018
//
// Modifications:
// Justin Privitera, Thu Jan 18 09:56:51 PST 2024
// Removed adios2::DebugON since it is not present in newer versions of
// adios2.
//
// ****************************************************************************

avtMEUMMAPSFileFormat::avtMEUMMAPSFileFormat(const char *filename)
: adios(std::make_shared<adios2::ADIOS>(adios2::DebugON)),
: adios(std::make_shared<adios2::ADIOS>()),
io(adios->DeclareIO("ReadBP")),
numTimeSteps(1),
avtMTMDFileFormat(filename)
Expand Down
20 changes: 14 additions & 6 deletions src/databases/ADIOS2/avtSpecFEMFileFormat.C
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,22 @@ avtSpecFEMFileFormat::CreateInterface(const char *const *list,
//
// Programmer: Dave Pugmire
// Creation: Wed Mar 17 15:29:24 EDT 2010
//
// Modifications:
// Justin Privitera, Thu Jan 18 09:56:51 PST 2024
// Removed adios2::DebugON since it is not present in newer versions of
// adios2.
//
// ****************************************************************************

avtSpecFEMFileFormat::avtSpecFEMFileFormat(const char *nm)
: avtMTMDFileFormat(nm),
#ifdef PARALLEL
adiosMesh(std::make_shared<adios2::ADIOS>((MPI_Comm)VISIT_MPI_COMM, adios2::DebugON)),
adiosData(std::make_shared<adios2::ADIOS>((MPI_Comm)VISIT_MPI_COMM, adios2::DebugON))
adiosMesh(std::make_shared<adios2::ADIOS>((MPI_Comm)VISIT_MPI_COMM)),
adiosData(std::make_shared<adios2::ADIOS>((MPI_Comm)VISIT_MPI_COMM))
#else
adiosMesh(std::make_shared<adios2::ADIOS>(adios2::DebugON)),
adiosData(std::make_shared<adios2::ADIOS>(adios2::DebugON))
adiosMesh(std::make_shared<adios2::ADIOS>()),
adiosData(std::make_shared<adios2::ADIOS>())
#endif
{
string filename(nm), meshNm, dataNm;
Expand Down Expand Up @@ -1720,6 +1725,9 @@ avtSpecFEMFileFormat::GenerateFileNames(const std::string &nm,
// Creation: April 9, 2014
//
// Modifications:
// Justin Privitera, Thu Jan 18 09:56:51 PST 2024
// Removed adios2::DebugON since it is not present in newer versions of
// adios2.
//
//****************************************************************************

Expand All @@ -1729,7 +1737,7 @@ avtSpecFEMFileFormat::IsMeshFile(const string &fname)
#if 0
{
#ifdef PARALLEL
adios2::ADIOS adios((MPI_Comm)VISIT_MPI_COMM, adios2::DebugON);
adios2::ADIOS adios((MPI_Comm)VISIT_MPI_COMM);
adios2::IO io = adios2::IO(adios.DeclareIO("ReadBP"));
io.SetEngine("BP");
adios2::Engine reader = io.Open(fname, adios2::Mode::Read);
Expand All @@ -1740,7 +1748,7 @@ avtSpecFEMFileFormat::IsMeshFile(const string &fname)
}
#endif

shared_ptr<adios2::ADIOS> adios = std::make_shared<adios2::ADIOS>(adios2::DebugON);
shared_ptr<adios2::ADIOS> adios = std::make_shared<adios2::ADIOS>();
adios2::IO io = adios2::IO(adios->DeclareIO("ReadBP"));
io.SetEngine("BP");
adios2::Engine reader = io.Open(fname, adios2::Mode::Read);
Expand Down
8 changes: 7 additions & 1 deletion src/resources/help/en_US/relnotes3.4.1.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@
<li>Upgraded MFEM library version to 4.6.0.</li>
<li>The <i>surface_normal</i> expression now accepts mesh types other than polydata, allowing it to be used more easily as an operator-created variable.</li>
<li>Added more keywords ("MFA", "2fa", "Autentication", and "OTP") that cause VisIt clients to open a second popup for a password.</li>
<li>GetPlotInformation() can now contain entries for multiple-curves when Query-over-time is performed on multiple variables. For example, if a pick-through-time was performed for variables 'u' and 'v', the curve for 'v' would be retrieved via 'GetPlotInformation()['Curves']['v']. Single variable results will still be retrieved via 'GetPlotInformation()['Curve'].
<li>Updated the ADIOS2 library version to 2.10.0-rc1, allowing BP5 files to be read by VisIt.</li>
<li>Removed the dependency on C-Blosc1.</li>
<li>Added a new dependency on C-Blosc2.</li>
<li>VisIt's Blueprint reader was enhanced so fields in Blueprint index files can supply a <i>display_name</i> hint that specifies the name used to expose the field in VisIt. This feature enables the index file to group related variables under sub-menus if the names in include slash characters.</li>
<li>VisIt's Blueprint reader was enhanced so fields that are low-order but are associated with a high-order mesh can be refined when the mesh is refined, as when the user applies a <i>MultiresControl</i> operator. This enables VisIt to correctly view such fields.</li>
<li>VisIt's CLI has a new <i>GetLastMessage()</i> function that returns the last message that VisIt issued, regardless of its type.</li>
<li>GetPlotInformation() can now contain entries for multiple-curves when Query-over-time is performed on multiple variables. For example, if a pick-through-time was performed for variables 'u' and 'v', the curve for 'v' would be retrieved via 'GetPlotInformation()['Curves']['v']. Single variable results will still be retrieved via 'GetPlotInformation()['Curve'].</li>
</ul>

<p>Click the following link to view the release notes for the previous version
Expand Down
78 changes: 52 additions & 26 deletions src/test/tests/databases/adios2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# Date: Mon May 9 18:05:05 PDT 2022
#
# Modifications:
# Justin Privitera, Thu Jan 18 09:40:00 PST 2024
# Added BP5 tests.
#
# ----------------------------------------------------------------------------
RequiredDatabasePlugin("ADIOS2")
Expand All @@ -20,6 +22,10 @@
adios2_test_dir = "adios2_v2.7.1_test_data"
cube_data = data_path(pjoin(adios2_test_dir,"interesting_cube00000000.bp"))

bp5_test_dir = "adios2_v2.10.0-rc1_bp5_test_data"
plt0 = data_path(pjoin(bp5_test_dir,"plt00000.bp"))
plt758 = data_path(pjoin(bp5_test_dir,"plt00758.bp"))

def set_3d_view():
v = View3DAttributes()
v.viewNormal = (0.844823, 0.290329, 0.449425)
Expand Down Expand Up @@ -47,31 +53,32 @@ def set_test_view(tag_name):
else:
ResetView()

def test(mesh_name, tag_name):
AddPlot("Mesh", mesh_name, 1, 1)
AddPlot("Pseudocolor", "/data/0/meshes/admbase_lapse_rl00/admbase_alp", 1, 1)
AddOperator("Clip", 1)
SetActivePlots(1)
SetActivePlots(1)
ClipAtts = ClipAttributes()
ClipAtts.quality = ClipAtts.Fast # Fast, Accurate
ClipAtts.funcType = ClipAtts.Plane # Plane, Sphere
ClipAtts.plane1Status = 1
ClipAtts.plane2Status = 0
ClipAtts.plane3Status = 0
ClipAtts.plane1Origin = (35, 35, 35)
ClipAtts.plane2Origin = (0, 0, 0)
ClipAtts.plane3Origin = (0, 0, 0)
ClipAtts.plane1Normal = (1, 0, 0)
ClipAtts.plane2Normal = (0, 1, 0)
ClipAtts.plane3Normal = (0, 0, 1)
ClipAtts.planeInverse = 0
ClipAtts.planeToolControlledClipPlane = ClipAtts.Plane1 # NONE, Plane1, Plane2, Plane3
ClipAtts.center = (0, 0, 0)
ClipAtts.radius = 1
ClipAtts.sphereInverse = 0
ClipAtts.crinkleClip = 0
SetOperatorOptions(ClipAtts, 0, 1)
def test(mesh_name, tag_name, var_name, mesh_plot = False):
if mesh_plot:
AddPlot("Mesh", mesh_name)
AddPlot("Pseudocolor", var_name)
if "3d" in tag_name:
AddOperator("Clip", 1)
SetActivePlots(1)
ClipAtts = ClipAttributes()
ClipAtts.quality = ClipAtts.Fast # Fast, Accurate
ClipAtts.funcType = ClipAtts.Plane # Plane, Sphere
ClipAtts.plane1Status = 1
ClipAtts.plane2Status = 0
ClipAtts.plane3Status = 0
ClipAtts.plane1Origin = (35, 35, 35)
ClipAtts.plane2Origin = (0, 0, 0)
ClipAtts.plane3Origin = (0, 0, 0)
ClipAtts.plane1Normal = (1, 0, 0)
ClipAtts.plane2Normal = (0, 1, 0)
ClipAtts.plane3Normal = (0, 0, 1)
ClipAtts.planeInverse = 0
ClipAtts.planeToolControlledClipPlane = ClipAtts.Plane1 # NONE, Plane1, Plane2, Plane3
ClipAtts.center = (0, 0, 0)
ClipAtts.radius = 1
ClipAtts.sphereInverse = 0
ClipAtts.crinkleClip = 0
SetOperatorOptions(ClipAtts, 0, 1)
DrawPlots()
set_test_view(tag_name)
Test(tag_name + "_" + mesh_name + "_mesh")
Expand All @@ -82,7 +89,26 @@ def test(mesh_name, tag_name):
OpenDatabase(cube_data, 0, "ADIOS2_1.0")
mesh_name = "mesh71x71x71"
tag_name = "adios2_3d_bp"
test(mesh_name, tag_name)
var_name = "/data/0/meshes/admbase_lapse_rl00/admbase_alp"
do_mesh_plot = True
test(mesh_name, tag_name, var_name, do_mesh_plot)
CloseDatabase(cube_data)

# requires adios2 to be built with c-blosc support
TestSection("Adios2 BP5 Tests")

OpenDatabase(plt0, 0, "ADIOS2_1.0")
mesh_name = "mesh512x512"
tag_name = "adios2_2d_bp5_1"
var_name = "/data/0/meshes/gasDensity"
test(mesh_name, tag_name, var_name)
CloseDatabase(plt0)

OpenDatabase(plt758, 0, "ADIOS2_1.0")
mesh_name = "mesh512x512"
tag_name = "adios2_2d_bp5_2"
var_name = "/data/758/meshes/gasDensity"
test(mesh_name, tag_name, var_name)
CloseDatabase(plt758)

Exit()

0 comments on commit 2170b2a

Please sign in to comment.