OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
inipar.F File Reference
#include "implicit_f.inc"
#include "comlock.inc"
#include "r4r8_p.inc"
#include "spmd.inc"
#include "com01_c.inc"
#include "task_c.inc"
#include "scr05_c.inc"
#include "units_c.inc"
#include "commandline.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine inipar (coupling, itid, icas, nnodes, input, got_input, nbtask)

Function/Subroutine Documentation

◆ inipar()

subroutine inipar ( type(coupling_type), intent(inout) coupling,
integer, dimension(*) itid,
integer icas,
integer nnodes,
character*100 input,
integer got_input,
integer, dimension(*) nbtask )

Definition at line 375 of file inipar.F.

376C-----------------------------------------------------------------
377 USE spmd_comm_world_mod, ONLY : spmd_comm_world
378 USE coupling_adapter_mod
379#include "implicit_f.inc"
380#include "comlock.inc"
381#include "r4r8_p.inc"
382C-----------------------------------------------
383C D u m m y A r g u m e n t s
384C-----------------------------------------------
385 INTEGER ITID(*),ICAS, NNODES,GOT_INPUT,NBTASK(*)
386 CHARACTER*100 INPUT
387C-----------------------------------------------
388C C o m m o n B l o c k s
389C-----------------------------------------------
390#include "spmd.inc"
391#include "com01_c.inc"
392#include "task_c.inc"
393#include "scr05_c.inc"
394#include "units_c.inc"
395#include "commandline.inc"
396C-----------------------------------------------
397C L o c a l V a r i a b l e s
398C-----------------------------------------------
399 type(coupling_type), intent(inout) :: coupling
400 INTEGER ICODE, I, NTHREAD1
401#if defined(_OPENMP)
402 INTEGER OMP_GET_MAX_THREADS
403#endif
404 CHARACTER (LEN=255) :: STR
405C--------------------------------------------------
406C CONVENTIONS:
407C ispmd 0...NSPMD-1
408C--------------------------------------------------
409 IF(icas==1) THEN
410C
411 REAL = 4
412 IF(ir4r8==2) real = 8
413C
414 nnodes= 1
415 ispmd = 0
416#if defined(_OPENMP)
417 str = ' '
418 CALL getenv('OMP_NUM_THREADS',str)
419 nthread1=0
420C nthread1 : nombre de threads fixe par la variable environnememt
421 READ(str,'(I10)',err=999)nthread1
422 GOTO 1000
423 999 CONTINUE
424 nthread1 = -1
425 1000 CONTINUE
426 IF(nthread1>0)THEN
427 nthread=nthread1
428 ELSE
429 nthread=nthread0 ! defaut run precedent
430 END IF
431 IF (got_nth == 1) THEN
432 IF (nthread>1 .AND. (nth/= nthread .OR. (nth==nthread .AND.
433 + nthread1>0.AND.nthread0>1.AND.nthread1/=nthread0)))THEN
434 WRITE(iout,*)
435 + '** WARNING : -nthread OPTION USED, DEFAULT SETTING IGNORED'
436 WRITE(iout,*)' '
437 END IF
438 nthread = nth
439 ELSE
440 IF(nthread1>0.AND.nthread0>1.AND.nthread1/=nthread0)THEN
441 WRITE(iout,*)
442 + '** WARNING : OMP_NUM_THREADS SET, DEFAULT SETTING IGNORED'
443 WRITE(iout,*)' '
444 END IF
445 ENDIF
446 IF(nthread<=0) nthread=1
447 IF(nthread>nthmax) nthread=nthmax
448C
449#elif 1
450 nthread = 1
451#endif
452 ELSE IF(icas==3) THEN
453C
454 IF (nspmd /= nnodes) THEN
455 WRITE(iout,*)
456 . 'NON HYBRID EXECUTABLE ONLY SUPPORTS ONE SPMD DOMAIN'
457 WRITE(iout,*)
458 . 'PLEASE, RUN STARTER WITH -nspmd 1 OR USE HMPP EXECUTABLE'
459 WRITE(iout,*)
460 . 'REQUIRED (number of .rst files) NSPMD =',nspmd
461 WRITE(iout,*)
462 . 'AVAILABLE =',nnodes
463 WRITE(iout,*)' '
464 WRITE(istdo,*)
465 . 'NON HYBRID EXECUTABLE ONLY SUPPORTS ONE SPMD DOMAIN'
466 WRITE(istdo,*)
467 . 'PLEASE, RUN STARTER WITH -nspmd 1 OR USE HMPP EXECUTABLE'
468 WRITE(istdo,*)' '
469 WRITE(iout,*)
470 . ' E R R O R T E R M I N A T I O N'
471 WRITE(istdo,*)
472 . ' E R R O R T E R M I N A T I O N'
473 WRITE(iout,*)
474 . ' TOTAL NUMBER OF CYCLES :', ncycle
475 WRITE(istdo,*)
476 . ' TOTAL NUMBER OF CYCLES :', ncycle
477 icode=2
478 CALL arret(7)
479C
480 ENDIF
481 nbtask(1)=nthread
482 nbtask(2)=nthread
483#if defined(_OPENMP)
484 CALL omp_set_num_threads(nthread)
485 DO i = 1, 2*intseg
486 CALL omp_init_lock(llock(1,i))
487 ENDDO
488#endif
489 ELSE IF(icas==2) THEN
490#if defined(_OPENMP)
491#endif
492 ENDIF
493 RETURN
subroutine arret(nn)
Definition arret.F:87