Projects‎ > ‎Peak-Two Cloud (P2C)‎ > ‎

Peak-Two Cloud Resources


posted Feb 6, 2017, 12:30 AM by SRGICS UPLB   [ updated Feb 6, 2017, 12:33 AM ]

Report of performance of P2C for HPC using NAS Parallel Benchmarks (NPB) is now available here.

Tutorial: Using Slurm to run MPI jobs

posted Oct 6, 2016, 9:01 PM by SRGICS UPLB   [ updated Oct 16, 2016, 9:00 PM ]

Quick start:

First, learn to use screen.
  1. ssh -ouserknownhostsfile=/dev/null <username>@<cluster ip>
  2. wget
  3. wget
  4. mpicc -o hello.exe hello.c
  5. sbatch ./hello.exe
  6. cat output.txt

Sample job script (
if [ "$#" -ne 1 ]; then
    echo "Usage: $0 <executable>"

#the name of the job
#SBATCH --job-name=mpijob

#the stdout output of the job
#SBATCH --output=output.txt

#available nodes
#SBATCH --nodes=4

#number of tasks
#SBATCH --ntasks=4

#time limit (D-HH:MM), terminate the job after two minutes
#if not yet done
#SBATCH -t 0-0:02

#the executable

#number of nodes to use in the run

mpiexec -np $NODES -f ../nodes.txt ./$EXEC
The script above describes a job to compile and execute hello.c, an MPI program. The important parameters to change are --job-name, --output, and EXEC. The values of these parameters should describe your program.

View node information
  • sinfo -N -l
Submit a job
  • sbatch
Check status of a job
  • squeue
Check job details
  • scontrol show job <id>
View result
  • cat hello.out
Cancel a job
  • scancel <job id>

More commands

Tutorial: Sharing a vcluster-deployed MPI cluster through Slurm

posted Oct 4, 2016, 1:49 AM by SRGICS UPLB   [ updated Nov 2, 2017, 3:49 AM ]

The main objective of vcluster is to provide on-demand provisioning of MPI clusters. However, sharing a cluster may be more efficient in some use cases, such as for training or teaching. This tutorial describes how to do this by using Slurm.
  1. Create an MPI cluster using vcluster with 3 slave nodes. Name the cluster cmsc180.
  2. On the master node
    1. screen -S slurm
    2. wget
    3. wget
    4. wget
    5. wget
    6. chmod 755 *.sh
    7. sudo ./
    8. #create users.txt,  with each line having the username and password, each line separated by space
    9. sudo ./ users.txt

  3. On each slave node. (ssh from the master.)
    1. sudo ./ users.txt #ignore the warnings
    2. sudo ./
  4. Test
    1. #ssh as user user01 or any user from users.txt to the master
    2. sinfo -N -l
  5. When the cluster reboots, resume the nodes
    1. sudo scontrol update NodeName=cmsc180-slave-3 State=Resume

Tutorial: How to prevent freezing of SSH connection to your instance

posted Jun 5, 2016, 9:53 PM by Joseph Anthony Hermocilla   [ updated Oct 14, 2016, 4:10 AM by SRGICS UPLB ]

First, to escape from a frozen ssh session, press and release (excluding the brackets) [ENTER], [~], [.] in succession.

On the client machine and on the instance, set the mtu of the interface to 1454 bytes.

$sudo ifconfig eth0 mtu 1454

If the above steps did not work, try the following.

On your instance edit /etc/ssh/sshd_config then add the following lines at the end.
ClientAliveInterval 60 TCPKeepAlive yes ClientAliveCountMax 10000
Restart sshd then exit the session.

$sudo service ssh restart

On your client (machine you are connecting from), edit /etc/ssh/ssh_config then add the line below.
ServerAliveInterval 60
Reconnect again.

Lastly, if you are using gnome-terminal, set the custom command in Edit->Profile Preferences to the following.

env TERM=xterm /bin/bash

It is highly recommended to use screen after login.

Tutorial: Running a Python Spark application in a vhadoop deployed hadoop cluster

posted Apr 28, 2016, 8:26 PM by Joseph Anthony Hermocilla   [ updated Apr 28, 2016, 8:42 PM ]

"Apache Spark is a fast and general processing engine compatible with Hadoop data. It can run in Hadoop clusters through YARN or Spark's standalone mode, and it can process data in HDFS, HBase, Cassandra, Hive, and any Hadoop InputFormat. It is designed to perform both batch processing (similar to MapReduce) and new workloads like streaming, interactive queries, and machine learning."

1. First start a vhadoop cluster as described here.

2. Save the following code as

from pyspark import SparkConf, SparkContext
wiki = "/wc-in/tagalog.txt" 
conf = (SparkConf()
         .set("spark.executor.memory", "128m"))
sc = SparkContext(conf = conf)
data = sc.textFile(wiki).cache()
us = data.filter(lambda s: 'Unibersidad' in s).count()
ps = data.filter(lambda s: 'Pilipinas' in s).count()
print "Lines with Unibersidad: %i, lines with Pilipinas: %i" % (us, ps)

4. Run the application.


A physical view of P2C

posted Apr 20, 2016, 12:29 AM by Joseph Anthony Hermocilla   [ updated May 15, 2016, 11:39 PM ]

CPU: Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz
Disk: 500GB

Front view

Back View

Tutorial: How to upload files to your instance

posted Oct 14, 2015, 11:16 PM by SRGICS UPLB   [ updated Mar 13, 2018, 6:36 PM by Joseph Anthony Hermocilla ]

If you need to upload files to your instance from the command line, the syntax is shown below.

$scp -oUserKnownHostsFile=/dev/null -i <Key File> <Filename> ubuntu@<Floating IP>:.

For example:
$scp -oUserKnownHostsFile=/dev/null -i user.pem hello.txt ubuntu@

If you enabled password authentication in SSH and created a user.

$scp -oUserKnownHostsFile=/dev/null myusername@

Tutorial: Enable SSH access to your instance using a username and password

posted Sep 28, 2015, 10:59 PM by SRGICS UPLB   [ updated Sep 29, 2015, 5:51 PM ]

As described in the User Guide, you can connect to your instance using a key pair as shown below.
$ssh -oUserKnownHostsFile=/dev/null -i jachermocilla-guest-p2c.pem ubuntu@

However, using a username and password to login maybe more convenient, especially if you are sharing access to others.  This tutorial describes how to configure SSH for this on an Ubuntu instance.

First login using the key pair as described above then become root.
$sudo -s

Second edit /etc/ssh/sshd_config. Set PasswordAuthentication to YES.
#nano /etc/ssh/sshd_config

Third, restart the SSH server.
#service ssh restart

Fourth, create a new user. You need to supply the password and other information for the user.
#adduser newusername

Fifth, add newusername ALL=(ALL:ALL) ALL to /etc/sudoers. This will give the new user sudo access.

#nano /etc/sudoers

Sixth, logout of the instance.


That's it! You can now connect using username and password.

$ssh -oUserKnownHostsFile=/dev/null newuser@

Supported Tools

posted Jul 30, 2015, 7:14 PM by SRGICS UPLB   [ updated Jul 31, 2015, 12:59 AM ]

The table below shows the supported tools. They support the Message Passing Interface (MPI) for distributed processing of large data sets and computation-intensive operations. After creating a cluster in P2C using vcluster, the p2ctools utility can be used to activate any of these tools.

Tutorial: Running unattended jobs on P2C clusters using Screen

posted Jun 4, 2015, 12:46 AM by SRGICS UPLB   [ updated Oct 7, 2016, 12:34 AM ]

Some jobs you run on P2C will need a long time to finish(or your ssh session freezes due to network instability). When you connect to a cluster remotely (using SSH for example) and start your job, you will have to run the task in the background (adding & at the end of the command line) in order to logout of the SSH session without terminating your job early. An alternative way is to use Screen.

(HINT: To escape from a frozen ssh session press in sequence: [ENTER] [~] [.] )

Screen allows you to have multiple shell sessions(multiplexing) within a single SSH session. You don't have to start multiple SSH sessions if you need to run several commands. A common use case is when running the same program several times but with different parameters. Let us try an example.

1. Connect to the cluster using SSH.

2. Once you are logged in, create a new screen session using the command below. The -S option specifies the name of he screen session, in the example it is session-01
$screen -S session-01

3. Run a command continuously. Simple check the memory usage.
$watch free

4. Detach from the session by pressing Ctrl-a, d (Press 'Ctrl' and 'a' at the same time, release, then press 'd'). You will be returned to your SSH login shell.  Alternatively you can close the terminal where you ssh'd then go directly to step 7.

5. View the list of available screens. You can create additional screens using step 2.
$screen -list

6. Exit from SSH.

7. Connect using SSH again. Once logged in, view the available screens.
$screen -list

8. Re attach to the session-01 screen.
$screen -r session-01

9. You will observe that the watch command is still running even after you logged out of SSH. For more information read the man page of the Screen command. You can exit the screen session using exit.


1-10 of 21