Exemplo n.º 1
0
lonb1 = b2[0]
lonb2 = b2[1]
dlon = int(b2[2])
lat_seq = np.zeros([dlat])
lon_seq = np.zeros([dlon])
dx = (lonb2 - lonb1) / (dlon - 1)
for i in range(0, dlon):
    lon_seq[i] = lonb1 + (i) * dx
dx = (latb2 - latb1) / (dlat - 1)
for i in range(0, dlat):
    lat_seq[i] = latb1 + (i) * dx

mytot = np.zeros([dlat, dlon])
mymax = np.zeros([dlat, dlon])

tymer(["-i", "reading data"])
#thehead=["year","month","day","hour","minute","second","cuspid","latitude","longitude","depth","SCSN","PandS","statino","residual","tod","method","ec","nen","dt","stdpos","stddepth","stdhorrel","stddeprel","le","ct","poly"]
#dat=pd.read_csv('start',sep='\s+',names=thehead)
q = h5py.File('myhd4.h5', 'r')
tymer(["-i", "got data"])

#dep=pd.DataFrame(np.array(q['depth']))['depth']
dep = pd.DataFrame(np.array(q['depth']))

#lat=pd.DataFrame(np.array(q['latitude']))['latitude']
lat = pd.DataFrame(np.array(q['latitude']))
# next line would also work if we used the first version
# of the call to result
#lat=pd.DataFrame(np.array(q['latitude']))

#lon=pd.DataFrame(np.array(q['longitude']))['longitude']
Exemplo n.º 2
0
from slideshow import mysay
from tymer import tymer
from tymer import clist
from tymer import sprint

mpi4py=mysay(datadir="mpi01_py")

mpi4py.nx()

%macro n 4

cd ../..

srun -n 8 hostname

!srun -n 8 hostname

tymer(["-i","start"])

%%capture out
srun -n 8 ./report.py

tymer(["-i","done"])

for x in clist(out) :
    print(x)

mpi4py.nx(0)

n
Exemplo n.º 3
0
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

import tensorflow as tf
import os
import sys
from tymer import tymer
tymer(["-i", "start"])
# mpi4py module
from mpi4py import MPI

# Initialize MPI
comm = MPI.COMM_WORLD
myid = comm.Get_rank()
numprocs = comm.Get_size()
print("hello from ", myid, " of ", numprocs)
import horovod.tensorflow as hvd

# Horovod: initialize Horovod.
#hvd.init()
hvd.init(comm)

# Horovod: pin GPU to be used to process local rank (one GPU per process)
Exemplo n.º 4
0
import sys
# here we need to point to the directory that contains tymer
sys.path.append("/Users/tkaiser2/bin")
sys.path.append("/home/tkaiser2/bin")
try:
    from tymer import tymer
except:
    print("Can't import tymer.  You need to change the line: ")
    print('sys.path.append("/home/tkaiser2/bin")')
    print("to point to the directory containing tymer.py")

from math import log10, acos, sqrt, sin, cos

#see https://engineering.upside.com/a-beginners-guide-to-optimizing-pandas-code-for-speed-c09ef2c6a4d6
dummy = [1, 2, 3, 4]
tymer(["-i", "reading data"])
thehead = [
    "year", "month", "day", "hour", "minute", "second", "cuspid", "latitude",
    "longitude", "depth", "SCSN", "PandS", "statino", "residual", "tod",
    "method", "ec", "nen", "dt", "stdpos", "stddepth", "stdhorrel",
    "stddeprel", "le", "ct", "poly"
]
dat = pd.read_csv('start', sep='\s+', names=thehead)
tymer(["-i", "got data"])

#The following enables memory cleanup that can be seen with map
dodel = False  #set to True for cleanup
sixty = True  #set to True to delay for 2*wt seconds when not doing cleanup
dosubs = True  #Delete the "pointers" into the df
domain = True  #Delete the df
wt = 30  #Time to pause before and after del to make it easier to see in traces