Hello,
Version: 2.0.5
Using pt.hbond and pt.distance work really well for my case study and I would like to use the parallel version pmap_mpi to accelerate de calculation.
The parallelization of pt.distance works straight forward. I'm struggling with the parallelization of pt.hbond.
The outputting format changes with respect to the sequential version.
Sequential: <pytraj.hbonds.DatasetHBond donor_acceptor pairs : 6938>
Parallel: [(OrderedDict([('total_solute_hbonds', array([706, 681, 670, ..., 692, 702, 680], dtype=int32)),
'PHE1472_O-LEU1475_N-H', array([1, 0, 0, ..., 1, 0, 0], dtype=int32)) ....
Trying to obtain the same format I added dtype as follows:
hb_parallelized = pt.pmap_mpi(pt.hbond, traj, distance=3.0, angle=135, dtype="hbond")
And in that case I have the following error:
File "//.conda/envs/openmpi_test_3.7/lib/python3.7/site-packages/pytraj/parallel/base.py", line 51, in concat_hbond
all_keys.update(partial_data[0].keys())
AttributeError: 'DatasetHBond' object has no attribute 'keys'
I tried to work around the problem directly returning the object data_collection and accessing to it data_collection[0][0].get_amber_mask()[0] but doing that I have not all the hbonds.
Can you please tell me if there is a way to change the parallel outputting format to the sequential one or if exist a parameter to obtain directly the same format in the parallel version than in the sequential.
Thank you in advance for your help.
Hello,
Version: 2.0.5
Using pt.hbond and pt.distance work really well for my case study and I would like to use the parallel version pmap_mpi to accelerate de calculation.
The parallelization of pt.distance works straight forward. I'm struggling with the parallelization of pt.hbond.
The outputting format changes with respect to the sequential version.
Sequential: <pytraj.hbonds.DatasetHBond donor_acceptor pairs : 6938>
Parallel: [(OrderedDict([('total_solute_hbonds', array([706, 681, 670, ..., 692, 702, 680], dtype=int32)),
'PHE1472_O-LEU1475_N-H', array([1, 0, 0, ..., 1, 0, 0], dtype=int32)) ....
Trying to obtain the same format I added dtype as follows:
hb_parallelized = pt.pmap_mpi(pt.hbond, traj, distance=3.0, angle=135, dtype="hbond")
And in that case I have the following error:
File "//.conda/envs/openmpi_test_3.7/lib/python3.7/site-packages/pytraj/parallel/base.py", line 51, in concat_hbond
all_keys.update(partial_data[0].keys())
AttributeError: 'DatasetHBond' object has no attribute 'keys'
I tried to work around the problem directly returning the object data_collection and accessing to it data_collection[0][0].get_amber_mask()[0] but doing that I have not all the hbonds.
Can you please tell me if there is a way to change the parallel outputting format to the sequential one or if exist a parameter to obtain directly the same format in the parallel version than in the sequential.
Thank you in advance for your help.