Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f56f2b5
Some initial work on implementing hdf5_definition
Oct 2, 2018
91aacab
Replacring exodus with hdf5
Oct 2, 2018
9c170ca
Updated cinch submodule
Oct 3, 2018
43a5ff8
CHnanged logic for EXODUS
Oct 3, 2018
4823548
More work on the hdf5_definition__
Oct 3, 2018
87f527c
Got flecsi-sp to compile with hdf5_definition
Oct 4, 2018
6d0016b
Working on the hdf5_definition for the MPAS
Oct 16, 2018
8a1883c
Added logic for reading connectivity information
Oct 17, 2018
e58996e
More work on connectivity information
Oct 17, 2018
6947d20
Type FIX for reading HDF5 file
Oct 17, 2018
8e336fc
Bugfx: in the input HDF5 file entitiy ordering starts from 1 where in…
Oct 22, 2018
d526bfb
Some code clean-up
Oct 24, 2018
2e18c45
C++ -> C api
Nov 29, 2018
4ff0905
add a simple unit test
Nov 29, 2018
4cf6c50
moving to MPAS naming
Nov 29, 2018
2c360ef
add sample MPAS mesh
Nov 29, 2018
85ccebe
Merge branch 'master' into hdf5-C
Nov 29, 2018
910ecd5
revert to cinch version from upstream
Nov 29, 2018
cc1c250
move MPAS mesh
Nov 30, 2018
0001e7b
rename + misc fixes
Nov 30, 2018
c77ab4d
change guard on MPAS unit test
Nov 30, 2018
51d8ebe
Merge remote-tracking branch 'origin/replication' into hdf5_definition
Dec 18, 2018
ff5ab1c
update build for burton backend selection
Dec 19, 2018
aefa752
submodule update for cinch
Dec 19, 2018
8c65ed5
fixing error with cinch version check
Dec 19, 2018
f341231
fixing compile-time error due to some changes to FLeCSI API
Dec 19, 2018
4a2b755
bump cinch to match upstream
Dec 20, 2018
c58d5e2
merge with upstream hdf5 branch
Dec 20, 2018
301da8a
CHanging region requirements for ghos to "na" when we have "wo" for e…
Dec 21, 2018
af8dea6
Merge branch 'hdf5_definition' into hdf5-C
Jan 10, 2019
3788ece
WIP refactor
Feb 8, 2019
687d092
first cut at templating mesh functions
Feb 11, 2019
b686019
fix build
Feb 11, 2019
934d4d4
simplify defs of instantiated mesh templ. funcs
Feb 12, 2019
dce4ca9
remove spurious flecsi registration
Feb 25, 2019
e9f14fa
Merge remote-tracking branch 'origin/master' into hdf5-C
Feb 25, 2019
2555456
Added missed endif()
Feb 25, 2019
11e2d7d
Fixing some compile-time errors after the merge
Feb 25, 2019
609709d
Removed io_utils.h form the CMakeLists.txt
Feb 25, 2019
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
2 changes: 1 addition & 1 deletion cinch
Submodule cinch updated 1 files
+2 −2 cmake/logging.cmake
37 changes: 17 additions & 20 deletions config/project.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ set(FLECSI_SP_TOOLS_DIR "${PROJECT_SOURCE_DIR}/tools")
set(FLECSI_SP_SHARE_DIR "${CMAKE_INSTALL_PREFIX}/share/FleCSI-SP")

# the default test init driver
set(FLECSI_SP_DEFAULT_TEST_INITIALIZATION_DRIVER
set(FLECSI_SP_DEFAULT_TEST_INITIALIZATION_DRIVER
${FLECSI_SP_TOOLS_DIR}/driver_initialization.cc)

#------------------------------------------------------------------------------#
Expand Down Expand Up @@ -76,10 +76,10 @@ if ( FLECSI_SP_RUNTIME_MODEL STREQUAL "mpi" )
elseif ( FLECSI_SP_RUNTIME_MODEL STREQUAL "legion" )
set( FLECSI_SP_UNIT_POLICY LEGION )
else()
MESSAGE( FATAL_ERROR
MESSAGE( FATAL_ERROR
"Unknown FLECSI_SP_RUNTIME_MODEL being used: ${FLECSI_SP_RUNTIME_MODEL}" )
endif()


#------------------------------------------------------------------------------#
# Ristra Library
Expand Down Expand Up @@ -107,7 +107,7 @@ endif()
# double or single precision
OPTION (FLECSI_SP_DOUBLE_PRECISION "Use double precision reals" ON)

if( FLECSI_SP_DOUBLE_PRECISION )
if( FLECSI_SP_DOUBLE_PRECISION )
message(STATUS "Note: Double precision build activated.")
SET (FLECSI_SP_TEST_TOLERANCE 1.0e-14 CACHE STRING "The testing tolerance")
else()
Expand All @@ -118,13 +118,13 @@ endif()
# size of integer ids to use
option( FLECSI_SP_USE_64BIT_IDS "Type of integer to use for ids" ON )

if( FLECSI_SP_USE_64BIT_IDS )
if( FLECSI_SP_USE_64BIT_IDS )
message(STATUS "Note: using 64 bit integer ids.")
else()
message(STATUS "Note: using 32 bit integer ids.")
endif()


#------------------------------------------------------------------------------#
# Boost is needed for program options
#------------------------------------------------------------------------------#
Expand Down Expand Up @@ -153,33 +153,30 @@ cinch_load_extras()

find_package(Legion)

if (Legion_FOUND)
if (Legion_FOUND)
include_directories(${Legion_INCLUDE_DIRS})
endif()

find_package(MPI)

if (MPI_FOUND)
if (MPI_FOUND)
set(MPI_LANGUAGE C CACHE STRING "" FORCE)
include_directories(${MPI_C_INCLUDE_PATH})
endif()


#------------------------------------------------------------------------------#
# Exodus II
# Burton Mesh backends
#------------------------------------------------------------------------------#

find_package(EXODUSII QUIET)

option(FLECSI_SP_ENABLE_EXODUS "Enable I/O with exodus." ${EXODUSII_FOUND})
find_package(EXODUSII REQUIRED)
include_directories(${EXODUSII_INCLUDE_DIRS})
list(APPEND FLECSI_SP_LIBRARIES ${EXODUSII_LIBRARIES})

if(FLECSI_SP_ENABLE_EXODUS AND NOT EXODUSII_FOUND)
message(FATAL_ERROR "Exodus requested, but not found")
endif()

if(FLECSI_SP_ENABLE_EXODUS)
include_directories(${EXODUSII_INCLUDE_DIRS})
list(APPEND FLECSI_SP_LIBRARIES ${EXODUSII_LIBRARIES})
endif()
# Note: If the CXX interface is ever needed, add COMPONENTS CXX here.
find_package(HDF5 REQUIRED)
include_directories(${HDF5_INCLUDE_DIRS})
list(APPEND FLECSI_SP_LIBRARIES ${HDF5_LIBRARIES})

#------------------------------------------------------------------------------#
# ParMETIS
Expand Down
Binary file added data/meshes/mpas/init.h5
Binary file not shown.
44 changes: 39 additions & 5 deletions flecsi-sp/burton/burton_specialization_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
#include <cinch/logging/cinchlog.h>
#include <flecsi-sp/burton/burton_specialization_init.h>
#include <flecsi-sp/burton/burton_specialization_arguments.h>
#include <ristra/utils/string_utils.h>

namespace flecsi {
namespace execution {



///////////////////////////////////////////////////////////////////////////////
//! \brief The specialization initialization driver.
///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -61,16 +64,34 @@ void specialization_tlt_init(int argc, char** argv)

//===========================================================================
// Partition mesh
//===========================================================================
//===========================================================================

clog(info) << "Partitioning mesh" << std::endl;

// need to put the filename into a statically sized character array
auto mesh_filename = flecsi_sp::utils::to_char_array( mesh_filename_string );

// io definition params
// using real_t = flecsi_sp::burton::burton_mesh_t::real_t;
// constexpr auto num_dims = flecsi_sp::burton::burton_mesh_t::num_dimensions;
// using exo_def_t = flecsi_sp::io::exodus_definition__<num_dims, real_t>;
// using mpas_def_t = flecsi_sp::io::mpas_definition_u<real_t>;

auto extension = ristra::utils::file_extension(mesh_filename_string);

// execute the mpi task to partition the mesh
flecsi_execute_mpi_task(partition_mesh, flecsi_sp::burton, mesh_filename,
max_entries);
if(extension == "exo" || extension == "g") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ipdemes @dmringo I'm looking at extending our runtime selection of type of mesh to parse, in particular looking towards X3D format meshes. Is having separate tasks for each format the approach you two have decided upon? I had stubbed out some code that pushed the if check down into the task (the singular partition_mesh task), but this involved casting the mesh definition object (e.g. exodus_definition_t or x3d_definition_t) to the common base class mesh_definition_u for some operations. That was part of the motivation of PR 553 in FleCSI

If we want to go the route of separate tasks for partitioning and initializing, that is fine. It cleans up some things, but does require, perhaps, a bit of code duplication. In general I'm against that sort of thing, but in this particular case I don't really have strong feelings either way.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmsquared : do you have your work in a branch somewhere? So I can have a look?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately not. But the changes to the partition_mesh task looked something like this:

  // mesh definitions
  using mesh_definition_t = flecsi::topology::mesh_definition_u<num_dims>;
  using exodus_definition_t = flecsi_sp::io::exodus_definition__<num_dims, real_t>;
  using x3d_definition_t = flecsi_sp::io::x3d_definition__<num_dims, real_t>;

  // load the mesh
  auto filename_string = filename.str();
  std::unique_ptr<mesh_definition_t> mesh_def;
  if (filename_string.find(".exo") != std::string::npos)
    mesh_def = std::make_unique<exodus_definition_t>(filename_string);
  else if (filename_string.find(".x3d") != std::string::npos)
    mesh_def = std::make_unique<x3d_definition_t>(filename_string);
  else
    clog_fatal("Burton specialization doesn't know how to read " <<
               filename_string);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmsquared I'm looking at this again, and liked your approach, but ran into problems resolving the write method on the mesh definition (called near the end of partition_mesh) since it's not part of the abstract mesh_definition_u interface. Did you cast to the concrete implementation to solve this? Unless there are plans to add that method to the interface in FleCSI, that makes it seem like a partition_mesh task templated on the IO backend would be preferred.

flecsi_execute_mpi_task(partition_exo_mesh, flecsi_sp::burton,
mesh_filename, max_entries);
}
else if(extension == "h5") {
flecsi_execute_mpi_task(partition_mpas_mesh, flecsi_sp::burton,
mesh_filename, max_entries);
}
else {
throw_runtime_error("unrecognized file extension: " << extension);
}

}

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -101,8 +122,21 @@ void specialization_spmd_init(int argc, char** argv)
// get a mesh handle and call the initialization task
auto mesh_handle = flecsi_get_client_handle(
flecsi_sp::burton::burton_mesh_t, meshes, mesh0);
flecsi_execute_task(initialize_mesh, flecsi_sp::burton, index,
mesh_handle, mesh_filename);

auto extension = ristra::utils::file_extension(mesh_filename_string);

// execute the mpi task to partition the mesh
if(extension == "exo" || extension == "g") {
flecsi_execute_task(initialize_exo_mesh, flecsi_sp::burton, index,
mesh_handle, mesh_filename);
}
else if(extension == "h5") {
flecsi_execute_task(initialize_mpas_mesh, flecsi_sp::burton, index,
mesh_handle, mesh_filename);
}
else {
throw_runtime_error("unrecognized file extension: " << extension);
}
}

} // namespace
Expand Down
Loading