1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301
|
#!/usr/bin/env python3
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import *
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
from Cheetah.compat import unicode
from xpdeint.Features.Transforms._FourierTransformFFTW3MPI import _FourierTransformFFTW3MPI
import operator
from xpdeint.Geometry.UniformDimensionRepresentation import UniformDimensionRepresentation
from xpdeint.Geometry.SplitUniformDimensionRepresentation import SplitUniformDimensionRepresentation
from xpdeint.Utilities import permutations
##################################################
## MODULE CONSTANTS
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '3.2.3'
__CHEETAH_versionTuple__ = (3, 2, 3, 'final', 0)
__CHEETAH_genTime__ = 1558054970.159666
__CHEETAH_genTimestamp__ = 'Fri May 17 11:02:50 2019'
__CHEETAH_src__ = '/home/mattias/xmds-2.2.3/admin/staging/xmds-3.0.0/xpdeint/Features/Transforms/FourierTransformFFTW3MPI.tmpl'
__CHEETAH_srcLastModified__ = 'Thu Apr 4 16:29:24 2019'
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
raise AssertionError(
'This template was compiled with Cheetah version'
' %s. Templates compiled before version %s must be recompiled.'%(
__CHEETAH_version__, RequiredCheetahVersion))
##################################################
## CLASSES
class FourierTransformFFTW3MPI(_FourierTransformFFTW3MPI):
##################################################
## CHEETAH GENERATED METHODS
def __init__(self, *args, **KWs):
super(FourierTransformFFTW3MPI, self).__init__(*args, **KWs)
if not self._CHEETAH__instanceInitialized:
cheetahKWArgs = {}
allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
for k,v in KWs.items():
if k in allowedKWs: cheetahKWArgs[k] = v
self._initCheetahInstance(**cheetahKWArgs)
def description(self, **KWS):
## Generated from @def description: FFTW3 with MPI at line 31, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
write('''FFTW3 with MPI''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def includes(self, **KWS):
## CHEETAH: generated from @def includes at line 34, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
#
_v = super(FourierTransformFFTW3MPI, self).includes()
if _v is not None: write(_filter(_v))
#
write('''#include <fftw3-mpi.h>
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def globals(self, **KWS):
## CHEETAH: generated from @def globals at line 41, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
#
_v = super(FourierTransformFFTW3MPI, self).globals()
if _v is not None: write(_filter(_v))
#
for dimRep in [dimRep for dim in self.mpiDimensions for dimRep in dim.representations if dimRep.hasLocalOffset]: # generated from line 45, col 3
write('''ptrdiff_t _block_size_''')
_v = VFFSL(SL,"dimRep.name",True) # '${dimRep.name}' on line 46, col 23
if _v is not None: write(_filter(_v, rawExpr='${dimRep.name}')) # from line 46, col 23.
write(''' = FFTW_MPI_DEFAULT_BLOCK;
''')
#
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def setLocalLatticeAndOffsetVariables(self, **KWS):
## CHEETAH: generated from @def setLocalLatticeAndOffsetVariables at line 51, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
#
write('''// First work out the local lattice and offset for the geometry
ptrdiff_t _sizes[''')
_v = VFFSL(SL,"len",False)(VFFSL(SL,"geometry.dimensions",True)) # '${len($geometry.dimensions)}' on line 54, col 18
if _v is not None: write(_filter(_v, rawExpr='${len($geometry.dimensions)}')) # from line 54, col 18.
write('''];
''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 55, col 1
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 55, col 1.
write('''_mpi_init();
''')
for firstMPIDimRep, secondMPIDimRep in permutations(*[dim.representations for dim in self.mpiDimensions]): # generated from line 56, col 3
if not (firstMPIDimRep.hasLocalOffset and secondMPIDimRep.hasLocalOffset): # generated from line 57, col 5
continue
write('''_sizes[0] = ''')
_v = VFFSL(SL,"firstMPIDimRep.globalLattice",True) # '${firstMPIDimRep.globalLattice}' on line 60, col 13
if _v is not None: write(_filter(_v, rawExpr='${firstMPIDimRep.globalLattice}')) # from line 60, col 13.
write('''; _sizes[1] = ''')
_v = VFFSL(SL,"secondMPIDimRep.globalLattice",True) # '${secondMPIDimRep.globalLattice}' on line 60, col 58
if _v is not None: write(_filter(_v, rawExpr='${secondMPIDimRep.globalLattice}')) # from line 60, col 58.
write(''';
''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 61, col 1
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 61, col 1.
write('''_mpi_local_size_many_transposed(
2, _sizes, 1, _block_size_''')
_v = VFFSL(SL,"firstMPIDimRep.name",True) # '${firstMPIDimRep.name}' on line 62, col 29
if _v is not None: write(_filter(_v, rawExpr='${firstMPIDimRep.name}')) # from line 62, col 29.
write(''', _block_size_''')
_v = VFFSL(SL,"secondMPIDimRep.name",True) # '${secondMPIDimRep.name}' on line 62, col 65
if _v is not None: write(_filter(_v, rawExpr='${secondMPIDimRep.name}')) # from line 62, col 65.
write(''', MPI_COMM_WORLD,
&''')
_v = VFFSL(SL,"firstMPIDimRep.localLattice",True) # '${firstMPIDimRep.localLattice}' on line 63, col 4
if _v is not None: write(_filter(_v, rawExpr='${firstMPIDimRep.localLattice}')) # from line 63, col 4.
write(''', &''')
_v = VFFSL(SL,"firstMPIDimRep.localOffset",True) # '${firstMPIDimRep.localOffset}' on line 63, col 37
if _v is not None: write(_filter(_v, rawExpr='${firstMPIDimRep.localOffset}')) # from line 63, col 37.
write(''',
&''')
_v = VFFSL(SL,"secondMPIDimRep.localLattice",True) # '${secondMPIDimRep.localLattice}' on line 64, col 4
if _v is not None: write(_filter(_v, rawExpr='${secondMPIDimRep.localLattice}')) # from line 64, col 4.
write(''', &''')
_v = VFFSL(SL,"secondMPIDimRep.localOffset",True) # '${secondMPIDimRep.localOffset}' on line 64, col 38
if _v is not None: write(_filter(_v, rawExpr='${secondMPIDimRep.localOffset}')) # from line 64, col 38.
write('''
);
if (_rank == 0) {
_block_size_''')
_v = VFFSL(SL,"firstMPIDimRep.name",True) # '${firstMPIDimRep.name}' on line 68, col 15
if _v is not None: write(_filter(_v, rawExpr='${firstMPIDimRep.name}')) # from line 68, col 15.
write(''' = ''')
_v = VFFSL(SL,"firstMPIDimRep.localLattice",True) # '${firstMPIDimRep.localLattice}' on line 68, col 40
if _v is not None: write(_filter(_v, rawExpr='${firstMPIDimRep.localLattice}')) # from line 68, col 40.
write(''';
_block_size_''')
_v = VFFSL(SL,"secondMPIDimRep.name",True) # '${secondMPIDimRep.name}' on line 69, col 15
if _v is not None: write(_filter(_v, rawExpr='${secondMPIDimRep.name}')) # from line 69, col 15.
write(''' = ''')
_v = VFFSL(SL,"secondMPIDimRep.localLattice",True) # '${secondMPIDimRep.localLattice}' on line 69, col 41
if _v is not None: write(_filter(_v, rawExpr='${secondMPIDimRep.localLattice}')) # from line 69, col 41.
write(''';
}
MPI_Bcast(&_block_size_''')
_v = VFFSL(SL,"firstMPIDimRep.name",True) # '${firstMPIDimRep.name}' on line 71, col 24
if _v is not None: write(_filter(_v, rawExpr='${firstMPIDimRep.name}')) # from line 71, col 24.
write(''', sizeof(ptrdiff_t), MPI_BYTE, 0, MPI_COMM_WORLD);
MPI_Bcast(&_block_size_''')
_v = VFFSL(SL,"secondMPIDimRep.name",True) # '${secondMPIDimRep.name}' on line 72, col 24
if _v is not None: write(_filter(_v, rawExpr='${secondMPIDimRep.name}')) # from line 72, col 24.
write(''', sizeof(ptrdiff_t), MPI_BYTE, 0, MPI_COMM_WORLD);
''')
#
firstMPIDim, secondMPIDim = VFFSL(SL,"mpiDimensions",True)
for field in VFFSL(SL,"fields",True): # generated from line 77, col 3
if field.name == 'geometry' or not field.isDistributed: # generated from line 78, col 5
continue
#
# Set the local_lattice and local_offset variables based on the
# values for the geometry's version of these
fieldMPIDim1 = field.dimensionWithName(firstMPIDim.name)
fieldMPIDim2 = field.dimensionWithName(secondMPIDim.name)
for fieldDim, geometryDim in [(fieldMPIDim1, firstMPIDim), (fieldMPIDim2, secondMPIDim)]: # generated from line 86, col 5
for fieldRep, geometryRep in zip(fieldDim.representations, geometryDim.representations): # generated from line 87, col 7
if (not fieldRep) or (not fieldRep.hasLocalOffset) or (not fieldRep.parent is fieldDim): # generated from line 88, col 9
continue
write("""// Set the local lattice and offset variables for the '""")
_v = VFFSL(SL,"field.name",True) # '${field.name}' on line 91, col 56
if _v is not None: write(_filter(_v, rawExpr='${field.name}')) # from line 91, col 56.
write("""' field
""")
if fieldRep == geometryRep: # generated from line 92, col 9
_v = VFFSL(SL,"fieldRep.localLattice",True) # '${fieldRep.localLattice}' on line 93, col 1
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localLattice}')) # from line 93, col 1.
write(''' = ''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 93, col 28
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 93, col 28.
write(''';
''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 94, col 1
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 94, col 1.
write(''' = ''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 94, col 27
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 94, col 27.
write(''';
''')
elif fieldRep.reductionMethod == fieldRep.ReductionMethod.fixedRange: # generated from line 95, col 9
# In this case we are in 'x' space and are subdividing a distributed dimension
# fixedRange reduction method means we take every nth point.
write('''ptrdiff_t _''')
_v = VFFSL(SL,"field.name",True) # '${field.name}' on line 98, col 12
if _v is not None: write(_filter(_v, rawExpr='${field.name}')) # from line 98, col 12.
write('''_''')
_v = VFFSL(SL,"fieldRep.name",True) # '${fieldRep.name}' on line 98, col 26
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.name}')) # from line 98, col 26.
write('''_skip_size = ''')
_v = VFFSL(SL,"geometryRep.globalLattice",True) # '${geometryRep.globalLattice}' on line 98, col 55
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.globalLattice}')) # from line 98, col 55.
write('''/''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 98, col 84
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 98, col 84.
write(''';
if (_rank == 0) {
''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 100, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 100, col 3.
write(''' = 0;
''')
_v = VFFSL(SL,"fieldRep.localLattice",True) # '${fieldRep.localLattice}' on line 101, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localLattice}')) # from line 101, col 3.
write(''' = (''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 101, col 31
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 101, col 31.
write('''-1)/_''')
_v = VFFSL(SL,"field.name",True) # '${field.name}' on line 101, col 63
if _v is not None: write(_filter(_v, rawExpr='${field.name}')) # from line 101, col 63.
write('''_''')
_v = VFFSL(SL,"fieldRep.name",True) # '${fieldRep.name}' on line 101, col 77
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.name}')) # from line 101, col 77.
write('''_skip_size + 1;
} else {
''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 103, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 103, col 3.
write(''' = (''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 103, col 31
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 103, col 31.
write('''-1)/_''')
_v = VFFSL(SL,"field.name",True) # '${field.name}' on line 103, col 62
if _v is not None: write(_filter(_v, rawExpr='${field.name}')) # from line 103, col 62.
write('''_''')
_v = VFFSL(SL,"fieldRep.name",True) # '${fieldRep.name}' on line 103, col 76
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.name}')) # from line 103, col 76.
write('''_skip_size + 1;
''')
_v = VFFSL(SL,"fieldRep.localLattice",True) # '${fieldRep.localLattice}' on line 104, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localLattice}')) # from line 104, col 3.
write(''' = (''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 104, col 31
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 104, col 31.
write(''' + ''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 104, col 60
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 104, col 60.
write(''' - 1)/_''')
_v = VFFSL(SL,"field.name",True) # '${field.name}' on line 104, col 94
if _v is not None: write(_filter(_v, rawExpr='${field.name}')) # from line 104, col 94.
write('''_''')
_v = VFFSL(SL,"fieldRep.name",True) # '${fieldRep.name}' on line 104, col 108
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.name}')) # from line 104, col 108.
write('''_skip_size
+ 1 - ''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 105, col 36
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 105, col 36.
write(''';
}
''')
elif isinstance(fieldRep, UniformDimensionRepresentation): # generated from line 107, col 9
# In this case, we are in 'k' space and may be subdividing a UniformDimensionRepresentation (dct/dst)
# Note that this is a fixedStep reduction method
write('''if (''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 110, col 5
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 110, col 5.
write(''' >= ''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 110, col 35
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 110, col 35.
write(''') {
// No points here
''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 112, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 112, col 3.
write(''' = 0;
''')
_v = VFFSL(SL,"fieldRep.localLattice",True) # '${fieldRep.localLattice}' on line 113, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localLattice}')) # from line 113, col 3.
write(''' = 0;
} else if (''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 114, col 12
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 114, col 12.
write(''' + ''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 114, col 41
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 114, col 41.
write(''' > ''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 114, col 71
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 114, col 71.
write('''){
// The upper edge is here
''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 116, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 116, col 3.
write(''' = ''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 116, col 29
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 116, col 29.
write(''';
''')
_v = VFFSL(SL,"fieldRep.localLattice",True) # '${fieldRep.localLattice}' on line 117, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localLattice}')) # from line 117, col 3.
write(''' = ''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 117, col 30
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 117, col 30.
write(''' - ''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 117, col 58
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 117, col 58.
write(''';
} else {
// somewhere near the start
''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 120, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 120, col 3.
write(''' = ''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 120, col 29
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 120, col 29.
write(''';
''')
_v = VFFSL(SL,"fieldRep.localLattice",True) # '${fieldRep.localLattice}' on line 121, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localLattice}')) # from line 121, col 3.
write(''' = ''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 121, col 30
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 121, col 30.
write(''';
}
''')
elif isinstance(fieldRep, SplitUniformDimensionRepresentation): # generated from line 123, col 9
# In this case, we are in 'k' space and may be subdividing a SplitUniformDimensionRepresentation (dft)
# Note that this is a fixedStep reduction method
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 126, col 1
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 126, col 1.
write(''' = -1;
if (''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 127, col 5
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 127, col 5.
write(''' >= (''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 127, col 36
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 127, col 36.
write("""+1)/2) {
// No points due to positive 'k' values.
} else if (""")
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 129, col 12
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 129, col 12.
write(''' + ''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 129, col 41
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 129, col 41.
write(''' > (''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 129, col 72
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 129, col 72.
write('''+1)/2) {
// the upper edge of the positive values are here
''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 131, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 131, col 3.
write(''' = ''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 131, col 29
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 131, col 29.
write(''';
''')
_v = VFFSL(SL,"fieldRep.localLattice",True) # '${fieldRep.localLattice}' on line 132, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localLattice}')) # from line 132, col 3.
write(''' = (''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 132, col 31
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 132, col 31.
write('''+1)/2 - ''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 132, col 64
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 132, col 64.
write(''';
} else if (''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 133, col 12
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 133, col 12.
write(''' < (''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 133, col 42
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 133, col 42.
write('''+1)/2) {
// somewhere near the start of the positive values
''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 135, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 135, col 3.
write(''' = ''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 135, col 29
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 135, col 29.
write(''';
''')
_v = VFFSL(SL,"fieldRep.localLattice",True) # '${fieldRep.localLattice}' on line 136, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localLattice}')) # from line 136, col 3.
write(''' = ''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 136, col 30
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 136, col 30.
write(''';
}
if (''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 139, col 5
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 139, col 5.
write(''' + ''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 139, col 34
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 139, col 34.
write(''' <= ''')
_v = VFFSL(SL,"geometryRep.globalLattice",True) # '${geometryRep.globalLattice}' on line 139, col 65
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.globalLattice}')) # from line 139, col 65.
write(''' - ''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 139, col 96
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 139, col 96.
write("""/2) {
// No points due to negative 'k' values.
} else if (""")
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 141, col 12
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 141, col 12.
write(''' < ''')
_v = VFFSL(SL,"geometryRep.globalLattice",True) # '${geometryRep.globalLattice}' on line 141, col 41
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.globalLattice}')) # from line 141, col 41.
write(''' - ''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 141, col 72
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 141, col 72.
write('''/2) {
// the lower edge of the negative values are here
if (''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 143, col 7
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 143, col 7.
write(''' == -1)
''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 144, col 5
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 144, col 5.
write(''' = (''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 144, col 32
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 144, col 32.
write('''+1)/2;
''')
_v = VFFSL(SL,"fieldRep.localLattice",True) # '${fieldRep.localLattice}' on line 145, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localLattice}')) # from line 145, col 3.
write(''' += ''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 145, col 31
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 145, col 31.
write(''' - (''')
_v = VFFSL(SL,"geometryRep.globalLattice",True) # '${geometryRep.globalLattice}' on line 145, col 62
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.globalLattice}')) # from line 145, col 62.
write('''-''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 145, col 91
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 145, col 91.
write('''/2-''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 145, col 119
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 145, col 119.
write(''');
} else if (''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 146, col 12
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 146, col 12.
write(''' + ''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 146, col 41
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 146, col 41.
write(''' > ''')
_v = VFFSL(SL,"geometryRep.globalLattice",True) # '${geometryRep.globalLattice}' on line 146, col 71
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.globalLattice}')) # from line 146, col 71.
write(''' - ''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 146, col 102
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 146, col 102.
write('''/2) {
// somewhere near the end of the negative values
''')
_v = VFFSL(SL,"fieldRep.localOffset",True) # '${fieldRep.localOffset}' on line 148, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localOffset}')) # from line 148, col 3.
write(''' = ''')
_v = VFFSL(SL,"geometryRep.localOffset",True) # '${geometryRep.localOffset}' on line 148, col 29
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localOffset}')) # from line 148, col 29.
write(''' - (''')
_v = VFFSL(SL,"geometryRep.globalLattice",True) # '${geometryRep.globalLattice}' on line 148, col 59
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.globalLattice}')) # from line 148, col 59.
write('''-''')
_v = VFFSL(SL,"fieldRep.globalLattice",True) # '${fieldRep.globalLattice}' on line 148, col 88
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.globalLattice}')) # from line 148, col 88.
write(''');
''')
_v = VFFSL(SL,"fieldRep.localLattice",True) # '${fieldRep.localLattice}' on line 149, col 3
if _v is not None: write(_filter(_v, rawExpr='${fieldRep.localLattice}')) # from line 149, col 3.
write(''' = ''')
_v = VFFSL(SL,"geometryRep.localLattice",True) # '${geometryRep.localLattice}' on line 149, col 30
if _v is not None: write(_filter(_v, rawExpr='${geometryRep.localLattice}')) # from line 149, col 30.
write(''';
}
''')
else: # generated from line 151, col 9
assert False
#
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def setVectorAllocSizes(self, vectors, **KWS):
## CHEETAH: generated from @def setVectorAllocSizes($vectors) at line 160, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
#
write('''ptrdiff_t _local_alloc_size, _tmp;
''')
for tID, transformation in self.transformations: # generated from line 163, col 3
if not transformation.get('distributedTransform', False): # generated from line 164, col 5
continue
untransformedDimRepBasis, transformedDimRepBasis = transformation['transformPair']
for dimNum, dimRep in enumerate(untransformedDimRepBasis): # generated from line 168, col 5
write('''_sizes[''')
_v = VFFSL(SL,"dimNum",True) # '${dimNum}' on line 169, col 8
if _v is not None: write(_filter(_v, rawExpr='${dimNum}')) # from line 169, col 8.
write('''] = ''')
_v = VFFSL(SL,"dimRep.globalLattice",True) # '${dimRep.globalLattice}' on line 169, col 21
if _v is not None: write(_filter(_v, rawExpr='${dimRep.globalLattice}')) # from line 169, col 21.
write(''';
''')
write('''_local_alloc_size = ''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 171, col 21
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 171, col 21.
write('''_mpi_local_size_many_transposed(
''')
_v = VFFSL(SL,"len",False)(untransformedDimRepBasis) # '${len(untransformedDimRepBasis)}' on line 172, col 3
if _v is not None: write(_filter(_v, rawExpr='${len(untransformedDimRepBasis)}')) # from line 172, col 3.
write(''', _sizes,
(ptrdiff_t)''')
_v = VFFSL(SL,"transformation",True)['postfixLatticeString'] # "${transformation['postfixLatticeString']}" on line 173, col 14
if _v is not None: write(_filter(_v, rawExpr="${transformation['postfixLatticeString']}")) # from line 173, col 14.
write(''',
_block_size_''')
_v = VFN(VFFSL(SL,"untransformedDimRepBasis",True)[0],"name",True) # '${untransformedDimRepBasis[0].name}' on line 174, col 15
if _v is not None: write(_filter(_v, rawExpr='${untransformedDimRepBasis[0].name}')) # from line 174, col 15.
write(''', _block_size_''')
_v = VFN(VFFSL(SL,"transformedDimRepBasis",True)[0],"name",True) # '${transformedDimRepBasis[0].name}' on line 174, col 64
if _v is not None: write(_filter(_v, rawExpr='${transformedDimRepBasis[0].name}')) # from line 174, col 64.
write(''',
MPI_COMM_WORLD,
&_tmp, &_tmp, &_tmp, &_tmp /* Local lattices and offsets were obtained above */
);
''')
for vector in transformation['vectors']: # generated from line 178, col 5
_v = VFFSL(SL,"vector.allocSize",True) # '${vector.allocSize}' on line 179, col 1
if _v is not None: write(_filter(_v, rawExpr='${vector.allocSize}')) # from line 179, col 1.
write(''' = MAX(''')
_v = VFFSL(SL,"vector.allocSize",True) # '${vector.allocSize}' on line 179, col 27
if _v is not None: write(_filter(_v, rawExpr='${vector.allocSize}')) # from line 179, col 27.
write(''', (_local_alloc_size''')
_v = '+1) / 2' if vector.type == 'complex' and transformation.get('transformType', 'real') == 'real' else ')' # "${'+1) / 2' if vector.type == 'complex' and transformation.get('transformType', 'real') == 'real' else ')'}" on line 179, col 66
if _v is not None: write(_filter(_v, rawExpr="${'+1) / 2' if vector.type == 'complex' and transformation.get('transformType', 'real') == 'real' else ')'}")) # from line 179, col 66.
write(''');
''')
write('''
''')
#
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def transposeTransformFunction(self, transformID, transformDict, function, **KWS):
## CHEETAH: generated from @def transposeTransformFunction(transformID, transformDict, function) at line 186, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
#
runtimePrefix, prefixLattice, postfixLattice, runtimePostfix = transformDict['transformSpecifier']
flags = ' | FFTW_MPI_TRANSPOSED_IN | FFTW_MPI_TRANSPOSED_OUT' if transformDict['transposedOrder'] else ''
flags += ' | FFTW_DESTROY_INPUT' if transformDict.get('outOfPlace', False) else ''
write('''// _prefix_lattice should be ''')
_v = VFFSL(SL,"prefixLattice",True) # '${prefixLattice}' on line 191, col 30
if _v is not None: write(_filter(_v, rawExpr='${prefixLattice}')) # from line 191, col 30.
write('''
// _postfix_lattice should be ''')
_v = VFFSL(SL,"postfixLattice",True) # '${postfixLattice}' on line 192, col 31
if _v is not None: write(_filter(_v, rawExpr='${postfixLattice}')) # from line 192, col 31.
write('''
static ''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 193, col 8
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 193, col 8.
write('''_plan _fftw_forward_plan = NULL;
static ''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 194, col 8
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 194, col 8.
write('''_plan _fftw_backward_plan = NULL;
if (!_fftw_forward_plan) {
_LOG(_SIMULATION_LOG_LEVEL, "Planning for ''')
_v = VFFSL(SL,"function.description",True) # '${function.description}' on line 197, col 45
if _v is not None: write(_filter(_v, rawExpr='${function.description}')) # from line 197, col 45.
write('''...");
''')
transformPair = transformDict['transformPair']
if transformDict['transposedOrder']: # generated from line 199, col 3
# Reverse the order
transformPair = transformPair[::-1]
dataOut = '_data_out' if transformDict.get('outOfPlace', False) else '_data_in'
write('''
_fftw_forward_plan = ''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 205, col 24
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 205, col 24.
write('''_mpi_plan_many_transpose(
''')
_v = ', '.join(dr.globalLattice for dr in transformPair[0]) # "${', '.join(dr.globalLattice for dr in transformPair[0])}" on line 206, col 5
if _v is not None: write(_filter(_v, rawExpr="${', '.join(dr.globalLattice for dr in transformPair[0])}")) # from line 206, col 5.
write(''',
_postfix_lattice, _block_size_''')
_v = VFN(VFFSL(SL,"transformPair",True)[0][0],"name",True) # '${transformPair[0][0].name}' on line 207, col 35
if _v is not None: write(_filter(_v, rawExpr='${transformPair[0][0].name}')) # from line 207, col 35.
write(''', _block_size_''')
_v = VFN(VFFSL(SL,"transformPair",True)[1][0],"name",True) # '${transformPair[1][0].name}' on line 207, col 76
if _v is not None: write(_filter(_v, rawExpr='${transformPair[1][0].name}')) # from line 207, col 76.
write(''',
reinterpret_cast<real*>(_data_in),
reinterpret_cast<real*>(''')
_v = VFFSL(SL,"dataOut",True) # '$dataOut' on line 209, col 29
if _v is not None: write(_filter(_v, rawExpr='$dataOut')) # from line 209, col 29.
write('''),
MPI_COMM_WORLD, ''')
_v = VFFSL(SL,"planType",True) # '${planType}' on line 210, col 21
if _v is not None: write(_filter(_v, rawExpr='${planType}')) # from line 210, col 21.
_v = VFFSL(SL,"flags",True) # '${flags}' on line 210, col 32
if _v is not None: write(_filter(_v, rawExpr='${flags}')) # from line 210, col 32.
write('''
);
if (!_fftw_forward_plan)
_LOG(_ERROR_LOG_LEVEL, "(%s: %i) Unable to create forward mpi transform plan.\\n", __FILE__, __LINE__);
_fftw_backward_plan = ''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 216, col 25
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 216, col 25.
write('''_mpi_plan_many_transpose(
''')
_v = ', '.join(dr.globalLattice for dr in transformPair[1]) # "${', '.join(dr.globalLattice for dr in transformPair[1])}" on line 217, col 5
if _v is not None: write(_filter(_v, rawExpr="${', '.join(dr.globalLattice for dr in transformPair[1])}")) # from line 217, col 5.
write(''',
_postfix_lattice, _block_size_''')
_v = VFN(VFFSL(SL,"transformPair",True)[1][0],"name",True) # '${transformPair[1][0].name}' on line 218, col 35
if _v is not None: write(_filter(_v, rawExpr='${transformPair[1][0].name}')) # from line 218, col 35.
write(''', _block_size_''')
_v = VFN(VFFSL(SL,"transformPair",True)[0][0],"name",True) # '${transformPair[0][0].name}' on line 218, col 76
if _v is not None: write(_filter(_v, rawExpr='${transformPair[0][0].name}')) # from line 218, col 76.
write(''',
reinterpret_cast<real*>(_data_in),
reinterpret_cast<real*>(''')
_v = VFFSL(SL,"dataOut",True) # '$dataOut' on line 220, col 29
if _v is not None: write(_filter(_v, rawExpr='$dataOut')) # from line 220, col 29.
write('''),
MPI_COMM_WORLD, ''')
_v = VFFSL(SL,"planType",True) # '${planType}' on line 221, col 21
if _v is not None: write(_filter(_v, rawExpr='${planType}')) # from line 221, col 21.
_v = VFFSL(SL,"flags",True) # '${flags}' on line 221, col 32
if _v is not None: write(_filter(_v, rawExpr='${flags}')) # from line 221, col 32.
write('''
);
if (!_fftw_backward_plan)
_LOG(_ERROR_LOG_LEVEL, "(%s: %i) Unable to create backward mpi transform plan.\\n", __FILE__, __LINE__);
// Save wisdom
#if CFG_OSAPI == CFG_OSAPI_POSIX
''')
_v = VFFSL(SL,"saveWisdom",True) # '${saveWisdom, autoIndent=True}' on line 229, col 3
if _v is not None: write(_filter(_v, autoIndent=True, rawExpr='${saveWisdom, autoIndent=True}')) # from line 229, col 3.
write(''' #endif // POSIX
_LOG(_SIMULATION_LOG_LEVEL, " done.\\n");
}
if (_forward) {
''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 236, col 3
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 236, col 3.
write('''_execute_r2r(
_fftw_forward_plan,
reinterpret_cast<real*>(_data_in),
reinterpret_cast<real*>(''')
_v = VFFSL(SL,"dataOut",True) # '${dataOut}' on line 239, col 29
if _v is not None: write(_filter(_v, rawExpr='${dataOut}')) # from line 239, col 29.
write(''')
);
} else {
''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 242, col 3
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 242, col 3.
write('''_execute_r2r(
_fftw_backward_plan,
reinterpret_cast<real*>(_data_in),
reinterpret_cast<real*>(''')
_v = VFFSL(SL,"dataOut",True) # '${dataOut}' on line 245, col 29
if _v is not None: write(_filter(_v, rawExpr='${dataOut}')) # from line 245, col 29.
write(''')
);
}
''')
#
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def distributedTransformFunction(self, transformID, transformDict, function, **KWS):
## CHEETAH: generated from @def distributedTransformFunction(transformID, transformDict, function) at line 251, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
#
runtimePrefix, prefixLattice, postfixLattice, runtimePostfix = transformDict['transformSpecifier']
write('''// _prefix_lattice should be ''')
_v = VFFSL(SL,"prefixLattice",True) # '${prefixLattice}' on line 254, col 30
if _v is not None: write(_filter(_v, rawExpr='${prefixLattice}')) # from line 254, col 30.
_v = ''.join([' * ' + runtimeLattice for runtimeLattice in runtimePrefix]) # "${''.join([' * ' + runtimeLattice for runtimeLattice in runtimePrefix])}" on line 254, col 46
if _v is not None: write(_filter(_v, rawExpr="${''.join([' * ' + runtimeLattice for runtimeLattice in runtimePrefix])}")) # from line 254, col 46.
write('''
// _postfix_lattice should be ''')
_v = VFFSL(SL,"postfixLattice",True) # '${postfixLattice}' on line 255, col 31
if _v is not None: write(_filter(_v, rawExpr='${postfixLattice}')) # from line 255, col 31.
_v = ''.join([' * ' + runtimeLattice for runtimeLattice in runtimePostfix]) # "${''.join([' * ' + runtimeLattice for runtimeLattice in runtimePostfix])}" on line 255, col 48
if _v is not None: write(_filter(_v, rawExpr="${''.join([' * ' + runtimeLattice for runtimeLattice in runtimePostfix])}")) # from line 255, col 48.
write('''
static ''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 256, col 8
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 256, col 8.
write('''_plan _fftw_forward_plan = NULL;
static ''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 257, col 8
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 257, col 8.
write('''_plan _fftw_backward_plan = NULL;
if (!_fftw_forward_plan) {
_LOG(_SIMULATION_LOG_LEVEL, "Planning for ''')
_v = VFFSL(SL,"function.description",True) # '${function.description}' on line 260, col 45
if _v is not None: write(_filter(_v, rawExpr='${function.description}')) # from line 260, col 45.
write('''...");
''')
transformPair = transformDict['transformPair']
dimensionsBeingTransformed = len(transformPair[0])
transformType = transformDict['transformType']
dataOut = '_data_out' if transformDict.get('outOfPlace', False) else '_data_in'
flags = ' | FFTW_DESTROY_INPUT' if transformDict.get('outOfPlace', False) else ''
write(''' ptrdiff_t _transform_sizes[''')
_v = VFFSL(SL,"dimensionsBeingTransformed",True) # '${dimensionsBeingTransformed}' on line 266, col 30
if _v is not None: write(_filter(_v, rawExpr='${dimensionsBeingTransformed}')) # from line 266, col 30.
write('''];
''')
if transformType == 'real': # generated from line 267, col 3
write(''' ''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 268, col 3
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 268, col 3.
write('''_r2r_kind _r2r_kinds[''')
_v = VFFSL(SL,"dimensionsBeingTransformed",True) # '${dimensionsBeingTransformed}' on line 268, col 37
if _v is not None: write(_filter(_v, rawExpr='${dimensionsBeingTransformed}')) # from line 268, col 37.
write('''];
''')
write('''
int _transform_sizes_index = 0;
''')
#
for dimID, dimRep in enumerate(transformPair[0]): # generated from line 274, col 3
write(''' _transform_sizes[_transform_sizes_index++] = ''')
_v = VFFSL(SL,"dimRep.globalLattice",True) # '${dimRep.globalLattice}' on line 275, col 48
if _v is not None: write(_filter(_v, rawExpr='${dimRep.globalLattice}')) # from line 275, col 48.
write(''';
''')
write('''
''')
if transformType == 'complex': # generated from line 278, col 3
guruPlanFunction = self.createGuruMPIDFTPlanInDirection
else: # generated from line 280, col 3
guruPlanFunction = self.createGuruMPIR2RPlanInDirection
#
write(''' ''')
_v = VFFSL(SL,"guruPlanFunction",False)(
transformDict, 'forward', dataOut,
'_block_size_' + transformPair[0][0].name, '_block_size_' + transformPair[1][0].name, 'FFTW_MPI_TRANSPOSED_OUT', flags
)
if _v is not None: write(_filter(_v, autoIndent=True, rawExpr="${guruPlanFunction(\n transformDict, 'forward', dataOut,\n '_block_size_' + transformPair[0][0].name, '_block_size_' + transformPair[1][0].name, 'FFTW_MPI_TRANSPOSED_OUT', flags\n ), autoIndent=True}")) # from line 284, col 3.
write(''' ''')
_v = VFFSL(SL,"guruPlanFunction",False)(
transformDict, 'backward', dataOut,
'_block_size_' + transformPair[1][0].name, '_block_size_' + transformPair[0][0].name, 'FFTW_MPI_TRANSPOSED_IN', flags
)
if _v is not None: write(_filter(_v, autoIndent=True, rawExpr="${guruPlanFunction(\n transformDict, 'backward', dataOut,\n '_block_size_' + transformPair[1][0].name, '_block_size_' + transformPair[0][0].name, 'FFTW_MPI_TRANSPOSED_IN', flags\n ), autoIndent=True}")) # from line 288, col 3.
write('''
// Save wisdom
#if CFG_OSAPI == CFG_OSAPI_POSIX
''')
_v = VFFSL(SL,"saveWisdom",True) # '${saveWisdom, autoIndent=True}' on line 295, col 3
if _v is not None: write(_filter(_v, autoIndent=True, rawExpr='${saveWisdom, autoIndent=True}')) # from line 295, col 3.
write(''' #endif // POSIX
_LOG(_SIMULATION_LOG_LEVEL, " done.\\n");
}
if (_forward) {
''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 302, col 3
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 302, col 3.
write('''_execute_r2r(
_fftw_forward_plan,
reinterpret_cast<real*>(_data_in),
reinterpret_cast<real*>(''')
_v = VFFSL(SL,"dataOut",True) # '${dataOut}' on line 305, col 29
if _v is not None: write(_filter(_v, rawExpr='${dataOut}')) # from line 305, col 29.
write(''')
);
} else {
''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 308, col 3
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 308, col 3.
write('''_execute_r2r(
_fftw_backward_plan,
reinterpret_cast<real*>(_data_in),
reinterpret_cast<real*>(''')
_v = VFFSL(SL,"dataOut",True) # '${dataOut}' on line 311, col 29
if _v is not None: write(_filter(_v, rawExpr='${dataOut}')) # from line 311, col 29.
write(''')
);
}
''')
#
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def createGuruMPIDFTPlanInDirection(self, transformDict, direction, dataOut, inBlockSize, outBlockSize, transposedState, flags, **KWS):
## CHEETAH: generated from @def createGuruMPIDFTPlanInDirection($transformDict, $direction, $dataOut, $inBlockSize, $outBlockSize, $transposedState, $flags) at line 317, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
#
write('''_fftw_''')
_v = VFFSL(SL,"direction",True) # '${direction}' on line 319, col 7
if _v is not None: write(_filter(_v, rawExpr='${direction}')) # from line 319, col 7.
write('''_plan = ''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 319, col 27
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 319, col 27.
write('''_mpi_plan_many_dft(
_transform_sizes_index, _transform_sizes, _postfix_lattice,
''')
_v = VFFSL(SL,"inBlockSize",True) # '${inBlockSize}' on line 321, col 3
if _v is not None: write(_filter(_v, rawExpr='${inBlockSize}')) # from line 321, col 3.
write(''', ''')
_v = VFFSL(SL,"outBlockSize",True) # '${outBlockSize}' on line 321, col 19
if _v is not None: write(_filter(_v, rawExpr='${outBlockSize}')) # from line 321, col 19.
write(''',
reinterpret_cast<''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 322, col 20
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 322, col 20.
write('''_complex*>(_data_in),
reinterpret_cast<''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 323, col 20
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 323, col 20.
write('''_complex*>(''')
_v = VFFSL(SL,"dataOut",True) # '${dataOut}' on line 323, col 44
if _v is not None: write(_filter(_v, rawExpr='${dataOut}')) # from line 323, col 44.
write('''),
MPI_COMM_WORLD, FFTW_''')
_v = VFN(VFFSL(SL,"direction",True),"upper",False)() # '${direction.upper()}' on line 324, col 24
if _v is not None: write(_filter(_v, rawExpr='${direction.upper()}')) # from line 324, col 24.
write(''', ''')
_v = VFFSL(SL,"planType",True) # '${planType}' on line 324, col 46
if _v is not None: write(_filter(_v, rawExpr='${planType}')) # from line 324, col 46.
write(''' | ''')
_v = VFFSL(SL,"transposedState",True) # '${transposedState}' on line 324, col 60
if _v is not None: write(_filter(_v, rawExpr='${transposedState}')) # from line 324, col 60.
_v = VFFSL(SL,"flags",True) # '${flags}' on line 324, col 78
if _v is not None: write(_filter(_v, rawExpr='${flags}')) # from line 324, col 78.
write('''
);
if (!_fftw_''')
_v = VFFSL(SL,"direction",True) # '${direction}' on line 326, col 12
if _v is not None: write(_filter(_v, rawExpr='${direction}')) # from line 326, col 12.
write('''_plan)
_LOG(_ERROR_LOG_LEVEL, "(%s: %i) Unable to create ''')
_v = VFFSL(SL,"direction",True) # '${direction}' on line 327, col 53
if _v is not None: write(_filter(_v, rawExpr='${direction}')) # from line 327, col 53.
write(''' mpi dft plan.\\n", __FILE__, __LINE__);
''')
#
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def createGuruMPIR2RPlanInDirection(self, transformDict, direction, dataOut, inBlockSize, outBlockSize, transposedState, flags, **KWS):
## CHEETAH: generated from @def createGuruMPIR2RPlanInDirection($transformDict, $direction, $dataOut, $inBlockSize, $outBlockSize, $transposedState, $flags) at line 332, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
#
for idx, dimRep in enumerate(transformDict['transformPair'][0]): # generated from line 334, col 3
write('''_r2r_kinds[''')
_v = VFFSL(SL,"idx",True) # '${idx}' on line 335, col 12
if _v is not None: write(_filter(_v, rawExpr='${idx}')) # from line 335, col 12.
write('''] = ''')
_v = VFFSL(SL,"r2rKindForDimensionAndDirection",False)(dimRep.name, direction) # '${r2rKindForDimensionAndDirection(dimRep.name, direction)}' on line 335, col 22
if _v is not None: write(_filter(_v, rawExpr='${r2rKindForDimensionAndDirection(dimRep.name, direction)}')) # from line 335, col 22.
write(''';
''')
write('''
_fftw_''')
_v = VFFSL(SL,"direction",True) # '${direction}' on line 338, col 7
if _v is not None: write(_filter(_v, rawExpr='${direction}')) # from line 338, col 7.
write('''_plan = ''')
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 338, col 27
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 338, col 27.
write('''_mpi_plan_many_r2r(
_transform_sizes_index, _transform_sizes, _postfix_lattice,
''')
_v = VFFSL(SL,"inBlockSize",True) # '${inBlockSize}' on line 340, col 3
if _v is not None: write(_filter(_v, rawExpr='${inBlockSize}')) # from line 340, col 3.
write(''', ''')
_v = VFFSL(SL,"outBlockSize",True) # '${outBlockSize}' on line 340, col 19
if _v is not None: write(_filter(_v, rawExpr='${outBlockSize}')) # from line 340, col 19.
write(''',
reinterpret_cast<real*>(_data_in),
reinterpret_cast<real*>(''')
_v = VFFSL(SL,"dataOut",True) # '${dataOut}' on line 342, col 27
if _v is not None: write(_filter(_v, rawExpr='${dataOut}')) # from line 342, col 27.
write('''),
MPI_COMM_WORLD, _r2r_kinds, ''')
_v = VFFSL(SL,"planType",True) # '${planType}' on line 343, col 31
if _v is not None: write(_filter(_v, rawExpr='${planType}')) # from line 343, col 31.
write(''' | ''')
_v = VFFSL(SL,"transposedState",True) # '${transposedState}' on line 343, col 45
if _v is not None: write(_filter(_v, rawExpr='${transposedState}')) # from line 343, col 45.
_v = VFFSL(SL,"flags",True) # '${flags}' on line 343, col 63
if _v is not None: write(_filter(_v, rawExpr='${flags}')) # from line 343, col 63.
write('''
);
if (!_fftw_''')
_v = VFFSL(SL,"direction",True) # '${direction}' on line 346, col 12
if _v is not None: write(_filter(_v, rawExpr='${direction}')) # from line 346, col 12.
write('''_plan)
_LOG(_ERROR_LOG_LEVEL, "(%s: %i) Unable to create ''')
_v = VFFSL(SL,"direction",True) # '${direction}' on line 347, col 53
if _v is not None: write(_filter(_v, rawExpr='${direction}')) # from line 347, col 53.
write(''' mpi r2r plan.\\n", __FILE__, __LINE__);
''')
#
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def loadWisdom(self, **KWS):
## CHEETAH: generated from @def loadWisdom at line 352, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
#
_v = super(FourierTransformFFTW3MPI, self).loadWisdom()
if _v is not None: write(_filter(_v))
#
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 356, col 1
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 356, col 1.
write('''_mpi_broadcast_wisdom(MPI_COMM_WORLD);
''')
#
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def saveWisdom(self, **KWS):
## CHEETAH: generated from @def saveWisdom at line 360, col 1.
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
#
_v = VFFSL(SL,"fftwPrefix",True) # '${fftwPrefix}' on line 362, col 1
if _v is not None: write(_filter(_v, rawExpr='${fftwPrefix}')) # from line 362, col 1.
write('''_mpi_gather_wisdom(MPI_COMM_WORLD);
''')
#
_v = super(FourierTransformFFTW3MPI, self).saveWisdom()
if _v is not None: write(_filter(_v))
#
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
def writeBody(self, **KWS):
## CHEETAH: main method generated for this template
trans = KWS.get("trans")
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
write('''
''')
#
# FourierTransformFFTW3MPI.tmpl
#
# Created by Graham Dennis on 2008-06-06.
#
# Copyright (c) 2008-2012, Graham Dennis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
write('''
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
##################################################
## CHEETAH GENERATED ATTRIBUTES
_CHEETAH__instanceInitialized = False
_CHEETAH_version = __CHEETAH_version__
_CHEETAH_versionTuple = __CHEETAH_versionTuple__
_CHEETAH_genTime = __CHEETAH_genTime__
_CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
_CHEETAH_src = __CHEETAH_src__
_CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
fftwSuffix = 'mpi'
_mainCheetahMethod_for_FourierTransformFFTW3MPI = 'writeBody'
## END CLASS DEFINITION
if not hasattr(FourierTransformFFTW3MPI, '_initCheetahAttributes'):
templateAPIClass = getattr(FourierTransformFFTW3MPI,
'_CHEETAH_templateClass',
Template)
templateAPIClass._addCheetahPlumbingCodeToClass(FourierTransformFFTW3MPI)
# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit https://cheetahtemplate.org/
##################################################
## if run from command line:
if __name__ == '__main__':
from Cheetah.TemplateCmdLineIface import CmdLineIface
CmdLineIface(templateObj=FourierTransformFFTW3MPI()).run()
|