Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/epiqc/ScaffCC
15 May 2026, 23:34:51 UTC
  • Code
  • Branches (10)
  • Releases (1)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/ScaffCC_OSX
    • refs/heads/master
    • refs/tags/2.2
    • refs/tags/5.0
    • refs/tags/v1.0
    • refs/tags/v1.0-beta.2
    • refs/tags/v2.0
    • refs/tags/v2.1
    • refs/tags/v3.0
    • refs/tags/v4.0
    • v3.1
  • 5990d7a
  • /
  • docs
  • /
  • ch-usage
  • /
  • chapter-usage.tex
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:0697a14ea3ef02a81b18d716ec99e1343e57b00c
origin badgedirectory badge
swh:1:dir:d022a069fdd3bfdd61d36626c89d6b25972a0c70
origin badgerevision badge
swh:1:rev:be5bfe685a7b7268af2ae0344c2ffe444e77f296
origin badgesnapshot badge
swh:1:snp:7eb50f12cf990a0030724453139e994df238639f

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: be5bfe685a7b7268af2ae0344c2ffe444e77f296 authored by ah744 on 20 August 2016, 18:31:59 UTC
Small script changes
Tip revision: be5bfe6
chapter-usage.tex
\chapter{Using ScaffCC}\label{ch:usage}

\section{Running the Compiler}
To run the compiler, simply use the `scaffold.sh' script in the main directory, with the name of the program and optional compiler flags.

\subsection{Basic Example:}

The command below runs the compiler with default options on the Binary Welded Tree algorithm, with n=100 and s=100 as problem sizes.
The default compiler option is to generate resource estimations (number of qubits and gates).

\begin{lstlisting}
./scaffold.sh Algorithms/Binary Welded Tree/Binary_Welded_Tree_n100s100.scaffold
\end{lstlisting}


\section{Compiler Options}
To see a list of compiler options which can be passed as flags, run:

\begin{lstlisting}
./scaffold.sh -h

Usage: ./scaffold.sh [-h] [-rqfRFcpd] [-L #] <filename>.scaffold
    -r   Generate resource estimate (default)
    -q   Generate QASM
    -f   Generate flattened QASM
    -R   Disable rotation decomposition
    -T   Disable Toffoli decomposition
    -l   Levels of recursion to run (default=1)
    -F   Force running all steps
    -c   Clean all files (no other actions)
    -p   Purge all intermediate files (preserves specified output,
         but requires recompilation for any new output)
    -d   Dry-run; show all commands to be run, but do not execute
    -v   Show current ScaffCC version
\end{lstlisting}



\section{Sample Scripts}
This section describes some of the example scripts contained in the `scripts/' directory. They are written to test the various functionalities 
of ScaffCC, as detailed below.

Each of them automates the process of running multiple compiler passes on an input file to perform the required analysis or optimization.


\subsection{Generating LLVM Intermediate Format: ./gen-ll.sh}

Lowers .scaffold source file to .ll file (intermediary LLVM format). Creates \textless algorithm\textgreater.ll
The .ll file is the main file in LLVM on which all transformations, optimizations and analysis are performed.


\subsection{Critical Path Estimation: ./gen-cp.sh}

Finds critical path information for several different flattening thresholds by doing the following:
\begin{enumerate}
\item Finding module sizes using the ResourceCount2 pass.
\item Flattening modules based on the found module sizes and the requested threshold.
\item Finds length of critical path, in terms of number of operations on it. Look for the number in front of "main" in the output. 
\end{enumerate}

\subsubsection{flattening\_thresh.py} 
Divides modules into different buckets based on their size, to be used for flattening decision purposes.


\subsection{Module Call Frequency Estimation: ./gen-freq-estimate.sh}
Generates an estimate of how many times each module is called, which can guide flattening decisions.


\subsection{Generate Longest-Path-First-Schedule (LPFS): ./gen-lpfs.sh}
Generates LPFS schedules with different options as specified below.

Options in the script: 
  K=number of SIMD regions / D=capacity of each region / th=flattening thresholds

Calls the following scripts:
  
  \subsubsection{./regress.sh}
  
  Runs the 3 different communication-aware schedulers, LPFS, RCP, SS, with different scheduler configurations.
  Look in ./sched.pl for configuration options. For example using -m gives metrics only, while -s outputs entire schedule.

  \subsubsection{./sched.pl}
  The main scheduler code for LPFS and RCP.

  \subsubsection{./comm\_aware.pl}
  Applies the communication penalty to timesteps.

All output files are placed in a new directory to avoid cluttering.


back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API