A compiler and static analysis of task parallel C programs.
If SCOOP contributes to a project that leads to a scientific publication, please acknowledge this work by citing the corresponding paper Inference and Declaration of Independence in Task-Parallel Programs (also available here).
#pragma scoop start(list of variables) #pragma scoop finish #pragma scoop malloc #pragma scoop free #pragma scoop sync #pragma scoop barrier #pragma scoop wait all #pragma scoop wait on(list of variables) #pragma scoop task [in(<input parameters>)] [inout(<input parameters>)] [out(<input parameters>)] Parameter notation: Non stride: <parameter>[\[number of elements (for arrays)\]] Stride: <parameter>\[Block Rows|Block Columns\]\[[Array Rows|]Array Columns\] Array Rows is optional and is totally ignored The parameter size/stride/els/elsz must be an expression, thus we don't allow function calls. Also there is no support for the conditional operator (? :) Example: #pragma scoop task in(a, b) out(c)
This section describes how to install SCOOP on your system. We
suppose that you have checked out/cloned SCOOP under
directory. However the same instructions should apply for any
alternative path, simply replacing
/opt/scoop with the desired
alternative path for the rest of this section.
In order to build SCOOP you will need to install the following packages:
- ocaml ≥ 3.11.2
To compile SCOOP you have to run
configure and then
./configure && make
You can install SCOOP running
sudo make install
this will create a copy of the scoop executable in
NOTE: You still have to keep the current directory to your system.
Alternatively you can append
/opt/scoop to the
echo "export PATH=$PATH:/opt/scoop" >> $HOME/.bashrc
You can uninstall SCOOP running
sudo make uninstall
this will erase the copy of the scoop executable from
If you chose the alternative method of adding
/opt/scoop to your
PATH variable, simply remove the added line from your
scoop --runtime=<myrmics/dummy> [options] <file> [file2 ...]
--runtime SCOOP: Define the target runtime (myrmics | dummy) --cflags SCOOP: Define the flags you want to pass to gcc. --include-path SCOOP: Define the path containing the runtime header files. --debug-SCOOP SCOOP: Print debugging information. --trace SCOOP: Trace SCOOP. --out-name SCOOP: Specify the output files' prefix. e.g. (default: scoop_trans) will produce scoop_trans.c (and scoop_trans_func.c for cell) --pragma SCOOP: Specify the string constant following the pragma e.g. (default: runtime name) myrmics will recognise #pragma myrmics ... --disable-sdam SCOOP: Disable the static dependence analysis module (SDAM) --myrmics-main-function SCOOP: Specify the name of the main function for the myrmics runtime (default: main)
In order to add support for your runtime on the SCOOP compiler you have to take the following steps.
- Perform any required changes to
- Add the following lines to
match !arch within
| "myruntime" ->
new Scoop_myruntime.codegen callgraph !gen_file !pragma_str !includePath
Common Errors/Limitations/Known Bugs
- Adding a semicolon at the end of
#pragmas will make SCOOP fail, i.e.,
#pragma scoop sync;
#pragma scoop barrierat the end of a block will make SCOOP fail (add a semicolon right below the
#pragmato fix it).
- Fatal error: exception Invalid_argument("Unknown") you probably
have wrong argument at a call tagged with
#pragma scoop task
- Using DEFINES or MACROS in pragmas (preprocessor doesn't process them)
#pragmadirectly above a declaration of a variable (pragmas are only supported above statements)
- Using directly the runtime API instead of the corresponding
#pragmamay result in SDAM not working properly.
- Error: "segment___0" not found in the #pragma scoop task usually means that the tool is renaming a variable due to previous declaration try renaming it manually (e.g. segment2) (This should be fixed by now)