0

当我运行分析时(例如 OPAL 源代码中的 CHADemo),我总是收到警告

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

在前一个问题中,它建议在 /src/main/resources/reference.conf 下的 Common 项目中的配置文件。所以我尝试在文件中添加后续行,但仍然收到相同的警告。

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

此外,当我在我的项目中将 OPAL 作为库导入并尝试在我的项目的“/src/main/resources/”中创建 reference.conf 时。我遇到了同样的问题。

4

1 回答 1

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。

于 2017-01-11T13:16:57.460 回答