Commit 7cab1a8f authored by Juan Caneses Marin (nfc)'s avatar Juan Caneses Marin (nfc)
Browse files

Settingn number of threads via environment variable in runProg.sh

parent 17994b47
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ in%Nsteps = 5000,
in%dt     = 0.5E-7,                                                             ! Time step in [s]
in%zmax = +5.0,
in%zmin = -5.0,
in%threads_request = 4,
in%padding = 4,

in%iSave = .true.,
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ in%Nsteps = 600, !
in%dt     = 0.5E-7,                                                             ! Time step in [s]
in%zmax = +5.0,
in%zmin = -5.0,
in%threads_request = 10,

in%iSave = .true.,
in%iPush = .true.,                                                             ! Enable RK4 particle pusher
+1 −6
Original line number Diff line number Diff line
@@ -217,11 +217,6 @@ CALL random_seed(get=seed)
seed = 314159565
CALL random_seed(put=seed)

! OMP setup:
! ==============================================================================
! Set the number of threads:
CALL OMP_SET_NUM_THREADS(in%threads_request)

! Inititalize zp, kep, xip
! ==============================================================================
kep = 0.; xip = 0.; zp = 0.;
@@ -274,7 +269,7 @@ TimeStepping: do j = 1,in%Nsteps

          ! Loop over particles:
          ! ==============================================================================
          !$OMP DO SCHEDULE(STATIC,in%Nparts/in%threads_request)
          !$OMP DO
              AllParticles: do i = 1,in%Nparts

            		if (j .EQ. 1 .AND. i .EQ. 1) then
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ TYPE inTYP
  REAL(r8) :: Aion, Zeff, Zion
  INTEGER(i4) :: Nparts, Nsteps, nz, species_a, species_b
  INTEGER(i4) :: jstart, jend, jincr
  INTEGER(i4) :: padding, threads_request, threads_given, particleBC
  INTEGER(i4) :: padding, threads_given, particleBC
  LOGICAL:: iDrag, iPotential, iSave, iPush, iHeat, iColl
  INTEGER(i4) :: zp_InitType
  REAL(r8) :: zp_init, Ep_init, xip_init, zp_init_std, Tp_init
+5 −1
Original line number Diff line number Diff line
@@ -5,9 +5,13 @@
INPUT_FILE="xp_IonSlowingDown.in"
#INPUT_FILE="xp_Test.in"

# Set number of threads:
# ===================================================
export OMP_NUM_THREADS=1

# Set processor binding for openMP:
# ===================================================
OMP_PROC_BIND=true
export OMP_PROC_BIND=true

# Get repo directory:
# ===================================================