Unable to use Parallel Java 2 library By Prof. Ala

2019-09-18 19:50发布

I'm trying to build a parallel program for matrix multiplication in Java. I've succeeded by using multithreading and my program is executing pretty quickly.

But, It took me a whole day to design the code.

Hence, I searched a library for constructing parallel program easily as there are no parallel programming constructs in Java like parfor loop in Matlab.

I found this Parallel Java 2 (pj2) library by Prof. Alan Kaminsky. But, I'm unable to install pj2 library. He also provided a pretty nice book on parallel computing which includes step by step tutorial to build parallel programs. But, I can't even execute his first basic program (It's frustrating. Really!!) given in his book named Big CPU, Big DATA.

Please, help me to configure my Computer to use this library. Explaining the installation procedure and execution procedure step by step will work for me.

Here is the link to Parallel Java 2 library.

ERROR I'M GETTING

C:\Users\Palash>java pj2 debug=makespan edu.rit.pj2.example.PrimeSeq \ 100000000
000000003 100000000000000013 100000000000000019 \ 100000000000000021 10000000000
0000003 100000000000000013 100000000000000019 100000000000000021 Job 1 makespan
19422 msec
Error: Could not find or load main class pj2

ERROR END

My Computer Specification

 Windows 8 , i5, Jdk 1.8

Specification End

1条回答
地球回转人心会变
2楼-- · 2019-09-18 20:16

You have to set your CLASSPATH variable to pj2.jar before running java pj2... etc.

how-to in Windows

On linux:

Usage

Here is an example of a command for the bash shell to set the classpath to the current directory plus the PJ2 JAR file:

export CLASSPATH=.:/path/to/pj2.jar

Here is an example of a command for the csh shell to set the classpath to the current directory plus the PJ2 JAR file:

setenv CLASSPATH .:/path/to/pj2.jar

Also:

System Requirements

PJ2 was developed using Java Development Kit (JDK) 1.7. When compiling and running PJ2 programs, you must use JDK 1.7. PJ2 uses features of the Java language and platform introduced in JDK 1.7 and will not compile with earlier JDK versions.

My guess is JDK 1.8 is backward compatible, but I haven't tried it with pj2.

(These quotes were taken directly from Prof. Alan Kaminsky's documentation on pj2)

If all else fails, incorporate his source code into your project's root directory by unpacking the source distribution which contains all of the .java files for pj2.

查看更多
登录 后发表回答