13 |
test_for_package_in_cpp_options() { |
test_for_package_in_cpp_options() { |
14 |
cpp_options=$1 |
cpp_options=$1 |
15 |
pkg=$2 |
pkg=$2 |
16 |
test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_$pkg" || exit 99 |
test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_$pkg[ ]" |
17 |
test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_$pkg" || exit 99 |
test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_$pkg[ ]" |
18 |
test_for_string_in_file $cpp_options "^[ ]*#define.*DISABLE_$pkg" || exit 99 |
test_for_string_in_file $cpp_options "^[ ]*#define.*DISABLE_$pkg[ ]" |
19 |
test_for_string_in_file $cpp_options "^[ ]*#undef.*DISABLE_$pkg" || exit 99 |
test_for_string_in_file $cpp_options "^[ ]*#undef.*DISABLE_$pkg[ ]" |
20 |
|
test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_$pkg$" |
21 |
|
test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_$pkg$" |
22 |
|
test_for_string_in_file $cpp_options "^[ ]*#define.*DISABLE_$pkg$" |
23 |
|
test_for_string_in_file $cpp_options "^[ ]*#undef.*DISABLE_$pkg$" |
24 |
} |
} |
25 |
|
|
26 |
# Search for particular CPP #cmds associated with MPI |
# Search for particular CPP #cmds associated with MPI |
27 |
# usage: test_for_mpi_in_cpp_eeoptions CPP_file |
# usage: test_for_mpi_in_cpp_eeoptions CPP_file |
28 |
test_for_mpi_in_cpp_eeoptions() { |
test_for_mpi_in_cpp_eeoptions() { |
29 |
cpp_options=$1 |
cpp_options=$1 |
30 |
test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_USE_MPI" || exit 99 |
test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_USE_MPI[ ]" |
31 |
test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_USE_MPI" || exit 99 |
test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_USE_MPI[ ]" |
32 |
test_for_string_in_file $cpp_options "^[ ]*#define.*ALWAYS_USE_MPI" || exit 99 |
test_for_string_in_file $cpp_options "^[ ]*#define.*ALWAYS_USE_MPI[ ]" |
33 |
test_for_string_in_file $cpp_options "^[ ]*#undef.*ALWAYS_USE_MPI" || exit 99 |
test_for_string_in_file $cpp_options "^[ ]*#undef.*ALWAYS_USE_MPI[ ]" |
34 |
|
test_for_string_in_file $cpp_options "^[ ]*#define.*ALLOW_USE_MPI$" |
35 |
|
test_for_string_in_file $cpp_options "^[ ]*#undef.*ALLOW_USE_MPI$" |
36 |
|
test_for_string_in_file $cpp_options "^[ ]*#define.*ALWAYS_USE_MPI$" |
37 |
|
test_for_string_in_file $cpp_options "^[ ]*#undef.*ALWAYS_USE_MPI$" |
38 |
} |
} |
39 |
|
|
40 |
# Search for particular string in a file. Return 1 if detected, 0 if not |
# Search for particular string in a file. Return 1 if detected, 0 if not |
47 |
if test "x${RETVAL}" = x0 ; then |
if test "x${RETVAL}" = x0 ; then |
48 |
printf "Error: In $file there is an illegal line: " |
printf "Error: In $file there is an illegal line: " |
49 |
grep -i "$strng" $file |
grep -i "$strng" $file |
50 |
return 1 |
exit 99 |
51 |
fi |
fi |
52 |
return 0 |
return 0 |
53 |
} |
} |
578 |
*only* works if it is supported by the OPTFILE that |
*only* works if it is supported by the OPTFILE that |
579 |
is being used. |
is being used. |
580 |
|
|
581 |
|
-ignoretime | -ignore_time | --ignoretime | --ignore_time |
582 |
|
Ignore all the "wall clock" routines entirely. This will |
583 |
|
not in any way hurt the model results -- it simply means |
584 |
|
that the code that checks how long the model spends in |
585 |
|
various routines will give junk values. |
586 |
|
|
587 |
-ts | --ts |
-ts | --ts |
588 |
Produce timing information per timestep |
Produce timing information per timestep |
589 |
-papis | --papis |
-papis | --papis |
590 |
Produce summary MFlop/s with PAPI per timestep |
Produce summary MFlop/s (and IPC) with PAPI per timestep |
591 |
|
-pcls | --pcls |
592 |
|
Produce summary MFlop/s etc. with PCL per timestep |
593 |
-foolad | --foolad |
-foolad | --foolad |
594 |
Fool the AD code generator |
Fool the AD code generator |
595 |
-papi | --papi |
-papi | --papi |
596 |
Performance analysis with PAPI |
Performance analysis with PAPI |
597 |
|
-pcl | --pcl |
598 |
|
Performance analysis with PCL |
599 |
-hpmt | --hpmt |
-hpmt | --hpmt |
600 |
Performance analysis with the HPM Toolkit |
Performance analysis with the HPM Toolkit |
601 |
|
|
767 |
|
|
768 |
|
|
769 |
check_HAVE_SIGREG() { |
check_HAVE_SIGREG() { |
770 |
|
if test ! "x$HAVE_SIGREG" = x ; then |
771 |
|
return |
772 |
|
fi |
773 |
get_fortran_c_namemangling |
get_fortran_c_namemangling |
774 |
cat <<EOF > genmake_tc_1.c |
cat <<EOF > genmake_tc_1.c |
775 |
$FC_NAMEMANGLE |
$FC_NAMEMANGLE |
937 |
cat genmake_tnc.F >> genmake_tnc.log |
cat genmake_tnc.F >> genmake_tnc.log |
938 |
echo "=== genmake_tnc.F ===" >> genmake_tnc.log |
echo "=== genmake_tnc.F ===" >> genmake_tnc.log |
939 |
RET_CPP=f |
RET_CPP=f |
940 |
COMM="$CPP $DEFINES $INCLUDES genmake_tnc.F" |
COMM="cat genmake_tnc.F | $CPP $DEFINES $INCLUDES" |
941 |
echo "$COMM" >> genmake_tnc.log |
echo "$COMM" >> genmake_tnc.log |
942 |
$COMM > genmake_tnc.$FS 2>/dev/null && RET_CPP=t |
$COMM > genmake_tnc.$FS 2>/dev/null && RET_CPP=t |
943 |
if test "x$RET_CPP" = xf ; then |
if test "x$RET_CPP" = xf ; then |
965 |
else |
else |
966 |
# try again with "-lnetcdf" added to the libs |
# try again with "-lnetcdf" added to the libs |
967 |
echo "try again with added '-lnetcdf'" > genmake_tnc.log |
echo "try again with added '-lnetcdf'" > genmake_tnc.log |
968 |
echo "$CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS \ " >> genmake_tnc.log |
echo "cat genmake_tnc.F | $CPP $DEFINES $INCLUDES > genmake_tnc.$FS \ " >> genmake_tnc.log |
969 |
echo " && $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS \ " >> genmake_tnc.log |
echo " && $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS \ " >> genmake_tnc.log |
970 |
echo " && $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf" >> genmake_tnc.log |
echo " && $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf" >> genmake_tnc.log |
971 |
$CPP $DEFINES $INCLUDES genmake_tnc.F > genmake_tnc.$FS 2>/dev/null \ |
cat genmake_tnc.F | $CPP $DEFINES $INCLUDES > genmake_tnc.$FS 2>/dev/null \ |
972 |
&& $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1 \ |
&& $FC $FFLAGS $FOPTIM -c genmake_tnc.$FS >> genmake_tnc.log 2>&1 \ |
973 |
&& $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf >> genmake_tnc.log 2>&1 |
&& $LINK -o genmake_tnc genmake_tnc.o $LIBS -lnetcdf >> genmake_tnc.log 2>&1 |
974 |
RET_COMPILE=$? |
RET_COMPILE=$? |
1023 |
MPIPATH= |
MPIPATH= |
1024 |
TS= |
TS= |
1025 |
PAPIS= |
PAPIS= |
1026 |
|
PCLS= |
1027 |
FOOLAD= |
FOOLAD= |
1028 |
PAPI= |
PAPI= |
1029 |
|
PCL= |
1030 |
HPMT= |
HPMT= |
1031 |
GSL= |
GSL= |
1032 |
HAVE_TEST_L= |
HAVE_TEST_L= |
1087 |
|
|
1088 |
# The following state can be set directly by command-line switches |
# The following state can be set directly by command-line switches |
1089 |
gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE" |
gm_s1="OPTFILE PDEPEND PDEFAULT MAKEFILE PLATFORM ROOTDIR MODS DISABLE ENABLE" |
1090 |
gm_s2="FC CPP IEEE TS PAPIS PAPI HPMT GSL MPI JAM DUMPSTATE STANDARDDIRS" |
gm_s2="FC CPP IEEE TS PAPIS PCLS PAPI PCL HPMT GSL MPI JAM DUMPSTATE STANDARDDIRS" |
1091 |
|
|
1092 |
# The following state is not directly set by command-line switches |
# The following state is not directly set by command-line switches |
1093 |
gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM " |
gm_s3="LN S64 KPP LINK PACKAGES MAKEDEPEND PDEPEND PDEFAULT INCLUDES FFLAGS FOPTIM " |
1271 |
TS=true ;; |
TS=true ;; |
1272 |
-papis | --papis) |
-papis | --papis) |
1273 |
PAPIS=true ;; |
PAPIS=true ;; |
1274 |
|
-pcls | --pcls) |
1275 |
|
PCLS=true ;; |
1276 |
-foolad | --foolad) |
-foolad | --foolad) |
1277 |
FOOLAD=true ;; |
FOOLAD=true ;; |
1278 |
-papi | --papi) |
-papi | --papi) |
1279 |
PAPI=true ;; |
PAPI=true ;; |
1280 |
|
-pcl | --pcl) |
1281 |
|
PCL=true ;; |
1282 |
-hpmt | --hpmt) |
-hpmt | --hpmt) |
1283 |
HPMT=true ;; |
HPMT=true ;; |
1284 |
|
|
1547 |
INCLUDES="$INCLUDES $PAPIINC" |
INCLUDES="$INCLUDES $PAPIINC" |
1548 |
LIBS="$LIBS $PAPILIB" |
LIBS="$LIBS $PAPILIB" |
1549 |
fi |
fi |
1550 |
|
if test ! "x$PCLS" = x ; then |
1551 |
|
echo " Turning on PCL counter summary per timestep" |
1552 |
|
echo " Please make sure PCLINC, PCLLIB are defined" |
1553 |
|
if test ! "x$FOOLAD" = x ; then |
1554 |
|
DEFINES="$DEFINES -DUSE_PCL_FLOPS_SFP" |
1555 |
|
else |
1556 |
|
DEFINES="$DEFINES -DUSE_PCL_FLOPS" |
1557 |
|
fi |
1558 |
|
INCLUDES="$INCLUDES $PCLINC" |
1559 |
|
LIBS="$LIBS $PCLLIB" |
1560 |
|
fi |
1561 |
if test ! "x$PAPI" = x ; then |
if test ! "x$PAPI" = x ; then |
1562 |
if test ! "x$PAPIS" = x ; then |
if test ! "x$PAPIS" = x ; then |
1563 |
echo " PAPI performance analysis and flop summary per timestep cannot co-exist!" |
echo " PAPI performance analysis and flop summary per timestep cannot co-exist!" |
1570 |
LIBS="$LIBS $PAPILIB" |
LIBS="$LIBS $PAPILIB" |
1571 |
fi |
fi |
1572 |
fi |
fi |
1573 |
|
if test ! "x$PCL" = x ; then |
1574 |
|
if test ! "x$PCLS" = x ; then |
1575 |
|
echo " PCL performance analysis and flop summary per timestep cannot co-exist!" |
1576 |
|
echo " Sticking with PCL flop summary per timestep!" |
1577 |
|
else |
1578 |
|
echo " Turning on performance analysis with PCL" |
1579 |
|
echo " Please make sure PCLINC, PCLLIB are defined" |
1580 |
|
DEFINES="$DEFINES -DUSE_PCL" |
1581 |
|
INCLUDES="$INCLUDES $PCLINC" |
1582 |
|
LIBS="$LIBS $PCLLIB" |
1583 |
|
fi |
1584 |
|
fi |
1585 |
if test ! "x$HPMT" = x ; then |
if test ! "x$HPMT" = x ; then |
1586 |
if test ! "x$PAPI" = x ; then |
if test ! "x$PAPI" = x ; then |
1587 |
echo " PAPI and the HPM Toolkit cannot co-exist!" |
echo " PAPI and the HPM Toolkit cannot co-exist!" |
1588 |
echo " Sticking with PAPI!" |
echo " Sticking with PAPI!" |
1589 |
|
else if test ! "x$PCL" = x ; then |
1590 |
|
echo " PCL and the HPM Toolkit cannot co-exist!" |
1591 |
|
echo " Sticking with PCL!" |
1592 |
else |
else |
1593 |
echo " Turning on performance analysis with the HPM Toolkit" |
echo " Turning on performance analysis with the HPM Toolkit" |
1594 |
echo " Please make sure HPMTINC, HPMTLIB are defined" |
echo " Please make sure HPMTINC, HPMTLIB are defined" |
1596 |
INCLUDES="$INCLUDES $HPMTINC" |
INCLUDES="$INCLUDES $HPMTINC" |
1597 |
LIBS="$LIBS $HPMTLIB" |
LIBS="$LIBS $HPMTLIB" |
1598 |
fi |
fi |
1599 |
|
fi |
1600 |
fi |
fi |
1601 |
if test ! "x$GSL" = x ; then |
if test ! "x$GSL" = x ; then |
1602 |
echo " Turning on use of GSL to control floating point calculations" |
echo " Turning on use of GSL to control floating point calculations" |
1693 |
|
|
1694 |
printf " Can we register a signal handler using $FC... " |
printf " Can we register a signal handler using $FC... " |
1695 |
check_HAVE_SIGREG |
check_HAVE_SIGREG |
1696 |
if test "x$HAVE_SIGREG" != x ; then |
if test "x$HAVE_SIGREG" = xt ; then |
1697 |
echo "yes" |
echo "yes" |
1698 |
else |
else |
1699 |
echo "no" |
echo "no" |
2470 |
-find \$(EXEDIR) -name "*.meta" -exec rm {} \; |
-find \$(EXEDIR) -name "*.meta" -exec rm {} \; |
2471 |
-find \$(EXEDIR) -name "*.data" -exec rm {} \; |
-find \$(EXEDIR) -name "*.data" -exec rm {} \; |
2472 |
-find \$(EXEDIR) -name "fort.*" -exec rm {} \; |
-find \$(EXEDIR) -name "fort.*" -exec rm {} \; |
2473 |
-rm -f \$(EXECUTABLE) output.txt STD* |
-rm -f \$(EXECUTABLE) *.txt STD* *diagnostics.log datetime |
2474 |
|
-rm -rf mnc_test_* |
2475 |
|
|
2476 |
#eh3 Makefile: makefile |
#eh3 Makefile: makefile |
2477 |
makefile: |
makefile: |