repo
stringlengths
2
99
file
stringlengths
13
225
code
stringlengths
0
18.3M
file_length
int64
0
18.3M
avg_line_length
float64
0
1.36M
max_line_length
int64
0
4.26M
extension_type
stringclasses
1 value
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_msgzero.py
from mpi4py import MPI import mpiunittest as unittest class BaseTestMessageZero(object): null_b = [None, MPI.INT] null_v = [None, (0, None), MPI.INT] def testPointToPoint(self): comm = self.COMM comm.Sendrecv(sendbuf=self.null_b, dest=comm.rank, recvbuf=self.null_b...
1,839
31.857143
67
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_comm_inter.py
from mpi4py import MPI import mpiunittest as unittest class BaseTestIntercomm(object): BASECOMM = MPI.COMM_NULL INTRACOMM = MPI.COMM_NULL INTERCOMM = MPI.COMM_NULL def setUp(self): size = self.BASECOMM.Get_size() rank = self.BASECOMM.Get_rank() if rank < size // 2 : ...
3,075
30.387755
72
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_errorcode.py
from mpi4py import MPI import mpiunittest as unittest class TestErrorCode(unittest.TestCase): errorclasses = [item[1] for item in vars(MPI).items() if item[0].startswith('ERR_')] errorclasses.insert(0, MPI.SUCCESS) errorclasses.remove(MPI.ERR_LASTCODE) def testGetErrorClass(self):...
4,398
38.990909
72
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_file.py
from mpi4py import MPI import mpiunittest as unittest import os, tempfile class BaseTestFile(object): COMM = MPI.COMM_NULL FILE = MPI.FILE_NULL prefix = 'mpi4py' def setUp(self): fd, self.fname = tempfile.mkstemp(prefix=self.prefix) os.close(fd) self.amode = MPI.MODE_RDWR | M...
6,880
31.457547
73
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_p2p_obj_matched.py
from mpi4py import MPI import mpiunittest as unittest _basic = [None, True, False, -7, 0, 7, -2**63+1, 2**63-1, -2.17, 0.0, 3.14, 1+2j, 2-3j, 'mpi4py', ] messages = list(_basic) messages += [ list(_basic), tuple(_basic), ...
5,636
30.143646
65
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_subclass.py
from mpi4py import MPI import mpiunittest as unittest # --- class MyBaseComm(object): def free(self): if self != MPI.COMM_NULL: super(type(self), self).Free() class BaseTestBaseComm(object): def setUp(self): self.comm = self.CommType(self.COMM_BASE) def testSubType(self): ...
8,160
24.907937
81
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_status.py
from mpi4py import MPI import mpiunittest as unittest class TestStatus(unittest.TestCase): def setUp(self): self.STATUS = MPI.Status() def tearDown(self): self.STATUS = None def testDefaultFieldValues(self): self.assertEqual(self.STATUS.Get_source(), MPI.ANY_SOURCE) self....
3,107
31.375
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/spawn_child.py
import sys; sys.path.insert(0, sys.argv[1]) import mpi4py if len(sys.argv) > 2: lfn = "runtests-mpi4py-child" mpe = sys.argv[2] == 'mpe' vt = sys.argv[2] == 'vt' if mpe: mpi4py.profile('mpe', logfile=lfn) if vt: mpi4py.profile('vt', logfile=lfn) from mpi4py import MPI parent = MPI.Comm.Get_parent...
453
27.375
46
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_exceptions.py
from mpi4py import MPI import mpiunittest as unittest # -------------------------------------------------------------------- class BaseTestCase(unittest.TestCase): def setUp(self): self.errhdl_world = MPI.COMM_WORLD.Get_errhandler() MPI.COMM_WORLD.Set_errhandler(MPI.ERRORS_RETURN) self.er...
15,031
30.579832
79
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/runtests.py
import sys, os import optparse import unittest def getoptionparser(): parser = optparse.OptionParser() parser.add_option("-q", "--quiet", action="store_const", const=0, dest="verbose", default=1, help="do not print status messages to stdout") parser.add_option("...
8,552
34.489627
79
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_dl.py
try: from mpi4py import dl except ImportError: dl = None import mpiunittest as unittest import sys import os class TestDL(unittest.TestCase): def testDL1(self): if sys.platform == 'darwin': libm = 'libm.dylib' else: libm = 'libm.so' handle = dl.dlopen(libm,...
2,106
26.012821
63
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_doc.py
import sys, types from mpi4py import MPI import mpiunittest as unittest ModuleType = type(MPI) ClassType = type(MPI.Comm) FunctionType = type(MPI.Init) MethodDescrType = type(MPI.Comm.Get_rank) GetSetDescrType = type(MPI.Comm.rank) def getdocstr(mc, docstrings, namespace=None): name = getattr(mc, '__name__', None...
1,794
31.053571
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_cco_ngh_obj.py
from mpi4py import MPI import mpiunittest as unittest _basic = [None, True, False, -7, 0, 7, 2**31, -2**63+1, 2**63-1, -2.17, 0.0, 3.14, 1+2j, 2-3j, 'mpi4py', ] messages = _basic messages += [ list(_basic), tuple(_basic), ...
3,548
26.944882
64
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_environ.py
from mpi4py import MPI import mpiunittest as unittest class TestEnviron(unittest.TestCase): def testIsInitialized(self): flag = MPI.Is_initialized() self.assertTrue(type(flag) is bool) self.assertTrue(flag) def testIsFinalized(self): flag = MPI.Is_finalized() self.asse...
3,488
31.607477
67
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_op.py
from mpi4py import MPI import mpiunittest as unittest import sys MPI_ERR_OP = MPI.ERR_OP try: import array except ImportError: array = None if array: try: tobytes = array.array.tobytes except AttributeError: tobytes = array.array.tostring def frombytes(typecode, data): a = array...
7,318
30.683983
76
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/test/test_cffi.py
from mpi4py import MPI import mpiunittest as unittest try: import cffi except ImportError: cffi = None class TestCFFI(unittest.TestCase): mpitypes = [ MPI.Datatype, MPI.Request, MPI.Info, MPI.Errhandler, MPI.Group, MPI.Win, MPI.Op, MPI.File, ...
2,218
25.73494
68
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_bibw.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI def osu_bw( BENCHMARH = "MPI Bi-Directional Bandwidth Test", skip = 10, loop = 100, window_size = 64, skip_large = 2, loop_large = 20, window_size_large = 64, large_message_size = 8192, MAX_MSG_SIZE = 1<<22, ...
2,728
28.031915
63
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_latency.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI def osu_latency( BENCHMARH = "MPI Latency Test", skip = 1000, loop = 10000, skip_large = 10, loop_large = 100, large_message_size = 8192, MAX_MSG_SIZE = 1<<22, ): comm = MPI.COMM_WORLD myid = comm.Get_rank(...
2,001
24.666667
63
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_alltoall.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI def osu_alltoall( BENCHMARH = "MPI All-to-All Latency Test", skip = 200, loop = 1000, skip_large = 10, loop_large = 100, large_message_size = 8192, MAX_MSG_SIZE = 1<<20, ): comm = MPI.COMM_WORLD myid = comm...
1,681
24.104478
59
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_bw.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI def osu_bw( BENCHMARH = "MPI Bandwidth Test", skip = 10, loop = 100, window_size = 64, skip_large = 2, loop_large = 20, window_size_large = 64, large_message_size = 8192, MAX_MSG_SIZE = 1<<22, ): comm =...
2,511
26.604396
63
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_gather.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI def osu_bcast( BENCHMARH = "MPI Gather Latency Test", skip = 1000, loop = 10000, skip_large = 10, loop_large = 100, large_message_size = 8192, MAX_MSG_SIZE = 1<<20, ): comm = MPI.COMM_WORLD myid = comm.Get_...
1,985
23.825
64
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_barrier.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI def osu_bcast( BENCHMARH = "MPI Barrier Latency Test", skip = 1000, loop = 10000, skip_large = 10, loop_large = 100, large_message_size = 8192, MAX_MSG_SIZE = 1<<20, ): comm = MPI.COMM_WORLD myid = comm.Get...
1,096
20.94
64
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_bcast.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI def osu_bcast( BENCHMARH = "MPI Broadcast Latency Test", skip = 1000, loop = 10000, skip_large = 10, loop_large = 100, large_message_size = 8192, MAX_MSG_SIZE = 1<<20, ): comm = MPI.COMM_WORLD myid = comm.G...
1,750
23.319444
64
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_alltoallv.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI from array import array def osu_alltoall( BENCHMARH = "MPI Alltoallv Latency Test", skip = 200, loop = 1000, skip_large = 10, loop_large = 100, large_message_size = 8192, MAX_MSG_SIZE = 1<<20, ): comm = MPI.COM...
2,090
25.807692
59
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_scatter.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI def osu_bcast( BENCHMARH = "MPI Scatter Latency Test", skip = 1000, loop = 10000, skip_large = 10, loop_large = 100, large_message_size = 8192, MAX_MSG_SIZE = 1<<20, ): comm = MPI.COMM_WORLD myid = comm.Get...
1,987
23.85
64
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/helloworld.py
#!/usr/bin/env python """ Parallel Hello World """ from mpi4py import MPI import sys size = MPI.COMM_WORLD.Get_size() rank = MPI.COMM_WORLD.Get_rank() name = MPI.Get_processor_name() sys.stdout.write( "Hello, World! I am process %d of %d on %s.\n" % (rank, size, name))
281
16.625
50
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_multi_lat.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI def osu_multi_lat( BENCHMARH = "MPI Multi Latency Test", skip_small = 100, loop_small = 10000, skip_large = 10, loop_large = 1000, large_message_size = 8192, MAX_MSG_SIZE = 1<<22, ): comm = MPI.COMM_WORLD m...
2,226
26.158537
60
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/osu_allgather.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from mpi4py import MPI def osu_bcast( BENCHMARH = "MPI Allgather Latency Test", skip = 1000, loop = 10000, skip_large = 10, loop_large = 100, large_message_size = 8192, MAX_MSG_SIZE = 1<<20, ): comm = MPI.COMM_WORLD myid = comm.G...
1,804
23.726027
64
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/wrap-ctypes/test.py
from mpi4py import MPI import helloworld as hw null = MPI.COMM_NULL hw.sayhello(null) comm = MPI.COMM_WORLD hw.sayhello(comm) try: hw.sayhello(list()) except: pass else: assert 0, "exception not raised"
218
12.6875
36
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/wrap-ctypes/helloworld.py
from mpi4py import MPI import ctypes import os _libdir = os.path.dirname(__file__) if MPI._sizeof(MPI.Comm) == ctypes.sizeof(ctypes.c_int): MPI_Comm = ctypes.c_int else: MPI_Comm = ctypes.c_void_p _lib = ctypes.CDLL(os.path.join(_libdir, "libhelloworld.so")) _lib.sayhello.restype = None _lib.sayhello.argtypes...
466
23.578947
61
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/threads/sendrecv.py
from mpi4py import MPI import sys if MPI.Query_thread() < MPI.THREAD_MULTIPLE: sys.stderr.write("MPI does not provide enough thread support\n") sys.exit(0) try: import threading except ImportError: sys.stderr.write("threading module not available\n") sys.exit(0) try: import numpy except Impor...
1,119
21.857143
68
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/nxtval/nxtval-threads.py
# ----------------------------------------------------------------------------- from mpi4py import MPI from array import array from threading import Thread class Counter(object): def __init__(self, comm): # duplicate communicator assert not comm.Is_inter() self.comm = comm.Dup() #...
2,250
27.493671
79
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/nxtval/nxtval-onesided.py
# -------------------------------------------------------------------- from mpi4py import MPI from array import array as _array import struct as _struct class Counter(object): def __init__(self, comm): # size = comm.Get_size() rank = comm.Get_rank() # itemsize = MPI.INT.Ge...
1,930
25.452055
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/nxtval/nxtval-mpi3.py
from mpi4py import MPI from array import array as _array import struct as _struct # -------------------------------------------------------------------- class Counter(object): def __init__(self, comm): rank = comm.Get_rank() itemsize = MPI.INT.Get_size() if rank == 0: n = 1 ...
2,113
23.581395
79
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/nxtval/nxtval-scalable.py
from mpi4py import MPI # ----------------------------------------------------------------------------- import struct as _struct try: from numpy import empty as _empty def _array_new(size, typecode, init=0): a = _empty(size, typecode) a.fill(init) return a def _array_set(ary, value)...
4,119
26.651007
79
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/nxtval/nxtval-dynproc.py
# -------------------------------------------------------------------- from mpi4py import MPI import sys, os class Counter(object): def __init__(self, comm): assert not comm.Is_inter() self.comm = comm.Dup() # start counter process script = os.path.abspath(__file__) if sc...
2,071
25.564103
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/spawning/cpi-master.py
from mpi4py import MPI from array import array from math import pi as PI from sys import argv cmd = 'cpi-worker-py.exe' if len(argv) > 1: cmd = argv[1] print("%s -> %s" % (argv[0], cmd)) worker = MPI.COMM_SELF.Spawn(cmd, None, 5) n = array('i', [100]) worker.Bcast([n,MPI.INT], root=MPI.ROOT) pi = array('d', [0.0])...
515
20.5
51
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/spawning/cpi-worker.py
from mpi4py import MPI from array import array master = MPI.Comm.Get_parent() nprocs = master.Get_size() myrank = master.Get_rank() n = array('i', [0]) master.Bcast([n, MPI.INT], root=0) n = n[0] h = 1.0 / n s = 0.0 for i in range(myrank+1, n+1, nprocs): x = h * (i - 0.5) s += 4.0 / (1.0 + x**2) pi = s * h ...
466
17.68
39
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/libmpi-cffi/test_latency.py
# http://mvapich.cse.ohio-state.edu/benchmarks/ from libmpi import ffi, lib def osu_latency( BENCHMARH = "MPI Latency Test", skip = 1000, loop = 10000, skip_large = 10, loop_large = 100, large_message_size = 8192, MAX_MSG_SIZE = 1<<22, ): myid = ffi.new('int*') numprocs = ffi....
2,079
27.108108
69
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/libmpi-cffi/apigen.py
import sys, os.path as p wdir = p.abspath(p.dirname(__file__)) topdir = p.normpath(p.join(wdir, p.pardir, p.pardir)) srcdir = p.join(topdir, 'src') sys.path.insert(0, p.join(topdir, 'conf')) from mpiscanner import Scanner scanner = Scanner() libmpi_pxd = p.join(srcdir, 'include', 'mpi4py', 'libmpi.pxd') scanner.parse_...
855
26.612903
62
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/libmpi-cffi/test_helloworld.py
from libmpi import ffi, lib NULL = ffi.NULL size_p = ffi.new('int*') rank_p = ffi.new('int*') nlen_p = ffi.new('int*') name_p = ffi.new('char[]', lib.MPI_MAX_PROCESSOR_NAME); lib.MPI_Init(NULL, NULL); lib.MPI_Comm_size(lib.MPI_COMM_WORLD, size_p) lib.MPI_Comm_rank(lib.MPI_COMM_WORLD, rank_p) lib.MPI_Get_processor_...
527
21
55
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/libmpi-cffi/test_ringtest.py
from libmpi import ffi, lib def ring(comm, count=1, loop=1, skip=0): size_p = ffi.new('int*') rank_p = ffi.new('int*') lib.MPI_Comm_size(comm, size_p) lib.MPI_Comm_rank(comm, rank_p) size = size_p[0] rank = rank_p[0] source = (rank - 1) % size dest = (rank + 1) % size sbuf = ffi....
2,302
28.909091
95
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/libmpi-cffi/build.py
import os import cffi ffi = cffi.FFI() with open("libmpi.c.in") as f: ffi.set_source("libmpi", f.read()) with open("libmpi.h") as f: ffi.cdef(f.read()) class mpicompiler(object): from cffi import ffiplatform def __init__(self, cc, ld=None): self.cc = cc self.ld = ld if ld else cc ...
1,640
28.836364
66
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/wrap-swig/test.py
from mpi4py import MPI import helloworld as hw null = MPI.COMM_NULL hw.sayhello(null) comm = MPI.COMM_WORLD hw.sayhello(comm) try: hw.sayhello(list()) except: pass else: assert 0, "exception not raised"
218
12.6875
36
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/wrap-boost/test.py
from mpi4py import MPI import helloworld as hw null = MPI.COMM_NULL hw.sayhello(null) comm = MPI.COMM_WORLD hw.sayhello(comm) try: hw.sayhello(list()) except: pass else: assert 0, "exception not raised"
218
12.6875
36
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-2.34.py
## mpiexec -n 2 python ex-2.34.py # Use of ready-mode and synchonous-mode # -------------------------------------------------------------------- from mpi4py import MPI try: import numpy except ImportError: raise SystemExit if MPI.COMM_WORLD.Get_size() < 2: raise SystemExit # ---------------------------...
1,190
23.8125
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-2.01.py
## mpiexec -n 2 python ex-2.01.py # Process 0 sends a message to process 1 # -------------------------------------------------------------------- from mpi4py import MPI import array if MPI.COMM_WORLD.Get_size() < 2: raise SystemExit # -------------------------------------------------------------------- s = "H...
1,007
24.2
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.08.py
from mpi4py import MPI try: import numpy except ImportError: raise SystemExit # extract the section a[0:6:2, 0:5:2] and store it in e[:,:] a = numpy.empty((6, 5), dtype=float, order='fortran') e = numpy.empty((3, 3), dtype=float, order='fortran') a.flat = numpy.arange(a.size, dtype=float) lb, sizeofdouble = ...
898
24.685714
60
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.07.py
execfile('ex-3.02.py') count = 2 blklen = 3 stride = 4 * dtype.extent newtype = dtype.Create_hvector(count, blklen, stride) assert newtype.size == dtype.size * count * blklen dtype.Free() newtype.Free()
207
16.333333
53
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.11.py
execfile('ex-3.02.py') B = (3, 1) D = (4, 0) newtype = dtype.Create_indexed(B, D) dtype.Free() newtype.Free()
112
11.555556
36
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.12.py
execfile('ex-3.02.py') B = (3, 1) D = (4 * dtype.extent, 0) newtype = dtype.Create_hindexed(B, D) dtype.Free() newtype.Free()
128
13.333333
37
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.01.py
from mpi4py import MPI try: import numpy except ImportError: raise SystemExit # send a upper triangular matrix N = 10 a = numpy.empty((N, N), dtype=float, order='c') b = numpy.zeros((N, N), dtype=float, order='c') a.flat = numpy.arange(a.size, dtype=float) # compute start and size of each row i = numpy.aran...
758
21.323529
60
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.06.py
execfile('ex-3.02.py') count = 3 blklen = 1 stride = -2 newtype = dtype.Create_vector(count, blklen, stride) assert newtype.size == dtype.size * count * blklen dtype.Free() newtype.Free()
192
15.083333
52
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.13.py
from mpi4py import MPI blens = (1, 1) disps = (0, MPI.DOUBLE.size) types = (MPI.DOUBLE, MPI.CHAR) type1 = MPI.Datatype.Create_struct(blens, disps, types) B = (2, 1, 3) D = (0, 16, 26) T = (MPI.FLOAT, type1, MPI.CHAR) dtype = MPI.Datatype.Create_struct(B, D, T) type1.Free() dtype.Free()
290
18.4
55
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.04.py
execfile('ex-3.02.py') count = 3 newtype = dtype.Create_contiguous(count) assert newtype.extent == dtype.extent * count dtype.Free() newtype.Free()
151
14.2
45
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.02.py
from mpi4py import MPI # Type = { (double, 0), (char, 8) } blens = (1, 1) disps = (0, MPI.DOUBLE.size) types = (MPI.DOUBLE, MPI.CHAR) dtype = MPI.Datatype.Create_struct(blens, disps, types) if 'ex-3.02' in __file__: dtype.Free()
237
17.307692
55
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-2.29.py
## mpiexec -n 3 python ex-2.29.py # Use a blocking probe to wait for an incoming message # -------------------------------------------------------------------- from mpi4py import MPI import array if MPI.COMM_WORLD.Get_size() < 3: raise SystemExit # --------------------------------------------------------------...
1,176
25.155556
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-2.32.py
# Jacobi computation, using persitent requests from mpi4py import MPI try: import numpy except ImportError: raise SystemExit n = 5 * MPI.COMM_WORLD.Get_size() # compute number of processes and myrank p = MPI.COMM_WORLD.Get_size() myrank = MPI.COMM_WORLD.Get_rank() # compute size of local block m = n/p if m...
2,315
23.378947
68
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.09.py
from mpi4py import MPI try: import numpy except ImportError: raise SystemExit # transpose a matrix a into b a = numpy.empty((100, 100), dtype=float, order='fortran') b = numpy.empty((100, 100), dtype=float, order='fortran') a.flat = numpy.arange(a.size, dtype=float) lb, sizeofdouble = MPI.DOUBLE.Get_extent()...
1,056
25.425
66
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-2.35.py
## mpiexec -n 1 python ex-2.35.py # Calls to attach and detach buffers # -------------------------------------------------------------------- from mpi4py import MPI try: from numpy import empty except ImportError: from array import array def empty(size, dtype): return array(dtype, [0]*size) # --...
735
20.028571
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-2.08.py
## mpiexec -n 2 python ex-2.08.py # An exchange of messages # -------------------------------------------------------------------- from mpi4py import MPI import array if MPI.COMM_WORLD.Get_size() < 2: raise SystemExit # -------------------------------------------------------------------- sendbuf = array.array...
1,333
27.382979
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.05.py
execfile('ex-3.02.py') count = 2 blklen = 3 stride = 4 newtype = dtype.Create_vector(count, blklen, stride) assert newtype.size == dtype.size * count * blklen dtype.Free() newtype.Free()
191
15
52
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-3.03.py
execfile('ex-3.02.py') assert dtype.size == MPI.DOUBLE.size + MPI.CHAR.size assert dtype.extent >= dtype.size dtype.Free()
125
17
52
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpi-ref-v1/ex-2.16.py
## mpiexec -n 4 python ex-2.16.py # Jacobi code # version of parallel code using sendrecv and null proceses. # -------------------------------------------------------------------- from mpi4py import MPI try: import numpy except ImportError: raise SystemExit # ------------------------------------------------...
1,868
24.958333
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/vampirtrace/threads.py
#!/usr/bin/env python import mpi4py mpi4py.rc.threads = True mpi4py.rc.thread_level = "funneled" mpi4py.profile('vt-hyb', logfile='threads') from mpi4py import MPI from threading import Thread MPI.COMM_WORLD.Barrier() # Understanding the Python GIL # David Beazley, http://www.dabeaz.com # PyCon 2010, Atlanta, Georg...
910
22.973684
51
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/vampirtrace/ring.py
#!/usr/bin/env python # If you want VampirTrace to log MPI calls, you have to add the two # lines below at the very beginning of your main bootstrap script. import mpi4py mpi4py.rc.threads = False mpi4py.profile('vt-mpi', logfile='ring') from mpi4py import MPI comm = MPI.COMM_WORLD size = comm.Get_size() rank = comm...
817
20.526316
67
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/vampirtrace/cpilog.py
#!/usr/bin/env python # If you want VampirTrace to log MPI calls, you have to add the two # lines below at the very beginning of your main bootstrap script. import mpi4py mpi4py.rc.threads = False mpi4py.profile('vt', logfile='cpilog') # Import the MPI extension module from mpi4py import MPI # Import the 'array' mod...
1,072
19.245283
67
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/init-fini/test_1.py
from mpi4py import rc rc.initialize = False from mpi4py import MPI assert not MPI.Is_initialized() assert not MPI.Is_finalized() MPI.Init() assert MPI.Is_initialized() assert not MPI.Is_finalized() MPI.Finalize() assert MPI.Is_initialized() assert MPI.Is_finalized()
270
17.066667
31
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/init-fini/test_4.py
from mpi4py import rc rc.finalize = False from mpi4py import MPI assert MPI.Is_initialized() assert not MPI.Is_finalized() MPI.Finalize() assert MPI.Is_initialized() assert MPI.Is_finalized()
195
16.818182
29
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/init-fini/test_5.py
from mpi4py import rc del rc.initialize del rc.threads del rc.thread_level del rc.finalize from mpi4py import MPI assert MPI.Is_initialized() assert not MPI.Is_finalized() import sys name, _ = MPI.get_vendor() if name == 'MPICH': assert MPI.Query_thread() == MPI.THREAD_MULTIPLE if name == 'MPICH2' and sys.platfor...
389
21.941176
52
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/init-fini/test_2a.py
from mpi4py import rc rc.initialize = False from mpi4py import MPI assert not MPI.Is_initialized() assert not MPI.Is_finalized() MPI.Init_thread(MPI.THREAD_MULTIPLE) assert MPI.Is_initialized() assert not MPI.Is_finalized() MPI.Finalize() assert MPI.Is_initialized() assert MPI.Is_finalized()
296
18.8
36
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/init-fini/test_2b.py
from mpi4py import rc rc.initialize = False from mpi4py import MPI assert not MPI.Is_initialized() assert not MPI.Is_finalized() MPI.Init_thread() assert MPI.Is_initialized() assert not MPI.Is_finalized() import sys name, _ = MPI.get_vendor() if name == 'MPICH': assert MPI.Query_thread() == MPI.THREAD_MULTIPLE i...
493
21.454545
52
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/init-fini/test_3.py
from mpi4py import rc rc.finalize = False from mpi4py import MPI assert MPI.Is_initialized() assert not MPI.Is_finalized()
125
17
29
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/init-fini/test_0.py
from mpi4py import rc from mpi4py import MPI
45
14.333333
22
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/reductions/test_reductions.py
#import mpi4py #mpi4py.profile("mpe") from mpi4py import MPI import unittest import sys, os sys.path.insert(0, os.path.dirname(__file__)) from reductions import Intracomm del sys.path[0] class BaseTest(object): def test_reduce(self): rank = self.comm.rank size = self.comm.size for root i...
6,307
28.895735
81
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/reductions/reductions.py
from mpi4py import MPI class Intracomm(MPI.Intracomm): """ Intracommunicator class with scalable, point-to-point based implementations of global reduction operations. """ def __new__(cls, comm=None): return super(Intracomm, cls).__new__(cls, comm) def reduce(self, sendobj=None, recvob...
3,109
28.903846
72
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/wrap-cffi/test.py
from mpi4py import MPI import helloworld as hw null = MPI.COMM_NULL hw.sayhello(null) comm = MPI.COMM_WORLD hw.sayhello(comm) try: hw.sayhello(list()) except: pass else: assert 0, "exception not raised"
218
12.6875
36
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/wrap-cffi/helloworld.py
from mpi4py import MPI import cffi import os _libdir = os.path.dirname(__file__) ffi = cffi.FFI() if MPI._sizeof(MPI.Comm) == ffi.sizeof('int'): _mpi_comm_t = 'int' else: _mpi_comm_t = 'void*' ffi.cdef(""" typedef %(_mpi_comm_t)s MPI_Comm; void sayhello(MPI_Comm); """ % vars()) lib = ffi.dlopen(os.path.join(_...
483
21
59
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpe-logging/threads.py
import sys import mpi4py mpi4py.profile('mpe', logfile='threads') from mpi4py import MPI from array import array try: import threading except ImportError: sys.stderr.write("threading module not available\n") sys.exit(0) send_msg = array('i', [7]*1000); send_msg *= 1000 recv_msg = array('i', [0]*1000); rec...
761
22.090909
67
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpe-logging/ring.py
#!/usr/bin/env python import os os.environ['MPE_LOGFILE_PREFIX'] = 'ring' import mpi4py mpi4py.profile('mpe') from mpi4py import MPI from array import array comm = MPI.COMM_WORLD size = comm.Get_size() rank = comm.Get_rank() src = rank-1 dest = rank+1 if rank == 0: src = size-1 if rank == size-1: dest = 0 ...
712
18.27027
41
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mpe-logging/cpilog.py
#!/usr/bin/env python # If you want MPE to log MPI calls, you have to add the two lines # below at the very beginning of your main bootstrap script. import mpi4py mpi4py.profile('mpe', logfile='cpilog') # Import the MPI extension module from mpi4py import MPI if 0: # <- use '1' to disable logging of MPI calls MPI...
1,110
19.574074
65
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/wrap-c/test.py
from mpi4py import MPI import helloworld as hw null = MPI.COMM_NULL hw.sayhello(null) comm = MPI.COMM_WORLD hw.sayhello(comm) try: hw.sayhello(list()) except: pass else: assert 0, "exception not raised"
218
12.6875
36
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mandelbrot/mandelbrot-master.py
from mpi4py import MPI import numpy as np x1 = -2.0 x2 = 1.0 y1 = -1.0 y2 = 1.0 w = 600 h = 400 maxit = 255 import os dirname = os.path.abspath(os.path.dirname(__file__)) executable = os.path.join(dirname, 'mandelbrot-worker.exe') # spawn worker worker = MPI.COMM_SELF.Spawn(executable, maxprocs=7) size = worker.G...
1,466
22.285714
64
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mandelbrot/mandelbrot-seq.py
import numpy as np import time tic = time.time() x1 = -2.0 x2 = 1.0 y1 = -1.0 y2 = 1.0 w = 150 h = 100 maxit = 127 def mandelbrot(x, y, maxit): c = x + y*1j z = 0 + 0j it = 0 while abs(z) < 2 and it < maxit: z = z**2 + c it += 1 return it dx = (x2 - x1) / w dy = (y2 - y1) / h ...
965
16.563636
51
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/mandelbrot/mandelbrot.py
from mpi4py import MPI import numpy as np tic = MPI.Wtime() x1 = -2.0 x2 = 1.0 y1 = -1.0 y2 = 1.0 w = 150 h = 100 maxit = 127 def mandelbrot(x, y, maxit): c = x + y*1j z = 0 + 0j it = 0 while abs(z) < 2 and it < maxit: z = z**2 + c it += 1 return it comm = MPI.COMM_WORLD size ...
2,569
23.47619
72
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/sequential/seq.py
class Seq(object): """ Sequential execution """ def __init__(self, comm, ng=1, tag=0): ng = int(ng) tag = int(tag) assert ng >= 1 assert ng <= comm.Get_size() self.comm = comm self.ng = ng self.tag = tag def __enter__(self): self.beg...
1,308
23.698113
58
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/sequential/test_seq.py
#import mpi4py #mpi4py.profile("mpe") from mpi4py import MPI import unittest import sys, os sys.path.insert(0, os.path.dirname(__file__)) from seq import Seq del sys.path[0] def test(): size = MPI.COMM_WORLD.Get_size() rank = MPI.COMM_WORLD.Get_rank() name = MPI.Get_processor_name() with Seq(MPI.COMM...
481
19.956522
56
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/wrap-cython/test.py
from mpi4py import MPI import helloworld as hw null = MPI.COMM_NULL hw.sayhello(null) comm = MPI.COMM_WORLD hw.sayhello(comm) try: hw.sayhello(None) except: pass else: assert 0, "exception not raised" try: hw.sayhello(list()) except: pass else: assert 0, "exception not raised"
306
12.347826
36
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/wrap-f2py/test.py
from mpi4py import MPI import helloworld as hw null = MPI.COMM_NULL fnull = null.py2f() hw.sayhello(fnull) comm = MPI.COMM_WORLD fcomm = comm.py2f() hw.sayhello(fcomm) try: hw.sayhello(list()) except: pass else: assert 0, "exception not raised"
260
13.5
36
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/compute-pi/cpi-dpm.py
#!/usr/bin/env python """ Parallel PI computation using Dynamic Process Management (DPM) within Python objects exposing memory buffers (requires NumPy). usage: + parent/child model:: $ mpiexec -n 1 python cpi-dpm.py [nchilds] + client/server model:: $ [xterm -e] mpiexec -n <nprocs> python cpi-dpm.p...
4,551
23.73913
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/compute-pi/cpi-rma.py
#!/usr/bin/env python """ Parallel PI computation using Remote Memory Access (RMA) within Python objects exposing memory buffers (requires NumPy). usage:: $ mpiexec -n <nprocs> python cpi-rma.py """ from mpi4py import MPI from math import pi as PI from numpy import array def get_n(): prompt = "Enter the n...
1,604
21.605634
63
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/demo/compute-pi/cpi-cco.py
#!/usr/bin/env python """ Parallel PI computation using Collective Communication Operations (CCO) within Python objects exposing memory buffers (requires NumPy). usage:: $ mpiexec -n <nprocs> python cpi-buf.py """ from mpi4py import MPI from math import pi as PI from numpy import array def get_n(): prompt ...
1,269
21.280702
71
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/docs/source/usrman/conf.py
# -*- coding: utf-8 -*- # # MPI for Python documentation build configuration file, created by # sphinx-quickstart on Sat May 11 08:44:19 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
8,286
31.120155
80
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/conf/mpiscanner.py
# Very, very naive RE-based way for collecting declarations inside # 'cdef extern from *' Cython blocks in in source files, and next # generate compatibility headers for MPI-2 partially implemented or # built, or MPI-1 implementations, perhaps providing a subset of MPI-2 from textwrap import dedent from warnings impor...
11,270
28.81746
82
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/conf/mpiregexes.py
import re def anyof(*args): return r'(?:%s)' % '|'.join(args) def join(*args): tokens = [] for tok in args: if isinstance(tok, (list, tuple)): tok = '(%s)' % r'\s*'.join(tok) tokens.append(tok) return r'\s*'.join(tokens) lparen = r'\(' rparen = r'\)' colon = r'\:' a...
2,735
33.632911
99
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/conf/coverage-helper.py
import mpi4py mpi4py.get_include() mpi4py.get_config() import mpi4py.rc mpi4py.rc( initialize = True, threads = True, thread_level = 'multiple', finalize = None, fast_reduce = True, recv_mprobe = True, errors = 'exception', ) try: mpi4py.rc(querty=False) except TypeError: pass import mpi4py mpi4py.profile() mpi4py.pr...
749
21.058824
40
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/conf/mpidistutils.py
# Author: Lisandro Dalcin # Contact: dalcinl@gmail.com """ Support for building mpi4py with distutils/setuptools. """ # ----------------------------------------------------------------------------- import sys, os, platform from distutils import sysconfig from distutils.util import convert_path from distutils.util i...
53,549
35.829436
79
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/conf/cythonize.py
#!/usr/bin/env python import sys, os def cythonize(source, includes=(), destdir_c=None, destdir_h=None, wdir=None): from Cython.Compiler.Main import \ CompilationOptions, default_options, \ compile, \ PyrexError from Cython.Comp...
2,050
28.724638
62
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/conf/epydocify.py
#!/usr/bin/env python # -------------------------------------------------------------------- from mpi4py import MPI try: from signal import signal, SIGPIPE, SIG_IGN signal(SIGPIPE, SIG_IGN) except ImportError: pass # -------------------------------------------------------------------- try: from doc...
3,073
26.693694
70
py
espressopp
espressopp-master/contrib/mpi4py/mpi4py-2.0.0/conf/mpiconfig.py
import sys, os, platform from distutils.util import split_quoted from distutils.spawn import find_executable from distutils import log as dulog try: from collections import OrderedDict except ImportError: OrderedDict = dict try: from configparser import ConfigParser from configparser import Error as...
17,349
37.470067
75
py