2016-12-14 67 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

非常感谢。 –