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

Fix non-working unit tests and smoke tests for new features. #164

Merged
merged 21 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1d509f0
Remove GA-based dense matrix; adjust matrix transpose
wperkins Aug 23, 2023
e85428a
Remove all PETSC_VERSION usage.
wperkins Aug 24, 2023
b9f6171
Update PETSc settings for tlaloc
wperkins Aug 28, 2023
4efdd6b
Add smoke test for 240-bus dynamic simulation
wperkins Aug 28, 2023
a0a0869
Add a CMake macro to do the LU solver check and use it
wperkins Aug 28, 2023
b713505
Add smoke test for 2-area dynamic simulation
wperkins Aug 28, 2023
f99aeac
Add smoke test for two area case w/ renewables
wperkins Aug 30, 2023
e4c2171
Remove math::transpose(Matrix<>, Matrix<>) because of PETSc transpose…
wperkins Aug 30, 2023
6580fda
Add smoke tests for dsf2.x (same as for dsf.x).
wperkins Aug 30, 2023
e7ab92b
Add smoke test for Wind DSA 9-bus case
wperkins Aug 31, 2023
5b38344
Fix typos in Wind DSA TAMU 2000 case
wperkins Aug 31, 2023
7514dcc
Add a smoke test for Wind DSA TAMU 2000 case
wperkins Aug 31, 2023
f84ae13
Remove ancient test from `applications/development/dynamic_simulation…
wperkins Sep 6, 2023
66fbc23
Fix incorrect Matrix type Jacobian supplied to DAESolver constructor
wperkins Sep 13, 2023
2c0744e
Update my build script
wperkins Sep 13, 2023
920d93e
Remove 2000-bus Wind-DSA smoke tests - they take too long
wperkins Oct 11, 2023
f5e91bc
Switch to a direct linear solver because this was diverging
wperkins Oct 11, 2023
1e63515
Fix memory crash for dsf application in Release mode.
abhyshr Nov 2, 2023
fa99737
Use gridpack::Environment instead of direct MPI/GA calls
wperkins Nov 8, 2023
4865438
Use a newer PETSc w/o SuperLU_dist on tlaloc
wperkins Nov 16, 2023
93e6d63
Fix parallel mapper test that failed with newer PETSc
wperkins Nov 16, 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
65 changes: 32 additions & 33 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# -------------------------------------------------------------
# -------------------------------------------------------------
# Created May 3, 2013 by William A. Perkins
# Last Change: 2022-10-05 09:26:46 d3g096
# Last Change: 2023-08-28 13:46:15 d3g096
# -------------------------------------------------------------

#
Expand Down Expand Up @@ -313,44 +313,43 @@ endif()
message(STATUS "Using PETSc version ${PETSC_VERSION}")

if (NOT USE_OLD_PETSC)
if(EXISTS "${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h")
set(petscconf "${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h")
elseif(EXISTS "${PETSC_DIR}/include/petscconf.h")
set(petscconf "${PETSC_DIR}/include/petscconf.h")
else()
message(FATAL_ERROR "Could not find PETSc configuration header file
if(EXISTS "${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h")
set(petscconf "${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h")
elseif(EXISTS "${PETSC_DIR}/include/petscconf.h")
set(petscconf "${PETSC_DIR}/include/petscconf.h")
else()
message(FATAL_ERROR "Could not find PETSc configuration header file
petscconf.h")
endif()
endif()

# checks
# define PETSc variables
include(CheckSymbolExists)
check_symbol_exists(PETSC_HAVE_PARMETIS ${petscconf} PETSC_HAVE_PARMETIS)
check_symbol_exists(PETSC_USE_REAL_DOUBLE ${petscconf} PETSC_USE_REAL_DOUBLE)
check_symbol_exists(PETSC_USE_COMPLEX ${petscconf} PETSC_USE_COMPLEX)
check_symbol_exists(PETSC_LANGUAGE_CXX ${petscconf} PETSC_CLANGUAGE_Cxx)
check_symbol_exists(PETSC_HAVE_SUPERLU_DIST ${petscconf}
PETSC_HAVE_SUPERLU_DIST)
check_symbol_exists(PETSC_HAVE_MUMPS ${petscconf} PETSC_HAVE_MUMPS)
# checks
# define PETSc variables
include(CheckSymbolExists)
check_symbol_exists(PETSC_HAVE_PARMETIS ${petscconf} PETSC_HAVE_PARMETIS)
check_symbol_exists(PETSC_USE_REAL_DOUBLE ${petscconf} PETSC_USE_REAL_DOUBLE)
check_symbol_exists(PETSC_USE_COMPLEX ${petscconf} PETSC_USE_COMPLEX)
check_symbol_exists(PETSC_LANGUAGE_CXX ${petscconf} PETSC_CLANGUAGE_Cxx)
check_symbol_exists(PETSC_HAVE_SUPERLU_DIST ${petscconf}
PETSC_HAVE_SUPERLU_DIST)
check_symbol_exists(PETSC_HAVE_MUMPS ${petscconf} PETSC_HAVE_MUMPS)
else()
if (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/conf/PETScConfig.cmake")
include("${PETSC_DIR}/${PETSC_ARCH}/conf/PETScConfig.cmake")
elseif (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/PETScConfig.cmake")
include("${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/PETScConfig.cmake")
elseif (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/PETScBuildInternal.cmake")
include("${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/PETScBuildInternal.cmake")
else()
message(FATAL_ERROR "PETSc found, but CMake configuration for PETSc installation not found?")
endif()

message(STATUS "PETSC_LIBRARY_SINGLE: ${PETSC_LIBRARY_SINGLE}")
if (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/conf/PETScConfig.cmake")
include("${PETSC_DIR}/${PETSC_ARCH}/conf/PETScConfig.cmake")
elseif (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/PETScConfig.cmake")
include("${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/PETScConfig.cmake")
elseif (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/PETScBuildInternal.cmake")
include("${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/PETScBuildInternal.cmake")
else()
message(FATAL_ERROR "PETSc found, but CMake configuration for PETSc installation not found?")
endif()

message(STATUS "PETSC_LIBRARY_SINGLE: ${PETSC_LIBRARY_SINGLE}")

# checks
# checks

if (NOT PETSC_HAVE_MPI)
message(FATAL_ERROR "PETSc installation is not parallel (--with-mpi=1)")
endif()
if (NOT PETSC_HAVE_MPI)
message(FATAL_ERROR "PETSc installation is not parallel (--with-mpi=1)")
endif()
endif()

# PETSc can be compiled for double precsion (--with-precision=double)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<Powerflow>
<networkConfiguration_v33> Benchmark_twoarea_v33.raw </networkConfiguration_v33>
<networkConfiguration_v33> kundur-twoarea_v33.raw </networkConfiguration_v33>
<maxIteration>50</maxIteration>
<tolerance>1.0e-6</tolerance>
<LinearSolver>
Expand Down Expand Up @@ -53,7 +53,7 @@
</Powerflow>
<Dynamic_simulation>
<!--<networkConfiguration> IEEE3G9B_V23.raw </networkConfiguration>-->
<generatorParameters> Benchmark_twoarea_4renewable_mech.dyr </generatorParameters>
<generatorParameters> kundur-twoarea_4renewable_mech.dyr </generatorParameters>
<simulationTime>20</simulationTime>
<!---<iterativeNetworkInterface>true</iterativeNetworkInterface>-->
<timeStep>0.005</timeStep>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# -------------------------------------------------------------
# -------------------------------------------------------------
# Created May 6, 2013 by William A. Perkins
# Last Change: 2019-01-04 08:39:22 d3g096
# Last Change: 2023-09-06 06:50:50 d3g096
# -------------------------------------------------------------

set(target_libraries
Expand Down Expand Up @@ -100,5 +100,5 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.install.in
# -------------------------------------------------------------
# run application as test
# -------------------------------------------------------------
gridpack_add_run_test("dynamic_simulation" ds.x input.xml)
# gridpack_add_run_test("dynamic_simulation" ds.x input.xml)

48 changes: 36 additions & 12 deletions src/applications/development/wind_dsa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# -------------------------------------------------------------
# -------------------------------------------------------------
# Created May 6, 2013 by William A. Perkins
# Last Change: 2019-08-16 13:51:41 d3g096
# Last Change: 2023-10-11 10:33:21 d3g096
# -------------------------------------------------------------

set(target_libraries
Expand Down Expand Up @@ -81,16 +81,18 @@ target_link_libraries(wind.x ${target_libraries})
target_link_libraries(wind2.x ${target_libraries})


# Put files necessary to run powerflow2 in binary directory.
# gridpack.petscrc is temporary -- it will be incorporated into
# input.xml
gridpack_set_lu_solver(
"${CMAKE_CURRENT_SOURCE_DIR}/input.xml"
"${CMAKE_CURRENT_BINARY_DIR}/input.xml"
)

gridpack_set_lu_solver(
"${CMAKE_CURRENT_SOURCE_DIR}/input_tamu2000_dsf.xml"
"${CMAKE_CURRENT_BINARY_DIR}/input_tamu2000_dsf.xml"
)

add_custom_target(wind.x.input

COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/input.xml
${CMAKE_CURRENT_BINARY_DIR}

COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/IEEE3G9B_V23.raw
${CMAKE_CURRENT_BINARY_DIR}
Expand All @@ -111,23 +113,45 @@ add_custom_target(wind.x.input
${CMAKE_CURRENT_SOURCE_DIR}/wind.txt
${CMAKE_CURRENT_BINARY_DIR}

COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/texas2000_hr_4882_mod_33.raw
${CMAKE_CURRENT_BINARY_DIR}

COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/texas2000_v23_fullsys_noac_wind_mod.dyr
${CMAKE_CURRENT_BINARY_DIR}

COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/tamu_2000_faults.xml
${CMAKE_CURRENT_BINARY_DIR}

COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/texas_2k_scenfile_5_full.txt
${CMAKE_CURRENT_BINARY_DIR}

DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/input.xml
${CMAKE_CURRENT_BINARY_DIR}/input.xml
${CMAKE_CURRENT_SOURCE_DIR}/IEEE3G9B_V23.raw
${CMAKE_CURRENT_SOURCE_DIR}/3g9b_faults.xml
${CMAKE_CURRENT_SOURCE_DIR}/3g9b_classical.dyr
${CMAKE_CURRENT_SOURCE_DIR}/load.txt
${CMAKE_CURRENT_SOURCE_DIR}/wind.txt

${CMAKE_CURRENT_BINARY_DIR}/input_tamu2000_dsf.xml
${CMAKE_CURRENT_SOURCE_DIR}/texas2000_hr_4882_mod_33.raw
${CMAKE_CURRENT_SOURCE_DIR}/texas2000_v23_fullsys_noac_wind_mod.dyr
${CMAKE_CURRENT_SOURCE_DIR}/tamu_2000_faults.xml
${CMAKE_CURRENT_SOURCE_DIR}/texas_2k_scenfile_5_full.txt
)
add_dependencies(wind.x wind.x.input)
add_dependencies(wind2.x wind.x.input)

# -------------------------------------------------------------
# run applications as tests
# -------------------------------------------------------------
# FIXME: temporarily disabled
#gridpack_add_run_test("wind" wind.x input.xml)
gridpack_add_run_test("wind_dsa" wind.x input.xml)
gridpack_add_run_test("wind_dsa_2" wind2.x input.xml)
# gridpack_add_run_test("wind_dsa_tamu2000" wind.x input_tamu2000_dsf.xml)
# gridpack_add_run_test("wind_dsa_2_tamu2000" wind2.x input_tamu2000_dsf.xml)

# -------------------------------------------------------------
# install as a sample application
Expand Down
22 changes: 9 additions & 13 deletions src/applications/development/wind_dsa/input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@
<SolutionTolerance>1.0E-08</SolutionTolerance>
<MaxIterations>50</MaxIterations>
<PETScOptions>
-ksp_type bicg
-pc_type bjacobi
-sub_pc_type ilu -sub_pc_factor_levels 5 -sub_ksp_type preonly
<!-ksp_monitor
-ksp_view>
-ksp_type richardson
-pc_type lu
-pc_factor_mat_solver_type superlu_dist
-ksp_max_it 1
</PETScOptions>
</LinearSolver>
</NewtonRaphsonSolver>
Expand All @@ -64,13 +63,10 @@
<FunctionTolerance>1.0E-05</FunctionTolerance>
<MaxIterations>50</MaxIterations>
<PETScOptions>
-ksp_type bicg
-pc_type bjacobi
-sub_pc_type ilu -sub_pc_factor_levels 5 -sub_ksp_type preonly
<!-snes_view
-snes_monitor
-ksp_monitor
-ksp_view>
-ksp_type richardson
-pc_type lu
-pc_factor_mat_solver_type superlu_dist
-ksp_max_it 1
</PETScOptions>
</NonlinearSolver>
</Powerflow>
Expand Down Expand Up @@ -110,7 +106,7 @@
<PETScOptions>
-ksp_type richardson
-pc_type lu
-pc_factor_mat_solver_type petsc
-pc_factor_mat_solver_type superlu_dist
-pc_factor_shift_type NONZERO
-ksp_max_it 1
</PETScOptions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<timeStep>0.005</timeStep>
<windFile>texas_2k_scenfile_5_full.txt</windFile>
<!--loadFile>load_2000.txt</loadFile-->
<faultList> tamu_2000_faults.xml </faultList>
<EventList> tamu_2000_faults.xml </EventList>
<generatorWatch>
<generator>
<busID> 1048 </busID>
Expand Down
4 changes: 2 additions & 2 deletions src/applications/development/wind_dsa/tamu_2000_faults.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FaultList>
<EventList>
<Dynamic_simulation>
<Events>
<faultEvent>
Expand All @@ -16,4 +16,4 @@
</faultEvent>
</Events>
</Dynamic_simulation>
</FaultList>
</EventList>
Loading