Changeset 9116
- Timestamp:
- May 15, 2014, 2:16:21 PM (11 years ago)
- Location:
- trunk/anuga_core/source/anuga_parallel/pypar_extras
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_parallel/pypar_extras/pypar_ext.py
r8514 r9116 230 230 231 231 import types 232 from mpiextimport size232 from pypar import size 233 233 numproc = size() # Needed to determine buffer size 234 234 -
trunk/anuga_core/source/anuga_parallel/pypar_extras/test_pypar_ext.py
r8514 r9116 20 20 #print "Importing pypar" 21 21 import pypar 22 import pypar_ext as par_exts 23 #import pypar as par_exts 24 par_exts_methods = dir(par_exts) 25 assert 'allreduce' in par_exts_methods 22 26 methods = dir(pypar) 23 27 assert 'abort' in methods … … 902 906 X = numpy.zeros(N, 'i') # Buffer for results 903 907 904 p ypar.allreduce(testArray, pypar.SUM, buffer=X)908 par_exts.allreduce(testArray, pypar.SUM, buffer=X) 905 909 906 910 if myid == 0: … … 911 915 print 'Buffered allreduce using pypar.SUM OK' 912 916 913 p ypar.allreduce(testArray, pypar.MAX, buffer=X)917 par_exts.allreduce(testArray, pypar.MAX, buffer=X) 914 918 if myid == 0: 915 919 Y = numpy.array(range(N))*numproc … … 917 921 print 'Buffered allreduce using pypar.MAX OK' 918 922 919 p ypar.allreduce(testArray, pypar.MIN, buffer=X)923 par_exts.allreduce(testArray, pypar.MIN, buffer=X) 920 924 if myid == 0: 921 925 Y = numpy.array(range(N)) … … 927 931 X_float = X.astype('f') 928 932 929 p ypar.allreduce(testArray_float, pypar.PROD, buffer=X_float)933 par_exts.allreduce(testArray_float, pypar.PROD, buffer=X_float) 930 934 if myid == 0: 931 935 Y = numpy.ones(N).astype('f') … … 940 944 print "Skipping product-allreduce - try again with numproc < 20" 941 945 942 p ypar.allreduce(testArray, pypar.LAND, buffer=X)946 par_exts.allreduce(testArray, pypar.LAND, buffer=X) 943 947 if myid == 0: 944 948 Y = numpy.ones(N).astype('i') … … 948 952 print 'Buffered allreduce using pypar.LAND OK' 949 953 950 p ypar.allreduce(testArray, pypar.BAND, buffer=X)954 par_exts.allreduce(testArray, pypar.BAND, buffer=X) 951 955 if myid == 0: 952 956 Y = numpy.ones(N).astype('i')*255 #Neutral element for & … … 956 960 print 'Buffered allreduce using pypar.BAND OK' 957 961 958 p ypar.allreduce(testArray, pypar.LOR, buffer=X)962 par_exts.allreduce(testArray, pypar.LOR, buffer=X) 959 963 if myid == 0: 960 964 Y = numpy.zeros(N).astype('i') … … 964 968 print 'Buffered allreduce using pypar.LOR OK' 965 969 966 p ypar.allreduce(testArray, pypar.BOR, buffer=X)970 par_exts.allreduce(testArray, pypar.BOR, buffer=X) 967 971 if myid == 0: 968 972 Y = numpy.zeros(N).astype('i') #Neutral element for | … … 972 976 print 'Buffered allreduce using pypar.BOR OK' 973 977 974 p ypar.allreduce(testArray, pypar.LXOR, buffer=X)978 par_exts.allreduce(testArray, pypar.LXOR, buffer=X) 975 979 if myid == 0: 976 980 Y = numpy.zeros(N).astype('i') … … 980 984 print 'Buffered allreduce using pypar.LXOR OK' 981 985 982 p ypar.allreduce(testArray, pypar.BXOR, buffer=X)986 par_exts.allreduce(testArray, pypar.BXOR, buffer=X) 983 987 if myid == 0: 984 988 Y = numpy.zeros(N).astype('i') #Neutral element for xor ?
Note: See TracChangeset
for help on using the changeset viewer.