Skip to content

Commit c6c0fd8

Browse files
Move jniortools import into a separate thread. (#1331)
* Move jniortools import into a separate thread. Signed-off-by: thiriondan <[email protected]> * Add EOF Signed-off-by: thiriondan <[email protected]> * Revert "Add EOF" This reverts commit 6ce6ce4. Signed-off-by: thiriondan <[email protected]> * Revert "Move jniortools import into a separate thread." This reverts commit 081280b. Signed-off-by: thiriondan <[email protected]> * Add OR-tools loading in Castor class so it gets loaded upon start Signed-off-by: thiriondan <[email protected]> --------- Signed-off-by: thiriondan <[email protected]>
1 parent a72080b commit c6c0fd8

File tree

1 file changed

+11
-0
lines changed
  • ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm

1 file changed

+11
-0
lines changed

ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/Castor.java

+11
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
package com.powsybl.openrao.searchtreerao.castor.algorithm;
99

10+
import com.google.ortools.Loader;
11+
import com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider;
1012
import com.powsybl.openrao.data.raoresult.api.RaoResult;
1113
import com.powsybl.openrao.raoapi.RaoInput;
1214
import com.powsybl.openrao.raoapi.RaoProvider;
@@ -28,6 +30,15 @@
2830
*/
2931
@AutoService(RaoProvider.class)
3032
public class Castor implements RaoProvider {
33+
34+
static {
35+
try {
36+
Loader.loadNativeLibraries();
37+
} catch (Exception e) {
38+
OpenRaoLoggerProvider.TECHNICAL_LOGS.error("Native library jniortools could not be loaded. You can ignore this message if it is not needed.");
39+
}
40+
}
41+
3142
private static final String SEARCH_TREE_RAO = "SearchTreeRao";
3243

3344
// Do not store any big object in this class as it is a static RaoProvider

0 commit comments

Comments
 (0)