Hello !
I’m trying to perfom some parallelized computations (for station keeping computations) involving an orbit propagator (an integrated ephemeris for faster computations).
The orbit propagator is the same for each thread since I just parallelized the search loop for the station-keeping solution. Something like:
- Propagate the orbit during the station keeping cycle duration
- Compute orbital delta between propagated orbit at the end of cycle and nominal (i.e., mission) orbit
- Search loop to compute SK manoeuvers (with reuse of the
IntegratedEphemeriscomputed for the propagator at step 1.)
However, I’m having the following issue:
java.util.ConcurrentModificationException
at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1597)
at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1630)
at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1628)
at org.orekit.propagation.AbstractPropagator.updateUnmanagedData(AbstractPropagator.java:209)
at org.orekit.propagation.AbstractPropagator.updateAdditionalData(AbstractPropagator.java:228)
at org.orekit.propagation.integration.IntegratedEphemeris.updateAdditionalData(IntegratedEphemeris.java:274)
at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:135)
at org.orekit.propagation.AbstractPropagator.propagate(AbstractPropagator.java:293)
It looks like the handling of unmanagedStates in AbstractPropagator class is not thread safe. I really think it is because of the use of HashMap object [1].
What do you think? Could we use a ConcurrentHashMap or synchronize the accesses of unmanagedStates?
I cannot copy or clone the propagator to have one different instance per thread since the method is not availble in Orekit.
Best regards,
Bryan
[1] : https://stackoverflow.com/questions/2688629/is-a-hashmap-thread-safe-for-different-keys