This commit is contained in:
@@ -376,6 +376,11 @@ contains
|
||||
if (lifecycle_count_event(NLC_EVENT_ITERATION_RESULT) .le. 0) &
|
||||
call fail(5613)
|
||||
call check_lifecycle_last(NLC_EVENT_ACCEPT, NFAIL_NONE, 5614)
|
||||
call check_lifecycle_summary(NLC_EVENT_ACCEPT, NFAIL_NONE, 1, 0, 0, &
|
||||
5660)
|
||||
call check_lifecycle_report_row( &
|
||||
'build-codex-gcc/test_solver_lifecycle_report_accept', &
|
||||
'accept', 'none', 5690)
|
||||
|
||||
dof = dof_id(1,2)
|
||||
call check_close(u(dof), 15.0_rk / 68.0_rk, 95)
|
||||
@@ -563,10 +568,23 @@ contains
|
||||
call fail(162)
|
||||
if (convergence_failure_reason_id .ne. NFAIL_MIN_STEP) call fail(5164)
|
||||
call check_reason_name(NFAIL_MIN_STEP, 'minimum-step-exhausted', 5165)
|
||||
call check_cutback_reason_name(CUTBACK_REASON_MIN_STEP, &
|
||||
'minimum-step-exhausted', 5680)
|
||||
if (conv_last_cutback_reason_id .ne. &
|
||||
CUTBACK_REASON_NONCONVERGENCE) call fail(5681)
|
||||
call check_cutback_reason_name(conv_last_cutback_reason_id, &
|
||||
'nonlinear-nonconvergence', 5682)
|
||||
call check_close(convergence_last_accepted_time, ZERO, 163)
|
||||
if (lifecycle_count_event(NLC_EVENT_CUTBACK) .ne. 2) call fail(5605)
|
||||
if (lifecycle_count_event_reason(NLC_EVENT_CUTBACK, &
|
||||
CUTBACK_REASON_NONCONVERGENCE) .ne. 2) call fail(5625)
|
||||
call check_lifecycle_last(NLC_EVENT_REJECT, NFAIL_MIN_STEP, 5606)
|
||||
call check_lifecycle_audit_min(1, 1, 1, 0, 0, 5630)
|
||||
call check_lifecycle_summary(NLC_EVENT_REJECT, NFAIL_MIN_STEP, 0, 1, &
|
||||
2, 5670)
|
||||
call check_lifecycle_report_row( &
|
||||
'build-codex-gcc/test_solver_lifecycle_report_reject', &
|
||||
'reject', 'minimum-step-exhausted', 5700)
|
||||
|
||||
allow_step_cutback = old_cutback
|
||||
max_cutback = old_max_cutback
|
||||
@@ -789,6 +807,14 @@ contains
|
||||
call check_close(nlc_path_real(NLC_PATH_R_PARAMETER, 1), ONE, 278)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_ACTUAL_L2, 1), &
|
||||
5.0_rk / 6.0_rk, 279)
|
||||
if (nlc_path_int(NLC_PATH_I_ARC_MODE, 1) .ne. NLC_ARC_MODE_LOAD) &
|
||||
call fail(5624)
|
||||
if (nlc_path_int(NLC_PATH_I_ARC_PRED_OK, 1) .ne. 1) &
|
||||
call fail(5625)
|
||||
if (nlc_path_int(NLC_PATH_I_ARC_LOAD_REVERSAL, 1) .ne. 0) call fail(5626)
|
||||
if (nlc_path_int(NLC_PATH_I_ARC_TURNING_POINT, 1) .ne. 0) call fail(5627)
|
||||
if (nlc_path_real(NLC_PATH_R_ARC_LENGTH, 1) .le. ZERO) call fail(5628)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_ARC_LOAD_DELTA, 1), ZERO, 5629)
|
||||
if (abs(nlc_last_arc_constraint) .gt. 1.0e-8_rk) call fail(280)
|
||||
if (nlc_path_int(NLC_PATH_I_STATUS_CODE, 1) .ne. &
|
||||
CONVERGENCE_STATUS_CONVERGED) call fail(281)
|
||||
@@ -861,6 +887,16 @@ contains
|
||||
if (nlc_path_int(NLC_PATH_I_STEP, 2) .ne. 2) call fail(236)
|
||||
if (nlc_path_int(NLC_PATH_I_CONTROL_DOF_COUNT, 1) .ne. 1) call fail(237)
|
||||
if (nlc_path_int(NLC_PATH_I_CONTROL_DOF_COUNT, 2) .ne. 1) call fail(238)
|
||||
if (nlc_path_int(NLC_PATH_I_ARC_MODE, 1) .ne. NLC_ARC_MODE_DISP) &
|
||||
call fail(5631)
|
||||
if (nlc_path_int(NLC_PATH_I_ARC_MODE, 2) .ne. NLC_ARC_MODE_DISP) &
|
||||
call fail(5632)
|
||||
if (nlc_path_int(NLC_PATH_I_ARC_PRED_OK, 2) .ne. 1) &
|
||||
call fail(5633)
|
||||
if (nlc_path_int(NLC_PATH_I_ARC_LOAD_REVERSAL, 2) .ne. 0) call fail(5634)
|
||||
if (nlc_path_int(NLC_PATH_I_ARC_TURNING_POINT, 2) .ne. 0) call fail(5635)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_ARC_LOAD_DELTA, 2), 0.5_rk, &
|
||||
5636)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TIME, 1), 0.5_rk, 239)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TIME, 2), ONE, 240)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TARGET_DT, 1), 0.5_rk, 249)
|
||||
@@ -1356,6 +1392,16 @@ contains
|
||||
if (trim(actual) .ne. trim(expected)) call fail(code)
|
||||
end subroutine check_reason_name
|
||||
|
||||
subroutine check_cutback_reason_name(reason_id, expected, code)
|
||||
integer, intent(in) :: reason_id
|
||||
character(len=*), intent(in) :: expected
|
||||
integer, intent(in) :: code
|
||||
character(len=64) :: actual
|
||||
|
||||
call cutback_reason_name(reason_id, actual)
|
||||
if (trim(actual) .ne. trim(expected)) call fail(code)
|
||||
end subroutine check_cutback_reason_name
|
||||
|
||||
subroutine check_lifecycle_event(index, expected_event, expected_reason, &
|
||||
code)
|
||||
integer, intent(in) :: index
|
||||
@@ -1432,6 +1478,53 @@ contains
|
||||
if (commit_ok_count .lt. min_commit_ok) call fail(code + 4)
|
||||
end subroutine check_lifecycle_audit_min
|
||||
|
||||
subroutine check_lifecycle_summary(expected_event, expected_reason, &
|
||||
min_accept, min_reject, min_cutback, &
|
||||
code)
|
||||
integer, intent(in) :: expected_event
|
||||
integer, intent(in) :: expected_reason
|
||||
integer, intent(in) :: min_accept
|
||||
integer, intent(in) :: min_reject
|
||||
integer, intent(in) :: min_cutback
|
||||
integer, intent(in) :: code
|
||||
integer :: step
|
||||
integer :: increment
|
||||
integer :: iteration
|
||||
integer :: event_id
|
||||
integer :: reason_id
|
||||
integer :: audit_status
|
||||
integer :: begin_trial_count
|
||||
integer :: rollback_requested_count
|
||||
integer :: rollback_ok_count
|
||||
integer :: rollback_failed_count
|
||||
integer :: commit_ok_count
|
||||
integer :: accept_count
|
||||
integer :: reject_count
|
||||
integer :: cutback_count
|
||||
character(len=64) :: event_name
|
||||
character(len=64) :: reason_name
|
||||
character(len=64) :: audit_name
|
||||
|
||||
call nl_lifecycle_get_summary(step, increment, iteration, event_id, &
|
||||
event_name, reason_id, reason_name, audit_status, audit_name, &
|
||||
begin_trial_count, rollback_requested_count, rollback_ok_count, &
|
||||
rollback_failed_count, commit_ok_count, accept_count, reject_count, &
|
||||
cutback_count)
|
||||
if (event_id .ne. expected_event) call fail(code)
|
||||
if (reason_id .ne. expected_reason) call fail(code + 1)
|
||||
if (trim(event_name) .eq. 'unknown') call fail(code + 2)
|
||||
if (trim(reason_name) .eq. 'unknown') call fail(code + 3)
|
||||
if (accept_count .lt. min_accept) call fail(code + 4)
|
||||
if (reject_count .lt. min_reject) call fail(code + 5)
|
||||
if (cutback_count .lt. min_cutback) call fail(code + 6)
|
||||
if (audit_status .lt. NLC_AUDIT_NONE) call fail(code + 7)
|
||||
if (begin_trial_count .lt. 0) call fail(code + 8)
|
||||
if (rollback_requested_count .lt. 0) call fail(code + 9)
|
||||
if (rollback_ok_count .lt. 0) call fail(code + 10)
|
||||
if (rollback_failed_count .lt. 0) call fail(code + 11)
|
||||
if (commit_ok_count .lt. 0) call fail(code + 12)
|
||||
end subroutine check_lifecycle_summary
|
||||
|
||||
integer function lifecycle_count_event(expected_event)
|
||||
integer, intent(in) :: expected_event
|
||||
integer :: i
|
||||
@@ -1453,6 +1546,30 @@ contains
|
||||
end do
|
||||
end function lifecycle_count_event
|
||||
|
||||
integer function lifecycle_count_event_reason(expected_event, &
|
||||
expected_reason)
|
||||
integer, intent(in) :: expected_event
|
||||
integer, intent(in) :: expected_reason
|
||||
integer :: i
|
||||
integer :: step
|
||||
integer :: increment
|
||||
integer :: iteration
|
||||
integer :: event_id
|
||||
integer :: reason_id
|
||||
character(len=64) :: event_name
|
||||
character(len=64) :: reason_name
|
||||
|
||||
lifecycle_count_event_reason = 0
|
||||
do i = 1, nl_lifecycle_get_event_count()
|
||||
call nl_lifecycle_get_event(i, step, increment, iteration, event_id, &
|
||||
event_name, reason_id, reason_name)
|
||||
if (event_id .eq. expected_event .and. &
|
||||
reason_id .eq. expected_reason) then
|
||||
lifecycle_count_event_reason = lifecycle_count_event_reason + 1
|
||||
end if
|
||||
end do
|
||||
end function lifecycle_count_event_reason
|
||||
|
||||
subroutine check_path_breakdown_header(code_base)
|
||||
integer, intent(in) :: code_base
|
||||
character(len=2048) :: header
|
||||
@@ -1500,9 +1617,64 @@ contains
|
||||
call fail(code_base + 17)
|
||||
if (index(header, 'lifecycle_reject_count') .le. 0) &
|
||||
call fail(code_base + 18)
|
||||
if (index(row_line, ',accept,') .le. 0) call fail(code_base + 19)
|
||||
if (index(header, 'arc_mode,arc_predictor_consistent') .le. 0) &
|
||||
call fail(code_base + 19)
|
||||
if (index(header, 'arc_load_reversal,arc_turning_point') .le. 0) &
|
||||
call fail(code_base + 20)
|
||||
if (index(header, 'arc_length,arc_load_delta,arc_predictor_dot') .le. 0) &
|
||||
call fail(code_base + 21)
|
||||
if (index(row_line, ',accept,') .le. 0) call fail(code_base + 22)
|
||||
end subroutine check_path_breakdown_header
|
||||
|
||||
subroutine check_lifecycle_report_row(output_dir, expected_event, &
|
||||
expected_reason, code_base)
|
||||
character(len=*), intent(in) :: output_dir
|
||||
character(len=*), intent(in) :: expected_event
|
||||
character(len=*), intent(in) :: expected_reason
|
||||
integer, intent(in) :: code_base
|
||||
character(len=2048) :: header
|
||||
character(len=2048) :: row_line
|
||||
character(len=512) :: filename
|
||||
integer :: ierr
|
||||
integer :: ios
|
||||
integer :: unit_id
|
||||
|
||||
call output_csv_set_directory(output_dir, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(code_base)
|
||||
call output_csv_write_nl_lifecycle(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(code_base + 1)
|
||||
|
||||
filename = trim(output_dir)//'/nonlinear_lifecycle.csv'
|
||||
unit_id = 95
|
||||
open(unit=unit_id, file=trim(filename), status='old', action='read', &
|
||||
iostat=ios)
|
||||
if (ios .ne. 0) call fail(code_base + 2)
|
||||
read(unit_id,'(A)',iostat=ios) header
|
||||
if (ios .ne. 0) call fail(code_base + 3)
|
||||
read(unit_id,'(A)',iostat=ios) row_line
|
||||
close(unit_id)
|
||||
if (ios .ne. 0) call fail(code_base + 4)
|
||||
if (index(header, 'convergence_status') .le. 0) call fail(code_base + 5)
|
||||
if (index(header, 'cutback_reason_id') .le. 0) call fail(code_base + 6)
|
||||
if (index(header, 'residual_total') .le. 0) call fail(code_base + 7)
|
||||
if (index(header, 'linear_status') .le. 0) call fail(code_base + 8)
|
||||
if (index(header, 'audit_status') .le. 0) call fail(code_base + 9)
|
||||
if (index(header, 'linear_method,linear_precond') .le. 0) &
|
||||
call fail(code_base + 12)
|
||||
if (index(header, 'linear_iterations') .le. 0) call fail(code_base + 13)
|
||||
if (index(header, 'linear_initial_residual') .le. 0) &
|
||||
call fail(code_base + 14)
|
||||
if (index(header, 'linear_final_residual') .le. 0) &
|
||||
call fail(code_base + 15)
|
||||
if (index(header, 'linear_relative_residual') .le. 0) &
|
||||
call fail(code_base + 16)
|
||||
if (index(header, 'linear_fail_class') .le. 0) call fail(code_base + 17)
|
||||
if (index(row_line, ','//trim(expected_event)//',') .le. 0) &
|
||||
call fail(code_base + 10)
|
||||
if (index(row_line, ','//trim(expected_reason)//',') .le. 0) &
|
||||
call fail(code_base + 11)
|
||||
end subroutine check_lifecycle_report_row
|
||||
|
||||
subroutine check_solver_diag(code_base)
|
||||
integer, intent(in) :: code_base
|
||||
integer :: ierr
|
||||
|
||||
Reference in New Issue
Block a user