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

Bugfix/mpi wtime profiler #317

Merged
merged 38 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e449311
always use clock_gettime
balos1 Aug 8, 2023
dbbf8c1
enable profiling and logging in windows github actions
balos1 Aug 8, 2023
7cd4a7c
fix subtraction of times
balos1 Aug 8, 2023
b459ddf
add windows implementation of gettime
balos1 Aug 8, 2023
b51603f
remove cygwin part
balos1 Aug 8, 2023
6964531
fix datatype for ticks
balos1 Aug 11, 2023
6a21559
remove error for no posix
balos1 Aug 11, 2023
cf468c3
declare a timespec if there is not one
balos1 Aug 11, 2023
68100ad
use LARGE_INTEGER
balos1 Aug 11, 2023
5626cf5
add missing windows system includes
balos1 Aug 11, 2023
b8b02b3
update changelog
balos1 Aug 11, 2023
a20e575
need windows.h
balos1 Sep 5, 2023
2d65535
ticks in microseconds
balos1 Sep 5, 2023
1a1c4a7
add profiling test
balos1 Sep 5, 2023
884541f
enable unit tests in Windows short test
balos1 Sep 5, 2023
21c3da4
remove commented out code
balos1 Oct 27, 2023
90717c9
add unit tests of profiler to tarscript
balos1 Oct 27, 2023
ec30aea
organize src targets for windows
balos1 Oct 27, 2023
21006fe
add get functions
balos1 Oct 27, 2023
b61c7cb
only test profiling if enabled
balos1 Oct 27, 2023
3c60571
fix windows includes and resolution
balos1 Oct 27, 2023
a8b0a4d
add new functions to docs
balos1 Oct 27, 2023
9c163a3
Merge branch 'develop' into bugfix/mpi-wtime-profiler
gardner48 Oct 27, 2023
b5d33ba
Merge branch 'develop' into bugfix/mpi-wtime-profiler
gardner48 Oct 29, 2023
ec66531
Apply suggestions from code review
balos1 Oct 30, 2023
69b7a21
simplify ifdef checks
balos1 Oct 30, 2023
99c338b
move C++ profiler parts to their own header file
balos1 Oct 30, 2023
5bfc365
add doc notes
balos1 Oct 30, 2023
41ebdd4
a few minor fixes
balos1 Oct 30, 2023
6713aea
include string header for stod/stoi
balos1 Oct 30, 2023
caeda65
Enable unit tests to build on Windows when access to private function…
balos1 Oct 30, 2023
7aa0e52
use integer 1e9
balos1 Oct 30, 2023
9d6de5b
workaround for cmake 3.12
balos1 Oct 30, 2023
be907b3
typo
balos1 Oct 30, 2023
0a53d76
add slack for timing test
balos1 Oct 30, 2023
55fd98d
update tolerance
balos1 Nov 1, 2023
2bc100c
turn off unit tests on mingw
balos1 Nov 1, 2023
fe77dc9
loosen test tolerance
balos1 Nov 1, 2023
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 doc/shared/sundials/Profiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ setting the ``CALI_CONFIG`` environment variable.

.. note::

The SUNDIALS profilers requires POSIX timers or the Windows ``profileapi.h`` timers.
The SUNDIALS profiler requires POSIX timers or the Windows ``profileapi.h`` timers.

.. warning::

Expand Down
4 changes: 0 additions & 4 deletions include/sundials/sundials_profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ SUNDIALS_EXPORT int SUNProfiler_Reset(SUNProfiler p);

#define SUNDIALS_MARK_END(profobj, name)

#ifdef __cplusplus
#define SUNDIALS_CXX_MARK_FUNCTION(profobj)
#endif

#endif

#ifdef __cplusplus
Expand Down
1 change: 1 addition & 0 deletions src/sundials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ set(sundials_HEADERS
sundials_nvector.h
sundials_nvector.hpp
sundials_profiler.h
sundials_profiler.hpp
sundials_logger.h
sundials_types.h
sundials_version.h
Expand Down
13 changes: 10 additions & 3 deletions test/unit_tests/arkode/CXX_serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,17 @@ foreach(test_tuple ${unit_tests})
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/src)

# Libraries to link against
# We explicitly choose which object libraries to link to
# and link in the arkode objects so that we have access to
# private functions w/o changing their visibility in the installed libraries.
gardner48 marked this conversation as resolved.
Show resolved Hide resolved
target_link_libraries(${test_target}
sundials_arkode
sundials_nvecserial
$<TARGET_OBJECTS:sundials_arkode_obj>
sundials_sunmemsys_obj
sundials_nvecserial_obj
sundials_sunlinsolband_obj
sundials_sunlinsoldense_obj
sundials_sunnonlinsolnewton_obj
sundials_sunnonlinsolfixedpoint_obj
${EXE_EXTRA_LINK_LIBS})

endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
*-----------------------------------------------------------------*/

// Header files
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <string.h>
#include <cstring>
#include <string>
#include <cmath>
#include <arkode/arkode_arkstep.h>
#include <arkode/arkode_mristep.h>
Expand Down Expand Up @@ -99,8 +100,8 @@ int main(int argc, char* argv[])

// if an argument supplied, set fixedpoint (otherwise use SUNFALSE)
fixedpoint = SUNFALSE;
if (argc > 1) fixedpoint = stoi(argv[1], NULL);
if (argc > 2) Nt = stoi(argv[2], NULL);
if (argc > 1) fixedpoint = std::stoi(argv[1], NULL);
if (argc > 2) Nt = std::stoi(argv[2], NULL);

// Initial problem output
cout << "\nAnalytical ODE test problem:\n";
Expand Down
17 changes: 9 additions & 8 deletions test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
* ---------------------------------------------------------------------------*/

// Header files
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <string.h>
#include <cstring>
#include <cmath>
#include <string>

#include <arkode/arkode_arkstep.h>
#include <arkode/arkode_mristep.h>
Expand Down Expand Up @@ -91,12 +92,12 @@ int main(int argc, char* argv[])
UserData udata;

// Check for inputs
if (argc > 1) udata.lambda_e = stod(argv[1]);
if (argc > 2) udata.lambda_i = stod(argv[2]);
if (argc > 3) udata.lambda_f = stod(argv[3]);
if (argc > 4) hs = stod(argv[4]);
if (argc > 5) hf = stod(argv[5]);
if (argc > 5) nsteps = stoi(argv[6]);
if (argc > 1) udata.lambda_e = std::stod(argv[1]);
if (argc > 2) udata.lambda_i = std::stod(argv[2]);
if (argc > 3) udata.lambda_f = std::stod(argv[3]);
if (argc > 4) hs = std::stod(argv[4]);
if (argc > 5) hf = std::stod(argv[5]);
if (argc > 5) nsteps = std::stoi(argv[6]);

// Output problem setup
cout << "\nDahlquist ODE test problem:\n";
Expand Down
12 changes: 9 additions & 3 deletions test/unit_tests/arkode/C_serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ foreach(test_tuple ${ARKODE_unit_tests})
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/src)

# libraries to link against
# We explicitly choose which object libraries to link to
# and link in the arkode objects so that we have access to
# private functions w/o changing their visibility in the installed libraries.
target_link_libraries(${test}
sundials_arkode
sundials_nvecserial
$<TARGET_OBJECTS:sundials_arkode_obj>
sundials_sunmemsys_obj
sundials_nvecserial_obj
sundials_sunlinsolband_obj
sundials_sunlinsoldense_obj
sundials_sunnonlinsolnewton_obj
${EXE_EXTRA_LINK_LIBS})

endif()
Expand Down
2 changes: 1 addition & 1 deletion test/unit_tests/profiling/test_profiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int sleep(SUNProfiler prof, int sec, double* chrono)
std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
*chrono =
std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin).count() *
1e-9;
1000000000;
return 0;
}

Expand Down
Loading