Huge improvement in reset (by increasing a little bit push time) using

OMP locks to assign particles to cells in the pushing step.

Trying to combine push+reset and  collision+scatter did not work.
This commit is contained in:
Jorge Gonzalez 2020-10-17 18:46:10 +02:00
commit fd42e0f3f9
7 changed files with 101 additions and 92 deletions

View file

@ -17,7 +17,6 @@ PROGRAM DSMC_Neutrals
INTEGER:: t, n, e, i
CHARACTER(200):: arg1
CHARACTER(:), ALLOCATABLE:: inputFile
REAL(8), EXTERNAL::omp_get_wtime
!Gets the input file
@ -45,6 +44,7 @@ PROGRAM DSMC_Neutrals
DO t = 1, tmax
!Insert new particles
!$OMP SINGLE
n_part_new = 0
tStep = omp_get_wtime()
tPush = omp_get_wtime()
DO i=1, nInject
@ -62,14 +62,6 @@ PROGRAM DSMC_Neutrals
!$OMP SINGLE
tPush = omp_get_wtime() - tPush
tReset = omp_get_wtime()
!$OMP END SINGLE
!Reset particles
CALL resetParticles(part_inj, part_old)
!$OMP SINGLE
tReset = omp_get_wtime() - tReset
tColl = omp_get_wtime()
!$OMP END SINGLE
@ -82,6 +74,14 @@ PROGRAM DSMC_Neutrals
!$OMP SINGLE
tColl = omp_get_wtime() - tColl
tReset = omp_get_wtime()
!$OMP END SINGLE
!Reset particles
CALL resetParticles(part_inj, part_old)
!$OMP SINGLE
tReset = omp_get_wtime() - tReset
!Weight
tWeight = omp_get_wtime()
@ -93,12 +93,14 @@ PROGRAM DSMC_Neutrals
tWeight = omp_get_wtime() - tWeight
tStep = omp_get_wtime() - tStep
!Output data
!TODO: Move to subroutine
counterOutput=counterOutput+1
IF (counterOutput>=triggerOutput .OR. t == tmax) THEN
counterOutput=0
CALL mesh%printOutput(t)
CALL printTime(t)
CALL mesh%printColl(t)
!TODO: Move to subroutine
PRINT *, "t/tmax: ", t, "/", tmax
PRINT *, "Particles: ", n_part_old
WRITE (*, "(2(5X,A26))") "total time (ms)", "avg t/particle (ns)"