[vtkusers] Java/vtkMPI problem/question
Jeremy Stout
stout.jeremy at gmail.com
Wed Jun 29 13:27:22 EDT 2005
Hello, I am trying to write a simple VTK-MPI test program in Java.
After working my way through some library loading errors, I getting
the following error message when running my program:
[stout at energy preprocessor]$ java VTKMPITester
Fatal error; unknown error handler
May be MPI call before MPI_INIT. Error message is MPI_COMM_SIZE and code is 197
Generic Warning: In
/usr/home/stout/vtk/VTK-Download-5-16-2005/VTK/Parallel/vtkMPICommunicator.cxx,
line 237
MPI error occured: Null communicator
I've also tried submitting to my computer cluster that is running
TORQUE and get the same error message. In my torque file, I am using
"mpirun <mpi options> java VTKMPITester".
Here is the source code for my program:
import vtk.*;
public class VTKMPITester {
private vtkMPIController controller;
private vtkMPICommunicator worldComm;
private vtkMPIGroup groupOfNodes;
static
{
System.loadLibrary("vtkCommonJava");
System.loadLibrary("vtkFilteringJava");
System.loadLibrary("vtkIOJava");
System.loadLibrary("vtkImagingJava");
System.loadLibrary("vtkGraphicsJava");
System.loadLibrary("vtkRenderingJava");
System.loadLibrary("vtkParallelJava");
}
public VTKMPITester(String args[])
{
controller = new vtkMPIController();
// controller.Initialize(args.length, args);
worldComm = new vtkMPICommunicator();
worldComm = worldComm.GetWorldCommunicator();
controller.SetCommunicator(worldComm);
groupOfNodes = new vtkMPIGroup();
groupOfNodes.Initialize(controller);
System.out.println("Hello from: " + controller.GetLocalProcessId());
System.out.println("Number of Processes: " +
controller.GetNumberOfProcesses());
controller.Finalize();
}
public static void main(String args[])
{
VTKMPITester tester;
tester = new VTKMPITester(args);
}
}
If I was writing this out in C, I would have expected to make a
controller->Initialize(&argc, &argv) statement before getting the
WorldCommunicator. Is there something else I need to call to perform
the initalization? I tried looking through the Java vtkMPI wrappers
and didn't see anything.
In case it matters, I am doing this on a 32 bit Fedora Core 3 system
with the 1.2.6 version of MPICH and 1.4.2 version of Java.
Jeremy Stout
More information about the vtkusers
mailing list