"Unresolved compilation issues" from running MPJ express in Eclipse Indigo

I followed the Utube tutorial on how to run parallel applications using MPJ Express in the IDE. I downloaded the latest version of MPJ Express and used Eclipse Indigo.

I included a JAR file for MPI in the project. When I tried to compile a simple "welcome program", I got this error:

Called: java.lang.Error: unresolved compilation problems: type mpi.MPIException could not be resolved. This indirectly refers to the required .class files

My code

import mpi.*; public class HelloEclipsWorld { public static void main(String[] args) throws Exception { MPI.Init(args); int rank = MPI.COMM_WORLD.Rank(); int size = MPI.COMM_WORLD.Size(); System.out.println("I am process < " + rank + " > of total < " + size + " > processes."); MPI.Finalize(); } } 

What am I doing wrong?

+4
source share
1 answer

It looks like a class error. Based on your editing, it looks like you are using Eclipse. When you right-click on the project, select Build Path > Configure Build Path... , and then go to the Libraries tab (or Order and Export), you will see mpj.jar . I assume that he will not be there, and you will need to add it.

This is not the same as mpi.jar you were talking about. I just created a simple test project using the code you provided and mpj.jar (downloaded from here ), and everything works.

+1
source

Source: https://habr.com/ru/post/1380006/


All Articles