Difference between revisions of "How to use Combo"
m |
m |
||
Line 203: | Line 203: | ||
* Now put the tarball somewhere safe. Maybe a local driver or another server. | * Now put the tarball somewhere safe. Maybe a local driver or another server. | ||
* Anytime you may move the tarball back to combo and untar: | * Anytime you may move the tarball back to combo and untar: | ||
− | $ tar -zxvf name-of-your-file.tar | + | $ tar -zxvf name-of-your-file.tar.gz |
− | + | ||
==Acknowledgement== | ==Acknowledgement== |
Revision as of 20:47, 29 April 2014
To start to use combo - our group cluster, you need to know something about it. This guide is intended for users with no prior experience with Linux/ Command Line Interface (CLI) or Cluster Computing. Refer to the User Guide for detailed information on using the Combo.
Contents
[hide]Introduction
The basic building block of a Linux cluster is a node. The two primary types of nodes on a cluster are:
- Compute nodes - these are the majority of nodes on a cluster and are the nodes that run user jobs
- Front-end or Master node(s) - one or more on a cluster and where you login from your local computer (laptop/desktop)
User access to the compute nodes is only available via a batch job. This is typically a sequence of commands listed in a file called a batch script that can be executed without the intervention of the user. The batch script is a plain text file that starts with directives that describe the requirements of the job such as number of nodes and wall clock time, followed by the user's commands to execute specific tasks or run a specific code. An interactive batch job provides a way to get interactive access to a compute node via a batch job. This is useful for testing and debugging purposes.
From the front-end, the batch job is submitted to a queue to be scheduled to run when the compute node resources requested are available. Users can also check status, monitor progress, or delete batch jobs on the head nodes.
IMPORTANT: The front-end on the Combo are a shared resource for all users of the system and their computational use should be limited to editing, compiling, and for short non-intensive runs. The administrators may terminate user processes on the head nodes that impact the system without warning. Users should do all production work by submitting jobs to the batch system.
How to Log in Combo
Use Cygwin/PuTTY on Windows or Terminal on Linux, login using your account and password. You need to use some specific IP address to access combo.
Only secured (ssh) connections to combo are supported. All insecure methods of connection (rlogin, rsh, telnet) are disabled.
Users with accounts on the Combo connect to the front-end via SSH (Secure Shell) client using their UserID and UserID password. Linux and Mac have an ssh client installed by default. Windows does not, but a list of some popular SSH Clients is available and can be downloaded for use.
QUICK ACCESS: Recommended free clients for Windows called Cygwin is available here
You will log on to the front-end and you should be in your home directory which is also accessible by compute nodes.
Users will see a similar prompt to the one listed below
[My_UserID@combo ~]$
after successfully logging into the Combo.
While logged into Combo users interact with resources through the Command Line Interface (CLI). This means that users will need to issue commands on the command line to accomplish various tasks.
Working with the CLI
Since the Combo's user environment is Linux based, it is essential to have a basic working knowledge of Linux to be able to compute successfully on the Combo. The information in the table below and a number of available online tutorials can help new Linux users learn enough to get started.
Useful Unix/Linux Commands | |||
---|---|---|---|
Basic Comands | Working With Files | ||
Command | Description | Command | Description |
ls | List directory contents | vi myfile | Create a new (or edit an existing) file named myfile with a simple text editor |
ls -l or ll | Detailed listing of directory contents | nano myfile | Create a new (or edit an existing) file named myfile with a simple text editor |
pwd | Display the path of the current/working directory | grep string myfile | Display the lines in myfile that contain a matching pattern(string) |
man command_name | Display online help (manual page) for command_name | cat myfile | Display the entire contents of the file myfile |
quota | Display your home directory disk usage | less myfile | Display the contents of the file myfile, one page at a time |
ps -u | Display detailed information about your running processes | cp myfile1 myfile2 | Copy the file myfile1 to myfile2 |
exit or logout | Log out of your current session | mv myfile1 myfile2 | Rename the file myfile1 to myfile2 |
history | Display a list of the commands you've recently run | mv myfile mydir | Move the file myfile into the directory mydir |
date | Display the system date and time | rm myfile | Delete the file myfile |
mkdir mydir | Create a directory named mydir | ||
cd mydir | Change the current directory to mydir | ||
rmdir mydir or
rm -r mydir |
Remove the directory mydir (if empty) |
Linux Tutorial | Text Editing | Shell Scripting |
---|---|---|
Key word combinations such as Unix Tutorial, Linux Tutorial, Linux Text Editing, Shell Scripting, etc., can be used in any search engine to find additional information online.
First thing you need to do after first login
Change your password, in command line, type
$ passwd
to change your password. A good password will have a mix of lower- and upper-case characters, numbers, and punctuation marks, and should be at least 6 characters long. Some people like to put a punctuation mark/number in the middle of a word, e.g., Ha&pp6Y.
Second thing you need to do
You need to change ~/.bashrc file so that you can use the apps in shared folder easily, type
$ cp /share/apps/useful/setup/_.bashrc ~/.bashrc $ source ~/.bashrc
to replace bashrc with prepared file. Then use this code to sync .bashrc to all nodes: (This step is optional, if you find the nodes does not apply same bashrc, then do it)
for i in compute-0-0 compute-0-2 compute-0-3 compute-0-4 compute-0-5 compute-0-6 compute-0-7 compute-0-8 compute-0-9 compute-0-10 compute-0-11 compute-0-12 compute-0-13 compute-0-14 compute-0-15 compute-0-16 ; do scp ~/.bashrc ${i}:~/ ; done for i in compute-0-0 compute-0-2 compute-0-3 compute-0-4 compute-0-5 compute-0-6 compute-0-7 compute-0-8 compute-0-9 compute-0-10 compute-0-11 compute-0-12 compute-0-13 compute-0-14 compute-0-15 compute-0-16 ; do ssh ${i} source ~/.bashrc ; done
Data Transfer
Users may have a need to move data between a local system and Combo. On Windows systems, several SSH based clients provide functionality for file transfer (SCP/SFTP). The list of SSH Clients indicates which ones support both file transfer and remote login functionality.
SCP/SFTP clients are also available in two formats - GUI and CLI.
- GUI Data transfer examples
- Generally GUI based scp/sftp clients implement a drag and drop interface. (Recommended for beginning users)
- CLI Data transfer examples
- The CLI examples below display scp and sftp syntax for transferring files between Combo and a local system.
- scp example:
- Transferring a file on your local system to your home directory on Combo:
my_desktop% scp local_file My_UserID@combo.domain.name:~/
- Transferring a file in your home directory on Combo to your local system:
my_desktop% scp My_UserID@combo.domain.name:~/remote_file ./
- sftp example:
- Transferring files between your local system and Combo:
my_desktop% sftp My_UserID@combo.domain.name sftp> put local_file sftp> get remote_file
Command line interface usage on Windows based machines may require additional configuration steps or use of specially named commands for scp and sftp. The additional CLI configuration information or usage instructions can be found in the documentation for the specific ssh client.
Editor
Text editors are used for editing plain text files. The Combo has two text editing programs - vi (and an improved version called vim) and nano. vi/vim is one of the most commonly used text editors, however we suggest users new to working in the Linux environment start off using nano to edit text files because it may be more similar to the way users edit text files on non-linux based machines. The general syntax to begin editing a file with nano is
$ nano file.txt
and with vi/vim is
$ vi file.txt
Use the Nano text editor to create a hello world c program. Type the following
[My_UserID@taubh1 ~]$ nano hello.c
to open a blank text file name "hello.c". Type the program exactly as it is shown below in your Nano text editing session.
#include main() { printf("Hello, C World"\n"); }
When you have completed entering the c program, exit the Nano text editing session by holding down the control(Ctrl) key and then pressing X, which is indicated by a "^X" in the bottom left hand corner of the Nano session. Exiting a Nano session after editing a text file will prompt to save the changes made to the text file. To save changes without exiting the Nano session hold down the control(Ctrl) key and then press O.
Building Applications
The GNU Compiler Collection (GCC) is available by default for compiling source code. The general syntax to compile source code and build an application (executable) is to type the compile command followed by the source code file. For example, to build an executable for a C program named myprogram.c the syntax would be
$ gcc myprogram.c
A successful build will generate an executable (binary) file named a.out that can be executed (run) by typing
$ ./a.out
Batch Job Submission
Please refer to How to submit jobs on Combo
Backup your things
We should emphasize the different levels of importance of computer data. Most of the data on combo are generated by programs, and could be regenerated, in case of necessity. The source code, on the other hand, are very precious to the developers, and could not easily be regenerated. It is your responsibility to back up critical data! Please maintain your own copy of important data stored in the cluster. Users are highly recommended to do everything possible for ensuring those critical material (programs etc.) never be lost. For example, the users should keep multiple copies of these important files on different computer systems, including users' local system. The following example illustrates a directory move from combo:
- Create a copy of the local directory with tar (the time to do this depends upon the sizes and number of files, etc.):
$ tar -cvf name-of-your-file.tar directory_to_be_transfer
- Compress tar file with gzip (this step may not be necessary if your file is small):
$ gzip name-of-your-file.tar
This creates a compressed tar file with the name name-of-your-file.tar.gz
- Now put the tarball somewhere safe. Maybe a local driver or another server.
- Anytime you may move the tarball back to combo and untar:
$ tar -zxvf name-of-your-file.tar.gz
Acknowledgement
With reference to:
- Illinois Campus Cluster Program, https://campuscluster.illinois.edu/
- Pegasus II cluster at Missouri University of Science & Technology, http://web.mst.edu/~vojtat/pegasus/home.htm