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

ENH: If a test data file is downloaded, then print the bandwidth in bytes/sec #762

Merged
Changes from all commits
Commits
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
16 changes: 14 additions & 2 deletions cmake/FetchDataFile.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@
# Download, Decompress, and possibly copy data archive
# message(STATUS "[DATA DOWNLOAD] @ARGS_ARCHIVE_NAME@")
# --------------------------------------------------------------------------------------------------
string(TIMESTAMP time_stamp_start %s)
file(DOWNLOAD https://github.com/BlueQuartzSoftware/complex/releases/download/Data_Archive/@ARGS_ARCHIVE_NAME@
"@ARGS_DREAM3D_DATA_DIR@/TestFiles/@ARGS_ARCHIVE_NAME@"
EXPECTED_HASH SHA512=@ARGS_SHA512@
SHOW_PROGRESS
# SHOW_PROGRESS
STATUS result
)
# message(STATUS "result: '${result}'")
string(TIMESTAMP time_stamp_end %s)
list(GET result 1 status)
string(REPLACE "\"" "" status "${status}")

if("${status}" STREQUAL "No error")
math(EXPR time_diff "${time_stamp_end} - ${time_stamp_start}" OUTPUT_FORMAT DECIMAL) # value is set to "1000"
file(SIZE "@ARGS_DREAM3D_DATA_DIR@/TestFiles/@ARGS_ARCHIVE_NAME@" file_size)
if(NOT "${time_diff}" STREQUAL "0")
math(EXPR bandwidth "${file_size} / ${time_diff}" OUTPUT_FORMAT DECIMAL) # value is set to "1000"
message(STATUS "@ARGS_ARCHIVE_NAME@ Download Complete: ${bandwidth} bytes/sec")
else()
message(STATUS "@ARGS_ARCHIVE_NAME@ Download Complete")
endif()
endif()
# message(STATUS "status: '${status}'")

# --------------------------------------------------------------------------------------------------
Expand Down
Loading