Skip to content

Commit

Permalink
Merge pull request #22 from IvanMary69/main
Browse files Browse the repository at this point in the history
FastS: loop CPU/GPU + bug senseur ijkmax sciacovelli (effort_t3)
  • Loading branch information
IvanMary69 authored Oct 29, 2024
2 parents 3bb129f + 4942ef1 commit 4b30e7e
Show file tree
Hide file tree
Showing 25 changed files with 467 additions and 675 deletions.
13 changes: 13 additions & 0 deletions Fast/FastC/FastC/HPC_LAYER/loop3dcart_begin.for
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef E_SCALAR_COMPUTER
#include "FastS/Compute/loop3dcartGpu_begin.for"
#else
do k = ind_loop(5), ind_loop(6)
do j = ind_loop(3), ind_loop(4)
lij = inddm( ind_loop(1) , j, k)
#ifdef _OPENMP4
!$OMP SIMD
#else
!DIR$ IVDEP
#endif
do l = lij, lij + ind_loop(2)- ind_loop(1)
#endif
7 changes: 7 additions & 0 deletions Fast/FastC/FastC/HPC_LAYER/loopGpu_begin.for
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
do k = ind_loop(5), ind_loop(6)
do j = ind_loop(3), ind_loop(4)
do i = ind_loop(1), ind_loop(2)

l = inddm(i,j,k)
lt = indmtr(i,j,k)
lvo = lt
3 changes: 3 additions & 0 deletions Fast/FastC/FastC/HPC_LAYER/loopGpu_end.for
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enddo
enddo
enddo
2 changes: 1 addition & 1 deletion Fast/FastC/FastC/HPC_LAYER/loop_begin.for
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef E_SCALAR_COMPUTER
#include "FastS/Compute/loopGpu_begin.for"
#include "FastC/HPC/loopGpu_begin.for"
#else
do k = ind_loop(5), ind_loop(6)
do j = ind_loop(3), ind_loop(4)
Expand Down
197 changes: 86 additions & 111 deletions Fast/FastS/FastS/Compute/SENSOR/sciacovelli.for
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ c Var loc


IF(param_int(ITYPZONE).eq.0) THEN
DO k = ind_loop(5), ind_loop(6)
DO j = ind_loop(3), ind_loop(4)

#include "FastS/Compute/loopI_begin.for"
#include "FastC/HPC_LAYER/loop_begin.for"
#include "FastS/Compute/SA/metric_3dfull.for"
#include "FastS/Compute/SA/div_rot_3dfull.for"
w_tg = wigi
Expand All @@ -95,53 +93,46 @@ c Var loc
tc_tg = tck
inc_tg = inck
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
if(icorr.eq.1) then !flux manquant en I
#include "FastC/HPC_LAYER/loop_end.for"

If(icorr.eq.1) then !flux manquant en I
i = ind_loop(2) + 1
l = inddm( i, j, k)
#include "FastS/Compute/SA/metric_3dfull.for"
#include "FastS/Compute/SA/div_rot_3dfull.for"
w_tg = wigi
tc_tg = tci
inc_tg = inci
#include "FastS/Compute/SENSOR/shock_sensor.for"
endif !
ENDDO
!complement jmax
If(jcorr.eq.1) then
#include "FastC/HPC_LAYER/loopPlanI_begin.for"
#include "FastS/Compute/SA/metric_3dfull.for"
#include "FastS/Compute/SA/div_rot_3dfull.for"
w_tg = wigi
tc_tg = tci
inc_tg = inci
#include "FastS/Compute/SENSOR/shock_sensor.for"
#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif !
If(jcorr.eq.1) then !complement jmax
j = ind_loop(4)+1
#include "FastS/Compute/loopI_begin.for"
#include "FastC/HPC_LAYER/loopPlanJ_begin.for"
#include "FastS/Compute/SA/metric_3dfull.for"
#include "FastS/Compute/SA/div_rot_3dfull.for"
w_tg = wigj
tc_tg = tcj
inc_tg = incj
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif
ENDDO
!complement kmax
If(kcorr.eq.1) then
k = ind_loop(6)+1
do j = ind_loop(3),ind_loop(4)
#include "FastS/Compute/loopI_begin.for"
If(kcorr.eq.1) then !complement kmax
k = ind_loop(6)+1
#include "FastC/HPC_LAYER/loopPlanK_begin.for"
#include "FastS/Compute/SA/metric_3dfull.for"
#include "FastS/Compute/SA/div_rot_3dfull.for"
w_tg = wigk
tc_tg = tck
inc_tg = inck
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
enddo
Endif
#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif


ELSEIF(param_int(ITYPZONE).eq.1) THEN

DO k = ind_loop(5), ind_loop(6)
DO j = ind_loop(3), ind_loop(4)

#include "FastS/Compute/loopI_begin.for"
#include "FastC/HPC_LAYER/loop_begin.for"
#include "FastS/Compute/SA/metric_3dhomo.for"
#include "FastS/Compute/SA/div_rot_3dhomo.for"
w_tg = wigi
Expand All @@ -156,46 +147,41 @@ c Var loc
tc_tg = tck
inc_tg = inck
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
if(icorr.eq.1) then !flux manquant en I
#include "FastC/HPC_LAYER/loop_end.for"

If(icorr.eq.1) then !flux manquant en I
i = ind_loop(2) + 1
l = inddm( i, j, k)
#include "FastS/Compute/SA/metric_3dhomo.for"
#include "FastS/Compute/SA/div_rot_3dhomo.for"
w_tg = wigi
tc_tg = tci
inc_tg = inci
#include "FastS/Compute/SENSOR/shock_sensor.for"
endif !
ENDDO
!complement jmax
If(jcorr.eq.1) then
#include "FastC/HPC_LAYER/loopPlanI_begin.for"
#include "FastS/Compute/SA/metric_3dhomo.for"
#include "FastS/Compute/SA/div_rot_3dhomo.for"
w_tg = wigi
tc_tg = tci
inc_tg = inci
#include "FastS/Compute/SENSOR/shock_sensor.for"
#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif !
If(jcorr.eq.1) then !complement jmax
j = ind_loop(4)+1
#include "FastS/Compute/loopI_begin.for"
#include "FastC/HPC_LAYER/loopPlanJ_begin.for"
#include "FastS/Compute/SA/metric_3dhomo.for"
#include "FastS/Compute/SA/div_rot_3dhomo.for"
w_tg = wigj
tc_tg = tcj
inc_tg = incj
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif
ENDDO
!complement kmax
If(kcorr.eq.1) then
k = ind_loop(6)+1
do j = ind_loop(3),ind_loop(4)
#include "FastS/Compute/loopI_begin.for"
If(kcorr.eq.1) then !complement kmax
k = ind_loop(6)+1
#include "FastC/HPC_LAYER/loopPlanK_begin.for"
#include "FastS/Compute/SA/metric_3dhomo.for"
#include "FastS/Compute/SA/div_rot_3dhomo.for"
w_tg = wigk
tc_tg = tck
inc_tg = inck
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
enddo
Endif

#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif

ELSEIF(param_int(ITYPZONE).eq.2) THEN
!metric
Expand All @@ -212,10 +198,7 @@ c Var loc
dz = vol(lvo)/tck
xvol = 0.5/vol(lvo)

DO k = ind_loop(5), ind_loop(6)
DO j = ind_loop(3), ind_loop(4)

#include "FastS/Compute/loopI3dcart_begin.for"
#include "FastC/HPC_LAYER/loop3dcart_begin.for"
#include "FastS/Compute/SA/div_rot_3dcart.for"
w_tg = wigi
tc_tg = tci
Expand All @@ -229,49 +212,42 @@ c Var loc
tc_tg = tck
inc_tg = inck
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
if(icorr.eq.1) then !flux manquant en I
#include "FastC/HPC_LAYER/loop_end.for"

If(icorr.eq.1) then !flux manquant en I
i = ind_loop(2) + 1
l = inddm( i, j, k)
#include "FastS/Compute/SA/div_rot_3dcart.for"
w_tg = wigi
tc_tg = tci
inc_tg = inci
#include "FastS/Compute/SENSOR/shock_sensor.for"
endif !
ENDDO
!complement jmax
If(jcorr.eq.1) then
#include "FastC/HPC_LAYER/loopPlanI3dcart_begin.for"
#include "FastS/Compute/SA/div_rot_3dcart.for"
w_tg = wigi
tc_tg = tci
inc_tg = inci
#include "FastS/Compute/SENSOR/shock_sensor.for"
#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif !
If(jcorr.eq.1) then !complement jmax
j = ind_loop(4)+1
#include "FastS/Compute/loopI3dcart_begin.for"
#include "FastC/HPC_LAYER/loopPlanJ3dcart_begin.for"
#include "FastS/Compute/SA/div_rot_3dcart.for"
w_tg = wigj
tc_tg = tcj
inc_tg = incj
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif
ENDDO
!complement kmax
If(kcorr.eq.1) then
k = ind_loop(6)+1
do j = ind_loop(3),ind_loop(4)
#include "FastS/Compute/loopI3dcart_begin.for"
If(kcorr.eq.1) then !complement kmax
k = ind_loop(6)+1
#include "FastC/HPC_LAYER/loopPlanK3dcart_begin.for"
#include "FastS/Compute/SA/div_rot_3dcart.for"
w_tg = wigk
tc_tg = tck
inc_tg = inck
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
enddo
Endif
#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif

ELSE

DO k = ind_loop(5), ind_loop(6)
DO j = ind_loop(3), ind_loop(4)

#include "FastS/Compute/loopI_begin.for"
#include "FastC/HPC_LAYER/loop_begin.for"
#include "FastS/Compute/SA/metric_2d.for"
#include "FastS/Compute/SA/div_rot_2d.for"
w_tg = wigi
Expand All @@ -282,31 +258,30 @@ c Var loc
tc_tg = tcj
inc_tg = incj
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
if(icorr.eq.1) then !flux manquant en I
#include "FastC/HPC_LAYER/loop_end.for"

If(icorr.eq.1) then !flux manquant en I
i = ind_loop(2) + 1
l = inddm( i, j, k)
#include "FastS/Compute/SA/metric_2d.for"
#include "FastS/Compute/SA/div_rot_2d.for"
w_tg = wigi
tc_tg = tci
inc_tg = inci
#include "FastS/Compute/SENSOR/shock_sensor.for"
endif !
ENDDO
!complement jmax
If(jcorr.eq.1) then
j = ind_loop(4)+1
#include "FastS/Compute/loopI_begin.for"
#include "FastS/Compute/SA/metric_2d.for"
#include "FastS/Compute/SA/div_rot_2d.for"
w_tg = wigj
tc_tg = tcj
inc_tg = incj
#include "FastS/Compute/SENSOR/shock_sensor.for"
enddo
Endif
ENDDO
#include "FastC/HPC_LAYER/loopPlanI_begin.for"
#include "FastS/Compute/SA/metric_2d.for"
#include "FastS/Compute/SA/div_rot_2d.for"
w_tg = wigi
tc_tg = tci
inc_tg = inci
#include "FastS/Compute/SENSOR/shock_sensor.for"
#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif !
If(jcorr.eq.1) then !complement jmax
j = ind_loop(4)+1
#include "FastC/HPC_LAYER/loopPlanJ_begin.for"
#include "FastS/Compute/SA/metric_2d.for"
#include "FastS/Compute/SA/div_rot_2d.for"
w_tg = wigj
tc_tg = tcj
inc_tg = incj
#include "FastS/Compute/SENSOR/shock_sensor.for"
#include "FastC/HPC_LAYER/loopPlan_end.for"
Endif

ENDIF
end
10 changes: 10 additions & 0 deletions Fast/FastS/FastS/Compute/SENSOR/wiggle.for
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
!calcul wiggle
qm1 = (rop(nm +v1)-rop(nm2 +v1))*(rop(l +v1)-rop(nm +v1))
qp1 = (rop(l +v1)-rop(nm +v1))*(rop(np +v1)-rop(l +v1))
!if (abs(qm1*roref2_inv).le.cutoff) qm1 = 1
!if (abs(qp1*roref2_inv).le.cutoff) qp1 = 1
f1 = sign(1.,qm1 )+sign(1.,qp1)
qm2 = (rop(nm +v2)-rop(nm2 +v2))*(rop(l +v2)-rop(nm +v2))
qp2 = (rop(l +v2)-rop(nm +v2))*(rop(np +v2)-rop(l +v2))
!if (abs(qm2*vref2_inv).le.cutoff) qm2 = 1
!if (abs(qp2*vref2_inv).le.cutoff) qp2 = 1
f2 = sign(1.,qm2 )+sign(1.,qp2)
qm3 = (rop(nm +v3)-rop(nm2 +v3))*(rop(l +v3)-rop(nm +v3))
qp3 = (rop(l +v3)-rop(nm +v3))*(rop(np +v3)-rop(l +v3))
!if (abs(qm3*vref2_inv).le.cutoff) qm3 = 1
!if (abs(qp3*vref2_inv).le.cutoff) qp3 = 1
f3 = sign(1.,qm3 )+sign(1.,qp3)
qm4 = (rop(nm +v4)-rop(nm2 +v4))*(rop(l +v4)-rop(nm +v4))
qp4 = (rop(l +v4)-rop(nm +v4))*(rop(np +v4)-rop(l +v4))
!if (abs(qm4*vref2_inv).le.cutoff) qm4 = 1
!if (abs(qp4*vref2_inv).le.cutoff) qp4 = 1
f4 = sign(1.,qm4 )+sign(1.,qp4)
qm5 = (rop(nm +v5)-rop(nm2 +v5))*(rop(l +v5)-rop(nm +v5))
qp5 = (rop(l +v5)-rop(nm +v5))*(rop(np +v5)-rop(l +v5))
!if (abs(qm5*tref2_inv).le.cutoff) qm5 = 1
!if (abs(qp5*tref2_inv).le.cutoff) qp5 = 1
f5 = sign(1.,qm5 )+sign(1.,qp5)
Loading

0 comments on commit 4b30e7e

Please sign in to comment.