summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorToyohisa Kameyama <kameyama@riken.jp>2020-04-07 22:43:46 +0900
committerGitHub <noreply@github.com>2020-04-07 08:43:46 -0500
commitae94c52f1c7cf8341cec15e4c2dd29677a7af037 (patch)
tree426a03f3ad52dc5c2e4fb6ff59cc949b8957db68 /var
parent93e22426a678c09e983b207542fea44a006b3a69 (diff)
downloadspack-ae94c52f1c7cf8341cec15e4c2dd29677a7af037.tar.gz
spack-ae94c52f1c7cf8341cec15e4c2dd29677a7af037.tar.bz2
spack-ae94c52f1c7cf8341cec15e4c2dd29677a7af037.tar.xz
spack-ae94c52f1c7cf8341cec15e4c2dd29677a7af037.zip
ppOpen-APPL/FEM: New package. (#15911)
* ppOpen-APPL/FEM: New package. * typo fix. Update patch.
Diffstat (limited to 'var')
-rwxr-xr-xvar/spack/repos/builtin/packages/ppopen-appl-fem/gcc_struct_atomic.patch69
-rw-r--r--var/spack/repos/builtin/packages/ppopen-appl-fem/package.py63
2 files changed, 132 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/ppopen-appl-fem/gcc_struct_atomic.patch b/var/spack/repos/builtin/packages/ppopen-appl-fem/gcc_struct_atomic.patch
new file mode 100755
index 0000000000..cd4fc87d9d
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ppopen-appl-fem/gcc_struct_atomic.patch
@@ -0,0 +1,69 @@
+diff --git a/ppohFEM/src/solver/matrix/hecmw_mat_ass.f90 b/ppohFEM/src/solver/matrix/hecmw_mat_ass.f90
+index dda6a62..6010d6d 100644
+--- a/ppohFEM/src/solver/matrix/hecmw_mat_ass.f90
++++ b/ppohFEM/src/solver/matrix/hecmw_mat_ass.f90
+@@ -322,7 +322,7 @@ module hecmw_matrix_ass
+ subroutine hecmw_mat_ass_bc(hecMAT, inode, idof, RHS, conMAT)
+ type (hecmwST_matrix) :: hecMAT
+ integer(kind=kint) :: inode, idof
+- real(kind=kreal) :: RHS
++ real(kind=kreal) :: RHS, tmp
+ type (hecmwST_matrix),optional :: conMAT
+ integer(kind=kint) :: NDOF, in, i, ii, iii, ndof2, k, iS, iE, iiS, iiE, ik
+
+@@ -338,13 +338,13 @@ module hecmw_matrix_ass
+
+ DO i = NDOF-1,0,-1
+ IF( i .NE. NDOF-idof ) THEN
++ tmp = hecMAT%D(ndof2*inode-ii)*RHS
+ !$omp atomic
+- hecMAT%B(NDOF*inode-i) = hecMAT%B(NDOF*inode-i) &
+- - hecMAT%D(ndof2*inode-ii)*RHS
++ hecMAT%B(NDOF*inode-i) = hecMAT%B(NDOF*inode-i) - tmp
+ if(present(conMAT)) then
++ tmp = conMAT%D(ndof2*inode-ii)*RHS
+ !$omp atomic
+- conMAT%B(NDOF*inode-i) = conMAT%B(NDOF*inode-i) &
+- - conMAT%D(ndof2*inode-ii)*RHS
++ conMAT%B(NDOF*inode-i) = conMAT%B(NDOF*inode-i) - tmp
+ endif
+ ENDIF
+ ii = ii - NDOF
+@@ -393,14 +393,14 @@ module hecmw_matrix_ass
+ if (hecMAT%itemU(ik) .eq. inode) then
+ iii = ndof2 - idof
+ DO i = NDOF-1,0,-1
++ tmp = hecMAT%AU(ndof2*ik-iii)*RHS
+ !$omp atomic
+- hecMAT%B(NDOF*in-i) = hecMAT%B(NDOF*in-i) &
+- - hecMAT%AU(ndof2*ik-iii)*RHS
++ hecMAT%B(NDOF*in-i) = hecMAT%B(NDOF*in-i) - tmp
+ hecMAT%AU(ndof2*ik-iii)= 0.d0
+ if(present(conMAT)) then
++ tmp = conMAT%AU(ndof2*ik-iii)*RHS
+ !$omp atomic
+- conMAT%B(NDOF*in-i) = conMAT%B(NDOF*in-i) &
+- - conMAT%AU(ndof2*ik-iii)*RHS
++ conMAT%B(NDOF*in-i) = conMAT%B(NDOF*in-i) - tmp
+ conMAT%AU(ndof2*ik-iii)= 0.d0
+ endif
+ iii = iii - NDOF
+@@ -432,14 +432,14 @@ module hecmw_matrix_ass
+ iii = ndof2 - idof
+
+ DO i = NDOF-1, 0, -1
++ tmp = hecMAT%AL(ndof2*ik-iii)*RHS
+ !$omp atomic
+- hecMAT%B(NDOF*in-i) = hecMAT%B(NDOF*in-i) &
+- - hecMAT%AL(ndof2*ik-iii)*RHS
++ hecMAT%B(NDOF*in-i) = hecMAT%B(NDOF*in-i) - tmp
+ hecMAT%AL(ndof2*ik-iii) = 0.d0
+ if(present(conMAT)) then
++ tmp = conMAT%AL(ndof2*ik-iii)*RHS
+ !$omp atomic
+- conMAT%B(NDOF*in-i) = conMAT%B(NDOF*in-i) &
+- - conMAT%AL(ndof2*ik-iii)*RHS
++ conMAT%B(NDOF*in-i) = conMAT%B(NDOF*in-i) - tmp
+ conMAT%AL(ndof2*ik-iii) = 0.d0
+ endif
+ iii = iii - NDOF
diff --git a/var/spack/repos/builtin/packages/ppopen-appl-fem/package.py b/var/spack/repos/builtin/packages/ppopen-appl-fem/package.py
new file mode 100644
index 0000000000..df15a29523
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ppopen-appl-fem/package.py
@@ -0,0 +1,63 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+
+from spack import *
+import os
+
+
+class PpopenApplFem(MakefilePackage):
+ """
+ ppOpen-APPL/FEM (ppohFEM) is a middleware to allow a Finite Element
+ Method (FEM) analysis code developer to devote himself to development of
+ the application software by offering a function commonly used in FEM.
+ """
+
+ homepage = "http://ppopenhpc.cc.u-tokyo.ac.jp/ppopenhpc/"
+ url = "file://{0}/ppohFEM_1.0.1.tar.gz".format(os.getcwd())
+
+ version('1.0.1', sha256='eea8837fa3eda284759b7ebf27c27cea8cbf9cf65cf37c62941700e1321aeb07')
+
+ depends_on('mpi')
+ depends_on('metis')
+
+ # gcc does not support OpenMP atomic to same structure reference.
+ # For example a%b = a%b - a%c
+ # To avoid this, the patch is replace as follows:
+ # tmp = a%c
+ # !%omp atomic
+ # a%b = a%b - a%c
+ patch('gcc_struct_atomic.patch', when='%gcc')
+ parallel = False
+
+ def edit(self, spec, prefix):
+ fflags = ['-O3', '-I.', self.compiler.openmp_flag]
+ if spec.satisfies('%gcc'):
+ fflags.extend(['-cpp', '-ffree-line-length-none'])
+ makefile_in = FileFilter('Makefile.in')
+ makefile_in.filter(
+ r'^PREFIX *=.*$',
+ 'PREFIX = {0}'.format(prefix)
+ )
+ makefile_in.filter(
+ r'^F90OPTFLAGS *=.*$',
+ 'F90OPTFLAGS = {0}'.format(' '.join(fflags))
+ )
+ makefile_in.filter(
+ r'^METISDIR *=.*$',
+ 'METISDIR = {0}'.format(spec['metis'].prefix)
+ )
+ makefile_in.filter('mpicc', spec['mpi'].mpicc)
+ makefile_in.filter('mpif90', spec['mpi'].mpifc)
+
+ def install(self, spec, prefix):
+ for d in ['ppohFEM', 'app_flow', 'app_heat', 'app_struct']:
+ with working_dir(d):
+ for install_dir in ['bin', 'lib', 'include']:
+ if os.path.isdir(install_dir):
+ install_tree(
+ install_dir,
+ join_path(prefix, install_dir)
+ )