Note that there are some explanatory texts on larger screens.

plurals
  1. POBig array problem
    text
    copied!<p>I have a code that worked fine until now with 3 million atom-sized static arrays. For practical reasons, I have to go now to 10 million atom sized arrays. At first, my compiler did not allow me to do this, but I managed to find a way around with the following flags <code>ifort -mcmodel medium -shared-intel -traceback kubo.f</code>. It runs, but something very strange is happening. My matrix contains 11 609 198 elements. </p> <p>I check the value of my coordinates as follows (the value of 4 669 671 is the first time it goes wrong):</p> <blockquote> <p>print*, x(4669671),y(4669671),zcoord(4669671)</p> </blockquote> <p>followed by several lines where the value of x, y and zcoord is not changed or anything. Then, I enter a loop on these 3 vectors where the value of x, y and zcoord will be used but not changed. I print the 3 values again, and suddenly, the 3 values are changed?!</p> <p>Is there something I'm missing for large arrays?</p> <p>EDIT : Here the complete code (as I don't know what is a race condition, I don't know If I'm allowed to delete some parts to make it more readable) :</p> <blockquote> <pre><code> open(1,FILE='fort.10') read(1,*)NAT1 write(*,*)'Lecture de Nat1=',NAT1 read(1,*) do i=1,nsites read(1,*)parcon(i),x(i),y(i),zcoord(i) enddo print*, x(4663659),y(4663659),zcoord(4663659) print*, x(4663663),y(4663663),zcoord(4663663) !HERE print*, x(4669671),y(4669671),zcoord(4669671) print*, x(4673254),y(4673254),zcoord(4673254) iflag=0 iflagg=0 impurityCounter=0 C4Counter=0 do i=1,nsites nvo=0 if(i.le.(nsites-93998)) then jj=i-10000 jjj=i+10000 do j=jj,jjj,1 if((j.gt.0).and.(j.le.(nsites-93998))) then dist=dsqrt((x(j)-x(i))**2+(y(j)-y(i))**2 . +(zcoord(j)-zcoord(i))**2) if((dist.lt.(1.11*aCC)) . .and.(j.ne.i).and.(dist.gt.0.1)) then nvo=nvo+1 v(i,nvo)=j if(i.eq.4663660) then !THERE print*, dist,j,x(j),y(j),zcoord(j) endif endif endif enddo jjjj=nsites-93998+1 do j=jjjj,nsites,1 dist=dsqrt((x(j)-x(i))**2+(y(j)-y(i))**2 . +(zcoord(j)-zcoord(i))**2) if((dist.lt.(1.11*aCC)).and.(j.ne.i).and.(dist.gt.0.1)) then nvo=nvo+1 v(i,nvo)=j endif enddo else do j=1,nsites dist=dsqrt((x(j)-x(i))**2+(y(j)-y(i))**2 . +(zcoord(j)-zcoord(i))**2) if((dist.lt.(1.11*aCC)).and.(j.ne.i).and.(dist.gt.0.1)) then nvo=nvo+1 v(i,nvo)=j endif enddo endif if ((nvo.eq.2).AND.(parcon(i).eq.'C')) then iflag=iflag+1 vpb(iflag)=i endif if((nvo.eq.1).AND.(parcon(i).eq.'C')) then iflagg=iflagg+1 vpbb(iflagg)=i endif !count the number of impurities if((nvo.eq.2).AND.(parcon(i).eq.'O1')) then impurityCounter=impurityCounter+1 impurityVector(impurityCounter)=i endif if((nvo.eq.2).AND.(parcon(i).eq.'O2')) then impurityCounter=impurityCounter+1 impurityVector(impurityCounter)=i endif !If nvo equals 4, there is a BAD counting! if(nvo.eq.4) then print*, v(i,1) print*, v(i,2) print*, v(i,3) print*, v(i,4) print*, x(i), y(i) endif if(nvo.eq.5) then C4Counter=C4Counter+1 C4Vector(C4Counter)=i endif enddo </code></pre> </blockquote> <p>I added !HERE and !THERE to show you where are the two places I print the x, y and zcoord of the element 4669671...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload