mirror of
https://github.com/JHUAPL/kaiju.git
synced 2026-01-09 15:17:56 -05:00
Merged development into newsrc0
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#PBS -q {{ queue }}
|
||||
#PBS -l job_priority={{ job_priority }}
|
||||
#PBS -l walltime={{ walltime }}
|
||||
#PBS -l select=1:ncpus=128:mpiprocs=9:ompthreads=14
|
||||
#PBS -l select=2:ncpus=128:mpiprocs=9:ompthreads=36
|
||||
#PBS -j oe
|
||||
#PBS -m abe
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ source {{ kaijuhome }}/scripts/setupEnvironment.sh
|
||||
echo 'Setting environment variables.'
|
||||
export MAGE_TEST_SET_ROOT={{ mage_test_set_root }}
|
||||
export SLACK_BOT_TOKEN={{ slack_bot_token }}
|
||||
export BRANCH_OR_COMMIT={{ branch_or_commit }}
|
||||
echo 'The active environment variables are:'
|
||||
printenv
|
||||
|
||||
|
||||
@@ -133,24 +133,45 @@ contains
|
||||
type(voltApp_T) :: voltronApp
|
||||
|
||||
character(len=strLen) :: caseInput = 'cmriD.xml'
|
||||
real(rp) testValue
|
||||
real(rp) :: xyz(3), invlat, invlon
|
||||
character(len=strLen) :: checkMessage
|
||||
type(XML_Input_T) :: xmlInp
|
||||
integer :: i,j,k
|
||||
|
||||
voltronApp%vOptions%gamUserInitFunc => initUser
|
||||
call initVoltron(voltronApp, caseInput)
|
||||
|
||||
associate(ebGr=>voltronApp%ebTrcApp%ebState%ebGr)
|
||||
|
||||
! enable debug projection for testing
|
||||
voltronApp%ebTrcApp%ebModel%doDip = .true.
|
||||
|
||||
|
||||
! advance to T=0seconds and perform a squish
|
||||
voltronApp%time = 0
|
||||
call SquishStart(voltronApp)
|
||||
call Squish(voltronApp)
|
||||
call SquishEnd(voltronApp)
|
||||
|
||||
@assertEqual(SUM(voltronApp%chmp2mhd%xyzSquish(:,:,:,1)),143412.6753716097_rp,1e-7_rp,'Squish Fake Projection Latitude value is wrong. Check Squish Processing and Output.')
|
||||
@assertEqual(SUM(voltronApp%chmp2mhd%xyzSquish(:,:,:,2)),352685.8263769484_rp,1e-7_rp,'Squish Fake Projection Longitude value is wrong. Check Squish Processing and Output.')
|
||||
@assertEqual(COUNT(voltronApp%chmp2mhd%isGood),112344,'Squish Fake Projection Good Count is wrong. Check Squish Processing and Output.')
|
||||
@assertEqual(COUNT(norm2(ebGr%xyz(ebGr%is:voltronApp%iDeep+1,ebGr%js:ebGr%je+1,ebGr%ks:ebGr%ke+1,:),4) <= voltronApp%rTrc),COUNT(voltronApp%chmp2mhd%isGood),'Squish Fake Projection Good Count is wrong. Check Squish Processing and Output.')
|
||||
|
||||
do k=ebGr%ks,ebGr%ke+1
|
||||
do j=ebGr%js+1,ebGr%je ! js and je+1 are smoothed singularities, not checked
|
||||
do i=ebGr%is,voltronApp%iDeep+1
|
||||
if(voltronApp%chmp2mhd%isGood(i,j,k)) then
|
||||
xyz = ebGr%xyz(i,j,k,XDIR:ZDIR)
|
||||
invlat = InvLatitude(xyz)
|
||||
invlon = katan2(xyz(YDIR),xyz(XDIR))
|
||||
write (checkMessage,'(A,I0,A,I0,A,I0,A)'), 'Squish Fake Projection Latitude is wrong at (',i,',',j,',',k,'). Check Squish Processing and Output.'
|
||||
@assertEqual(invlat,voltronApp%chmp2mhd%xyzSquish(i,j,k,1),1e-17_rp,trim(checkMessage))
|
||||
write (checkMessage,'(A,I0,A,I0,A,I0,A)'), 'Squish Fake Projection Longitude is wrong at (',i,',',j,',',k,'). Check Squish Processing and Output.'
|
||||
@assertEqual(invlon,voltronApp%chmp2mhd%xyzSquish(i,j,k,2),1e-17_rp,trim(checkMessage))
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
|
||||
end associate
|
||||
|
||||
end subroutine
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ contains
|
||||
type(voltApp_T) :: voltronApp
|
||||
|
||||
character(len=strLen) :: caseInput = 'cmriD.xml'
|
||||
real(rp) testValue
|
||||
type(XML_Input_T) :: xmlInp
|
||||
integer :: i,j
|
||||
character(len=strLen) :: checkMessage
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ringknobs doVClean="T"/>
|
||||
<wind tsfile="bcwind.h5"/>
|
||||
<source doSource="T" doBounceDT="T"/>
|
||||
<threading NumTh="18"/>
|
||||
<threading NumTh="14"/>
|
||||
</Gamera>
|
||||
<!-- Remix -->
|
||||
<REMIX>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ringknobs doVClean="T"/>
|
||||
<wind tsfile="bcwind.h5"/>
|
||||
<source doSource="T" doBounceDT="T"/>
|
||||
<threading NumTh="18"/>
|
||||
<threading NumTh="14"/>
|
||||
<coupling blockHalo="T"/>
|
||||
</Gamera>
|
||||
<!-- Remix -->
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ringknobs doVClean="T"/>
|
||||
<wind tsfile="bcwind.h5"/>
|
||||
<source doSource="T" doBounceDT="T"/>
|
||||
<threading NumTh="18"/>
|
||||
<threading NumTh="14"/>
|
||||
<coupling blockHalo="T"/>
|
||||
</Gamera>
|
||||
<!-- Remix -->
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ringknobs doVClean="T"/>
|
||||
<wind tsfile="bcwind.h5"/>
|
||||
<source doSource="T" doBounceDT="T"/>
|
||||
<threading NumTh="18"/>
|
||||
<threading NumTh="14"/>
|
||||
<coupling blockHalo="T"/>
|
||||
</Gamera>
|
||||
<!-- Remix -->
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ringknobs doVClean="T"/>
|
||||
<wind tsfile="bcwind.h5"/>
|
||||
<source doSource="T" doBounceDT="T"/>
|
||||
<threading NumTh="18"/>
|
||||
<threading NumTh="14"/>
|
||||
<coupling blockHalo="T"/>
|
||||
</Gamera>
|
||||
<!-- Remix -->
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ringknobs doVClean="T"/>
|
||||
<wind tsfile="bcwind.h5"/>
|
||||
<source doSource="T" doBounceDT="T"/>
|
||||
<threading NumTh="18"/>
|
||||
<threading NumTh="14"/>
|
||||
<coupling blockHalo="T"/>
|
||||
</Gamera>
|
||||
<!-- Remix -->
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ringknobs doVClean="T"/>
|
||||
<wind tsfile="bcwind.h5"/>
|
||||
<source doSource="T" doBounceDT="T"/>
|
||||
<threading NumTh="18"/>
|
||||
<threading NumTh="14"/>
|
||||
<coupling blockHalo="T"/>
|
||||
</Gamera>
|
||||
<!-- Remix -->
|
||||
|
||||
@@ -139,7 +139,7 @@ contains
|
||||
|
||||
end subroutine testConcCoupling
|
||||
|
||||
@test(npes=[9])
|
||||
! @test(npes=[9])
|
||||
subroutine testAsyncCoupling(this)
|
||||
class (MpiTestMethod), intent(inout) :: this
|
||||
|
||||
@@ -227,16 +227,6 @@ contains
|
||||
else
|
||||
write (*,'(a,I0)') 'Testing Quick Squish ',this%getNumProcesses()
|
||||
|
||||
!adjust coupling parameters, must be MPI Gamera Coupler
|
||||
SELECT type(cpl=>voltAppMpi%gApp)
|
||||
TYPE IS (gamCouplerMpi_volt_T)
|
||||
call endVoltronWaits(voltAppMpi)
|
||||
voltAppMpi%doSerialMHD = .false.
|
||||
cpl%doAsyncCoupling = .true.
|
||||
CLASS DEFAULT
|
||||
@assertTrue(.false., "Voltron Allocated non-mpi Gamera coupler for MPI Voltron Coupling Test. Failure")
|
||||
ENDSELECT
|
||||
|
||||
! run case for 10 seconds past spinup
|
||||
call runApplication(11.0_rp)
|
||||
|
||||
@@ -283,16 +273,6 @@ contains
|
||||
else
|
||||
write (*,'(a,I0)') 'Testing Quick Squish Storm ',this%getNumProcesses()
|
||||
|
||||
!adjust coupling parameters, must be MPI Gamera Coupler
|
||||
SELECT type(cpl=>voltAppMpi%gApp)
|
||||
TYPE IS (gamCouplerMpi_volt_T)
|
||||
call endVoltronWaits(voltAppMpi)
|
||||
voltAppMpi%doSerialMHD = .false.
|
||||
cpl%doAsyncCoupling = .true.
|
||||
CLASS DEFAULT
|
||||
@assertTrue(.false., "Voltron Allocated non-mpi Gamera coupler for MPI Voltron Coupling Test. Failure")
|
||||
ENDSELECT
|
||||
|
||||
! run case for 10 seconds past restart
|
||||
call runApplication(611.0_rp)
|
||||
|
||||
|
||||
178
tests/voltron_mpi/testebmpi.pf
Normal file
178
tests/voltron_mpi/testebmpi.pf
Normal file
@@ -0,0 +1,178 @@
|
||||
module testebmpi
|
||||
use testHelperMpi
|
||||
use voltapp_mpi
|
||||
use gamCouple_mpi_G2V
|
||||
use uservoltic
|
||||
|
||||
implicit none
|
||||
|
||||
type(gamCouplerMpi_gam_T), allocatable :: gamCplMpi
|
||||
type(voltAppMpi_T), allocatable :: voltAppMpi
|
||||
|
||||
contains
|
||||
|
||||
@before
|
||||
subroutine setup(this)
|
||||
class (MpiTestMethod), intent(inout) :: this
|
||||
character(len=strLen) :: caseFile
|
||||
|
||||
integer :: ierror
|
||||
type(MPI_Comm) :: voltComm
|
||||
type(XML_Input_T) :: xmlInp
|
||||
|
||||
call setMpiReal()
|
||||
|
||||
write(caseFile,'(A,I0,A)') 'cmiD_deep_', this%getNumProcesses()-1, '.xml'
|
||||
|
||||
|
||||
if(this%getProcessRank() < (this%getNumProcesses()-1)) then
|
||||
allocate(gamCplMpi)
|
||||
|
||||
! make gamera-only mpi communicator
|
||||
call MPI_Comm_Split(getMpiF08Communicator(this), gamId, this%getProcessRank(), gamCplMpi%gOptionsMpi%gamComm, ierror)
|
||||
|
||||
gamCplMpi%gOptionsCplMpiG%couplingPoolComm = getMpiF08Communicator(this)
|
||||
gamCplMpi%gOptions%userInitFunc => initUser
|
||||
gamCplMpi%gOptionsMpi%doIO = .false.
|
||||
xmlInp = New_XML_Input(trim(caseFile),'Kaiju',.true.)
|
||||
call gamCplMpi%InitModel(xmlInp)
|
||||
else
|
||||
allocate(voltAppMpi)
|
||||
|
||||
! make gamera-only mpi communicator
|
||||
call MPI_Comm_Split(getMpiF08Communicator(this), voltId, this%getProcessRank(), voltComm, ierror)
|
||||
|
||||
voltAppMpi%vOptions%gamUserInitFunc => initUser
|
||||
allocate(voltAppMpi%vOptionsMpi%couplingPoolComm)
|
||||
voltAppMpi%vOptionsMpi%couplingPoolComm = getMpiF08Communicator(this)
|
||||
call initVoltron_mpi(voltAppMpi, trim(caseFile))
|
||||
endif
|
||||
|
||||
end subroutine setup
|
||||
|
||||
@after
|
||||
subroutine teardown(this)
|
||||
class (MpiTestMethod), intent(inout) :: this
|
||||
|
||||
if(allocated(voltAppMpi)) then
|
||||
call endVoltronWaits(voltAppMpi)
|
||||
deallocate(voltAppMpi)
|
||||
endif
|
||||
if(allocated(gamCplMpi)) deallocate(gamCplMpi)
|
||||
|
||||
end subroutine teardown
|
||||
|
||||
|
||||
! helper subroutine to check squish data in Gas0
|
||||
subroutine testGas0(Gr, locStr)
|
||||
type(Grid_T), intent(in) :: Gr
|
||||
character(len=*), intent(in) :: locStr
|
||||
|
||||
real(rp) :: Qs(8),xyz(NDIM), X1cc, X2cc
|
||||
real(rp), allocatable :: SrcX12(:,:,:,:)
|
||||
character(len=strLen) :: checkMessage
|
||||
integer :: i,j,k,jmin,jmax
|
||||
|
||||
!Testing code to run on each gamera mpi rank
|
||||
allocate(SrcX12(Gr%isg:Gr%ieg+1,Gr%jsg:Gr%jeg+1,Gr%ksg:Gr%keg+1,2))
|
||||
|
||||
!Calculate corner projections
|
||||
do k=Gr%ksg,Gr%keg+1
|
||||
do j=Gr%jsg,Gr%jeg+1
|
||||
do i=Gr%isg,Gr%ieg+1
|
||||
xyz = Gr%xyz(i,j,k,:) !Corner
|
||||
SrcX12(i,j,k,1) = rad2deg*InvLatitude(xyz)
|
||||
SrcX12(i,j,k,2) = rad2deg*katan2(xyz(YDIR),xyz(XDIR))
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
|
||||
if(Gr%hasLowerBC(JDIR)) then
|
||||
jMin = Gr%js+1
|
||||
else
|
||||
jMin = Gr%jsg
|
||||
endif
|
||||
if(Gr%hasUpperBC(JDIR)) then
|
||||
jMax = Gr%je-1
|
||||
else
|
||||
jMax = Gr%jeg
|
||||
endif
|
||||
|
||||
!Now check against each cell center Gas0 value
|
||||
do k=Gr%ksg,Gr%keg
|
||||
do j=jMin,jMax ! singularities get averaged, don't test them
|
||||
do i=Gr%isg,Gr%ieg
|
||||
!Define cell center value to be appropriate 8-point of corners
|
||||
if(Gr%Gas0(i,j,k,IMDEN,BLK) /= 0 .or. Gr%Gas0(i,j,k,IMX1,BLK) /= 0 .or. &
|
||||
Gr%Gas0(i,j,k,IMX2,BLK) /= 0 .or. Gr%Gas0(i,j,k,IMPR,BLK) /= 0) then
|
||||
!Gas0 data is tasty/valid
|
||||
call SquishCorners(SrcX12(i:i+1,j:j+1,k:k+1,1),Qs)
|
||||
X1cc = ArithMean(Qs)
|
||||
call SquishCorners(SrcX12(i:i+1,j:j+1,k:k+1,2),Qs)
|
||||
X2cc = CircMeanDeg(Qs)
|
||||
|
||||
write (checkMessage,'(A,A,A,I0,A,I0,A,I0,A)'), 'Gas0 Latitude is wrong on ',trim(locStr),' at (',i,',',j,',',k,')'
|
||||
@assertEqual(X1cc,Gr%Gas0(i,j,k,IMX1,BLK),1e-17_rp,trim(checkMessage))
|
||||
write (checkMessage,'(A,A,A,I0,A,I0,A,I0,A)'), 'Gas0 Longitude is wrong on ',trim(locStr),' at (',i,',',j,',',k,')'
|
||||
@assertEqual(X2cc,Gr%Gas0(i,j,k,IMX2,BLK),1e-17_rp,trim(checkMessage))
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
|
||||
deallocate(SrcX12)
|
||||
|
||||
end subroutine
|
||||
|
||||
@test(npes=[2,5,9])
|
||||
subroutine VMPIsquishDipoleTest(this)
|
||||
class (MpiTestMethod), intent(inout) :: this
|
||||
|
||||
character(len=strLen) :: locStr, checkMessage
|
||||
integer :: i,j,k
|
||||
|
||||
if(allocated(gamCplMpi)) then
|
||||
|
||||
! receive data from voltron
|
||||
call recvDeepCplDataMpi(gamCplMpi)
|
||||
|
||||
! check Gas0 data
|
||||
write (locStr,'(A,I0,A,I0,A,I0,A)'), 'Gam(',gamCplMpi%Grid%Ri,',',gamCplMpi%Grid%Rj,',',gamCplMpi%Grid%Rk,')'
|
||||
call testGas0(gamCplMpi%Grid, locStr)
|
||||
|
||||
else
|
||||
|
||||
! enable debug projection and tubes for testing
|
||||
voltAppMpi%ebTrcApp%ebModel%doDip = .true.
|
||||
select type(rcmApp=>voltAppMpi%imagApp)
|
||||
type is (rcmIMAG_T)
|
||||
rcmApp%doFakeTube = .true.
|
||||
class default
|
||||
@assertTrue(.false., 'IMAG type must be RCM for the MPI squish test')
|
||||
end select
|
||||
! disable quick squishing
|
||||
voltAppMpi%qkSquishStride = 1
|
||||
voltAppMpi%doQkSquish = .false.
|
||||
|
||||
@assertTrue(voltAppMpi%ebTrcApp%ebSquish%myNumBlocks < 0, 'Helpers must be disabled for MPI squish test')
|
||||
|
||||
! advance to T=0seconds and perform a deep coupling
|
||||
voltAppMpi%time = 0
|
||||
call DeepUpdate_mpi(voltAppMpi)
|
||||
|
||||
SELECT type(cpl=>voltAppMpi%gApp)
|
||||
TYPE IS (gamCouplerMpi_volt_T)
|
||||
! send the data to gamera
|
||||
call sendDeepCplDataMpi(cpl)
|
||||
CLASS DEFAULT
|
||||
@assertTrue(.false., "Voltron Allocated non-mpi Gamera coupler for MPI squish test. Failure")
|
||||
ENDSELECT
|
||||
|
||||
! check results on voltron side
|
||||
call testGas0(voltAppMpi%gApp%Grid, 'Voltron')
|
||||
|
||||
endif
|
||||
end subroutine VMPIsquishDipoleTest
|
||||
|
||||
end module testebmpi
|
||||
|
||||
Reference in New Issue
Block a user