Skip to content

Commit 7bfd075

Browse files
pyft renamed into pyfortool
1 parent c765b3e commit 7bfd075

File tree

9 files changed

+77
-77
lines changed

9 files changed

+77
-77
lines changed

build/with_fcm/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The make\_fcm.sh script will:
1818
- populate the fcm and fiat directories on first call
1919
- create the arch\_$ARCH directory, poulate it with arch specific files and a compilation script
2020
- populate the compilation directory with source code (using the prep\_code.sh script). Source code
21-
transformation can occur during this step (in particular using the PYFT_OPTS variable set
21+
transformation can occur during this step (in particular using the PYFT\_OPTS variable set
2222
in the architecture env file).
2323
- execute the newly created compilation script
2424

@@ -37,7 +37,7 @@ Such a file can be build using a gmkfile with the command:
3737
make\_fcm.sh --gmkfile \<GMKFILE\> --arch \<new arch name\>
3838
The env file is sourced several times:
3939
- before populating the build directory with the source code.
40-
Indeed, during this second step, the source code is copied or cloned and transformed by the pyft\_tool.py script.
40+
Indeed, during this second step, the source code is copied or cloned and transformed by the pyfortool script.
4141
The active transformations are controlled by the --noexpand/--expand options given to the
4242
different check\_commit\_\* scripts and by the PYFT\_OPTS that can be set in the env file (only for testprogs).
4343
The syntax is given below.
@@ -57,10 +57,10 @@ A line can take one of these two forms:
5757
If the line doesn't contain the FILE\_DESCRIPTOR part, it applies to all source code.
5858

5959
For example, to transform all source code in lower case:
60-
> export OPTS='--lowerCase'; pyft\_tool.py --pyft\_opts\_env OPTS ...
60+
> export OPTS='--lowerCase'; pyfortool --pyfortool\_opts\_env OPTS ...
6161
6262
To transform all source code in lower case, except routines in turb directory which must be
6363
in upper case but keeping the turb.F90 in lower case:
6464
> export OPTS='--lowerCase
6565
> ^turb/:=:--upperCase
66-
> ^turb/turb\..90:=:--lowerCase'; pyft\_tool.py --pyft\_opts\_env OPTS ...
66+
> ^turb/turb\..90:=:--lowerCase'; pyfortool --pyfortool\_opts\_env OPTS ...

build/with_fcm/arch/arch-pgi_CPU_preGPU_MFflavour.env

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ descTree=${TMPDIR:-/tmp}/descTree_$$
4848
trap "\rm -f $descTree" EXIT
4949

5050
#We cannot suppress non column calls for Méso-NH, stack transformation is replaced by allocatables
51-
#source this file, then: "export PYFT_OPTS_MNH; check_commit_mesonh.sh --prep_code-opts '--pyft_opts_env PYFT_OPTS_MNH' ...."
51+
#source this file, then: "export PYFT_OPTS_MNH; check_commit_mesonh.sh --prep_code-opts '--pyfortool_opts_env PYFT_OPTS_MNH' ...."
5252
#The --wrapH is automatically set by prep_code
5353
#The --mnhExpand is controlled by the different check_commit_* scripts
5454
#--addIncludes must be before --descTree because --addIncludes removes a wrong "file" node
@@ -66,7 +66,7 @@ $specificTransfos
6666
^(./)?micro/rain_ice.F90:=:--removeCall ELEC_TENDENCIES $PYFT_OPTS_MNH"
6767

6868
#For IAL, stack transformation is replaced by allocatables
69-
#source this file, then: "export PYFT_OPTS_IAL; check_commit_ial.sh --prep_code-opts '--pyft_opts_env PYFT_OPTS_IAL' ...."
69+
#source this file, then: "export PYFT_OPTS_IAL; check_commit_ial.sh --prep_code-opts '--pyfortool_opts_env PYFT_OPTS_IAL' ...."
7070
#The --wrapH is automatically set by prep_code
7171
#The --mnhExpand is controlled by the different check_commit_* scripts
7272
#--addIncludes must be before --descTree because --addIncludes removes a wrong "file" node

build/with_fcm/make_fcm.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $0 [options]
4343
-c performs compilation
4444
--inplace-install install or update, if needed, fiat and fcm in the directory where the current script is
4545
--inplace-clean remove the fiat and fcm installation present in the directory where the current script is
46-
--ssh use the ssh protocol to clone the pyft and fxtran repositories instead of https"
46+
--ssh use the ssh protocol to clone the pyfortool and fxtran repositories instead of https"
4747
4848
Unrecognized options are passed to the fcm build command. Useful options include :
4949
--new clean build tree before building
@@ -425,15 +425,15 @@ if [ $packupdate -eq 1 -o $packcreation -eq 1 ]; then
425425
#This commit is ready for inclusion
426426
PATH=$UPDATEDPATH prep_code.sh -c $commit src
427427
else
428-
PATH=$UPDATEDPATH prep_code.sh --pyft_opts_env PYFT_OPTS -c $commit $expand_options $subs \
429-
-m offline src --useParallelPyft -- --tree . --descTree $descTree
428+
PATH=$UPDATEDPATH prep_code.sh --pyfortool_opts_env PYFT_OPTS -c $commit $expand_options $subs \
429+
-m offline src --useParallelPyForTool -- --tree . --descTree $descTree
430430
fi
431431
else
432432
echo "Copy $fromdir"
433433
mkdir src
434434
scp -q -r $fromdir/src src/
435-
PATH=$UPDATEDPATH prep_code.sh --pyft_opts_env PYFT_OPTS $expand_options $subs \
436-
-m offline src --useParallelPyft -- --tree . --descTree $descTree
435+
PATH=$UPDATEDPATH prep_code.sh --pyfortool_opts_env PYFT_OPTS $expand_options $subs \
436+
-m offline src --useParallelPyForTool -- --tree . --descTree $descTree
437437
fi
438438

439439
# Add some code

src/common/micro/modi_minpack.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
MODULE MODI_MINPACK
2-
!Automatically generated by pyft
2+
!Automatically generated by PyForTool
33
IMPLICIT NONE
44
INTERFACE
55
subroutine chkder ( m, n, x, fvec, fjac, ldfjac, xp, fvecp, mode, err )

tools/INSTALL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ This document is written using the markdown language. With pandoc, it can be con
2020
3. AUTOMATIC INSTALLATION
2121
The script INSTALL.sh (INSTALL.sh -h for help) handles the installation of:
2222

23-
- the pyft tool needed by the different check\_commit\_\*.sh scripts, depending on options used at execution.
23+
- the pyfortool tool needed by the different check\_commit\_\*.sh scripts, depending on options used at execution.
2424
- the testprogs reference data which are needed by the script check\_commit\_testprogs.sh. The manual
2525
generation of these data is explained in [INSTALL\_testprogs](./INSTALL_testprogs.md)

tools/INSTALL.sh

+19-19
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -e
55
set -o pipefail #abort if left command on a pipe fails
66

7-
pyft_version=tags/0.1.1
7+
pyfortool_version=tags/0.2.0
88

99
#This script installs PHYEX
1010
#Call the script with the -h option to get more information.
@@ -14,14 +14,14 @@ pyft_version=tags/0.1.1
1414
################################
1515

1616
function usage {
17-
echo "Usage: $0 [-h] [--ALL] [--dataset] [--pyft] [--clean]"
17+
echo "Usage: $0 [-h] [--ALL] [--dataset] [--pyfortool] [--clean]"
1818
echo " --ALL Install or clean everything"
1919
echo " --dataset Install or clean a reduced dataset for the test programs"
20-
echo " --pyft Install or clean the pyft tool"
20+
echo " --pyfortool Install or clean the pyfortool tool"
2121
echo " --fiatfcm Install or clean the fiat and fcm tools"
2222
echo " --clean Clean instead of installing"
2323
echo " --test Perform a test"
24-
echo " --ssh Use the ssh protocol to clone the pyft, fxtran, fiat and fcm"
24+
echo " --ssh Use the ssh protocol to clone the pyfortool, fxtran, fiat and fcm"
2525
echo " repositories instead of https"
2626
echo ""
2727
echo "If the installation has already been done, calling again this script will update"
@@ -30,7 +30,7 @@ function usage {
3030

3131
ALL=0
3232
dataset=0
33-
pyft=0
33+
pyfortool=0
3434
clean=0
3535
dotest=0
3636
ssh=0
@@ -40,7 +40,7 @@ while [ -n "$1" ]; do
4040
case "$1" in
4141
'--ALL') ALL=1;;
4242
'--dataset') dataset=1;;
43-
'--pyft') pyft=1;;
43+
'--pyfortool') pyfortool=1;;
4444
'--fiatfcm') fiatfcm=1;;
4545
'--clean') clean=1;;
4646
'--test') dotest=1;;
@@ -53,7 +53,7 @@ done
5353

5454
if [ $ALL == 1 ]; then
5555
dataset=1
56-
pyft=1
56+
pyfortool=1
5757
fiatfcm=1
5858
fi
5959

@@ -83,35 +83,35 @@ if [ $dataset -eq 1 ]; then
8383
done
8484
fi
8585

86-
if [ $pyft -eq 1 ]; then
86+
if [ $pyfortool -eq 1 ]; then
8787
cd $PHYEXTOOLSDIR/site
8888
if [ $clean -eq 1 ]; then
89-
rm -rf pyft
89+
rm -rf pyfortool
9090
else
91-
if [ ! -d pyft ]; then
91+
if [ ! -d pyfortool ]; then
9292
#Install
9393
if [ $ssh -eq 1 ]; then
94-
git clone [email protected]:UMR-CNRM/pyft.git
94+
git clone [email protected]:UMR-CNRM/pyfortool.git
9595
else
96-
git clone https://github.com/UMR-CNRM/pyft.git
96+
git clone https://github.com/UMR-CNRM/pyfortool.git
9797
fi
98-
cd pyft
98+
cd pyfortool
9999
else
100100
#Update
101-
cd pyft
101+
cd pyfortool
102102
if [ $ssh -eq 1 ]; then
103-
git fetch --tags [email protected]:UMR-CNRM/pyft.git
103+
git fetch --tags [email protected]:UMR-CNRM/pyfortool.git
104104
else
105-
git fetch --tags https://github.com/UMR-CNRM/pyft.git
105+
git fetch --tags https://github.com/UMR-CNRM/pyfortool.git
106106
fi
107107
fi
108-
git checkout ${pyft_version}
108+
git checkout ${pyfortool_version}
109109
cd ..
110110
#Install/update
111111
if [ $ssh -eq 1 ]; then
112-
./pyft/bin/INSTALL.sh --ssh
112+
./pyfortool/bin/INSTALL.sh --ssh
113113
else
114-
./pyft/bin/INSTALL.sh
114+
./pyfortool/bin/INSTALL.sh
115115
fi
116116
echo ""
117117
echo "To use PHYEX, you only need to source the file $PHYEXTOOLSDIR/env.sh"

tools/env.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
33
export PATH=$DIR:$PATH
44
export PYTHONPATH=$PYTHONPATH:$DIR/../build/with_fcm/arch_gnu/build/bin
55

6-
PYFT_DIR=$DIR/site/pyft
7-
. $PYFT_DIR/bin/env.sh
6+
. $DIR/site/pyfortool/bin/env.sh

tools/prep_code.sh

+41-41
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e
66
#This script can:
77
# - extract a tag or a commit from the PHYEX repository
88
# - merge code from common and model specific directories
9-
# - apply the pyft tool
9+
# - apply the pyfortool script
1010
# - push the result in a new branch of the repository
1111

1212

@@ -16,39 +16,39 @@ PHYEXTOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1616
###### COMMAND LINE ARGUMENTS
1717
function usage {
1818
echo "Usage: $0 [-h] [-c CHECKOUT_POINT] [-m MODEL] [-D OPTION [-D OPTION [...]]]] \\"
19-
echo " [-s SUBDIR [-s SUBDIR [...]]] [--pyft_opts_env VAR] [-v [-v [-v]]] \\"
20-
echo " DIRECTORY -- PYFT_OPTIONS"
19+
echo " [-s SUBDIR [-s SUBDIR [...]]] [--pyfortool_opts_env VAR] [-v [-v [-v]]] \\"
20+
echo " DIRECTORY -- PYFORTOOL_OPTIONS"
2121
echo "DIRECTORY directory containing the script result"
2222
echo "-c CHECKOUT_POINT git object to checkout, can be a specific commit"
2323
echo " or a tag with the following syntax: tags/TAG where TAG is the tag name"
2424
echo "-m MODEL merge the code under the common directory with the code specific to MODEL model"
25-
echo "--mnhExpand option passed to the pyft tool"
26-
echo "--removeACC option passed to the pyft tool"
25+
echo "--mnhExpand option passed to the pyfortool script"
26+
echo "--removeACC option passed to the pyfortool script"
2727
echo "-p push the result as a new branch"
28-
echo "-s SUB subdiretory or file (under src) to consider when merging and applying pyft"
28+
echo "-s SUB subdiretory or file (under src) to consider when merging and applying pyfortool"
2929
echo "--renameFf rename .F90 into .f90"
3030
echo "--ilooprm replace indexes in do loop (and mnh_expand) by :"
3131
echo "--repo use this repository instead of the one derived (if any) from the env variables"
3232
echo " PHYEXREPOuser (=$PHYEXREPOuser) and PHYEXREPOprotocol (=$PHYEXREPOprotocol)"
3333
echo "-v add verbosity (up to 3 -v)"
34-
echo "--pyft_opts_env VAR name of an environment variable containing options to use to call"
35-
echo " the pyft_tool.py script"
36-
echo "--useParallelPyft use the parallel version of the pyft tool (pyft_parallel_tool.py)"
37-
echo "-- PYFT_OPTIONS everything after '--' are used as options for pyft_tool.py"
34+
echo "--pyfortool_opts_env VAR name of an environment variable containing options to use to call"
35+
echo " the pyfortool script"
36+
echo "--useParallelPyForTool use the parallel version of the pyfortool script (pyfortool_parallel)"
37+
echo "-- PYFORTOOL_OPTIONS everything after '--' are used as options for pyfortool"
3838
echo " These options are used for all the files."
3939
echo ""
4040
echo "* If the -c option is not provided, DIRECTORY must already contain files and directory as if"
4141
echo " it was the result of a git checkout"
4242
echo "* If the -m option is used, directory tree is modified, only relevant code is kept"
43-
echo "* If none of --mnhExpand, --removeACC, --pyft_opts_env or PYFT_OPTIONS is not used, pyft is not called at all"
43+
echo "* If none of --mnhExpand, --removeACC, --pyfortool_opts_env or PYFORTOOL_OPTIONS is not used, pyfortool is not called at all"
4444
echo "* -s options are mandatory for -m, -D and -p options"
4545
echo "* -p option is allowed only if -c and -m options are provided"
4646
echo ""
47-
echo "Everything after the '--' is passed to pyft for source-to-source transformation"
47+
echo "Everything after the '--' is passed to pyfortool for source-to-source transformation"
4848
echo ""
49-
echo "To use the pyft tool... it must be installed"
49+
echo "To use the pyfortool script... it must be installed"
5050
echo ""
51-
echo "The variable name sent with --pyft_opts_env must correspond to an exported environement"
51+
echo "The variable name sent with --pyfortool_opts_env must correspond to an exported environement"
5252
echo "variable. The variable can contain a multi-lines string."
5353
echo "The variable is read line by line and the last applicable line is used."
5454
echo "A line can take one of these two forms:"
@@ -60,13 +60,13 @@ function usage {
6060
echo " If the line doesn't contain the FILE_DESCRIPTOR part, it applies to all source code."
6161
echo ""
6262
echo "For example, to transform all source code in lower case:"
63-
echo "> export OPTS='--lowerCase'; $0 --pyft\_opts\_env OPTS ..."
63+
echo "> export OPTS='--lowerCase'; $0 --pyfortool_opts_env OPTS ..."
6464
echo ""
6565
echo "To transform all source code in lower case, except routines in turb directory which must be"
6666
echo "in upper case but keeping the turb.F90 in lower case:"
6767
echo "> export OPTS='--lowerCase "
6868
echo "> ^turb/:=:--upperCase "
69-
echo "> ^turb/turb\..90:=:--lowerCase'; $0 --pyft\_opts\_env OPTS ..."
69+
echo "> ^turb/turb\..90:=:--lowerCase'; $0 --pyfortool_opts_env OPTS ..."
7070
}
7171

7272
full_command="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}") $@"
@@ -75,16 +75,16 @@ separator='_' #- be carrefull, gmkpack (at least on belenos) has multiple allerg
7575

7676
directory=""
7777
checkout_point=""
78-
pyft_options=""
78+
pyfortool_options=""
7979
model=""
8080
push=0
8181
subs=""
8282
renameFf=0
8383
verbose=0
8484
ilooprm=0
85-
useParallelPyft=0
86-
forpyft=0
87-
pyft_opts_env=""
85+
useParallelPyForTool=0
86+
forpyfortool=0
87+
pyfortool_opts_env=""
8888

8989
if [ -z "${PHYEXREPOprotocol-}" ]; then
9090
repository=""
@@ -103,21 +103,21 @@ while [ -n "$1" ]; do
103103
'-h') usage; exit;;
104104
'-c') checkout_point="$2"; shift;;
105105
'-m') model="$2"; shift;;
106-
'--mnhExpand') pyft_options="$pyft_options $1";;
107-
'--removeACC') pyft_options="$pyft_options $1";;
106+
'--mnhExpand') pyfortool_options="$pyfortool_options $1";;
107+
'--removeACC') pyfortool_options="$pyfortool_options $1";;
108108
'-s') subs="$subs $2"; shift;;
109109
'-p') push=1;;
110110
'--renameFf') renameFf=1;;
111111
'--ilooprm') ilooprm=1;;
112112
'--repo') repository=$2; shift;;
113113
'-v') verbose=$(($verbose+1));;
114-
'--useParallelPyft') useParallelPyft=1;;
115-
'--pyft_opts_env') pyft_opts_env=$2; shift;;
116-
'--') forpyft=1;;
117-
*) if [ $forpyft -eq 0 ]; then
114+
'--useParallelPyForTool') useParallelPyForTool=1;;
115+
'--pyfortool_opts_env') pyfortool_opts_env=$2; shift;;
116+
'--') forpyfortool=1;;
117+
*) if [ $forpyfortool -eq 0 ]; then
118118
directory="$1"
119119
else
120-
pyft_options="$pyft_options $1"
120+
pyfortool_options="$pyfortool_options $1"
121121
fi;;
122122
esac
123123
shift
@@ -174,7 +174,7 @@ else
174174
fi
175175

176176
###### RENAME .F90 into .f90
177-
#This step could also be achieved by pyft_tool.py but it must be done *before* the call to pyft_tool
177+
#This step could also be achieved by pyfortool but it must be done *before* the call to pyfortool
178178
if [ $renameFf -eq 1 ]; then
179179
#we use find/while/read in case the number of files is too big to be hold on a single shell line
180180
find . -type f -name \*.F90 -print0 | \
@@ -290,15 +290,15 @@ if [ $ilooprm -eq 1 ]; then
290290
done
291291
fi
292292

293-
###### PYFT
294-
if [ "$pyft_opts_env" != "" -o -n "${pyft_options-}" ]; then
295-
[ $verbose -gt 0 ] && echo "Applying pyft_tool"
293+
###### PyForTool
294+
if [ "$pyfortool_opts_env" != "" -o -n "${pyfortool_options-}" ]; then
295+
[ $verbose -gt 0 ] && echo "Applying pyfortool"
296296

297297
#Update PATH and PYTHONPATH if needed
298-
if [ $useParallelPyft -eq 1 ]; then
299-
which pyft_parallel_tool.py > /dev/null || . $PHYEXTOOLSDIR/site/pyft/bin/env.sh
298+
if [ $useParallelPyForTool -eq 1 ]; then
299+
which pyfortool_parallel > /dev/null || . $PHYEXTOOLSDIR/site/pyfortool/bin/env.sh
300300
else
301-
which pyft_tool.py > /dev/null || . $PHYEXTOOLSDIR/site/pyft/bin/env.sh
301+
which pyfortool > /dev/null || . $PHYEXTOOLSDIR/site/pyfortool/bin/env.sh
302302
fi
303303

304304
if [ -n "${model-}" ]; then
@@ -311,13 +311,13 @@ if [ "$pyft_opts_env" != "" -o -n "${pyft_options-}" ]; then
311311
fi
312312

313313
extra_opts=""
314-
if [ "$pyft_opts_env" != "" ]; then
315-
extra_opts="--optsByEnv $pyft_opts_env"
314+
if [ "$pyfortool_opts_env" != "" ]; then
315+
extra_opts="--optsByEnv $pyfortool_opts_env"
316316
fi
317317

318-
if [ "$extra_opts" != "" -o -n "${pyft_options-}" ]; then
319-
if [ $useParallelPyft -eq 1 ]; then
320-
cmd="pyft_parallel_tool.py --wrapH $pyft_options $extra_opts --nbPar 8" #--wrapH allows to deal with h files
318+
if [ "$extra_opts" != "" -o -n "${pyfortool_options-}" ]; then
319+
if [ $useParallelPyForTool -eq 1 ]; then
320+
cmd="pyfortool_parallel --wrapH $pyfortool_options $extra_opts --nbPar 8" #--wrapH allows to deal with h files
321321
[ $verbose -gt 1 ] && echo $cmd
322322
$cmd
323323
else
@@ -326,8 +326,8 @@ if [ "$pyft_opts_env" != "" -o -n "${pyft_options-}" ]; then
326326
find $rep -type f -not -name '.*.swp' -not -name '.*.swo' | while read file; do
327327
if [ "$(echo $file | grep '\.')" != '' -a $(echo $file | rev | cut -d. -f1 | rev) != 'fypp' ]; then
328328
#Files without extension are certainly not source code files
329-
#.fypp files cannot be read by pyft_tool.py
330-
cmd="pyft_tool.py --wrapH $pyft_options $extra_opts" #--wrapH allows to deal with h files
329+
#.fypp files cannot be read by pyfortool
330+
cmd="pyfortool --wrapH $pyfortool_options $extra_opts" #--wrapH allows to deal with h files
331331
[ $verbose -gt 1 ] && echo $cmd "$file"
332332
$cmd "$file"
333333
fi

0 commit comments

Comments
 (0)