Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
29771ca
MPI Fortran push-pop count fix for extra MAIN subroutine
sputhala-amd Sep 25, 2025
f9116c7
Fetch dockerfile changes (include gfortran)
kcossett-amd Sep 30, 2025
7c3750c
Add MPI CTests (use gfortran)
kcossett-amd Sep 30, 2025
25349cb
Use different tests
kcossett-amd Sep 30, 2025
f616d2e
Fix a very silly and very blatant mistake
kcossett-amd Sep 30, 2025
62d2983
Add proper regex check
kcossett-amd Sep 30, 2025
be6a3ef
Skip Runtime-Instrument due to incompatibility with MPI
kcossett-amd Oct 1, 2025
58a8552
Remove nonblock
kcossett-amd Oct 2, 2025
06388fb
Remove STOP from poisson_mpi.f90
kcossett-amd Oct 7, 2025
75076c5
Merge branch 'develop' into users/kcossett-amd/fortran-mpi-tests
kcossett-amd Oct 7, 2025
a960270
Workflow test
kcossett-amd Oct 7, 2025
1ab97ad
Add new test for workflow. Fix codecov failure.
kcossett-amd Oct 8, 2025
f4ed548
Cleanup
kcossett-amd Oct 14, 2025
8e9ad37
Merge branch 'develop' into users/kcossett-amd/fortran-mpi-tests
kcossett-amd Oct 22, 2025
188d9f7
Removed --main-function arg and set message to WARNING
kcossett-amd Oct 22, 2025
f6efbc5
Fix typo
kcossett-amd Oct 22, 2025
76a0993
Merge branch 'develop' into users/kcossett-amd/fortran-mpi-tests
kcossett-amd Oct 29, 2025
4954ca5
Merge branch 'develop' into users/kcossett-amd/fortran-mpi-tests
kcossett-amd Oct 30, 2025
591352a
Remove 20.04 check from Ubuntu dockerfile
kcossett-amd Oct 30, 2025
d0453bc
Merge branch 'develop' into users/kcossett-amd/fortran-mpi-tests
kcossett-amd Nov 26, 2025
bfdfdfe
Apply suggestions from code review
kcossett-amd Nov 26, 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 projects/rocprofiler-systems/docker/Dockerfile.opensuse
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN zypper --non-interactive update -y && \
zypper --non-interactive dist-upgrade -y && \
zypper --non-interactive install -y -t pattern devel_basis && \
zypper --non-interactive install -y binutils-gold chrpath cmake curl dpkg-devel \
gcc-c++ git gmock gtest iproute2 libdrm-devel libnuma-devel ninja \
gcc-c++ gcc-fortran git gmock gtest iproute2 libdrm-devel libnuma-devel ninja \
nlohmann_json-devel openmpi3-devel python3-pip rpm-build \
sqlite3-devel wget && \
python3 -m pip install 'cmake==3.21'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN zypper --non-interactive update -y && \
zypper --non-interactive dist-upgrade -y && \
zypper --non-interactive install -y -t pattern devel_basis && \
zypper --non-interactive install -y binutils-gold chrpath cmake curl dpkg-devel \
gcc-c++ git gmock gtest iproute2 libnuma-devel ninja nlohmann_json-devel \
gcc-c++ gcc-fortran git gmock gtest iproute2 libnuma-devel ninja nlohmann_json-devel \
openmpi3-devel papi-devel python3-devel python3-pip \
rpm-build sqlite3-devel vim wget && \
zypper --non-interactive clean --all && \
Expand Down
5 changes: 4 additions & 1 deletion projects/rocprofiler-systems/docker/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ RUN apt-get update && \
python3 -m pip install 'cmake==3.21'; \
else \
python3 -m pip install --break-system-packages 'cmake==3.21' perfetto; \
fi
fi; \
if [ "${OS_VERSION}" == "20.04" ]; then \
apt-get install -y gfortran; \
fi;

RUN ROCM_MAJOR=$(echo "${ROCM_VERSION}" | sed 's/\./ /g' | awk '{print $1}') && \
ROCM_MINOR=$(echo "${ROCM_VERSION}" | sed 's/\./ /g' | awk '{print $2}') && \
Expand Down
5 changes: 4 additions & 1 deletion projects/rocprofiler-systems/docker/Dockerfile.ubuntu.ci
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ RUN apt-get update && \
gzip iproute2 libgmock-dev libgtest-dev libiberty-dev libpapi-dev libpfm4-dev \
libsqlite3-dev libtool locales lsb-release m4 ninja-build nlohmann-json3-dev \
python3-pip software-properties-common texinfo unzip wget vim zip zlib1g-dev && \
apt-get autoclean
apt-get autoclean && \
if [ "${OS_VERSION}" == "20.04" ]; then \
apt-get install -y gfortran; \
fi;

RUN OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"') && \
OS_ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"') && \
Expand Down
61 changes: 61 additions & 0 deletions projects/rocprofiler-systems/examples/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR)

project(rocprofiler-systems-mpi-examples LANGUAGES C CXX)

find_program(GFORTRAN_EXECUTABLE NAMES gfortran)
if(GFORTRAN_EXECUTABLE)
enable_language(Fortran)
set(ENABLE_FORTRAN_MPI_CTESTS
TRUE
CACHE BOOL
"Internal variable used by rocprofiler-systems"
)
execute_process(
COMMAND ${GFORTRAN_EXECUTABLE} --version
OUTPUT_VARIABLE GFORTRAN_VERSION_OUTPUT
RESULT_VARIABLE GFORTRAN_VERSION_RESULT
ERROR_VARIABLE GFORTRAN_VERSION_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(GFORTRAN_VERSION_RESULT EQUAL 0)
string(
REGEX MATCH
"GNU Fortran \\([^)]*\\) ([0-9]+\\.[0-9]+\\.[0-9]+)"
GFORTRAN_VERSION_MATCH
"${GFORTRAN_VERSION_OUTPUT}"
)
set(GFORTRAN_VERSION ${CMAKE_MATCH_1})
rocprofiler_systems_message(STATUS "Detected gfortran version: ${GFORTRAN_VERSION}")
else()
rocprofiler_systems_message(FATAL_ERROR "Failed to get gfortran version: ${GFORTRAN_EXECUTABLE}")
endif()
else()
set(ENABLE_FORTRAN_MPI_CTESTS
FALSE
CACHE BOOL
"Internal variable used by rocprofiler-systems"
)
rocprofiler_systems_message(WARNING "gfortran was not found, disabling fortran MPI tests...")
endif()

if(ROCPROFSYS_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)

Expand Down Expand Up @@ -62,6 +98,24 @@ target_link_libraries(mpi-send-recv PRIVATE mpi-c-interface-library)
add_executable(mpi-allreduce allreduce.c)
target_link_libraries(mpi-allreduce PRIVATE mpi-c-interface-library m)

if(ENABLE_FORTRAN_MPI_CTESTS)
if(NOT MPI_Fortran_FOUND)
rocprofiler_systems_message(FATAL_ERROR "MPI Fortran support not found")
endif()
add_library(mpi-fortran-interface-library INTERFACE)
target_link_libraries(
mpi-fortran-interface-library
INTERFACE
Threads::Threads
MPI::MPI_Fortran
$<TARGET_NAME_IF_EXISTS:rocprofiler-systems::rocprofiler-systems-compile-options>
)

# Also tests the case where Fortran Main has FuncReturnStatus == NORETURN
add_executable(mpi-fortran-intervals intervals_mpi.f90)
target_link_libraries(mpi-fortran-intervals PRIVATE mpi-fortran-interface-library)
endif()

set(CMAKE_BUILD_TYPE "Release")

add_library(mpi-cxx-interface-library INTERFACE)
Expand Down Expand Up @@ -89,4 +143,11 @@ if(ROCPROFSYS_INSTALL_EXAMPLES)
DESTINATION bin
COMPONENT rocprofiler-systems-examples
)
if(ENABLE_FORTRAN_MPI_CTESTS)
install(
TARGETS mpi-fortran-intervals
DESTINATION bin
COMPONENT rocprofiler-systems-examples
)
endif()
endif()
Loading
Loading