Golly could be faster?
Posted: July 27th, 2016, 9:24 pm
Am new here. First time I ran Golly I thought "cripes that's fast", and it is, but not always. Golly (with default settings) handles "ash" extremely badly. I just wrote a 37 line standalone Fortran program, with no optimisation at all apart from the O3 compiler tag. On my old 32-bit computer it runs in 4 minutes 11 seconds. On the same problem, Golly is more than 5 times as slow!
The problem is 10,000 generations on a 5% random start on a 2048*2048 toroidal grid.
Ideally, a program designed to calculate Life ought to ignore ash completely, or at least ignore still lifes and period 2 oscillators blinker, toad and beacon. So it ought to speed up as the pattern develops towards ash. Is there a switch on Golly that does this?
The problem is 10,000 generations on a 5% random start on a 2048*2048 toroidal grid.
Ideally, a program designed to calculate Life ought to ignore ash completely, or at least ignore still lifes and period 2 oscillators blinker, toad and beacon. So it ought to speed up as the pattern develops towards ash. Is there a switch on Golly that does this?
Code: Select all
parameter(numi=2048,numj=2048)
integer a(0:numi+1,0:numj+1)
a=0
do j=1,numj
do i=1,numi
if(rand().lt.0.05) then
a(i,j)=1
end if
end do
end do
do itime=1,10000
do j=1,numj
do i=1,numi
icount=a(i-1,j-1)+a(i,j-1)+a(i+1,j-1)+a(i-1,j)+a(i+1,j)+a(i-1,j+1)+a(i,j+1)+a(i+1,j+1)
if(a(i,j).eq.0) then
if(icount.eq.3) then
a(i,j)=1
end if
else
if(icount.lt.2.or.icount.gt.3) then
a(i,j)=0
end if
end if
end do
end do
do i=1,numi
a(i,0)=a(i,numj)
a(i,numj+1)=a(i,1)
end do
do j=0,numj+1
a(0,j)=a(numi,j)
a(numi+1,j)=a(1,j)
end do
end do
stop
end