POSIDONIA: TUTORIAL

Technical specifications:

  • Two sides needed: desktop and high performance system.
  • Desktop interface:
    • Java version: 1.8.0_60 (use of JavaFX library).
  • High Performance System:
    • Java version: 1.7.0_51.
    • SGE version: OGS/GE 2011.11p1.

Test 1: MATLAB

Scenario

  • Program used: MATLAB. Version: 7.6.0.324.
  • Desktop:
    • Windows 7 with direct access to HPC system.
    • Ubuntu 14.04.2 LTS.
  • High Performance System:
    • Linux distribution in the HPC system: CentOS release 6.5 (Final).
    • Rocks version: 6.1.1.

MATLAB code

A simple code is used in this test to get 6 images and to use the Parallel Computing Toolbox from MATLAB. Three files in different file directories are used in order to check some features of Posidonia.

  • Example/prueba.m. It uses plots.mat.
    % Se usa el contenedor.
    load plots.mat
    x = lineal(1:10);
    y = cuadratica(1:10);
    % Algunas representaciones.
    h = plot(x,y);
    print('plot1.jpg','-djpeg')
    h2 = plot(x,x);
    print('plot2.jpg','-djpeg')
    t = 0:.01:2*pi;
    h3 = polar(t,sin(2*t).*cos(2*t),'--r');
    print('polar.jpg','-djpeg')
    th = (0:127)/128*2*pi;
    x = cos(th);
    y = sin(th);
    f=abs(fft(ones(10,1),128));
    h4 = stem3(x,y,f');
    print('plot3d.jpg','-djpeg')
    [X,Y] = meshgrid(-2:.2:2,-2:.2:3);
    Z = X.*exp(-X.^2-Y.^2);
    [c, h5] = contour(X,Y,Z);
    print('contorno.jpg','-djpeg')
    [X,Y] = meshgrid(-3:.125:3);
    Z = peaks(X,Y);
    h6 = mesh(X,Y,Z);
    print('plot3d2.jpg','-djpeg')
    % Parallel setup.
    parpool(8)
    parfor i = 1:8
    for j = 1:10000
    x (:,:,j,i) = rand(1000);
    end
    end
    delete(gcp)
  • Example/lib/lineal.m
    function lin = lineal(x)
    lin = x;
  • Example/lib/cuadratica.m
    function cuad = cuadratica(x)
    cuad = x.^2;

Step 1: executing Posidonia

  • From command line (recommended option in Linux systems):

java -jar posidonia.jar

  • Double-click in posidonia.jar.

Step 2: connecting to the HPC System

  1. You have to provide the name or IP address of the host in which you want to run the simulation code.
  2. Please fill the username and password you use to access that host. If the checkbox placed next to the password field is on, Posidonia will store the password in an encrypted file for the next time you open Posidonia.
  3. If the passive mode is OFF, a TCP server will be launched in port 2012 to receive notifications. Otherwise, notifications won’t be received and no TCP server will be active.
  4. Press Connect. The status of the connection will be Connected to… if everything is correct.

Posidonia connection

 

 

 

 

 

 

 

 

 

Step 3: check the tab of Job Options

This tab contains the minimum number of options you have to specify in order to simulate in a HPC system. The content of this tab is saved automatically when Posidonia is closed.

  1. Next fields have to be necessarily filled:
    • Related to the characteristics of the job:
      • Job Name: this is the identifier of the job for the user.
      • Script Name: it’s the name of the file to simulate.
      • Input Files: here the directory where the file to simulate is will be shown. It’s a non-editable field since you have to select the directory with the Examine button located at the right of the text field.
      • Output Files: it’s the directory in which the results will be downloaded. This is useful for an automatic downloading of the results, but you can always download the outputs wherever you want via the repository.
    • Related to the characteristics of the execution in the cluster:
      • Processes: the number of MPI (or MPICH, or the parallel scheme supported by the job scheduler) processes the job needs to run.
      • Mail Address: here you will receive some mails sent by the job scheduler. This parameter is optional.
      • Memory: this is the maximum virtual memory the job can use (in MB). Some programs need a minimum value of memory to work.
  2. NOTE: This tab is checked when a job is submitted. Otherwise, the status will be Not checked.

Image2

 

 

 

 

 

 

 

 

 

Step 4: check the tab of Profiles

This tab is related to the application you want to simulate. Normally, you will have a profile for each application you want to run (Matlab, Octave, R…) but you can also have different options for the same application in different profiles.

  1. Next fields have to be filled by the user:
    • Profile Name: this is the name of the profile for the user.
    • Input Extensions: here you define the extensions of the files in the Input Files Text Field of the tab of Job Options which are relevant for your simulation. For example: for our job, we need to define the extensions .m and .mat since we need to upload prueba.m and plots.mat; they have to be defined with a comma as separator. Moreover, we have two files in a different directory: lineal.m and cuadratica.m. Pressing the Add File buttton we will have a file chooser to add the external files we need for our simulation.
    • Command:
      1. You can write directly the command you want to execute in the HPC system. In this case:
        echo ?scriptName? | /opt/matlab/bin/matlab -nosplash -nojvm -nodisplay
      2. If you have more than one command or you prefer this way, you can add a script. This script could be:
        echo ?jobName?
        echo ?processes?
        echo ?memory?
        echo ?logname?
        echo ?scriptName? | /opt/matlab/bin/matlab -nosplash -nojvm -nodisplay
      3. NOTE: You can use the tags (case insensitive) ?jobName?, ?scriptName?, ?processes?, ?memory? and ?logName? and Posidonia will process it to substitute for the value of the text fields Job Name, Script Name, Processes, Memory -in the tab of Job Options- and Log Name -in the tab of Profiles- respectively.
    • Log Name: Here you can specify the name of a log which is created by the application (optional). If you don’t fill this field, the log you will see in the repository is the generated by the job scheduler.
    • Overwrite Auto: This checkbox, if selected, means that the output files will overwrite any file in the output directory when the results are downloaded after the job is finished. If it’s not selected, the user will be asked about it.
    • NOTE: The Status field will warn you about some errors not accepted by Posidonia.
  2. Press Save Profile.

Step 5: submit the job

  1. Once you have filled correctly the characteristics of your job you can submit it to your Remote host. Press Submit.
    • The Status field will warn you about the status of the submission.
    • If your files are big enough you will see a notification informing you about the uploading percentage of each file.

Image3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step 6: getting the results

  1. If the job ends when Posidonia is launched and it’s set Passive Mode to OFF (the TCP server is on), the results will be downloaded automatically. You will be a notification if the files are big enough with the status of the download, and another notification when the results are available in your machine. If you double-click in the notification, the directory where the result files have been downloaded will be shown.
  2. If the job ends when Posidonia is not launched, you will see a notification the first time that Posidonia starts after the job is finished warning you about the ending of the job. Then, you can go the tab of History to get the results.

Image4

 

 

 

 

 

 

 

 

 

 

Step 7: other options

The tab of History gives you some special characteristics you can use whenever and wherever you want:

  • This information is available in all the computers you have Posidonia installed. Thus, you can use the application in your job and at home if you have a VPN or direct access to the remote host.
  • You can download the input files and the output files for your job whenever you want, so you can compare between different simulations.
  • You have a tidy repository in which you can access to every job launched with Posidonia. Moreover, you can create different profiles and see all the jobs in the same window.
  • While the job is running, you can see the log you have specified in the tab of Profiles. If you are able to do so, you can create a file from your simulation which shows the progress of your work and you can see it in the application pressing the View Log button. Moreover, you can check if a job is offering the results you expected only checking the log and without downloading the results.
  • The deletion of a job supposes the removal of every file used in the simulation of that job.

Comments are closed.