Page MenuHomec4science

exemple-pNbody.mpi-spec.py
No OneTemporary

File Metadata

Created
Tue, Nov 5, 22:24

exemple-pNbody.mpi-spec.py

#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from pNbody import mpi
from numpy import *
######################
# sum/min/max/mean/len
######################
tag = "sum/min/max/mean/len"
n = 10
data = ones(n)*mpi.ThisTask
data_sum = mpi.mpi_sum(data)
data_min = mpi.mpi_min(data)
data_max = mpi.mpi_max(data)
data_mean = mpi.mpi_mean(data)
data_len = mpi.mpi_len(data)
print tag,mpi.ThisTask,data_sum,data_min,data_max,data_mean,data_len
mpi.mpi_barrier()
######################
# arange
######################
data = mpi.mpi_arange(5)
print tag,mpi.ThisTask,data

Event Timeline