Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/biagas/fix_python_testing_windows_main
Browse files Browse the repository at this point in the history
  • Loading branch information
biagas authored Sep 4, 2024
2 parents 1c52660 + 9af504e commit 69881a3
Show file tree
Hide file tree
Showing 42 changed files with 576 additions and 645 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Basic

on:
push:
branches: ["mcm86-30jul24-gh-actions-ci"]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install HDF5
run: |
wget -q https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.4/bin/unix/hdf5-1.14.4-3-ubuntu-2204_gcc.tar.gz
mkdir hdf5-1.14.4-3
tar -xf hdf5-1.14.4-3-ubuntu-2204_gcc.tar.gz
tar -xf hdf5/HDF5-1.14.4.3-Linux.tar.gz --strip-components=4 -C hdf5-1.14.4-3
rm -rf hdf5
- name: Build Silo
run: |
export PATH="$PWD/hdf5-1.14.4-3/bin:$PATH"
mkdir build
cd build
env LDFLAGS=-Wl,-rpath,`pwd`/../hdf5-1.14.4-3/lib FFLAGS=-fallow-argument-mismatch FCFLAGS=-fallow-argument-mismatch ../configure --with-hdf5=`pwd`/../hdf5-1.14.4-3/include,`pwd`/../hdf5-1.14.4-3/lib --enable-pythonmodule --enable-json --prefix=`pwd`/myinstall
make -j 8 install
- name: Check Silo
run: |
export PATH="$PWD/hdf5-1.14.4-3/bin:$PATH"
cd build
make -j 8 check
2 changes: 1 addition & 1 deletion CMake/SiloFindHDF5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ if(HDF5_FOUND)

add_custom_command(TARGET copy_deps POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${HDF5_DLL} ${Silo_BINARY_DIR}/bin/$<CONFIG>)
${HDF5_DLL} ${Silo_BINARY_DIR}/bin/$<$<BOOL:${is_multi_config}>:$<CONFIG>>/)
endif()
endif()

Expand Down
17 changes: 12 additions & 5 deletions CMake/SiloFindPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,25 @@
###


if(DEFINED SILO_PYTHON_DIR)
if(SILO_PYTHON_DIR)
# help CMake find the specified python
set(Python_ROOT ${SILO_PYTHON_DIR})
set(Python_ROOT_DIR ${SILO_PYTHON_DIR})

# prefer python3
if(EXISTS ${SILO_PYTHON_DIR}/bin/python3)
set(Python_EXECUTABLE ${SILO_PYTHON_DIR}/bin/python3)
elseif(EXISTS ${SILO_PYTHON_DIR}/bin/python)
set(Python_EXECUTABLE ${SILO_PYTHON_DIR}/bin/python)
endif()
endif()

find_package(Python COMPONENTS Interpreter Development)

if(Python_FOUND)
# Need to ensure these vars are available by testing, so make
# them live in PARENT_SCOPE.
set(Python_EXECUTABLE ${Python_EXECUTABLE} PARENT_SCOPE)
if(WIN32)
# Need to ensure these vars are available by testing, so make
# them live in PARENT_SCOPE.
set(Python_EXECUTABLE ${Python_EXECUTABLE} PARENT_SCOPE)
if(TARGET Python::Module)
get_target_property(PYTHON_DLL Python::Module IMPORTED_LOCATION)
if(PYTHON_DLL)
Expand Down
30 changes: 15 additions & 15 deletions CMake/SiloFindQt5.cmake → CMake/SiloFindQt6.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@
##############################################################################

###
# Uses find_package to find the Qt5 library
# If SILO_QT5_DIR is defined, uses it to tell CMake where to look.
# Uses find_package to find the Qt6 library
# If SILO_QT6_DIR is defined, uses it to tell CMake where to look.
###


if(DEFINED SILO_QT5_DIR AND EXISTS ${SILO_QT5_DIR})
if(DEFINED SILO_QT6_DIR AND EXISTS ${SILO_QT6_DIR})
# set the variable needed for CMake to find this version of Qt
set(Qt5_DIR ${SILO_QT5_DIR})
set(Qt6_DIR ${SILO_QT6_DIR})
endif()

find_package(Qt5 COMPONENTS Core Gui Widgets CONFIG)
find_package(Qt6 COMPONENTS Core Gui Widgets CONFIG)

if(NOT Qt5_FOUND)
message(WARNING "An explicit request for silex was made and it requires Qt, but Qt could not be found. You may want to try setting SILO_QT5_DIR")
if(NOT Qt6_FOUND)
message(WARNING "An explicit request for silex was made and it requires Qt, but Qt could not be found. You may want to try setting SILO_QT6_DIR")
endif()


Expand All @@ -81,24 +81,24 @@ endif()
##
# Windows
##
if(Qt5_FOUND AND WIN32)
if(Qt6_FOUND AND WIN32)
# the windeployqt target will be executed as a POST build step for SILEX
if(TARGET Qt5::qmake AND NOT TARGET Qt5::windeployqt)
get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION)
if(TARGET Qt6::qmake AND NOT TARGET Qt6::windeployqt)
get_target_property(_qt6_qmake_location Qt6::qmake IMPORTED_LOCATION)

execute_process(
COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX
COMMAND "${_qt6_qmake_location}" -query QT_INSTALL_PREFIX
RESULT_VARIABLE return_code
OUTPUT_VARIABLE qt5_install_prefix
OUTPUT_VARIABLE qt6_install_prefix
OUTPUT_STRIP_TRAILING_WHITESPACE
)

set(imported_location "${qt5_install_prefix}/bin/windeployqt.exe")
set(imported_location "${qt6_install_prefix}/bin/windeployqt.exe")

if(EXISTS ${imported_location})
add_executable(Qt5::windeployqt IMPORTED)
add_executable(Qt6::windeployqt IMPORTED)

set_target_properties(Qt5::windeployqt PROPERTIES
set_target_properties(Qt6::windeployqt PROPERTIES
IMPORTED_LOCATION ${imported_location}
)
endif()
Expand Down
5 changes: 3 additions & 2 deletions CMake/SiloFindSzip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@ if(SZIP_FOUND)
set(HAVE_LIBSZ 1)
if(WIN32)
get_target_property(SZIP_DLL szip IMPORTED_LOCATION_RELEASE )
if(SILO_ENABLE_SILEX OR SILEX_ENABLE_BROWSER)

if(SILO_ENABLE_SILEX OR SILO_ENABLE_BROWSER)
install(FILES ${SZIP_DLL} DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ)

add_custom_command(TARGET copy_deps POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SZIP_DLL} ${Silo_BINARY_DIR}/bin/$<CONFIG>)
${SZIP_DLL} ${Silo_BINARY_DIR}/bin/$<$<BOOL:${is_multi_config}>:$<CONFIG>>/)
endif()
endif()
else()
Expand Down
7 changes: 4 additions & 3 deletions CMake/SiloFindZlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

if(DEFINED SILO_ZLIB_DIR AND EXISTS ${SILO_ZLIB_DIR}/zlib-config.cmake)
# this works for zlib with CMake
find_package(ZLIB PATHS ${SILO_ZLIB_DIR} CONFIG)
find_package(ZLIB PATHS ${SILO_ZLIB_DIR} CONFIG NO_DEFAULT_PATH)
else()
if(DEFINED SILO_ZLIB_DIR AND EXISTS ${SILO_ZLIB_DIR})
# help CMake find the specified zlib
Expand All @@ -76,15 +76,16 @@ if(ZLIB_FOUND)
set(HAVE_ZLIB_H 1)
if(WIN32)
get_target_property(ZLIB_DLL zlib IMPORTED_LOCATION_RELEASE)
if(SILO_ENABLE_SILEX OR SILEX_ENABLE_BROWSER)

if(SILO_ENABLE_SILEX OR SILO_ENABLE_BROWSER)
install(FILES ${ZLIB_DLL} DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ)

add_custom_command(TARGET copy_deps POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ZLIB_DLL} ${Silo_BINARY_DIR}/bin/$<CONFIG>)
${ZLIB_DLL} ${Silo_BINARY_DIR}/bin/$<$<BOOL:${is_multi_config}>:$<CONFIG>>/)
endif()
endif()
else()
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,11 @@ check_symbol_exists(stat64 "sys/stat.h" HAVE_STAT64)
check_symbol_exists(stat "sys/stat.h" HAVE_STAT)

if (HAVE_STAT64)
add_definitions(-DHAVE_STAT64)
add_definitions(-DHAVE_STAT64)
endif()

if (HAVE_STAT)
add_definitions(-DHAVE_STAT)
add_definitions(-DHAVE_STAT)
endif()

###-----------------------------------------------------------------------------
Expand Down
9 changes: 3 additions & 6 deletions config-site/steppenwolf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@
###
# config-site for STEPPENWOLF, a Windows system.
###
message("steppenwolf.cmake being processed")

###
# Helpers for TP lib location
###
set(TP_DIR C:/A_Visit/ForRegression/visit-deps/windowsbuild/MSVC2022)
Expand All @@ -78,9 +76,9 @@ silo_option_default(VAR SILO_HDF5_SZIP_DIR VALUE ${TP_DIR}/szip/2.1.1/cmake)
silo_option_default(VAR SILO_ZLIB_DIR VALUE ${TP_DIR}/zlib/1.2.13/cmake)

##
# QT5 (must be the location of Qt5Config.cmake)
# QT6 (must be the location of Qt6Config.cmake)
##
#silo_option_default(VAR SILO_QT5_DIR VALUE ${TP_DIR}/Qt/5.14.2/lib/cmake/Qt5)
silo_option_default(VAR SILO_QT6_DIR VALUE ${TP_DIR}/Qt/6.4.2/lib/cmake/Qt6)

##
# python
Expand All @@ -97,6 +95,5 @@ silo_option_default(VAR SILO_ENABLE_FORTRAN VALUE OFF TYPE BOOL)
silo_option_default(VAR SILO_ENABLE_PYTHON_MODULE VALUE ON TYPE BOOL)

# enable tests
#silo_option_default(VAR SILO_ENABLE_TESTS VALUE ON TYPE BOOL)

silo_option_default(VAR SILO_ENABLE_TESTS VALUE ON TYPE BOOL)

10 changes: 5 additions & 5 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ docutils==0.17.1
# myst-parser
# sphinx
# sphinx-rtd-theme
idna==3.4
idna==3.7
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==6.8.0
# via sphinx
jinja2==3.1.2
jinja2==3.1.4
# via
# myst-parser
# sphinx
Expand All @@ -47,7 +47,7 @@ pytz==2023.3.post1
# via babel
pyyaml==6.0.1
# via myst-parser
requests==2.31.0
requests==2.32.2
# via sphinx
snowballstemmer==2.2.0
# via sphinx
Expand All @@ -70,7 +70,7 @@ sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
urllib3==2.0.7
urllib3==2.2.2
# via requests
zipp==3.17.0
zipp==3.19.1
# via importlib-metadata
62 changes: 31 additions & 31 deletions src/hdf5_drv/H5FDsilo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1647,42 +1647,42 @@ H5FD_silo_close(H5FD_t *_file)
hsize_t tot_raw_count, tot_raw_bytes, tot_md_count, tot_md_bytes;
FILE* logf = fopen(file->log_name, "w");
fprintf(logf, "======== Interactions between the VFD and the filesystem ========\n");
fprintf(logf, "block size = %llu\n", file->block_size);
fprintf(logf, "block size = %llu\n", (long long unsigned) file->block_size);
fprintf(logf, "block count = %d\n", file->max_blocks);
fprintf(logf, "\n");
fprintf(logf, "max block id = %llu\n", file->stats.max_block_id);
fprintf(logf, "max blocks in mem = %llu\n", file->stats.max_blocks_in_mem);
fprintf(logf, "max block id = %llu\n", (long long unsigned) file->stats.max_block_id);
fprintf(logf, "max blocks in mem = %llu\n", (long long unsigned) file->stats.max_blocks_in_mem);
fprintf(logf, "\n");
fprintf(logf, "total seeks = %llu\n", file->stats.total_seeks);
fprintf(logf, "total seeks = %llu\n", (long long unsigned) file->stats.total_seeks);
fprintf(logf, "\n");
fprintf(logf, "number of multi-block writes = %llu\n", file->stats.num_multiblock_writes);
fprintf(logf, "number of multi-block reads = %llu\n", file->stats.num_multiblock_reads);
fprintf(logf, "number of multi-block writes = %llu\n", (long long unsigned) file->stats.num_multiblock_writes);
fprintf(logf, "number of multi-block reads = %llu\n", (long long unsigned) file->stats.num_multiblock_reads);
fprintf(logf, "\n");
fprintf(logf, "number of blocks majority md = %llu\n", file->stats.num_blocks_majority_md);
fprintf(logf, "number of blocks majority raw = %llu\n", file->stats.num_blocks_majority_raw);
fprintf(logf, "number of blocks majority md = %llu\n", (long long unsigned) file->stats.num_blocks_majority_md);
fprintf(logf, "number of blocks majority raw = %llu\n", (long long unsigned) file->stats.num_blocks_majority_raw);
fprintf(logf, "\n");
fprintf(logf, "number of writes = %llu\n", file->stats.total_write_count);
fprintf(logf, "number of bytes written = %llu\n", file->stats.total_write_bytes);
fprintf(logf, "number of writes = %llu\n", (long long unsigned) file->stats.total_write_count);
fprintf(logf, "number of bytes written = %llu\n", (long long unsigned) file->stats.total_write_bytes);
fprintf(logf, "\n");
fprintf(logf, "number of times a raw block was written = %llu\n", file->stats.total_block_raw_writes);
fprintf(logf, "number of times a raw block was written more than once = %llu\n", file->stats.total_block_raw_re_writes);
fprintf(logf, "number of times a raw block was written = %llu\n", (long long unsigned) file->stats.total_block_raw_writes);
fprintf(logf, "number of times a raw block was written more than once = %llu\n", (long long unsigned) file->stats.total_block_raw_re_writes);
fprintf(logf, "\n");
fprintf(logf, "number of times an md block was written = %llu\n", file->stats.total_block_md_writes);
fprintf(logf, "number of times an md block was written more than once = %llu\n", file->stats.total_block_md_re_writes);
fprintf(logf, "number of times an md block was written = %llu\n", (long long unsigned) file->stats.total_block_md_writes);
fprintf(logf, "number of times an md block was written more than once = %llu\n", (long long unsigned) file->stats.total_block_md_re_writes);
fprintf(logf, "\n");
fprintf(logf, "number of reads = %llu\n", file->stats.total_read_count);
fprintf(logf, "number of bytes read = %llu\n", file->stats.total_read_bytes);
fprintf(logf, "number of reads = %llu\n", (long long unsigned) file->stats.total_read_count);
fprintf(logf, "number of bytes read = %llu\n", (long long unsigned) file->stats.total_read_bytes);
fprintf(logf, "\n");
fprintf(logf, "number of times a block was read = %llu\n", file->stats.total_block_reads);
fprintf(logf, "number of times a block was read more than once = %llu\n", file->stats.total_block_re_reads);
fprintf(logf, "number of times a block was read = %llu\n", (long long unsigned) file->stats.total_block_reads);
fprintf(logf, "number of times a block was read more than once = %llu\n", (long long unsigned) file->stats.total_block_re_reads);
fprintf(logf, "\n");
fprintf(logf, "number of hot blocks %d\n", file->stats.num_hot_blocks);
fprintf(logf, "hot blocks...\n");
for (i = 0; i < file->stats.num_hot_blocks; i++)
{
silo_vfd_hot_block_stats_t *hb = &(file->stats.hot_block_list[i]);
fprintf(logf," %8llu: %4s (%f), #writes=%8llu, #reads=%8llu\n",
hb->id, (hb->raw_frac>0.5?"raw":"meta"), hb->raw_frac, hb->num_block_writes+1, hb->num_block_reads+1);
(long long unsigned) hb->id, (hb->raw_frac>0.5?"raw":"meta"), hb->raw_frac, (long long unsigned) hb->num_block_writes+1, (long long unsigned) hb->num_block_reads+1);
}
if (file->stats.hot_block_list) free(file->stats.hot_block_list);
if (file->was_written_map.bitmap) free(file->was_written_map.bitmap);
Expand All @@ -1691,10 +1691,10 @@ H5FD_silo_close(H5FD_t *_file)
fprintf(logf, "\n");
fprintf(logf, "\n");
fprintf(logf, "======== Interactions between HDF5 library and the VFD ========\n");
fprintf(logf, "number raw writes = %llu\n", file->stats.total_vfd_raw_write_count);
fprintf(logf, "number raw bytes written = %llu\n", file->stats.total_vfd_raw_write_bytes);
fprintf(logf, "number md writes = %llu\n", file->stats.total_vfd_md_write_count);
fprintf(logf, "number md bytes written = %llu\n", file->stats.total_vfd_md_write_bytes);
fprintf(logf, "number raw writes = %llu\n", (long long unsigned) file->stats.total_vfd_raw_write_count);
fprintf(logf, "number raw bytes written = %llu\n", (long long unsigned) file->stats.total_vfd_raw_write_bytes);
fprintf(logf, "number md writes = %llu\n", (long long unsigned) file->stats.total_vfd_md_write_count);
fprintf(logf, "number md bytes written = %llu\n", (long long unsigned) file->stats.total_vfd_md_write_bytes);
fprintf(logf, "histogram...\n");
cum_raw_count = 0;
cum_raw_bytes = 0;
Expand Down Expand Up @@ -1730,16 +1730,16 @@ H5FD_silo_close(H5FD_t *_file)

fprintf(logf,"%2d: %8llu (%3d%%, %3d%%) %8llu (%3d%%, %3d%%) | "
"%8llu (%3d%%, %3d%%) %8llu (%3d%%, %3d%%)\n", i,
file->stats.vfd_raw_write_count_hist[i],
(long long unsigned) file->stats.vfd_raw_write_count_hist[i],
(int) (100.0 * file->stats.vfd_raw_write_count_hist[i] / tot_raw_count),
(int) (100.0 * cum_raw_count / tot_raw_count),
file->stats.vfd_raw_write_bytes_hist[i],
(long long unsigned) file->stats.vfd_raw_write_bytes_hist[i],
(int) (100.0 * file->stats.vfd_raw_write_bytes_hist[i] / tot_raw_bytes),
(int) (100.0 * cum_raw_bytes / tot_raw_bytes),
file->stats.vfd_md_write_count_hist[i],
(long long unsigned) file->stats.vfd_md_write_count_hist[i],
(int) (100.0 * file->stats.vfd_md_write_count_hist[i] / tot_md_count),
(int) (100.0 * cum_md_count / tot_md_count),
file->stats.vfd_md_write_bytes_hist[i],
(long long unsigned) file->stats.vfd_md_write_bytes_hist[i],
(int) (100.0 * file->stats.vfd_md_write_bytes_hist[i] / tot_md_bytes),
(int) (100.0 * cum_md_bytes / tot_md_bytes));
}
Expand Down Expand Up @@ -1777,16 +1777,16 @@ H5FD_silo_close(H5FD_t *_file)

fprintf(logf,"%2d: %8llu (%3d%%, %3d%%) %8llu (%3d%%, %3d%%) | "
"%8llu (%3d%%, %3d%%) %8llu (%3d%%, %3d%%)\n", i,
file->stats.vfd_raw_read_count_hist[i],
(long long unsigned) file->stats.vfd_raw_read_count_hist[i],
(int) (100.0 * file->stats.vfd_raw_read_count_hist[i] / tot_raw_count),
(int) (100.0 * cum_raw_count / tot_raw_count),
file->stats.vfd_raw_read_bytes_hist[i],
(long long unsigned) file->stats.vfd_raw_read_bytes_hist[i],
(int) (100.0 * file->stats.vfd_raw_read_bytes_hist[i] / tot_raw_bytes),
(int) (100.0 * cum_raw_bytes / tot_raw_bytes),
file->stats.vfd_md_read_count_hist[i],
(long long unsigned) file->stats.vfd_md_read_count_hist[i],
(int) (100.0 * file->stats.vfd_md_read_count_hist[i] / tot_md_count),
(int) (100.0 * cum_md_count / tot_md_count),
file->stats.vfd_md_read_bytes_hist[i],
(long long unsigned) file->stats.vfd_md_read_bytes_hist[i],
(int) (100.0 * file->stats.vfd_md_read_bytes_hist[i] / tot_md_bytes),
(int) (100.0 * cum_md_bytes / tot_md_bytes));
}
Expand Down
Loading

0 comments on commit 69881a3

Please sign in to comment.