Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90912109
exemple-pNbody.mpi-spec.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Nov 5, 22:24
Size
583 B
Mime Type
text/x-python
Expires
Thu, Nov 7, 22:24 (2 d)
Engine
blob
Format
Raw Data
Handle
22157479
Attached To
rPNBODY pNbody
exemple-pNbody.mpi-spec.py
View Options
#!/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
Log In to Comment