nb_procs Subroutine

private subroutine nb_procs()

Number of concurrent threads

Arguments

None

Calls

proc~~nb_procs~~CallsGraph proc~nb_procs nb_procs omp_get_num_procs omp_get_num_procs proc~nb_procs->omp_get_num_procs

Called by

proc~~nb_procs~~CalledByGraph proc~nb_procs nb_procs proc~read_job read_job proc~read_job->proc~nb_procs proc~prg_surf prg_surf proc~prg_surf->proc~read_job program~main main program~main->proc~prg_surf

Source Code

   subroutine nb_procs()
      !! Number of concurrent threads
   implicit none

      integer(kind=I4) :: nb_th

      read(JOB,*) nb_th ; LINE_READ = LINE_READ + 1 ; write(SPY, *) LINE_READ, 'nb_procs', nb_th

      select case( nb_th )

         case( 0) ! no multihreading
            PARAM%nb_threads = 1
            NB_THREADS_FFT   = 1

         case(-1) ! determined by system
            PARAM%nb_threads = omp_get_num_procs()
            NB_THREADS_FFT   = PARAM%nb_threads

         case default
            stop 'Bad choice "nb_procs" in "mod_script"'

      endselect

   return
   endsubroutine nb_procs