"Unresolved compilation problems" from running MPJ express in Eclipse Indigo
Asked Answered
G

1

4

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

I did include in my project JAR file for MPI. When I tried to compile a simple "hello program," I got this error:

Caused by: java.lang.Error: Unresolved compilation problems: The type mpi.MPIException cannot be resolved. It is indirectly referenced from required .class files

My code is

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?

Ghostwrite answered 7/11, 2011 at 14:33 Comment(2)
You're going to have to tell us which tutorial you were trying to follow, or what code you used.Paapanen
Did you add the jar in which MPIException is defined to the build path?Tophole
P
1

This looks like a classpath error. Based on your edit, it looks like you're using Eclipse. When you right-click on your project, select Build Path > Configure Build Path... and then go to the "Libraries" (or "Order and Export") tab, you should see mpj.jar. I'm guessing it won't be there, and you'll need to add it.

This is not the same as mpi.jar, which you said you have. I just set up a simple test project using the code you provided and mpj.jar (downloaded from here), and everything works.

Paapanen answered 7/11, 2011 at 14:40 Comment(7)
Sorry for not sharing whole info, I use tutorial form Utube on how to run parallel aplication using MPJ Express in Eclips. I down load MPJExpress (newest) and I work on newest Eclips Indigo. I did include in my project jar file for mpi, and I try compile simple hellow program : 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(); } }Monostome
Please don't use comments for code blocks; as you can see, it just results in an unreadable mess. Since this is more information about your question, you should edit it into your question.Paapanen
Thanks! Have an upvote and five "learning how to use the site" reputation points.Paapanen
I do have mpi.jar file in my build Path :/Monostome
I got it. It started to work, thank you for your time and helpMonostome
Ah, great! If my answer helped you, please mark it as "accepted" with the check mark icon to its left. If it didn't, please add your own answer to explain what you did to solve your problem, and mark that as "accepted."Paapanen
@LordTorgamus hey lord could you please take a look at my question <#10698071> thanks!Matchboard

© 2022 - 2024 — McMap. All rights reserved.