ppOpen-APPL/FEM: New package. (#15911)
* ppOpen-APPL/FEM: New package. * typo fix. Update patch.
This commit is contained in:
parent
93e22426a6
commit
ae94c52f1c
69
var/spack/repos/builtin/packages/ppopen-appl-fem/gcc_struct_atomic.patch
Executable file
69
var/spack/repos/builtin/packages/ppopen-appl-fem/gcc_struct_atomic.patch
Executable file
@ -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
|
63
var/spack/repos/builtin/packages/ppopen-appl-fem/package.py
Normal file
63
var/spack/repos/builtin/packages/ppopen-appl-fem/package.py
Normal file
@ -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)
|
||||
)
|
Loading…
Reference in New Issue
Block a user