Пример #1
0
# Starting MD simulation on all GPUs using OpenMM 
jobs = job_list() 
for gpu_id in GPU_ids: 
    job = omm_job(job_id=int(time.time()), gpu_id=gpu_id, top_file=top_file, pdb_file=pdb_file)
    job.start() 
    jobs.append(job) 
    print(' Started OpenMM jobs on GPU', gpu_id)
    time.sleep(2)
    
print('\nWaiting 2 mins for omm to write valid contact map .h5 files ')
time.sleep(120) 


# Read all the contact map .h5 file in local dir
cm_files = sorted(glob('omm*/*_cm.h5'))
cm_data_lists = [read_h5py_file(cm_file) for cm_file in cm_files] 

print('Waiting for the OpenMM to complete the first 100,000 frames as CVAE training data')
frame_number = lambda lists: sum([cm.shape[1] for cm in lists]) 

frame_marker = 0 
# number of training frames for cvae, change to 1e5 later, HM 
while frame_number(cm_data_lists) < 100000: 
    for cm in cm_data_lists: 
        cm.refresh() 
    if frame_number(cm_data_lists) >= frame_marker: 
        print('Current number of frames from OpenMM:', frame_number(cm_data_lists)) 
        frame_marker = int((10000 + frame_marker) / 10000) * 10000
        print('    Next report at frame', frame_marker) 

print('Ready for CAVE with total number of frames:', frame_number(cm_data_lists)) 
Пример #2
0
for gpu_id in GPU_ids:
    job = omm_job(job_id=int(time.time()),
                  gpu_id=gpu_id,
                  top_file=top_file,
                  pdb_file=pdb_file)
    job.start()
    jobs.append(job)
    print('Started OpenMM jobs on GPU', gpu_id)
    time.sleep(2)

print('Waiting 10 mins for omm to write valid contact map .h5 files ')
time.sleep(600)

# Read all the contact map .h5 file in local dir
cm_files = sorted(glob('./omm*/*_cm.h5'))
cm_data_lists = [read_h5py_file(cm_file) for cm_file in cm_files]

print(
    'Waiting for the OpenMM to complete the first 100,000 frames as CVAE training data'
)
frame_number = lambda lists: sum([cm.shape[1] for cm in lists])

frame_marker = 0
# number of training frames for cvae, change to 1e5 later, HM
while frame_number(cm_data_lists) < 20000:
    for cm in cm_data_lists:
        cm.refresh()
    if frame_number(cm_data_lists) >= frame_marker:
        print('Current number of frames from OpenMM:',
              frame_number(cm_data_lists))
        frame_marker = int((10000 + frame_marker) / 10000) * 10000