【发布时间】:2016-07-21 06:21:29
【问题描述】:
我下载了mpj-v0_44并解压到C:\mpj
把Windows系统环境。变量 MPJ_HOME 到 C:\mpj 并在 PATH 中添加值 C:\mpj\bin
我在项目结构 -> 库中添加了mpi.jar、mpj.jar
并编写了简单的 helloworld mpi 程序:
import mpi.MPI;
public class Main {
public static void main(String[] args) {
MPI.Init(args);
int me = MPI.COMM_WORLD.Rank();
int size = MPI.COMM_WORLD.Size();
System.out.println("Hello world from <"+me+"> of <"+size+">");
MPI.Finalize();
}
}
但我收到以下错误:
MPJ Express (0.44) is started in the multicore configuration
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at runtime.starter.MulticoreStarter$1.run(MulticoreStarter.java:281)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: 0
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
... 6 more
我在发布的 eclipse 中发现了类似的问题,但没有解决方案:
java.io.FileNotFoundException: null\conf\wrapper.conf (The system cannot find the path specified)
"Unresolved compilation problems" from running MPJ express in Eclipse Indigo
在 Eclipse 中一切正常,但我需要 Intellij IDEA!
PS:
(如果您需要 javadoc,请为库源添加整个 C:\mpj\lib 文件夹和 C:\mpj\src 文件夹)
【问题讨论】:
标签: java intellij-idea mpi mpj-express