Skip to content

Commit

Permalink
Release 3.0.2 (#42)
Browse files Browse the repository at this point in the history
* Enable remap in RZ geometry.
* Add analysis application for particle remap.
* Improve numeric tolerances consistency between Tangram and Portage.
* Propagate recent fixes from R3D.
* Fix CI issues.
* Fix for IBM XL compiler.
* Fix slope limiter in multi-material cells.
  • Loading branch information
hobywan authored Apr 16, 2021
1 parent 238948e commit c2f717a
Show file tree
Hide file tree
Showing 64 changed files with 189,338 additions and 443 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ endif()
#------------------------------------------------------------------------------#
option(ENABLE_APP_TIMINGS "Enable timings" OFF)

#------------------------------------------------------------------------------#
# Enable PORTAGE_DEBUG flag
#------------------------------------------------------------------------------#
option(PORTAGE_DEBUG "Additional checks will be performed and info printed" OFF)
if (PORTAGE_DEBUG)
add_definitions(-DPORTAGE_DEBUG)
endif()

#----------------------------------------------------------------------------
# Find packages here and set CMake variables. Set link dependencies
# and compile definitions for portage_support target in
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ Thrust and TCMalloc in your build. The cmake command for this is:

INTEL_VERSION=18.0.5
MPI_VERSION=2.1.2
WONTON_VERSION=1.2.8
TANGRAM_VERSION=1.0.4
WONTON_VERSION="dev"
TANGRAM_VERSION="dev"

TPL_PREFIX=/usr/projects/ngc/private

Expand Down Expand Up @@ -249,8 +249,8 @@ export MODULEPATH=""

INTEL_VERSION=18.0.1
MPI_VERSION=2.1.2
WONTON_VERSION=1.2.8
TANGRAM_VERSION=1.0.4
WONTON_VERSION="dev"
TANGRAM_VERSION="dev"

TPL_PREFIX=/usr/local/codes/ngc/private

Expand Down
1 change: 1 addition & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ add_subdirectory(simple_mesh_app)
add_subdirectory(swarmapp)
add_subdirectory(msmapp)
add_subdirectory(momentumapp)
add_subdirectory(particle-analysis)

option(ENABLE_APP_TIMINGS "Enable timing in apps" OFF)

Expand Down
9 changes: 5 additions & 4 deletions app/momentumapp/MomentumRemap_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ void MomentumRemap_mm<D, Mesh_Wrapper, State_Wrapper>::InitMaterials(
double dst_tol = 100 * std::numeric_limits<double>::epsilon();
double vol_tol = 100 * std::numeric_limits<double>::epsilon();

get_material_moments<Mesh_Wrapper>(mesh, material_IDs,
circle_cen, circle_rad, nquadrant_samples,
cell_num_mats, cell_mat_ids, cell_mat_volfracs, cell_mat_centroids,
vol_tol, dst_tol, false);
get_material_moments<Mesh_Wrapper, Wonton::CartesianCoordinates>(
mesh,material_IDs,
circle_cen, circle_rad, nquadrant_samples,
cell_num_mats, cell_mat_ids, cell_mat_volfracs, cell_mat_centroids,
vol_tol, dst_tol, false);

// Count the number of local materials and gather their IDs
std::set<int> mat_ids;
Expand Down
4 changes: 2 additions & 2 deletions app/momentumapp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ message(STATUS "Adding momentum remap test")

# this app can be run in serial or mpi mode - set an environment
# variable so that either will work
if(ENABLE_MPI)
if(WONTON_ENABLE_MPI)
set(RUN_COMMAND "mpirun -np 1")
else()
set(RUN_COMMAND "")
endif(ENABLE_MPI)
endif(WONTON_ENABLE_MPI)

macro(ADD_MOMENTUM_TEST DIM TEST_NUM)
file(COPY momentumapp${DIM}_test${TEST_NUM}.sh
Expand Down
8 changes: 4 additions & 4 deletions app/momentumapp/test/errorsMM_gold0.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
0 1.11022e-15
1 6.66134e-16
2 0.0156782
0 6.66134e-16
1 1.48952e-15
2 0.0154166
3 1.62945
4 0.124934
5 0.112769
5 0.113188
8 changes: 4 additions & 4 deletions app/msmapp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ if (WONTON_ENABLE_MPI AND WONTON_ENABLE_Jali)
target_link_libraries(msmapp PRIVATE ${VTUNE_LIB})
endif(ENABLE_PROFILE)


#if (ENABLE_APP_TESTS)
# add_subdirectory(test)
#endif (ENABLE_APP_TESTS)
# add app tests if needed
if (ENABLE_APP_TESTS)
add_subdirectory(test)
endif (ENABLE_APP_TESTS)

endif ()
43 changes: 40 additions & 3 deletions app/msmapp/msmapp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ class runMSM {
//Check the answer
double totmerr=0., totserr=0., totint=0.;

//Create a diagnostics vector solely for the purpose of outputing to
//a file so we can run an app test
std::vector<double> diagnostics(6);

auto& cellvecout = std::static_pointer_cast<Wonton::StateVectorUni<>>(targetStateWrapper.get("celldata"))->get_data();
auto& cellvecout2 = std::static_pointer_cast<Wonton::StateVectorUni<>>(targetStateWrapper2.get("celldata"))->get_data();
auto& nodevecout = std::static_pointer_cast<Wonton::StateVectorUni<>>(targetStateWrapper.get("nodedata"))->get_data();
Expand Down Expand Up @@ -354,10 +358,14 @@ class runMSM {
totmerr = std::max(totmerr, std::fabs(merror));
totserr = std::max(totserr, std::fabs(serror));
}

std::printf("\n\nLinf NORM OF MM CELL ERROR: %le\n\n", totmerr);
std::printf("\n\nLinf NORM OF MSM CELL ERROR: %le\n\n", totserr);

//Update diagnostics
diagnostics[0]=totmerr;
diagnostics[1]=totserr;

if (controls_.print_detail == 1) {
if (Dimension==2) {
std::printf("Node Node-coord-1-2 Exact Mesh-Mesh Error Mesh-Swarm-Mesh Error\n");
Expand Down Expand Up @@ -391,6 +399,10 @@ class runMSM {

std::printf("\n\nLinf NORM OF MM NODE ERROR: %lf\n\n", totmerr);
std::printf("\n\nLinf NORM OF MSM NODE ERROR: %lf\n\n", totserr);

//Update diagnostics
diagnostics[2]=totmerr;
diagnostics[3]=totserr;
}

if (controls_.print_detail == 1) {
Expand Down Expand Up @@ -443,6 +455,12 @@ class runMSM {
}

std::printf("\n\nLinf NORM OF MSM CELL ERROR: %le\n\n", totserr);
if (oper8tor == Portage::Meshfree::oper::VolumeIntegral)
std::printf("\n\nTOTAL INTEGRAL: %le\n\n", totint);

//Update diagnostics
diagnostics[4]=totserr;

if (oper8tor == Portage::Meshfree::oper::VolumeIntegral)
std::printf("\n\nTOTAL INTEGRAL: %le\n\n", totint);

Expand Down Expand Up @@ -474,7 +492,19 @@ class runMSM {
}

std::printf("\n\nLinf NORM OF MSM NODE ERROR: %lf\n\n", totserr);

//Update diagnostics
diagnostics[5]=totserr;


//Print diagnostics to a file
std::ofstream file("diagnostics.dat");
file << std::scientific;
file.precision(13);
for (auto&& value : diagnostics) {
file << "-1 " << value <<std::endl;
}
file.close();
}

//Constructor
Expand Down Expand Up @@ -757,6 +787,9 @@ class runMSMJali {
if (oper8tor == Portage::Meshfree::oper::VolumeIntegral)
std::printf("\n\nTOTAL INTEGRAL: %le\n\n", totint);

if (oper8tor == Portage::Meshfree::oper::VolumeIntegral)
std::printf("\n\nTOTAL INTEGRAL: %le\n\n", totint);

if (controls_.print_detail == 1) {
if (Dimension==2) {
std::printf("Node Node-coord-1-2 Exact Mesh-Swarm-Mesh Error\n");
Expand Down Expand Up @@ -817,10 +850,10 @@ void print_usage() {
number source cells, int: 28 32 20\n\
number target cells, int: 26 30 23\n\
order, int, choice of 1 or 2: 2\n\
example, int, choice of -1...3: 3\n\
example, int, choice of -2...3: 3\n\
double, smoothing factor: 1.5\n\
double, boundary factor: 0.5\n\
string, part id field: a_name\n\
string, part id field: a_name (or NONE)\n\
double, part id tolerance: 0.125\n\
print detail, choice of 0 or 1: 1\n\
geometry: tensor \n\
Expand Down Expand Up @@ -1011,4 +1044,8 @@ int main(int argc, char** argv) {
} else {
runjob<3>(ctl, filename);
}

#ifdef WONTON_ENABLE_MPI
MPI_Finalize();
#endif
}
27 changes: 27 additions & 0 deletions app/msmapp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# This file is part of the Ristra portage project.
# Please see the license file at the root of this repository, or at:
# https://github.com/laristra/portage/blob/master/LICENSE
#

if (WONTON_ENABLE_MPI)

message(STATUS "Adding msmapp test")

# copy run script, input parameters, and gold files
file(GLOB data
"run.sh"
"example_input"
"gold/gold_diagnostics.dat")

file(COPY ${data} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

# add tests
add_test(NAME "test_msmapp" COMMAND ./run.sh)

set_property(TEST "test_msmapp"
PROPERTY ENVIRONMENT
ROOT_DIR=${CMAKE_BINARY_DIR}/app/msmapp
COMPARE=${CMAKE_BINARY_DIR}/app/apptest_cmp/apptest_cmp)

endif()
File renamed without changes.
6 changes: 6 additions & 0 deletions app/msmapp/test/gold/gold_diagnostics.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-1 4.3291634482639e+00
-1 2.7228090924636e-03
-1 7.3670204276142e+00
-1 2.5319967415767e-03
-1 2.7228090924636e-03
-1 2.5319967415767e-03
14 changes: 14 additions & 0 deletions app/msmapp/test/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# This file is part of the Ristra portage project.
# Please see the license file at the root of this repository, or at:
# https://github.com/laristra/portage/blob/master/LICENSE

set -e
set -x

epsilon=1.e-10

mpirun -np 1 ${ROOT_DIR}/msmapp "${ROOT_DIR}/test/example_input"

${COMPARE} "gold_diagnostics.dat" "diagnostics.dat" ${epsilon}
2 changes: 1 addition & 1 deletion app/part-by-part/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ------------------------------------------------------------------------------

# cannot build jali apps without MPI.
if (WONTON_ENABLE_MPI AND WONTON_ENABLE_MPI)
if (WONTON_ENABLE_Jali AND WONTON_ENABLE_MPI)

# create binary
add_executable(part-remap part-remap.cc)
Expand Down
18 changes: 18 additions & 0 deletions app/particle-analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ------------------------------------------------------------------------------
# This file is part of the Ristra portage project.
# Please see the license file at the root of this repository, or at:
# https://github.com/laristra/portage/blob/master/LICENSE
# ------------------------------------------------------------------------------

if (WONTON_ENABLE_MPI)
# create binary
add_executable(particle-analysis remap.cc)

# link to portage and its dependencies
target_link_libraries(particle-analysis PRIVATE portage)

# build tests as well
if (ENABLE_APP_TESTS)
add_subdirectory(test)
endif()
endif()
Loading

0 comments on commit c2f717a

Please sign in to comment.