Optaplanner 7.9.0 Multithreading - Solution not reproducable - optaplanner

Having updated to 7.9.0 and after initial problems: https://stackoverflow.com/questions/51597744/optaplanner-7-9-0-and-adding-multithreading-same-planningid-exception I now have been trying to test and compare to my 7.7.0 version. However I cannot get it to reproduce the same solution everytime (obviously only with the same problem data) as in my older version, even when explicitly set in the config xml. Is there additional set up for this version required?
Edit: Did some testing and found switching to TABU (haven't been through them all) gave me the expected consistency:
Extra Cores:1 - DEFAULT:
Score (Hrd:Med:Sft) Time Taken (Minutes:Seconds)
Test1 0:0:-7609 0:08
Test2 0:-1:-7758 0:13
Test3 0:-1:-7705 0:14
Extra Cores:1 - TABU:
Score (Hrd:Med:Sft) Time Taken (Minutes:Seconds)
Test1 0:0:-7763 1:29
Test2 0:0:-7763 1:29
Test3 0:0:-7763 1:28
Between two runs of the former the solution diverges at LS step 28:
LS step (25), time spent (1869), score (0hard/-3medium/-8155soft),
LS step (26), time spent (1890), score (0hard/-3medium/-8339soft),
LS step (27), time spent (1895), score (0hard/-3medium/-8126soft),
**LS step (28), time spent (1909), score (0hard/-3medium/-8256soft),
LS step (29), time spent (1915), score (0hard/-3medium/-8438soft),
LS step (30), time spent (1924), score (0hard/-3medium/-8620soft),
LS step (31), time spent (1952), score (0hard/-3medium/-8639soft),**
...and...
LS step (25), time spent (1385), score (0hard/-3medium/-8155soft),
LS step (26), time spent (1407), score (0hard/-3medium/-8339soft),
LS step (27), time spent (1412), score (0hard/-3medium/-8126soft),
**LS step (28), time spent (1422), score (0hard/-3medium/-8217soft),
LS step (29), time spent (1436), score (0hard/-3medium/-8336soft),
LS step (30), time spent (1442), score (0hard/-3medium/-8517soft),
LS step (31), time spent (1448), score (0hard/-3medium/-8571soft),**
Don't know if that all makes it more or less likely to be problem/solution set up or something else.

First, let's define reproducible: getting the same result at the same step iteration. If the CPU time is completely the same (which it never is), this also means getting the same result after the same amount of time. So you might need to run it a bit longer to get the same amount of steps.
Multithreaded solving is reproducible if and only if the same moveThreadCount is used. A run with <moveThreadCount>4</> is NOT reproducible by a <moveThreadCount>2</>. Even a run with <moveThreadCount>NONE</> is not reproducible with a run with <moveThreadCount>1</> (the latter being useless except for QA btw).
Look at your score calculation speed.
If it's lower, you probably forgot to increase the memory size and GC churns are hurting you.
If that's higher, you'd normally get a better result. If you see a worse result anyway, the config might have been overfitted for the no move threads. Use additional datasets in optaplanner-benchmark to prove or disprove that.
Furthermore, if you use <moveThreadCount>AUTO</>, it's only reproducible on the same machine, because AUTO changes the moveThreadCount depending on the number of CPU cores in the machine.

Related

ffmpeg - How to change the filter-paramaters depending on time oder framenumber?

Hallo to all userse and helpers here in this forum! Thank you, i am new and i have found allready a lot of solutions.
Now I want to ask, if someone can help me:
I have a Movie about 30 seconds made of 1 image.
Now I want to pixelate depending on time or framenumber - every time a litlle bit less.
My code so far:
ffmpeg -i in.mp4 -vf scale=iw/n:ih/n,scale=niw:nih:flags=neighbor out.mp4
where n should be the framenumber 1 to 900.
this scould also be t+1 for slower change.
the stars are gone - so i mean n times iw:n times ih:
error-massage:
undefined constant or missing '(' in 'n'
error when evaluating the expression 'ih/n'
maybe the expression for out_w:'w/n' or for out_h:'ih/n' is self-referencing.
failed to configure output pad on paresed_scale_0
error reinitializing filters!
failed to inject frame into filter network: invalid argument
error while processing the decoded data for stream #0:0
Do you have some suggestion plaese - Thank you in Advance

How to measure cpu time of TCL script

I have long TCL script . I want measure exact cpu time the process is taking in TCL
I tried the time command in TCL but I am not sure it is correct way to measure cpu time taken by complete TCL script
Tcl itself doesn't provide this information. You want to use the TclX package's times command.
package require Tclx
set pre [times]
# do CPU intensive operation here; for example calculating the length of a number with many digits...
string length [expr {13**12345}]
set post [times]
# the current process's non-OS CPU time is the first element; it's in milliseconds
set cpuSecondsTaken [expr {([lindex $post 0] - [lindex $pre 0]) / 1000.0}]
# The other elements are: system-cpu-time, subprocess-user-cpu-time, subprocess-system-time
You are, of course, dependent on the OS measuring this information correctly. It's not portable to non-POSIX systems (e.g., Windows) though there might be something logically similar in the TWAPI package.

How to get encoding time per frame using x265 v1.7?

Using -log-level 4 on x265 v1.4 I get encoding time and elapsed time per frame.
Now using v1.7 I don't get these values in csv. Instead I get DecideWait (ms), Row0Wait (ms), Wall time (ms), Ref Wait Wall (ms), Total CTU time (ms), Stall Time (ms), Avg WPP, amd Row Blocks.
I tried -log-level values 3,4 and 5 and still no luck.
can you help me please?
I found the solution.
x265 v2.5 now gives the Total frame time (ms) in the csv log file.
When you run an x265 encoding add the following flag and csv created file location:
--csv-log-level 2 --csv info.csv
More info can be found here and here.
For x265 earlier versions, a rough estimation of the elapsed time per frame is calculated by the summation of DecideWait (ms), Row0Wait (ms), and Wall time (ms).

Mono human readable GC statistics in runtime

Is there a Mono profiler mode similar to Java -Xloggc?
I would like to see a human readable GC report while my application is running. Currently Mono can be run with --profile=log option but the output is in binary format and every time I need to run mprof-report to read it. The output file also contains a lot of info which is not interesting for me.
I tried to reduce the file size by specifying heapshot=14400000ms to collect statistics every few hours but it didn't help a lot. In a week I had few gigabytes log.
I also tried to use "sample" profiler but the overhead was too much.
You can use Mono's trace filters for this. Just set the MONO_LOG_MASK to gc and lower the MONO_LOG_LEVEL. Then run your app normally and you will get the human-readable GC statistics while your app is running:
$ export MONO_LOG_MASK=gc
$ export MONO_LOG_LEVEL=debug
$ mono ... # run your application normally ..
...
# notice the human readable GC output
mono: GC_MAJOR: (LOS overflow) pause 26.00ms, total 26.06ms, bridge 0.00ms major 31472K/0K los 1575K/0K
Mono: GC_MINOR: (Nursery full) pause 2.30ms, total 2.35ms, bridge 0.00ms promoted 31456K major 31456K los 5135K
Mono: GC_MINOR: (Nursery full) pause 2.43ms, total 2.45ms, bridge 0.00ms promoted 31456K major 31456K los 8097K
Mono: GC_MINOR: (Nursery full) pause 1.80ms, total 1.82ms, bridge 0.00ms promoted 31472K major 31472K los 11425K

Apache httpd rotatelogs: is it possible to create a new file every day?

I want to make a new logs for my website every 00:00:01 (= each new day).
The problem with rotatelogs is that you can either precise the max size of the logs before creating a new one, or precise the rotation time in seconds. It's not possible to precise an hour of rotation.
They talk about "cronjobs", but I don't get it. Could someone please explain if it's possible, and if so, give an example?
Thank you very much
Following is the help of the rotatelogs utility:
/ # /opt/httpd/bin/rotatelogs --help Incorrect number of arguments
Usage: /opt/httpd/bin/rotatelogs [-l] [-f] {|} [offset minutes from UTC]
Add this:
TransferLog "|/opt/httpd/bin/rotatelogs /some/where 86400"
or
TransferLog "|/opt/httpd/bin/rotatelogs /some/where 5M"
to httpd.conf. The generated name will be /some/where.nnnn where nnnn
is the system time at which the log nominally starts (N.B. if using a
rotation time, the time will always be a multiple of the rotation
time, so you can synchronize cron scripts with it). At the end of each
rotation time or when the file size is reached a new log is started. /
#
According to this section of the manual page for rotatelogs:
rotationtime
The time between log file rotations in seconds. The rotation
occurs at the beginning of this interval. For example, if the
rotation time is 3600, the log file will be rotated at the
beginning of every hour; if the rotation time is 86400, the log
file will be rotated every night at midnight.
setting 86400 as the period will do what you want (new file started at midnight every day).
Also use the -l option if you want "midnight" to be in your local timezone rather than UTC.
The case when a cronjob would be needed is if you wanted a period of one day but at a different time than midnight. More general tools like logrotate (outside apache) are typically used for that.