- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我收到此运行时错误:
MPJ Express (0.35) is started in the cluster configuration
Starting process <0> on <Tornado>
Starting process <1> on <Predator>
mpi.MPIException: Error in SimplePacker : count <1> is less than length <2>
at mpi.SimplePackerChar.unpack(SimplePackerChar.java:105)
at mpi.Comm.recv(Comm.java:1305)
at mpi.Comm.Recv(Comm.java:1255)
at PingPongVariousLengths.main(PingPongVariousLengths.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at runtime.daemon.Wrapper.execute(Wrapper.java:165)
at runtime.daemon.Wrapper.main(Wrapper.java:180)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at runtime.daemon.Wrapper.execute(Wrapper.java:165)
at runtime.daemon.Wrapper.main(Wrapper.java:180)
Caused by: mpi.MPIException: mpi.MPIException: mpi.MPIException: Error in Simple
Packer : count <1> is less than length <2>
at mpi.Comm.Recv(Comm.java:1259)
at PingPongVariousLengths.main(PingPongVariousLengths.java:29)
... 6 more
Caused by: mpi.MPIException: mpi.MPIException: Error in SimplePacker : count <1>
is less than length <2>
at mpi.Comm.recv(Comm.java:1317)
at mpi.Comm.Recv(Comm.java:1255)
... 7 more
Caused by: mpi.MPIException: Error in SimplePacker : count <1> is less than leng
th <2>
at mpi.SimplePackerChar.unpack(SimplePackerChar.java:105)
at mpi.Comm.recv(Comm.java:1305)
... 8 more
不明白什么意思
这是导致它的代码:
import mpi.* ;
class PingPongVariousLengths {
static public void main(String[] args) {
MPI.Init(args);
int myrank = MPI.COMM_WORLD.Rank();
int tag = 99;
int maxlen = 104857600; //200 megabytes 104857600 characters * 2 bytes per character = 209715200 bytes total, or 200 megabytes
int minlen = 1; // 2 bytes
char [] sendbuff = new char [maxlen];
char [] recvbuff = new char [maxlen];
long speedKbps;
long speedMbps;
long durationseconds;
int MAX_LOOPS = 20;
for (int len = minlen; len <= maxlen; len *= 2) {
if (myrank == 0) {
durationseconds = 0;
for (int i = 0; i < MAX_LOOPS; i++) {
long startTime = System.nanoTime();
MPI.COMM_WORLD.Send(sendbuff, 0, len, MPI.CHAR, 1, tag);
MPI.COMM_WORLD.Recv(recvbuff, 0, len, MPI.CHAR, 1, tag);
long endTime = System.nanoTime();
long duration = endTime - startTime;
durationseconds = durationseconds + (duration* 10-9);
}
durationseconds = durationseconds / MAX_LOOPS;
System.out.println("Average time for the ping to be sent and recived of " + (len*2) + " bytes is " + durationseconds + " seconds");
double transferRateMb = ((len*524288.0) / durationseconds );
System.out.println("average transferRate (megabytes) : " + transferRateMb + " megabytes per second");
} else if (myrank == 1) {
MPI.COMM_WORLD.Recv(recvbuff, 0, len, MPI.CHAR, 0, tag);
MPI.COMM_WORLD.Send(recvbuff, 0, len, MPI.CHAR, 0, tag);
}
}
MPI.Finalize();
}
}
导致错误的原因以及如何解决?
编辑TTTT
将最小长度更改为 2
import mpi.* ;
class PingPongVariousLengths {
static public void main(String[] args) {
MPI.Init(args);
int myrank = MPI.COMM_WORLD.Rank();
int tag = 99;
int maxlen = 104857600; //200 megabytes 104857600 characters * 2 bytes per character = 209715200 bytes total, or 200 megabytes
int minlen = 2; // 2 bytes
char [] sendbuff = new char [maxlen];
char [] recvbuff = new char [maxlen];
long speedKbps;
long speedMbps;
long durationseconds;
int MAX_LOOPS = 20;
for (int len = minlen; len <= maxlen; len *= 2) {//len=*2 doubles the ping size each time
if (myrank == 0) {
durationseconds = 0;
for (int i = 0; i < MAX_LOOPS; i++) {
long startTime = System.nanoTime();
MPI.COMM_WORLD.Send(sendbuff, 0, len, MPI.CHAR, 1, tag);
MPI.COMM_WORLD.Recv(recvbuff, 0, len, MPI.CHAR, 1, tag);
long endTime = System.nanoTime();
long duration = endTime - startTime;
durationseconds = durationseconds + (duration* 10-9);// Converts nanoseconds to seconds
}
durationseconds = durationseconds / MAX_LOOPS;
//double transferRate = ((len*2.0) / durationseconds ) ; //amount of data in bytes transferred in 1 second. Currently returning 0 for every result
//System.out.println("transferRate: " + transferRate + " bytes per second");
System.out.println("Average time for the ping to be sent and recived of " + (len*2) + " bytes is " + durationseconds + " seconds");
double transferRateMb = ((len*524288.0) / durationseconds );
System.out.println("average transferRate (megabytes) : " + transferRateMb + " megabytes per second");
} else if (myrank == 1) {
MPI.COMM_WORLD.Recv(recvbuff, 0, len, MPI.CHAR, 0, tag);
MPI.COMM_WORLD.Send(recvbuff, 0, len, MPI.CHAR, 0, tag);
}
}
MPI.Finalize();
}
}
并且收到此错误:
PongVariousLengths
MPJ Express (0.35) is started in the cluster configuration
Starting process <0> on <Tornado>
Starting process <1> on <Predator>
mpi.MPIException: Error in SimplePacker : count <2> is less than length <4>
at mpi.SimplePackerChar.unpack(SimplePackerChar.java:105)
at mpi.Comm.recv(Comm.java:1305)
at mpi.Comm.Recv(Comm.java:1255)
at PingPongVariousLengths.main(PingPongVariousLengths.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at runtime.daemon.Wrapper.execute(Wrapper.java:165)
at runtime.daemon.Wrapper.main(Wrapper.java:180)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at runtime.daemon.Wrapper.execute(Wrapper.java:165)
at runtime.daemon.Wrapper.main(Wrapper.java:180)
Caused by: mpi.MPIException: mpi.MPIException: mpi.MPIException: Error in Simple
Packer : count <2> is less than length <4>
at mpi.Comm.Recv(Comm.java:1259)
at PingPongVariousLengths.main(PingPongVariousLengths.java:25)
... 6 more
Caused by: mpi.MPIException: mpi.MPIException: Error in SimplePacker : count <2>
is less than length <4>
at mpi.Comm.recv(Comm.java:1317)
at mpi.Comm.Recv(Comm.java:1255)
... 7 more
Caused by: mpi.MPIException: Error in SimplePacker : count <2> is less than leng
th <4>
at mpi.SimplePackerChar.unpack(SimplePackerChar.java:105)
at mpi.Comm.recv(Comm.java:1305)
... 8 more
编辑2
好吧,经过一番尝试和错误后,我在第 19 行注释掉了 '//len *= 2)',注释掉后,程序会运行,但它会持续以 2 个字节运行,并且不会停止在所需的 20 个循环之后,所以我认为这就是问题所在,但是如何解决这个问题?
最佳答案
您的异常似乎是由此 block of code: 引发的
public void unpack(mpjbuf.Buffer mpjbuf, int length, Object buf,
int offset, int count) throws MPIException {
if(count * numEls < length) {
throw new MPIException ("Error in SimplePacker : count <"+
(count*numEls)+"> is less than length <"+length+">");
}
因此,count * numEls
似乎小于length
。这一切似乎都会导致您的 Recv()
调用(我认为是第 29 行):
MPI.COMM_WORLD.Recv(recvbuff, 0, len, MPI.CHAR, 1, tag);
或
MPI.COMM_WORLD.Recv(recvbuff, 0, len, MPI.CHAR, 0, tag);
因此“计数”(len
) 小于长度(即 2)。您将 minlen
设置为 1(不是像评论所说的“2”),请尝试将其设置为 2。
关于java - 我以前从未见过 MPJ Express 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15994032/
我正在使用 MPJ 构建一个简单的分布式应用程序(基本上是另一个生产者/消费者问题),并且在使用多个线程时从同一台机器接收数据时遇到了巨大的问题。 示例代码: Thread t = new Threa
我正在尝试运行 MPJ express 在没有运行时的集群模式下,如 中所述附录 A 的 mpj linux guide 我无法使用 运行mpj.sh 作为我的类(class)的脚本有一些我需要传递的
我正在使用 MPJ Express 开展项目。我在这里读到: http://www.researchgate.net/profile/Bryan_Carpenter/publication/22130
我必须为并行计算类(class)做一个练习。 该任务使用 N 个并行进程从字符串中删除字母“RTY”的所有组合。 通常我会用 来做String strAfter=str1.replaceAll("[R
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
我已经看过这个,但它并没有真正帮助,因为我正在处理基元,而不是对象。这只是一个项目的额外部分的一部分。虽然这样很好,但我想让它正常工作。 它编译得很好,但是当我运行它时,我在第 20 行得到了 Cla
我必须为并行计算类(class)做一个练习。我使用 MPJ Express 将任务分配给多个进程(在我的例子中为 5 个进程)。我解决了所有子任务,工作正常。现在我想实现一个简单的用户对话框,以便我的
我收到此运行时错误: MPJ Express (0.35) is started in the cluster configuration Starting process on Starting
我是并行编程的新手,我想用 Java 来实现。我想知道是否可以通过 MPI 发送和接收更复杂的对象。我正在使用 MPJ express 。但是,每当我想发送一个对象时,我都会收到 ClassCastE
我想通过 MPJ 发送邻接矩阵,一种解决方案是以对象的形式发送二维数组,第二种解决方案是将二维数组作为一维数组发送,即 [N*N]。 但是,我希望以原始形式发送二维数组——MPJ 支持吗?如果是这样,
我不断收到与 here 相同的相同错误.我在 linux mint 17.3 下运行 eclipse。 我试图将 MPJ_HOME 添加到系统变量中,在终端上写入此命令:export MPJ_HOME
问题#1。 Scatterv 的“位移”参数的用途是什么?它与 Gatherv 有何不同?以及它如何支持地址空间上的“重叠”?您的平均 joe 位移阵列是什么样的? Scatterv( Object
我正在尝试为 MpJ-Express 配置一个 Linux 集群。我已正确设置 PATH 和 MPJ_HOME。 当我运行命令mpjboot 机器 我收到以下消息。 mpjboot machines
我下载了mpj-v0_44并将其提取到 C:\mpj 放Windows系统环境。变量 MPJ_HOME 到 C:\mpj 并在 PATH 中添加值 C:\mpj\bin 我在项目结构->库中添加了mp
我遵循了 Utube 的教程,了解如何在 IDE 中使用 MPJ Express 运行并行应用程序。我下载了最新版本的 MPJ Express 并使用了 Eclipse Indigo。 我确实将 MP
我是一名优秀的程序员,十分优秀!