gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dc_clock::dcclockpredict Interface Reference

Public Member Functions

subroutine dcclockpredict0 (clk, progress, unit, err)

Detailed Description

Definition at line 164 of file dc_clock.f90.

Member Function/Subroutine Documentation

◆ dcclockpredict0()

subroutine dc_clock::dcclockpredict::dcclockpredict0 ( type(clock), intent(in) clk,
real, intent(in) progress,
integer, intent(in), optional unit,
logical, intent(out), optional err )

プログラムが終了するまでの予測 CPU 時間・日時を表示

CLOCK 変数 clkprogress から、プログラムが終了するまでの 予測 CPU 時間および日時を以下のように表示します。

########## PREDICTION OF CALCULATION ###########
start date 2007-03-08t16:49:25+09:00
current date 2007-03-08t16:49:27+09:00
progress 66.67% [**************** ]
remaining cpu time 0.100000e+01
completion date 2007-03-08t16:49:28+09:00

progress には 0 〜 1 までの値を与えてください。 プログラムの開始時を 0、終了時を 1 とします (例: プログラムが半分進んだ時には 0.5 を与えます)。

Note
ここで行う「予測」とは、これまでの経過時間および終了した プログラムの分量から単純なアルゴリズムで割り出しているものなので、 正確な予測値を返すわけではありません。あくまで目安として利用してください。

unit には出力先の装置番号を与えてください。 unit を与えない場合、標準出力へ表示されます。

clk に対して DCClockCreate による初期化が行われていない場合、 エラーを発生させます。err を与える場合には err に .true. が返り、 プログラムは続行されます。

Parameters
[in]clkCLOCK 型変数
[in]progress進捗値 (0.0 〜 1.0)
[in]unit出力先装置番号 (省略可)。デフォルト: 標準出力。
[out]errエラーフラグ (省略可)。エラー時に .true.。

Definition at line 1137 of file dc_clock.f90.

1138 use dc_types, only: stdout, dp
1139 use dc_message, only: messagenotify
1140 use dc_string, only: tochar, cprintf, printf
1143 use dc_date, only: operator(+), dcdatetimecreate, tochar, evalsec, &
1144 & dcdifftimecreate
1145 implicit none
1146 type(CLOCK), intent(in):: clk
1147 real, intent(in):: progress
1148 integer, intent(in), optional:: unit
1149 logical, intent(out), optional:: err
1150 character(STRING):: cause_c
1151 integer:: stat, out_unit
1152 type(DC_DIFFTIME):: remain_diff
1153 type(DC_DATETIME):: comp_date, cur_date
1154 character(7):: prog_percent
1155 character(25):: prog_bar
1156 integer:: prog_bar_ptr
1157 real:: prog_valid
1158 logical:: initflag_mpi
1159 integer:: err_mpi, myrank_mpi
1160 character(*), parameter:: subname = 'DCClockPredict'
1161 continue
1162 call beginsub(subname)
1163 stat = dc_noerr
1164 cause_c = 'CLOCK'
1165 if (.not. clk % initialized) then
1166 call messagenotify('W', subname, 'Call Create before Predict in dc_clock.')
1167 call dbgmessage('Ignored because input argument was not initialized.')
1168 stat = dc_enotinit
1169 goto 999
1170 end if
1171 if (progress <= 0.0) then
1172 call messagenotify('W', subname, 'Specify 0.0 -- 1.0 value to "progress"')
1173 return
1174 elseif (progress > 1.0) then
1175 call messagenotify('W', subname, 'Over 1.0 value to "progress" was modified to 1.0')
1176 prog_valid = 1.0
1177 else
1178 prog_valid = progress
1179 end if
1180 if (present(unit)) then
1181 out_unit = unit
1182 else
1183 out_unit = stdout
1184 end if
1185 call dcdifftimecreate( remain_diff, &
1186 & sec = real(nint(evalsec(clk) / prog_valid * (1.0 - prog_valid)), dp) )
1187 call dcdatetimecreate(cur_date)
1188 comp_date = cur_date + remain_diff
1189 prog_percent = ''
1190 prog_percent = adjustr(trim(printf_g5_2(real(prog_valid * 100, dp))) // '%')
1191 prog_bar = ''
1192 prog_bar_ptr = int(prog_valid * 25)
1193 if (prog_bar_ptr > 0) prog_bar(1:prog_bar_ptr) = '*************************'
1194 call mpi_initialized(initflag_mpi, err_mpi)
1195 if ( initflag_mpi ) then
1196 call mpi_comm_rank(mpi_comm_world, myrank_mpi, err_mpi)
1197 if ( myrank_mpi /= 0 ) goto 999
1198 end if
1199 call printf(out_unit, '')
1200 call printf(out_unit, &
1201 & ' ########## PREDICTION OF CALCULATION ###########')
1202 call printf(out_unit, &
1203 & ' Start Date %c', c1=trim(tochar(clk % start_date)))
1204 call printf(out_unit, &
1205 & ' Current Date %c', c1=trim(tochar(cur_date)))
1206 call printf(out_unit, &
1207 & ' Progress %c [%c]', c1=prog_percent, c2=prog_bar)
1208 call printf(out_unit, &
1209 & ' Remaining CPU TIME %c %c', &
1210 & c1=trim(result_value_form(evalsec(remain_diff))), &
1211 & c2=trim(fit_unit_value(0.0_dp, remain_diff)))
1212 call printf(out_unit, &
1213 & ' Completion Date %c', c1=trim(tochar(comp_date)))
1214999 continue
1215 call storeerror(stat, subname, err, cause_c)
1216 call endsub(subname)
日付・時刻に関する構造データ型と定数
日付および時刻に関する手続きを提供するモジュール
Definition dc_date.f90:57
エラー処理用モジュール
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer, parameter, public dc_enotinit
-400 以下: dc ユーティリティのエラー
Definition dc_error.f90:534
integer, parameter, public dc_noerr
エラー等を保持
Definition dc_error.f90:468
メッセージの出力
文字型変数の操作
Definition dc_string.f90:83
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public stdout
標準出力の装置番号
Definition dc_types.f90:117
integer, parameter, public dp
倍精度実数型変数
Definition dc_types.f90:92

References dc_trace::beginsub(), dc_trace::dbgmessage(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), dc_types::stdout, and dc_error::storeerror().

Here is the call graph for this function:

The documentation for this interface was generated from the following file: