I am trying to code a stop criteria in cs_user_extra_operation subroutine. When the calculation is performed on a single processor, there is not problem and does it works !
Code: Select all
if(ippmod(ielion).ge.1) then
!Calcul du résidu courant
if (ntcabs.eq.1) then
allocate(residu(ntmabs))
call getcel('cell3',nlelt,lstelt)
do ilelt = 1, nlelt
icell = lstelt(ilelt)
!Calcul du résidu au premier pas de temps
residu(ntcabs) = (propce(icell,ipproc(iqelec))) - 0d0)/propce(icell,ipproc(iqelec))
rhoa = propce(icell,ipproc(iqelec))
enddo
elseif(ntcabs.gt.1) then
call getcel('cell3',nlelt,lstelt)
do ilelt = 1, nlelt
icell = lstelt(ilelt)
!Calcul du résidu durant le pas de temps courant
residu(ntcabs) = (propce(icell,ipproc(iqelec))) - rhoa)/propce(icell,ipproc(iqelec))
rhoa = propce(icell,ipproc(iqelec))
enddo
endif
! Gestion de l'arrêt du calcul
! Premier cas -- Le critère ne converge pas, on arrive donc à ntcabs = ntmabs
if (ntcabs.eq.ntmabs) then
impout = impusr(1)
open(impout,file="residu.dat")
do i = 1, ntcabs
write(impout,*) residu(i)
enddo
close(impout)
deallocate(residu)
endif
if(residu(ntcabs).gt.critere.and.ntcabs.gt.10) then
impout = impusr(1)
open(impout,file="residu.dat")
do i = 1, ntcabs
write(impout,*) residu(i)
enddo
close(impout)
deallocate(residu)
!Sachant que le calcul n'est pas arrivée à la valeur ntmabs
!Alors on provoque l'arrêt du calcul car il a atteint le critère
!de convergence
call csexit(0)
endif
endif
Example :
with functionif (irangp.ge.0.or.iperio.eq.1)
What is the way to run the script on several processor ? That's possible ?then call synsca(...)
Thanks for your help
Best regards
Paul Leblanc