# DidaWiki

### Strumenti Sito

magistraleinformaticanetworking:spm:spm1617

This instructions are relative to the Xeon PHI Knights Corner. The additional instructions to access the PHI Knights Landing may be found here.

### Machine name and access

The machine is r720-phi.itc.unipi.it and has the IP address 131.114.137.225

In case you have not already received and account, you should request the account to the SPM teacher sending an email with

• SUbject: SPM PHI ACCOUNT 1617
• Body: name, family name enrollement number and either CS or MCSN in case you are enrolled in Computer Science or in Computer Science and Networking

Once you have the account (will be an “spm16XX”) you may access the host with the Xeon PHI board by

• ssh spm16XX@r720-phi.itc.unipi.it

You should change the password you received by email at first login issuing a command passwd at the shell prompt.

#### Backup

Please take into account the homes on r720-phi.itc.unipi.it are not subject to backup. Keep a local copy of whatever (source) files you are using on the machine. In case of problems I'll not be able to recover any of the home files.

Take into account that you may edit files on your machine and just compile and run them on the remote (host or PHI). What you can do is to have a local directory hosting the source files, may be develop and debug using local IDE (such as Eclipse or Visual Studio), then synchronize the files using the rsync command and execute commands on remote host via ssh commands from the shell prompt.

If you need further info concerning the procedure don't hesitate to ask me during question time or by email.

#### Accessing FastFlow and sample Code/Classworks

The correct version of FastFlow to use for the course is actually replicated under

/home/spm1501/fastflow

and the exercises and material relative to the classworks are under

/home/spm1501/public

In case you want to access directly these directories under your own home directory, you may create symbolic links to the two directories by issuing commands such as:

    link -s /home/spm1501/fastflow .
link -s /home/spm1501/public .

that will leave two new subdirectories (link) in the current directory.

## Extra tools

All the non standard tools (or the versions newer than the ones provided in the standard distribution) are available under the directory

/home/spm1501/public

### Java

Oracle JDK 1.8 has been installed under /home/spm1501/public directory. Set up the PATH to the bin directory and please avoid to make local copies of it in your local home directory. Both compiler and run time have been installed. This only works on the host, it does not work on the Xeon PHI.

### Compiling and running code on the PHI

In order to be able to use the tools, you have to run the script in

• source /opt/intel/composerxe/bin/compilervars.sh intel64 that will set up the proper compiler and library paths. I suggest you to make the execution of the script automatic by inserting the call to the script in the .bashrc configuration file of your home directory (add a line such as source /opt/intel/composerxe/bin/compilervars.sh intel64 at the end of this file)

In order to run a program on PHI:

1. compile it on the host using icc with the additional flag -mmic
2. copy the executable to the mic0 or mic1 with a scp a.out mic0:
3. execute it on the mic: ssh mic0 ./a.out

Please take into account that a minimal set of libraries is available on the mic.

#### FastFLow

There are a few things to take into account when using FastFlow on PHI:

• please take into account that you need to include the flag
-DNO_DEFAULT_MAPPING

when compiling FastFlow programs, as the default mapping at the moment assumes a core numbering such as the one used for Sandy/Ivy Bridge (0 first context of the first core, 1 first context of the second core …) processors, which is different from the one used on PHI (0 first context of the first core, 1 second context of the first core …).

• always use the compile flag
 -O3

to compile FastFlow code

• use the FastFlow version in
/home/spm1501/fastflow

that is use the compile time flag

-I /home/spm1501/fastflow

#### MIC0 and MIC1

You can use both the accelerators available on the machine (namely MIC0 and MIC1), despite the fact the examples in this page alway use mic0 …

#### Documentation

Available documentation on the Xeon PHI and the relative programming tools may be accessed at the Intel Xeon PHI Developer Zone

### More documentation

magistraleinformaticanetworking/spm/spm1617.txt · Ultima modifica: 21/02/2017 alle 16:02 (6 anni fa) da Marco Danelutto