Material: Java Programme

API Dokumentation mit javadoc.

Matrix Multiplikation

Vector Multiplikation

Konten und Buchungen

Semaphore und Deque

Thread pools, java.util.concurrent

TCP/IP

new IO

OpenMP

OpenMP and Eclipse

Using JOMP with Eclipse, copied from: http://www.lst.ethz.ch/teaching/lectures/ss10/24/assignments/assignment_10/eclipse.txt

1. Add MatrixMultiply.jomp to your project

2. Add a new class MatrixMultiply.java to your project (this file will
   be overwritten by jomp)

3. copy jomp1.0b.jar to your project directory

4. Preferences: Add a file association for *.jomp as java files (for
   syntax highlighting and auto completion)

5. Project properties: Add jomp1.0b.jar to your project's build path

6. Project properties: Add a new builder for jomp.
 - Main Tab:
      Location: Full path to java
      Working Directory: ${workspace_loc:/project_name}
      Arguments: -classpath jomp1.0b.jar jomp.compiler.Jomp src/MatrixMultiply
 - Refresh Tab:
      Check "Refresh resources upon completion"
 - Build Options Tab:
      Check "During auto builds"
      Check "Specify working set of relevant resources"
      Click "Specify Resources" and select MatrixMultiply.jomp

Now jomp will be invoked each time you save MatrixMultiply.jomp. And
syntax highlighting etc. also works.

MPI, MPP und MPJ Express

MPJ Express and Eclipse

Using MPJ Express with Eclipse, contained in: mpj-v0_38/doc/DebuggingWithEclipseIDE.pdf

1. prepare an Eclipse project

2. in project properties, "Java Build Path", "Libraries", add the mpj.jar from 
   the lib path of MPJ Express

3. to run an MPJ Express program:
   in project properties, "Run/Debug Settings", in launch configurations select your
   MPJ program and edit launch configuration
 - in the "Environment" tab, "new"  
   add "MPJ_HOME" and as value give the path to your MPJ installation directory
 - in the "Arguments" tab 
   add "-jar ${MPJ_HOME}/lib/starter.jar" to VM arguments
   add "-np 8" to Program arguments, 8 is the number of MPJ processes
 - select a "variables" button, select "edit varibles", select "new" and 
   add "MPJ_HOME" and as value give the path to your MPJ installation directory
 - run your MPJ program, the output will appear in the "Console" window
FastMPJ and Eclipse

Using FastMPJ with Eclipse, contained in: http://torusware.com/extfiles/doc/fastmpj-documentation/userguide/UsersGuide.pdf

1. prepare an Eclipse project

2. in project properties, "Java Build Path", "Libraries", add the mpj.jar from 
   the lib path of FastMPJ 

3. to run a FastMPJ program:
   in "Run/External Tools/External Tools Configuration", 
   add new "Program Configuration", say FastMPJ
 - in "Location", add the full path to the fmpjrun script 
   of your computer
 - in "Working Directory", add the relative path of your project, if your
   project is named withFastMPJ then add 
      ${workspace_loc:/withFastMPJ/bin}
 - in "Arguments", add the number of MPJ processes and the class name, 
   for example, to request 4 processes and the current class name, add
      -np 4 -class ${java_type_name}
 - in the "Environment" tab, "new"  
   add "FMPJ_HOME" and as value give the path to your FastMPJ installation
   directory
 - run your FastMPJ program, the output will appear in the "Console" window

Travelling Salesman Problem (TSP)

Umfang der Implementierungen:

lines (factor)bytes (factor)Implementierung
188 (1.0)4464 (1.0)SeqByteTSP.java
379 (2.0)9398 (2.1)ParByteLocalTSP.java
992 (5.3)26178 (5.9)DistTSP.java

Travelling Salesman Problem (TSP) mit Listen

Travelling Salesman Problem (TSP) mit byte[]

Travelling Salesman Problem (TSP) mit byte[] und local

Travelling Salesman Problem (TSP) verteilt

Travelling Salesman Problem (TSP) mit GUI


Heinz Kredel
Last modified: Sun Apr 15 22:11:24 CEST 2012