コード例 #1
0
ファイル: progcontrol.py プロジェクト: astrofanlee/project_TL
    def finalize(self):
	mpi.barrier()  # no effect without MPI
        if mpi.rank0:
	    t=time.time()-self.start_time

	    h=int(t/3600)
	    m=int((t-h*3600)/60)
	    s=(t-h*3600-m*60)

            print '\nWe are done, and execution time = {0}h/{1}min/{2}sec'.format(h,m,s)
コード例 #2
0
#=========================

# Apply inverse PFB
rects = pfb.inverse_pfb_parallel(pfb_local,
                                 args.ntap,
                                 nblock,
                                 no_nyquist=args.no_nyquist)

# Calculate the range of local timestream blocks
local_tsblock, start_tsblock, end_tsblock = mpiutil.split_local(nblock)

#=========================
#
# This is where we must output the data. Again this is a very stupid way of doing it.
#
#=========================
for ri in range(mpiutil.size):
    if mpiutil.rank == ri:

        with h5py.File(args.file_out, 'a') as f:
            if 'ts' not in f:
                f.create_dataset('ts',
                                 shape=(nblock, rects.shape[-1]),
                                 dtype=rects.dtype)

            f['ts'][start_tsblock:end_tsblock] = rects

    mpiutil.barrier()

#=========================
コード例 #3
0
ファイル: pfbdriver.py プロジェクト: jrs65/pfb-inverse
pfb_local = pfb_data[start_block:end_block]  # Pull out the correct section of the file.

# =========================


# Apply inverse PFB
rects = pfb.inverse_pfb_parallel(pfb_local, args.ntap, nblock, no_nyquist=args.no_nyquist)

# Calculate the range of local timestream blocks
local_tsblock, start_tsblock, end_tsblock = mpiutil.split_local(nblock)


# =========================
#
# This is where we must output the data. Again this is a very stupid way of doing it.
#
# =========================
for ri in range(mpiutil.size):
    if mpiutil.rank == ri:

        with h5py.File(args.file_out, "a") as f:
            if "ts" not in f:
                f.create_dataset("ts", shape=(nblock, rects.shape[-1]), dtype=rects.dtype)

            f["ts"][start_tsblock:end_tsblock] = rects

    mpiutil.barrier()

# =========================