set num threads back and forth between abaqus and DAMASK (like marc)

This commit is contained in:
Martin Diehl 2014-04-29 16:11:13 +00:00
parent 2346a0841e
commit 01416b7ab6
3 changed files with 18 additions and 2 deletions

View File

@ -106,6 +106,8 @@ subroutine vumat(nBlock, nDir, nshr, nStateV, nFieldV, nProps, lAnneal, &
use prec, only: &
pReal, &
pInt
!$ use numerics, only: &
!$ DAMASK_NumThreadsInt
use FEsolving, only: &
cycleCounter, &
theTime, &
@ -192,7 +194,14 @@ subroutine vumat(nBlock, nDir, nshr, nStateV, nFieldV, nProps, lAnneal, &
real(pReal), dimension(6,6) :: ddsdde
real(pReal) :: temp, timeInc
integer(pInt) :: computationMode, n, i, cp_en
!$ integer :: defaultNumThreadsInt !< default value set by Abaqus
!$ include "omp_lib.h"
!$ defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
!$ call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS
enerInternNew = 0.0_pReal
enerInelasNew = 0.0_pReal
computationMode = CPFEM_CALCRESULTS ! always calculate
do n = 1,nblock(1) ! loop over vector of IPs
temp = tempOld(n)
@ -279,6 +288,7 @@ subroutine vumat(nBlock, nDir, nshr, nStateV, nFieldV, nProps, lAnneal, &
nBlock(2),mesh_FEasCP('elem', nBlock(4_pInt+n)))
enddo
!$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value
end subroutine vumat

View File

@ -101,11 +101,11 @@ subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,&
TIME,DTIME,TEMP,DTEMP,PREDEF,DPRED,CMNAME,NDI,NSHR,NTENS,&
NSTATV,PROPS,NPROPS,COORDS,DROT,PNEWDT,CELENT,&
DFGRD0,DFGRD1,NOEL,NPT,KSLAY,KSPT,KSTEP,KINC)
use prec, only: &
pReal, &
pInt
use numerics, only: &
!$ DAMASK_NumThreadsInt, &
usePingPong
use FEsolving, only: &
cycleCounter, &
@ -202,11 +202,16 @@ subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,&
real(pReal), dimension(6,6) :: ddsdde_h
integer(pInt) :: computationMode, i, cp_en
logical :: cutBack
!$ integer :: defaultNumThreadsInt !< default value set by Abaqus
!$ include "omp_lib.h"
temperature = temp ! temp is intent(in)
DDSDDT = 0.0_pReal
DRPLDE = 0.0_pReal
!$ defaultNumThreadsInt = omp_get_num_threads() ! remember number of threads set by Marc
!$ call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution set by DAMASK_NUM_THREADS
if (iand(debug_level(debug_abaqus),debug_levelBasic) /= 0 .and. noel == 1 .and. npt == 1) then
!$OMP CRITICAL (write2out)
write(6,*) 'el',noel,'ip',npt
@ -342,6 +347,7 @@ subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,&
statev = materialpoint_results(1:min(nstatv,materialpoint_sizeResults),npt,mesh_FEasCP('elem', noel))
if ( terminallyIll ) pnewdt = 0.5_pReal ! force cutback directly ?
!$ call omp_set_num_threads(defaultNumThreadsInt) ! reset number of threads to stored default value
end subroutine UMAT

View File

@ -123,7 +123,7 @@ subroutine numerics_init
IO_EOF
#ifdef Spectral
!$ use OMP_LIB, only: omp_set_num_threads ! Use the standard conforming module file for omp if not using MSC.Marc
!$ use OMP_LIB, only: omp_set_num_threads ! Use the standard conforming module file for omp if using the spectral solver
#endif
implicit none
#ifndef Spectral