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 371 of file inipar.F.

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