Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BinMapper construction ignores pcoord dim #63

Open
astatide opened this issue Jul 26, 2017 · 0 comments
Open

BinMapper construction ignores pcoord dim #63

astatide opened this issue Jul 26, 2017 · 0 comments

Comments

@astatide
Copy link

astatide commented Jul 26, 2017

A little bit of fun behavior, here.

The following bin mapper construction in the system object (system.py or equivalent) works:

 96 class ODLDSystem(WESTSystem):
 97     def initialize(self):
 98         self.pcoord_ndim = 1
 99         self.pcoord_dtype = pcoord_dtype
100         self.pcoord_len = pcoord_len
101
102         #self.bin_mapper = RectilinearBinMapper([[0,1.3] + list(numpy.arange(1.4, 10.1, 0.1)) + [float('inf')]])
103         self.bounds_1 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, float('inf')]
104         self.bounds_2 = [-0.5, 0, .5, float('inf')]
105         #self.bin_mapper = RectilinearBinMapper([ list(numpy.arange(0.0, 11, 1)) + [10.1] ])
106         self.bin_mapper = RectilinearBinMapper([self.bounds_1, self.bounds_2])
107         self.bin_target_counts = numpy.empty((self.bin_mapper.nbins,), numpy.int)
108         self.bin_target_counts[...] = 10

Where we have specifically set the number of dimensions for the pcoord to 1, but then pass two dimensions to the RectilinearBinMapper. The system initializes and runs, with the occasional odd failure of:

-- ERROR    [w_run] -- Traceback (most recent call last):
  File "/Users/judas/apps/westpa/split-merge/lib/cmds/w_run.py", line 65, in <module>
    sim_manager.run()
  File "/Users/judas/apps/westpa/split-merge/src/west/sim_manager.py", line 643, in run
    self.propagate()
  File "/Users/judas/apps/westpa/split-merge/src/west/sim_manager.py", line 495, in propagate
    self.we_driver.assign(incoming)
  File "/Users/judas/apps/westpa/split-merge/src/west/we_driver.py", line 369, in assign
    final_assignments = self.bin_mapper.assign(all_pcoords[1,:,:])
  File "/Users/judas/apps/westpa/split-merge/lib/west_tools/westpa/binning/assign.py", line 186, in assign
    rectilinear_assign(coords, mask, output, self.boundaries, self._boundlens)
  File "westpa/binning/_assign.pyx", line 44, in westpa.binning._assign.rectilinear_assign (westpa/binning/_assign.c:2676)
    cpdef rectilinear_assign(coord_t[:,:] coords,
  File "westpa/binning/_assign.pyx", line 97, in westpa.binning._assign.rectilinear_assign (westpa/binning/_assign.c:2394)
    raise ValueError('coordinate value {} is out of bin space in dimension {}'.format(cval,idim))
ValueError: coordinate value -1.9821292526e+14 is out of bin space in dimension 1

Which is the 'wrong' dimension. In addition, during dynamics propagation, populated bin counts and total target walkers are inconsistent with the bin counts, and it's very unclear what's actually happening during the simulation. See the following log snippet, where bin target counts are fixed at 100 per bin:

 17
 18 Wed Jul 26 12:46:57 2017
 19 Iteration 533 (1500 requested)
 20 Beginning iteration 533
 21 3800 segments remain in iteration 533 (3800 total)
 22 30 of 81 (37.037037%) active bins are populated
 23 per-bin minimum non-zero probability:       7.49441e-05
 24 per-bin maximum probability:                0.339661
 25 per-bin probability dynamic range (kT):     8.41896
 26 per-segment minimum non-zero probability:   1.48603e-08
 27 per-segment maximum non-zero probability:   0.0056005
 28 per-segment probability dynamic range (kT): 12.8397
 29 norm = 1, error in norm = 5.50671e-14 (2.5e+02*epsilon)
 30 Iteration wallclock: 0:03:03.960751, cputime: 3:59:32.955966
 31
 32
 33 Wed Jul 26 12:50:01 2017
 34 Iteration 534 (1500 requested)
 35 Beginning iteration 534
 36 2700 segments remain in iteration 534 (2700 total)
 37 30 of 81 (37.037037%) active bins are populated
 38 per-bin minimum non-zero probability:       9.4708e-05
 39 per-bin maximum probability:                0.321169
 40 per-bin probability dynamic range (kT):     8.12893
 41 per-segment minimum non-zero probability:   1.83534e-06
 42 per-segment maximum non-zero probability:   0.00702615
 43 per-segment probability dynamic range (kT): 8.25016
 44 norm = 1, error in norm = 5.4845e-14 (2.5e+02*epsilon)
 45 Iteration wallclock: 0:02:28.132365, cputime: 2:49:55.639250

It's likely just reading some uninitialized value in the array, and so what bins are considered populated or unpopulated is highly variable and dependent on whatever is in RAM. We should probably check for this case during initialization, or at least during the system run (does our bin mapper dimensionality agree with the pcoord dimensionality?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant