Skip to content

Commit

Permalink
Feature/aaroncblack/version update 5.3.0 (#18)
Browse files Browse the repository at this point in the history
* updates to 5.3.0.  See README and CHANGELOG for more info.
  • Loading branch information
aaroncblack authored Dec 4, 2023
1 parent 9ca7527 commit 643f42b
Show file tree
Hide file tree
Showing 36 changed files with 1,459 additions and 939 deletions.
4 changes: 0 additions & 4 deletions benchmarks/README

This file was deleted.

41 changes: 0 additions & 41 deletions benchmarks/generate_strong_scaling_runs_spp1.py

This file was deleted.

41 changes: 0 additions & 41 deletions benchmarks/generate_weak_scaling_runs_spp1.py

This file was deleted.

45 changes: 15 additions & 30 deletions build_and_run_umt.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/bin/sh -x
# This script will compile a basic RelWithDebInfo build of UMT. Additional CMake options can be added to the command line args of this script, and they will be picked up and added to the UMT CMake command at the bottom of this script.
# For a list of supported CMake options, run 'ccmake /path/to/umt/src'.
# Do not copy this script out of the UMT repo directory, it assumes it is located next to the UMT source files in order to work.

# If you have a UMT tarball, untar it. Otherwise, git clone it from github.
# git clone https://github.com/LLNL/UMT.git

Expand All @@ -11,31 +7,22 @@
# CXX = <path to C++ compiler>
# FC = <path to Fortran compiler>

# Alternatively, you can set the compilers to point to MPI compiler wrappers, if CMake has trouble finding your MPI installation location.
# Default to GNU
CC=gcc
CXX=g++
FC=gfortran

# Example using GNU
#CC=gcc
#CXX=g++
#FC=gfortran
FFLAGS=-fallow-argument-mismatch

# Example using Intel
# Intel example
# CC=icx
# CXX=icpx
# FC=ifx

# Example using MPI compiler wrappers
CC=mpicc
CXX=mpicxx
FC=mpif90

#If using CUDA, set this to point to your CUDA installation
#export CUDA_TOOLKIT_ROOT_DIR=/usr/tce/packages/cuda/cuda-11.8.0

# Desired installation path
INSTALL_PATH=${PWD}/umt_workspace/install

# Set common CMAKE args for Conduit and UMT.
CMAKE_COMMON_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_Fortran_COMPILER=${FC}"
# This script will compile a basic Release build of UMT. Additional CMake options can be added to the command line args of this script, and they will be picked up and added to the UMT CMake command at the bottom of this script.
# For a list of supported CMake options, run 'ccmake /path/to/umt/src'.
# Do not copy this script out of the UMT repo directory, it assumes it is located next to the UMT source files in order to work.

# Get directory this script is located in. This is assumed to be the UMT repo location.
SOURCE="${BASH_SOURCE[0]}"
Expand All @@ -46,28 +33,26 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
done
UMT_REPO_PATH="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"

# Create workspace for building umt and required library conduit
# Create workspace for building umt and required libraries conduit, metis, hypre, mfem.
INSTALL_PATH=${PWD}/umt_workspace/install
mkdir -p ${INSTALL_PATH}
echo Libraries will be installed to: ${INSTALL_PATH}

cd umt_workspace

# Git latest conduit source from github
git clone --recurse-submodules https://github.com/LLNL/conduit.git conduit
mkdir build_conduit
cd build_conduit
# Run CMake on Conduit, compile, and install.
cmake ${PWD}/../conduit/src ${CMAKE_COMMON_ARGS} -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_DOCS=OFF -DENABLE_FORTRAN=ON -DENABLE_MPI=ON -DENABLE_PYTHON=OFF -DENABLE_UTILS=OFF -DENABLE_RELAY_WEBSERVER=OFF
cmake ${PWD}/../conduit/src -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_Fortran_COMPILER=${FC} -DMPI_CXX_COMPILER=mpicxx -DMPI_Fortran_COMPILER=mpifort -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_DOCS=OFF -DENABLE_FORTRAN=ON -DENABLE_MPI=ON -DENABLE_PYTHON=OFF
gmake -j install
cd ..

mkdir build_umt
cd build_umt
# Run CMake on UMT, compile, and install.
cmake ${UMT_REPO_PATH}/src ${CMAKE_COMMON_ARGS} -DCONDUIT_ROOT=${INSTALL_PATH}
cmake ${UMT_REPO_PATH}/src -DCMAKE_Fortran_FLAGS=${FFLAGS} -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_Fortran_COMPILER=${FC} -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} -DCONDUIT_ROOT=${INSTALL_PATH} $1
gmake -j install
cd ..

# Test on 2D and 3D problem
srun -n 8 ${INSTALL_PATH}/bin/test_driver -c 10 -B -d 8,8,0 --benchmark_problem 2
srun -n 8 ${INSTALL_PATH}/bin/test_driver -c 10 -B -d 4,4,4 --benchmark_problem 2

# Test UMT on SSP1 unstructured 3d mesh problem on two mpi ranks. Refine the mesh via -r and -R arguments.
19 changes: 0 additions & 19 deletions host-configs/example.nvidia.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(PROJECT_NAME teton)
# Update version information in this file.

set(TETON_VERSION_MAJOR 5)
set(TETON_VERSION_MINOR 1)
set(TETON_VERSION_MINOR 3)
set(TETON_VERSION_PATCH 0)
include (cmake/Version.cmake)

Expand Down
8 changes: 4 additions & 4 deletions src/cmake/InitBuildTypeCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "")

elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -diag-enable=remark -traceback")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -diag-enable=remark -traceback")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -diag-enable=remark")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -diag-enable=remark")

elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI")

Expand Down Expand Up @@ -74,8 +74,8 @@ if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "")

elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "IntelLLVM")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -DNDEBUG")
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-O2 -g -warn all,noexternal,nointerfaces -diag-enable=remark -fpen=0-traceback")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -warn all,noexternal,nointerfaces -diag-enable=remark -check all -fpen=0 -traceback")
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-O2 -g -warn all,noexternal,nointerfaces -diag-enable=remark -fpe-all=0 -fpe0 -traceback")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -warn all,noexternal,nointerfaces -diag-enable=remark -check all -fpe-all=0 -fpe0 -traceback")

elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "PGI")

Expand Down
5 changes: 3 additions & 2 deletions src/teton/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ if (ENABLE_CALIPER)
endif()

if (ENABLE_BLUEPRINT_INTERFACE)
target_sources( teton INTERFACE include/TetonSources.hh )
target_sources( teton INTERFACE include/TetonBlueprint.hh )
target_sources( teton INTERFACE include/TetonSurfaceTallies.hh )
target_sources( teton INTERFACE include/TetonConduitInterface.hh )
Expand Down Expand Up @@ -95,6 +96,7 @@ if (ENABLE_BLUEPRINT_INTERFACE)
install( FILES "include/TetonConduitInterface.hh" DESTINATION include )
install( FILES "include/TetonBlueprint.hh" DESTINATION include )
install( FILES "include/TetonSurfaceTallies.hh" DESTINATION include )
install( FILES "include/TetonSources.hh" DESTINATION include )
endif()

install( FILES "${PROJECT_BINARY_DIR}/teton/include/TetonVersion.hh" DESTINATION include )
Expand All @@ -120,7 +122,6 @@ if(ENABLE_TESTS)
endif()

add_executable( test_driver
interface/TetonBlueprint.cc
driver/test_driver.cc )

if (ENABLE_FIND_MPI)
Expand All @@ -140,7 +141,7 @@ if(ENABLE_TESTS)

# Generally preferred to link with the Fortran compiler.
# Intel has trouble with this, fallback on using the C++ compiler to link.
if ( NOT CMAKE_Fortran_COMPILER_ID STREQUAL Intel AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL IntelLLVM AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL NVHPC)
if ( NOT CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL IntelLLVM)
set_target_properties(test_driver PROPERTIES LINKER_LANGUAGE Fortran)
endif ()

Expand Down
136 changes: 136 additions & 0 deletions src/teton/aux/AppendSourceToPsi.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#include "macros.h"

!***********************************************************************
! Last Update: 2023/01/10 BCY *
! *
! AppendSourceToPsi - Updates Psi from the previous time step to *
! to account for external fixed radiation sources. *
! *
! *
! We are basically adding q*c*dt to \psi_old to piggy-back off *
! the existing \psi_old/(c*dt) term in the sweep *
! *
! *
!***********************************************************************

subroutine AppendSourceToPsi(numSourceZones, &
numSourceAngles, &
numSourceGroups, &
sourceZoneList, &
sourceValues) BIND(C,NAME="teton_appendsourcetopsi")

USE ISO_C_BINDING
use kind_mod
use constant_mod
use radconstant_mod
use Size_mod
use QuadratureList_mod
use SetData_mod
use AngleSet_mod
use TimeStepControls_mod
use Geometry_mod
use QuadratureList_mod

implicit none

! Arguments

integer(C_INT), intent(in) :: numSourceZones
integer(C_INT), intent(in) :: numSourceAngles
integer(C_INT), intent(in) :: numSourceGroups

integer(C_INT), intent(in) :: sourceZoneList(numSourceZones)
! This must be in units of energy per time
! That is, sourceValues*c*dt/zoneVolume must have the same units as \psi
real(C_DOUBLE), intent(in) :: sourceValues(numSourceGroups, numSourceAngles, numSourceZones)

! Local

type(SetData), pointer :: Set
type(AngleSet), pointer :: ASet

integer :: angle
integer :: angle0
integer :: polarAngle
integer :: c
integer :: c0
integer :: g0
integer :: nCornerInZone
integer :: z
integer :: zone
integer :: NumGroupsInSet
integer :: NumAnglesInSet
integer :: setID
integer :: nSets
real(adqt) :: cdt
real(adqt) :: volumeZone
real(adqt) :: src_value(numSourceGroups)

integer :: angleSetID
integer :: numAngleSets
integer :: numAnglesInternal
integer :: numPolarAnglesInternal

! Constants

nSets = getNumberOfSets(Quad)
numAngleSets = getNumberOfAngleSets(Quad)
cdt = speed_light*getRadTimeStep(DtControls)

! Some checks on quadrature/angle sizes:
numAnglesInternal = 0
do angleSetID = 1,numAngleSets
ASet => getAngleSetData(Quad,angleSetID)
numAnglesInternal = numAnglesInternal + ASet%NumAngles
enddo
TETON_VERIFY(Quad%QuadPtr(1)%TypeName /= 'lobatto', 'Lobatto quadratures not supported for general sources yet.')
if (Quad%QuadPtr(1)%TypeName == 'levelsym') then
TETON_VERIFY(numSourceAngles == 1 .or. numSourceAngles == numAnglesInternal, "For level symmetric, numSourceAngles must be 1 or # of total angles.")
elseif (Quad%QuadPtr(1)%TypeName == 'product') then
numPolarAnglesInternal = Quad%QuadPtr(1)%nPolarAngles
TETON_VERIFY(numSourceAngles == 1 .or. numSourceAngles == numAnglesInternal .or. numSourceAngles == numPolarAnglesInternal, "numSourceAngles must be 1, # of polar angles, or # of total angles.")
endif

TETON_VERIFY(numSourceGroups == Size%ngr, "number of source groups must match ngr in Size")

SetLoop: do setID=1,nSets

Set => getSetData(Quad, setID)

NumGroupsInSet = Set% Groups
NumAnglesInSet = Set% NumAngles
g0 = Set% g0
angle0 = Set% angle0

AngleLoop: do angle=1,Set%NumAngles

SourceZoneLoop: do z = 1,numSourceZones

zone = sourceZoneList(z)
c0 = Geom%cOffset(zone)
nCornerInZone = Geom%numCorner(zone)
volumeZone = Geom%VolumeZone(zone)*getGeometryFactor(Size)

if (numSourceAngles == 1) then
src_value(1:NumGroupsInSet) = sourceValues(g0+1:g0+NumGroupsInSet, 1, z)*Size%wtiso/volumeZone
else if (numSourceAngles == numPolarAnglesInternal) then
polarAngle = Set%polarAngle(angle)
if (polarAngle < 1) then ! skip starting/finishing directions
cycle
endif
src_value(1:NumGroupsInSet) = sourceValues(g0+1:g0+NumGroupsInSet, polarAngle, z)*Size%wtiso*two/volumeZone
else !if (numSourceAngles == numAnglesInternal) then
src_value(1:NumGroupsInSet) = sourceValues(g0+1:g0+NumGroupsInSet, angle0+angle, z)/volumeZone
endif
src_value = cdt*src_value

do c=c0+1,c0+nCornerInZone
Set% Psi(:,c,angle) = Set% Psi(:,c,angle) + src_value(1:NumGroupsInSet)
enddo

enddo SourceZoneLoop
enddo AngleLoop
enddo SetLoop

return
end subroutine AppendSourceToPsi
Loading

0 comments on commit 643f42b

Please sign in to comment.