Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8621

Off topic discussion • Re: A bit of Raspberry with 144C/288T

$
0
0
With the last commits I introduced a slowdown of the recreates, which I am debugging.
Good that I took the time needed to investigate this.

In this posting I confirmed @ejolson's claims that using dist(CC[a],CC[⁠b]) is faster than using D[a][⁠b]:
viewtopic.php?t=390765&sid=ae2a4d8bc77b ... 5#p2335207
For AMD 7950X CPU single threaded (with >5.5GHz) all_.cpp is 76293824 / 45356407 = 1.68× faster
For Xeon 2680v4 CPU single threaded all_.cpp is 274323815 / 158094868 = 1.74× faster

My previous posting statement was related to execution of ./validate which does run greedy with seed 670 for pcb442 problem. Indeed for those (small, only 442 cities) TSP each individual recreate got slower, here seen for RR_all:

Code:

pi@raspberrypi5:~/RR/tsp/comp $ grep RR_all * | sed "s/ [ ]*/ /g;s/\x9*//g"____7950x.txt:0: 58136 RR_all() [210us] |0: 58136 RR_all() [628us]E5-2680v4.txt:0: 58136 RR_all() [485us] |0: 58136 RR_all() [1168us]_x3950-X6.txt:0: 58136 RR_all() [969us] |0: 58136 RR_all() [1489us]pi@raspberrypi5:~/RR/tsp/comp $

Running mona-lisa100K.tsp on 7950X CPU PC is not possible, as it uses more than its 32GB RAM.
So I used usa13509.tsp that uses slightly less than 1GB RAM.

With "git checkout 570b6cc" and running

Code:

time ./greedy -m 0 -s 1234 ../data/tsp/usa13509 2>&1 | sed "s/\xd/\n/g"
on 7950X CPU:

Code:

-1           init_dist() [6468346us]...0: 22715332           RR_all() [868496us]...real0m7.409s
and on e5-2680v4 CPU:

Code:

-1           init_dist() [15482648us]...0: 22715332           RR_all() [2704676us]...real0m18.318s
With "git checkout 81ed991" (the following commit, removing distance matrix D) and running

Code:

time ./greedy -m 0 -s 1234 ../data/tsp/usa13509 2>&1 | sed "s/\xd/\n/g"
on 7950X CPU:

Code:

-1           init_dist() [25140208us]...0: 22715332           RR_all() [456642us]...real0m25.637s
on e5-2680v4 CPU:

Code:

-1           init_dist() [49077715us]...0: 22715332           RR_all() [1861007us]...real0m51.019s

So the RR_all got better after removing the distance matrix!

Code:

868496us -> 456642us     2704676us -> 1861007us
But the total runtime increased a lot.
Reason is the runtime for init_dist(), something is really wrong there
(performance wise, ./validate verified that no execution changes for the complete pcb442 TSP happened) ...


P.S:
init_dist() time is getting much slower, although no initializing of the distance matrix D happens.

Statistics: Posted by HermannSW — Fri Sep 12, 2025 6:45 pm



Viewing all articles
Browse latest Browse all 8621

Trending Articles