2016-12-14 65 views
0

當我運行分析(eg.CHADemo在OPAL源代碼),我總是警告如OPAL-如何配置

[warn][OPAL] the property org.opalj.threads.CPUBoundTasks is unspecified 

former question項目的性質,它建議在配置文件中的常見項目在/src/main/resources/reference.conf下。所以我嘗試在文件中添加後續行,但仍得到相同的警告。

org.opalj.threads{ 
    CPUBoundTasks = "8" 
    IOBoundTasks = "8" 
} 

此外,雖然我進口OPAL在我的項目庫,並試圖創造reference.conf「/ src目錄/主/資源/」我的項目。我遇到了同樣的問題。

回答

0

這些值是在項目編譯時考慮的配置值中配置的。您需要的文件位於OPAL的根目錄中。當您打開文件local.sbt.template你會看到以下內容:

// 
// Optional configuration settings specific to each developers machine. 
// 

// If your CPU uses hyperthreading, it is recommended to specify the 
// number of physical cores and the number of hyperthreaded cores; 
// this will spead up the overall execution. 
    javaOptions in ThisBuild ++= Seq(
"-Dorg.opalj.threads.CPUBoundTasks=16", // Number of physical (not   hyperthreaded) cores/CPUs 
"-Dorg.opalj.threads.IOBoundTasks=32" // Number of (hyperthreaded) cores * 1,5 
) 

// If you want to disable assertions, uncomment the following line. 
// Assertions are heavily used throughout OPAL and have a 
// signifcant performance impact. However, at development time it is 
// HIGHLY recommend to turn on assertions! 
//scalacOptions in ThisBuild += "-Xdisable-assertions" 

// 
//scalacOptions in ThisBuild -= "-Ywarn-unused-import" 
//scalacOptions in ThisBuild -= "-Ywarn-unused" 

如果你想配置使用的核心數量,從文件中刪除名.template和值滿足您的需求。然後你必須重建OPAL。

+0

非常感謝。 –