コード例 #1
0
 def Initialize(self, simname, visitdir):
     mpicom.init(sys.argv)
     VisItSetBroadcastIntFunction(self.broadcast_int)
     VisItSetBroadcastStringFunction(self.broadcast_string)
     self.par_size = mpicom.size()
     self.par_rank = mpicom.rank()
     VisItSetParallel(self.par_size  >1)
     VisItSetParallelRank(self.par_rank)
     self.par_size = mpicom.size()
     self.par_rank = mpicom.rank()
     self.MP = self.M / self.par_size
     Simulation.Initialize(self, simname, visitdir)
     print self.par_rank, self.v
コード例 #2
0
 def Initialize(self, simname, visitdir):
     mpicom.init(sys.argv)
     VisItSetBroadcastIntFunction(self.broadcast_int)
     VisItSetBroadcastStringFunction(self.broadcast_string)
     self.par_size = mpicom.size()
     self.par_rank = mpicom.rank()
     VisItSetParallel(self.par_size > 1)
     VisItSetParallelRank(self.par_rank)
     self.par_size = mpicom.size()
     self.par_rank = mpicom.rank()
     self.MP = self.M / self.par_size
     Simulation.Initialize(self, simname, visitdir)
     print(self.par_rank, self.v)
コード例 #3
0
ファイル: batch.py プロジェクト: m-kim/visit
 def Initialize(self):
     mpicom.init(sys.argv)
     VisItSetBroadcastIntFunction(self.broadcast_int)
     VisItSetBroadcastStringFunction(self.broadcast_string)
     self.par_size = mpicom.size()
     self.par_rank = mpicom.rank()
     VisItSetParallel(self.par_size > 1)
     VisItSetParallelRank(self.par_rank)
コード例 #4
0
ファイル: test_mpicom.py プロジェクト: burlen/visit_vtk_7_src
def test(name,curr,expected):
    """
    A basic assert equal helper.
    """
    rank = mpicom.rank()
    res = "passed"
    if curr != expected:
        res = "failed"
        failures += 1
    print "%d:%s=%s:%s" % (rank,name,repr(str(curr)),res)
コード例 #5
0
def test(name, curr, expected):
    """
    A basic assert equal helper.
    """
    rank = mpicom.rank()
    res = "passed"
    if curr != expected:
        res = "failed"
        failures += 1
    print "%d:%s=%s:%s" % (rank, name, repr(str(curr)), res)
コード例 #6
0
ファイル: test_mpicom.py プロジェクト: burlen/visit_vtk_7_src
def test(name,curr,expected):
    """
    A basic assert equal helper.
    """
    rank = mpicom.rank()
    res = "passed"
    if curr != expected:
        res = "failed"
        failures += 1
    print "%d:%s=%s:%s" % (rank,name,repr(str(curr)),res)

# fire up mpi
mpicom.init(sys.argv)
# get the current process id and total # of processors
rank = mpicom.rank()
sz   = mpicom.size()

# test min reduce
test("min",mpicom.min(rank),0)
# test max reduce
test("max",mpicom.max(rank),sz-1)
# test sum reduce
test("sum",mpicom.sum(rank),(sz)*(sz-1)/2)
# test mult reduce
test("mult",mpicom.mult(rank),0)

# test broadcast of integer
if rank == 0:
    test("broadcast",mpicom.broadcast(1),None)
else:
コード例 #7
0
def test(name, curr, expected):
    """
    A basic assert equal helper.
    """
    rank = mpicom.rank()
    res = "passed"
    if curr != expected:
        res = "failed"
        failures += 1
    print "%d:%s=%s:%s" % (rank, name, repr(str(curr)), res)


# fire up mpi
mpicom.init(sys.argv)
# get the current process id and total # of processors
rank = mpicom.rank()
sz = mpicom.size()

# test min reduce
test("min", mpicom.min(rank), 0)
# test max reduce
test("max", mpicom.max(rank), sz - 1)
# test sum reduce
test("sum", mpicom.sum(rank), (sz) * (sz - 1) / 2)
# test mult reduce
test("mult", mpicom.mult(rank), 0)

# test broadcast of integer
if rank == 0:
    test("broadcast", mpicom.broadcast(1), None)
else: