10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-12-21 11:53:32 +01:00

Locks initialized in openmp mode

This commit is contained in:
Anthony Scemama 2014-10-08 22:56:54 +02:00
parent d17c2870e0
commit 5a3af0649a
5 changed files with 24 additions and 17 deletions

View File

@ -3,8 +3,6 @@ IRPF90
IRPF90 is a Fortran90 preprocessor written in Python for programming using the Implicit Reference to Parameters (IRP) method. It simplifies the development of large fortran codes in the field of scientific high performance computing.
![IRPF90 Logo](Irpf90.xpm)
Dependencies
------------
@ -18,14 +16,14 @@ Installing IRPF90
``${IRPF90_HOME}`` is the location of your irpf90 directory::
``` bash
cd ${IRPF90_HOME}
make
cat << EOF >> ${HOME}/.bash_profile
export PYTHONPATH=${IRPF90_HOME}/src:${PYTHONPATH}
export PATH=${IRPF90_HOME}/bin:${PATH}
export MANPATH=${IRPF90_HOME}/man:${MANPATH}
EOF
. ${HOME}/.bash_profile
cd ${IRPF90_HOME}
make
cat << EOF >> ${HOME}/.bash_profile
export PYTHONPATH=${IRPF90_HOME}/src:${PYTHONPATH}
export PATH=${IRPF90_HOME}/bin:${PATH}
export MANPATH=${IRPF90_HOME}/man:${MANPATH}
EOF
source ${HOME}/.bash_profile
```
@ -35,7 +33,7 @@ Using IRPF90
In an empty directory, run:
``` bash
irpf90 --init
irpf90 --init
```
This command creates a new Makefile suitable for most irpf90 projects.

View File

@ -33,7 +33,7 @@ case "$0" in
local cur
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "`cat tags | cut -d' ' -f 1`" -- "$cur" ) )
COMPREPLY=( $(compgen -W "`[[ -f tags ]] && cat tags | cut -d' ' -f 1`" -- "$cur" ) )
} && complete -F _irpman_complete irpman
;;

View File

@ -40,6 +40,13 @@ def create():
var = variables[v]
out += var.locker
out += [
"subroutine irp_init_locks_%s()"%(irp_id),
" implicit none" ]
for v in l:
out += [ " call irp_lock_%s(.True.)"%v ]
out += [ " call irp_lock_%s(.False.)"%v ]
out += [ "end subroutine" ]
out = map(lambda x: "%s\n"%(x),out)
if not same_file(FILENAME,out):
file = open(FILENAME,'w')

View File

@ -627,6 +627,8 @@ def irp_simple_statements(text):
temp = [ Program(0,"program irp_program",program_name) ]
if command_line.do_profile:
temp += [ Simple_line(0,"call irp_init_timer()",line.filename) ]
if command_line.do_openmp:
temp += [ Simple_line(0," call irp_init_locks_%s()"%(irp_id),line.filename) ]
temp += [ Call(0," call %s"%(program_name),line.filename) ]
if command_line.do_profile:
temp += [ Simple_line(0,"call irp_print_timer()",line.filename) ]

View File

@ -465,7 +465,7 @@ class Variable(object):
same_as = self.same_as
def check_openmp():
if not do_openmp:
if not command_line.do_openmp:
result = [ "!$ nthreads = omp_get_num_threads()" ,
"!$ if (nthreads > 1) then" ,
"!$ print *, irp_here//': Error: Provider in an openMP section'" ,
@ -610,7 +610,7 @@ class Variable(object):
text = parsed_text.move_to_top(text,Implicit)
text = parsed_text.move_to_top(text,Use)
text = map(lambda x: x[1], text)
inside_omp = False
# inside_omp = False
for line in filter(lambda x: type(x) not in [ Begin_doc, End_doc, Doc], text):
if type(line) == Begin_provider:
result = []
@ -630,10 +630,10 @@ class Variable(object):
# Detect OpenMP blocks
buffer = line.text.lower().split()
if buffer[1] == "parallel":
inside_omp = True
# inside_omp = True
self._has_openmp = True
if buffer[1] == "end" and buffer[2] == "parallel":
inside_omp = False
# if buffer[1] == "end" and buffer[2] == "parallel":
# inside_omp = False
result.append(line.text)
else:
# if inside_omp: