Skip to content
Snippets Groups Projects
  • fiskissimo's avatar
    4f709055
    Fix: Segmentation fault whenever more than 2 CVs are used for METAD with REWEIGHTING_NGRID #328 · 4f709055
    fiskissimo authored
    I tried to interpret and fix the code and for me it works nicely with 1 to 3 CVs.
    Here a brief description: the index i spans through the whole reweghting-grid (according to the mpi rank in case of mpi).
    rewf_grid_ contains the size on each dimension of the reweghting-grid. t_index is the array containing the coordinates of i in each dimension of the grid. The indexes had to be changed from i to j in line 1967, which indeed spans correctly the dimensions of the grid. In 1968 in order to get the correct index, we need to subtract the former index (ncv-2 -- instead of "ncv-1" which is yet not assigned -- from what is left of kk).
    
    I didn't attempt any further test.
    
    Please let me know if I had misinterpreted the code.
    
    Fixes #399
    4f709055
    History
    Fix: Segmentation fault whenever more than 2 CVs are used for METAD with REWEIGHTING_NGRID #328
    fiskissimo authored
    I tried to interpret and fix the code and for me it works nicely with 1 to 3 CVs.
    Here a brief description: the index i spans through the whole reweghting-grid (according to the mpi rank in case of mpi).
    rewf_grid_ contains the size on each dimension of the reweghting-grid. t_index is the array containing the coordinates of i in each dimension of the grid. The indexes had to be changed from i to j in line 1967, which indeed spans correctly the dimensions of the grid. In 1968 in order to get the correct index, we need to subtract the former index (ncv-2 -- instead of "ncv-1" which is yet not assigned -- from what is left of kk).
    
    I didn't attempt any further test.
    
    Please let me know if I had misinterpreted the code.
    
    Fixes #399
Code owners
Assign users and groups as approvers for specific file changes. Learn more.