Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a step-by-step guide on how to use CPF as a tool #34

Open
andreybokhanko opened this issue May 13, 2021 · 4 comments
Open

Add a step-by-step guide on how to use CPF as a tool #34

andreybokhanko opened this issue May 13, 2021 · 4 comments
Assignees

Comments

@andreybokhanko
Copy link

A step-by-step guide on how to use CPF as a tool (to auto-parallelize user's own applications), rather than a research artifact, would be useful.

It's OK if CPF is not really ready for production use; a sequence of steps like:

clang -c -emit-llvm test.c
opt -some_options test.bc
...

would be enough for evaluation.

Right now one needs to go through all the makefiles, which is frustrating.

(unless I'm missing something...)

Yours,
Andrey
===
Advanced Software Technology Lab
Huawei

@vgene
Copy link
Member

vgene commented May 13, 2021

Step 1: Build the master CPF with the Dockerfile
Step 2: Create a benchmark under /tests/regression/{bmark}, put the source code under {bmark}/src and create an execInfo file under {bmark}, the structure follows https://github.com/PrincetonUniversity/cpf/blob/master/tests/regression/dijkstra-dynsize/execInfo
Step 3: Source the environment variables by source ~/cpf-workspace/cpf-env-debug.rc (debug LLVM and debug CPF) or source ~/cpf-workspace/cpf-env-release.rc (release LLVM and release CPF)
Step 4: Run make benchmark.compare.out under {bmark}/src, which will run all the necessary profilings and create a benchmark.collaborative.exe (parallelized binary), then run both the sequential binary (benchmark.plain.o3.exe) and the parallel with the provided TESTARGS

There are currently several limitations (profilers and the code generation part). For example, the profiler does not handle some C++ corner cases correctly and might crash while running. I'll recommend using some simple C program to test first. We are actively developing to handle C++ programs right now. If you have a benchmark that is open-source or can be shared directly, we are more than happy to take a closer look!

@andreybokhanko
Copy link
Author

Hi @vgene

Thanks for the instructions, but that's not exactly what I meant. Your guide relies on a pre-created makefile, that hides individual commands.

What I'm asking for (and do believe would be very useful for people like me) is a list of individual commands to compile, profile, optimize and run a single application -- outside of the context of your testing framework.

Andrey

@vgene
Copy link
Member

vgene commented May 25, 2021

@andreybokhanko Thank you for the feedback. We will work on a detailed explanation of each step and put it in the Wiki (https://github.com/PrincetonUniversity/cpf/wiki) by the end of this week.

@vgene vgene self-assigned this May 25, 2021
@andreybokhanko
Copy link
Author

@vgene Thanks for the quick response! (here and elsewhere)

It's great to see a [relatively] young project with such high level of response and support already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants