Пытаюсь запустить следующий код:
import mpi.*;
public class Task {
public static void main(String args[]){
int root = 0;
int number = 1;
MPI.Init(args);
int size = MPI.COMM_WORLD.Size();
int rank = MPI.COMM_WORLD.Rank();
String name = MPI.Get_processor_name();
MPI.COMM_WORLD.Bcast(number, 0, size, MPI.INT, root);
System.out.println("Process " + rank + " (" + name + ") got " + number);
MPI.Finalize();
}
}
Когда выполнение доходит до команды MPI.COMM_WORLD.Bcast выходят ошибки:
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: mpi.MPIException: mpi.MPIException: java.lang.ClassCastException: java.lang.Integer cannot be cast to [I
at mpi.Comm.send(Comm.java:435)
at mpi.PureIntracomm.MST_Broadcast(PureIntracomm.java:719)
at mpi.PureIntracomm.Bcast(PureIntracomm.java:604)
at mpi.Intracomm.Bcast(Intracomm.java:252)
at Task.main(Task.java:15)
... 6 more
Caused by: mpi.MPIException: java.lang.ClassCastException: java.lang.Integer cannot be cast to [I
at mpi.SimplePackerInt.pack(SimplePackerInt.java:87)
at mpi.Comm.send(Comm.java:424)
... 10 more
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to [I
at mpi.SimplePackerInt.pack(SimplePackerInt.java:84)
... 11 more
Что такое может быть?