Skip to content

Commit

Permalink
Merge pull request #212 from BerkeleyLab/parallel
Browse files Browse the repository at this point in the history
Fix locality macro logic
  • Loading branch information
rouson authored Oct 1, 2024
2 parents af9bc3a + 222c062 commit 03ea107
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
14 changes: 14 additions & 0 deletions include/language-support.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
! Copyright (c), The Regents of the University of California
! Terms of use are as specified in LICENSE.txt

#ifndef F2023_LOCALITY
#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 202400)
# define F2023_LOCALITY 1
#endif
#endif

#ifndef F2018_LOCALITY
#if defined(_CRAYFTN)
# define F2018_LOCALITY 1
#endif
#endif
16 changes: 3 additions & 13 deletions src/inference_engine/trainable_engine_s.F90
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
! Copyright (c), The Regents of the University of California
! Terms of use are as specified in LICENSE.txt

#ifndef F2023_LOCALITY
#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 202400)
# define F2023_LOCALITY 1
#endif
#endif

#ifndef F2018_LOCALITY
#if defined(_CRAYFTN)
# define F2018_LOCALITY 1
#endif
#endif
#include "language-support.F90"

submodule(trainable_engine_m) trainable_engine_s
use assert_m, only : assert
Expand Down Expand Up @@ -196,7 +186,7 @@
real(rkind) reduce_dcdw(size(dcdw,1),size(dcdw,2),size(dcdw,3),mini_batch_size)
reduce_dcdb = 0._rkind
reduce_dcdw = 0._rkind

iterate_through_batch: &
do concurrent (pair = 1:mini_batch_size) local(a,z,delta)

Expand Down Expand Up @@ -268,7 +258,7 @@
end do iterate_through_batch
dcdb = sum(reduce_dcdb,dim=3)
dcdw = sum(reduce_dcdw,dim=4)

end block reduce_gradients
#else
end block iteration
Expand Down

0 comments on commit 03ea107

Please sign in to comment.