Testing for stage III for project

Hi Everyone, in this blog I am going to demonstrate how to use or test the final version of tool for stage III. To read about the stage III please visit this link.

You can get the tool at https://github.com/NishanSingh6/SPO600-Project

To successfully run the final version of tool, both tool.py and template.txt must be present in the same directory. Do not change the content of template.txt.

This tool have some permitted limitations:

  1. This tool only operates on aarch64 systems
  2. There are three targets of interest: machines with advanced SIMD, SVE, and SVE2 capabilities
  3. There are only two input source files, one containing main (and optionally other functions) (main.c) and one containing a function to be optimized (function.c)
  4. Only function.c is built multiple times for different SIMD implementations
  5. The file function.c may only contain one function

How to use:

Firstly use the following command to clone the tool.

git clone https://github.com/NishanSingh6/SPO600-Project
By using following command files will be copied.


Now to test, lets clone the directory which contains all the test files.
You can run the following command to clone the directory:
git clone https://github.com/ctyler/spo600-fall2022-project-test-code
Now, after cloning both directories, a new directory with name SPO600-Project will be created, this will contain our tool - tool.py and template.txt. Also, our test files will under spo600-fall2022-project-test code. This testing directory was provided by my professor.

  

 
We can use the tool by using the following command.
python tool.py arg1 arg2
Here arg1 is the main.c, and arg2 is filename of the file which contains the function which will be vectorized.

To test the tool, copy tool.py and template.txt to test directory. you can do it using following code
cp SPO600-Project/* spo600-fall2022-project-test-code/
After copying the file go to test directory and double check that all the files are in the same directory, these must be in the same directory in order tool to work.


Then run the following command to use the tool
python tool.py main.c function.c
This will be run the tool. The tool will ask for user input for multiple times.

Firstly, It will ask that if the function contains any prototypes with user-defined data types such as class or struct. 


If your function contains only parameters with built-in data types (int, char, double). Then enter N, then tool will run normally.
If your function contains user-defined parameters. lets assume your function prototype is 

void myfunc(Node* n, Record& r)
Then, your user-defined dtypes are Node and Record.
In this case you will enter Y and then tool will ask you to enter these data types separated by ,.


After this, tool will build the main binary output file
But before exiting, it will ask user for two options

It will ask if user wants to keep function output files (function1.o, function2.o, function3.o).
If you enters Y, then it will keep them, if you enters N then it will remove these three files.

Again, It will ask if user wants to keep three version of function files (function1.c. function2.c, function3.c).
If you enters Y, then it will keep them, if you enters N then it will remove these three files

After this tool produce deliverables according to user decisions. It will produce the main binary output file
Here main is the file binary output file. 


To test it we can run the following command.
./main tests/input/bree.jpg 1.0 1.0 1.0 tests/output/bree.jpg


As I am using israel.cdot.systems as my system which does not support SVE, We can qemu-aarch64 to run the emulator. By adding it before the previous command we can see this time it will use sve2 implementation.


To read about the my reflection on this project please visit this link.


Comments

Popular posts from this blog

Review of 2 Open Source Softwares

Final Implementation of SPO600 Project - Stage III

Testing for Stage II for Project