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

wip GPU opt #49

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
7faf1d1
Fixed the mass computation in MassBasedAvg LO solver.
vladotomov Nov 13, 2024
682c760
Avoid recomputation of the HO solition in MassBasedAvg.
vladotomov Nov 13, 2024
937768e
FOM output.
vladotomov Nov 13, 2024
17e523b
including extra directory in makefile
Nov 14, 2024
105b06d
initial commit of caliper
Nov 14, 2024
35f46f2
adding adiak import
Nov 15, 2024
b3672a8
fix?
Nov 15, 2024
2a1494e
adding instantiation
Nov 15, 2024
a8b8bf9
moving configmanager
Nov 15, 2024
9b31e0c
fixing calimanager
Nov 15, 2024
ab7d8c7
Add git ignore file
camierjs Nov 15, 2024
2c78a7d
cmake & tests
camierjs Nov 17, 2024
47b2d23
cleanup Test
camierjs Nov 17, 2024
e469175
Claenup
camierjs Nov 17, 2024
4144751
cmake renames
camierjs Nov 17, 2024
0b845c1
cmake cleanup
camierjs Nov 17, 2024
f0620b0
DGMassInverse
camierjs Nov 17, 2024
3951840
DGMassInverse update
camierjs Nov 17, 2024
0c8d965
MassesAndVolumesAtPosition
camierjs Nov 17, 2024
e696aab
CalcLOSolution debug device
camierjs Nov 17, 2024
35bb707
Keep asserts in RelWithDebInfo
camierjs Nov 17, 2024
80ca3f5
CalcFCTSolution kernel
camierjs Nov 17, 2024
d93662f
AdvectionOperator MKbf pa
camierjs Nov 17, 2024
4245af0
Avoid lumped assembly
camierjs Nov 18, 2024
fc84eb5
Single debug device test
camierjs Nov 18, 2024
eaee1ff
Device sync
camierjs Nov 22, 2024
3642115
Cuda 2D/3D runs
camierjs Nov 23, 2024
56efed7
Darwin cleanup
camierjs Nov 23, 2024
658ca4f
cleanup makefile
camierjs Nov 23, 2024
03e6cbb
Cleanup
camierjs Nov 23, 2024
16de0ea
Sync devlopment to gpu-opt
camierjs Nov 23, 2024
2d343b5
Meld toward gpu-fom
camierjs Nov 23, 2024
1aa2122
Delete txt files
camierjs Nov 23, 2024
d14bb3a
Remove debug file
camierjs Nov 23, 2024
7bc9bbf
Squashed meld toward gpu-fom
camierjs Nov 23, 2024
e79590d
Remove debug traces
camierjs Nov 23, 2024
ec791b0
Merge branch 'main' into gpu-opt
camierjs Nov 23, 2024
63672c8
Meld toward gpu-fom
camierjs Nov 23, 2024
c50a970
workflow
vladotomov Nov 25, 2024
47f56e6
fixed the 1D tests
vladotomov Nov 25, 2024
ef0678d
Automatic creation of well-partitioned meshes based on #tasks and #el…
vladotomov Dec 3, 2024
09fa1b7
Merge branch 'gpu-opt' of github.com:august-knox/Remhos into gpu-fom
Dec 13, 2024
38ac1ac
rermoving unnecessary adiak import
Dec 19, 2024
e27e71f
rmoving problematic adiak line
Dec 19, 2024
1ba87a0
removing adiak annotations
Dec 19, 2024
91b1cb5
removing other import
Dec 19, 2024
41d5217
updating remhos_tools
Dec 19, 2024
6b571d3
updating class as well
Dec 19, 2024
93085fa
undoing changes
Dec 19, 2024
773701f
fixed a HIP build error
vladotomov Jan 2, 2025
f102edb
Skipped unrelated computations
vladotomov Jan 3, 2025
0690282
make caliper optional
Jan 6, 2025
ca08bf8
making caliper optional
Jan 6, 2025
c895327
resolving conflict
Jan 6, 2025
ad75451
fixing conflict
Jan 6, 2025
63c6bca
adding back remhos_fct
Jan 6, 2025
47ec6d8
replacing remhos_fct.cpp
Jan 7, 2025
28c7b8c
upstream remhos_fct.cpp
Jan 7, 2025
4a89f5a
making caliper option clearer
Jan 7, 2025
61aeca0
changing use_caliper syntax
Jan 7, 2025
12b052b
returning to original method
Jan 7, 2025
7770136
Update remhos_fct.cpp
august-knox Jan 7, 2025
5725b01
Merge pull request #51 from august-knox/gpu-opt
vladotomov Jan 7, 2025
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 .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:

- name: Archive test results patch
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: baseline-patch
path: remhos/baseline.patch
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
remhos
*.dat
*.mesh
*.o
*.gf
*.svg
.DS_Store
/build/
/.cache/
/.vscode/
85 changes: 85 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
cmake_minimum_required(VERSION 3.18)

set(project remhos)
project(${project} LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# CXX flags *******************************************************************
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-fsanitize=address -O0)
add_link_options(-fsanitize=address)
endif()

# remove -DNDEBUG from default RelWithDebInfo flags
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING "" FORCE)

# Verbosity options ***********************************************************
set(CMAKE_VERBOSE_MAKEFILE OFF CACHE BOOL "" FORCE)
# set(CUDA_VERBOSE_BUILD OFF CACHE BOOL "" FORCE)

# Include paths ***************************************************************
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../mfem)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
include_directories(/usr/include/hypre /usr/include)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include_directories(/opt/homebrew/opt/fmt/include
/opt/homebrew/opt/openmpi/include
/opt/homebrew/opt/metis/include
/opt/homebrew/opt/hypre/include)
add_compile_definitions(MFEM_USE_CMAKE_TESTS)
else()
message(FATAL_ERROR "Unsupported system")
endif()

# Copy mesh files *************************************************************
file(GLOB SRC_MESH_FILES LIST_DIRECTORIES false data/*.mesh)
set(BUILD_DATA_DIR ${CMAKE_CURRENT_BINARY_DIR}/data)
add_custom_command(OUTPUT data_is_copied
COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_DATA_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SRC_MESH_FILES} ${BUILD_DATA_DIR}
COMMAND ${CMAKE_COMMAND} -E touch data_is_copied
COMMENT "Copying mesh files ...")
add_custom_target(copy_mesh_files DEPENDS data_is_copied)

# Library source files ********************************************************
add_library(Remhos STATIC remhos.cpp remhos_fct.cpp
remhos_ho.cpp remhos_lo.cpp
remhos_mono.cpp remhos_sync.cpp
remhos_tools.cpp)

# Testing options *************************************************************
enable_testing()
function(add_remhos_test name)
set(file ${name}.cpp)
set(target ${name})
list(LENGTH ARGN ARGN_COUNT)
if(ARGN_COUNT GREATER 0)
list(GET ARGN 0 extra)
string(APPEND name "_" ${extra})
string(APPEND target "_" ${extra})
endif()
message(STATUS "Adding target: ${target}")
add_executable(${target} ${file})
add_dependencies(${target} copy_mesh_files)
target_link_libraries(${target} Remhos -lmpi -lmfem -lhypre -lmetis -lfmt)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_directories(${target} PUBLIC /usr/lib/x86_64-linux-gnu)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_directories(${target} PUBLIC /opt/homebrew/opt/openmpi/lib
/opt/homebrew/opt/metis/lib
/opt/homebrew/opt/hypre/lib
/opt/homebrew/opt/fmt/lib)
endif()
target_link_directories(${target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../mfem)
message(STATUS "Adding test: ${target}_n1")
add_test(NAME ${target}_n1 COMMAND mpirun -n 1 ${target} ${extra})
message(STATUS "Adding test: ${target}_n3")
add_test(NAME ${target}_n3 COMMAND mpirun -n 3 ${target})
endfunction()

add_remhos_test(remhos_main)
add_remhos_test(remhos_tests)
20 changes: 17 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ TEST_MK = $(MFEM_DIR)/config/test.mk
MFEM_DIR1 := $(MFEM_DIR)
MFEM_DIR2 := $(realpath $(MFEM_DIR))

# Use Caliper annotations

ifdef CALIPER_DIR
CALIPER_DIR = $(spack location --install-dir caliper)
ADIAK_DIR = $(spack location --install-dir adiak)
CALIPER_FLAGS = -I${CALIPER_DIR}/include -DUSE_CALIPER
ADIAK_INCLUDE = -I${ADIAK_DIR}/include
ADIAK_LDFLAGS = -L${ADIAK_DIR}/lib -ladiak
CALIPER_LDFLAGS = -L${CALIPER_DIR}/lib64 -lcaliper
endif


# Use the compiler used by MFEM. Get the compiler and the options for compiling
# and linking from MFEM's config.mk. (Skip this if the target does not require
# building.)
Expand All @@ -73,15 +85,16 @@ ifeq (,$(filter help clean distclean style,$(MAKECMDGOALS)))
endif

CXX = $(MFEM_CXX)
CPPFLAGS = $(MFEM_CPPFLAGS)
CPPFLAGS = $(MFEM_CPPFLAGS) $(CALIPER_FLAGS) $(ADIAK_FLAGS)
CXXFLAGS = $(MFEM_CXXFLAGS)

# MFEM config does not define C compiler
CC = gcc
CFLAGS = -O3

# Optional link flags
LDFLAGS =
LDFLAGS = $(CALIPER_LDFLAGS) $(ADIAK_LDFLAGS)


OPTIM_OPTS = -O3
DEBUG_OPTS = -g -Wall -std=c++11
Expand All @@ -102,7 +115,8 @@ ifeq ($(REMHOS_DEBUG),YES)
endif

LIBS = $(strip $(REMHOS_LIBS) $(LDFLAGS))
CCC = $(strip $(CXX) $(REMHOS_FLAGS))
EXTRA_INC_DIR = $(or $(wildcard $(MFEM_DIR)/include/mfem),$(MFEM_DIR))
CCC = $(strip $(CXX) $(REMHOS_FLAGS) $(if $(EXTRA_INC_DIR),-I$(EXTRA_INC_DIR)))
Ccc = $(strip $(CC) $(CFLAGS) $(GL_OPTS))

SOURCE_FILES = remhos.cpp remhos_tools.cpp remhos_lo.cpp remhos_ho.cpp \
Expand Down
Loading