├── .gitignore ├── .gitmodules ├── README.md ├── bin ├── bc ├── btree ├── canneal ├── cc ├── cg ├── graph500 ├── gups ├── memcached ├── notify_hawkeye ├── numactl ├── perf ├── pr ├── redis ├── svm └── xsbench ├── datasets ├── canneal_netlist.pl ├── prep_canneal_dataset.sh ├── prep_fragmentation_dataset.py └── prep_svm_dataset.sh ├── scripts ├── cleanup_datasets.sh ├── common.sh ├── compile_results.py ├── configs.sh ├── fragment.py ├── gen_vmconfigs.py ├── prep_all_datasets.sh ├── run_figure_1.sh ├── run_figure_10.sh ├── run_figure_11.sh ├── run_figure_12.sh ├── run_figure_13.sh ├── run_figure_2.sh ├── run_figure_9.sh └── run_guest.sh ├── trident-workloads ├── .gitignore ├── Makefile ├── README.md ├── bin │ └── .gitignore ├── btree │ ├── Makefile │ └── btree1.c ├── canneal │ ├── .gitignore │ ├── AtomicPtr.h │ ├── COPYRIGHT │ ├── LICENSE │ ├── Makefile │ ├── MersenneTwister.h │ ├── annealer_thread.cpp │ ├── annealer_thread.h │ ├── annealer_types.h │ ├── atomic │ │ ├── alpha │ │ │ └── atomic.h │ │ ├── amd64 │ │ │ └── atomic.h │ │ ├── atomic.h │ │ ├── i386 │ │ │ └── atomic.h │ │ ├── ia64 │ │ │ └── atomic.h │ │ ├── powerpc │ │ │ └── atomic.h │ │ └── sparc │ │ │ ├── asi.h │ │ │ ├── atomic.h │ │ │ └── cpufunc.h │ ├── location_t.h │ ├── main.cpp │ ├── netlist.cpp │ ├── netlist.h │ ├── netlist_elem.cpp │ ├── netlist_elem.h │ ├── rng.cpp │ └── rng.h ├── common │ ├── main-mt.c │ ├── main-ptdump.c │ ├── main-st.c │ └── ptdump.h ├── gapbs │ ├── .gitignore │ ├── .travis.yml │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── src │ │ ├── bc.cc │ │ ├── benchmark.h │ │ ├── bfs.cc │ │ ├── bitmap.h │ │ ├── builder.h │ │ ├── cc.cc │ │ ├── cc_sv.cc │ │ ├── command_line.h │ │ ├── converter.cc │ │ ├── generator.h │ │ ├── graph.h │ │ ├── platform_atomics.h │ │ ├── pr.cc │ │ ├── pvector.h │ │ ├── reader.h │ │ ├── sliding_queue.h │ │ ├── sssp.cc │ │ ├── tc.cc │ │ ├── timer.h │ │ ├── util.h │ │ └── writer.h │ └── test │ │ ├── graphs │ │ ├── 4.el │ │ ├── 4.gr │ │ ├── 4.graph │ │ ├── 4.mtx │ │ ├── 4.wel │ │ ├── 4w.graph │ │ └── 4w.mtx │ │ └── reference │ │ ├── graph-4.el.out │ │ ├── graph-4.gr.out │ │ ├── graph-4.graph.out │ │ ├── graph-4.mtx.out │ │ ├── graph-4.wel.out │ │ ├── graph-4w.graph.out │ │ ├── graph-4w.mtx.out │ │ ├── graph-g10.out │ │ └── graph-u10.out ├── graph500 │ ├── COPYING │ ├── Graph500.html │ ├── Graph500.org │ ├── Makefile │ ├── README │ ├── compat.h │ ├── generator │ │ ├── LICENSE_1_0.txt │ │ ├── Makefile.mpi │ │ ├── Makefile.omp │ │ ├── Makefile.seq │ │ ├── Makefile.xmt │ │ ├── README │ │ ├── generator_test_mpi.c │ │ ├── generator_test_omp.c │ │ ├── generator_test_seq.c │ │ ├── generator_test_xmt.c │ │ ├── graph_generator.c │ │ ├── graph_generator.h │ │ ├── make_graph.c │ │ ├── make_graph.h │ │ ├── mod_arith.h │ │ ├── mod_arith_32bit.h │ │ ├── mod_arith_64bit.h │ │ ├── mod_arith_xmt.h │ │ ├── mrg_transitions.c │ │ ├── splittable_mrg.c │ │ ├── splittable_mrg.h │ │ ├── user_settings.h │ │ ├── utils.c │ │ └── utils.h │ ├── graph500.c │ ├── graph500.h │ ├── kronecker.c │ ├── kronecker.h │ ├── make-edgelist.c │ ├── make-incs │ │ ├── make.inc-gcc │ │ ├── make.inc-osx │ │ └── make.inc-xmt │ ├── make.inc │ ├── octave │ │ ├── Graph500.m │ │ ├── kernel_1.m │ │ ├── kernel_2.m │ │ ├── kronecker_generator.m │ │ ├── output.m │ │ └── validate.m │ ├── omp-csr │ │ ├── bitmap.h │ │ ├── omp-csr-old.c │ │ └── omp-csr.c │ ├── options.c │ ├── options.h │ ├── prng.c │ ├── prng.h │ ├── rmat.c │ ├── rmat.h │ ├── seq-csr │ │ └── seq-csr.c │ ├── seq-list │ │ └── seq-list.c │ ├── timer.c │ ├── timer.h │ ├── verify.c │ ├── verify.h │ ├── xalloc.c │ └── xalloc.h ├── gups │ ├── Makefile │ ├── gups.c │ └── gupstoy.c ├── hashjoin │ ├── Makefile │ ├── hashjoin.c │ ├── hashjoin_2.c │ ├── murmur3.h │ └── murmurhash.c ├── liblinear │ ├── COPYRIGHT │ ├── Makefile │ ├── Makefile.win │ ├── README │ ├── README.multicore │ ├── blas │ │ ├── Makefile │ │ ├── blas.h │ │ ├── blasp.h │ │ ├── daxpy.c │ │ ├── ddot.c │ │ ├── dnrm2.c │ │ └── dscal.c │ ├── heart_scale │ ├── linear.cpp │ ├── linear.def │ ├── linear.h │ ├── matlab │ │ ├── Makefile │ │ ├── README │ │ ├── README.multicore │ │ ├── libsvmread.c │ │ ├── libsvmwrite.c │ │ ├── linear_model_matlab.c │ │ ├── linear_model_matlab.h │ │ ├── make.m │ │ ├── predict.c │ │ └── train.c │ ├── predict.c │ ├── python │ │ ├── Makefile │ │ ├── README │ │ ├── commonutil.py │ │ ├── liblinear.py │ │ └── liblinearutil.py │ ├── svm-scale.c │ ├── train.c │ ├── tron.cpp │ └── tron.h ├── memops │ ├── .gitignore │ ├── Makefile │ ├── mmapbench-run.sh │ └── mmapbench.c ├── stream │ ├── .gitignore │ ├── HISTORY.txt │ ├── LICENSE.txt │ ├── Makefile │ ├── README │ ├── mysecond.c │ ├── stream.c │ └── stream.f └── xsbench │ ├── CHANGES │ ├── LICENSE │ ├── README.txt │ ├── docs │ ├── XSBench_Theory.pdf │ └── XSBench_Theory.tex │ └── src │ ├── CalculateXS.c │ ├── GridInit.c │ ├── Main.c │ ├── Makefile │ ├── Materials.c │ ├── Simulation.c │ ├── XSbench_header.h │ ├── XSutils.c │ ├── io.c │ ├── papi.c │ └── results.txt └── vmconfigs └── samples ├── 1GBHUGE.xml ├── 2MBHUGE.xml ├── 4KB.xml └── HAWKEYE.xml /.gitignore: -------------------------------------------------------------------------------- 1 | datasets/canneal_small 2 | datasets/*kdd12* 3 | datasets/fragmentation 4 | vmconfigs/*.xml 5 | evaluation/* 6 | report/* 7 | test/* 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "sources/HawkEye"] 2 | path = sources/HawkEye 3 | url = https://github.com/apanwariisc/HawkEye.git 4 | [submodule "sources/Trident"] 5 | path = sources/Trident 6 | url = https://github.com/csl-iisc/Trident 7 | -------------------------------------------------------------------------------- /bin/bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/bc -------------------------------------------------------------------------------- /bin/btree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/btree -------------------------------------------------------------------------------- /bin/canneal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/canneal -------------------------------------------------------------------------------- /bin/cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/cc -------------------------------------------------------------------------------- /bin/cg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/cg -------------------------------------------------------------------------------- /bin/graph500: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/graph500 -------------------------------------------------------------------------------- /bin/gups: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/gups -------------------------------------------------------------------------------- /bin/memcached: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/memcached -------------------------------------------------------------------------------- /bin/notify_hawkeye: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/notify_hawkeye -------------------------------------------------------------------------------- /bin/numactl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/numactl -------------------------------------------------------------------------------- /bin/perf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/perf -------------------------------------------------------------------------------- /bin/pr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/pr -------------------------------------------------------------------------------- /bin/redis: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/redis -------------------------------------------------------------------------------- /bin/svm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/svm -------------------------------------------------------------------------------- /bin/xsbench: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/bin/xsbench -------------------------------------------------------------------------------- /datasets/canneal_netlist.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Copyright 2009, Princeton University 4 | # All rights reserved. 5 | # 6 | # A simple script to generate inputs for the canneal workload of the PARSEC 7 | # Benchmark Suite. 8 | 9 | use strict; 10 | my @names; 11 | 12 | my $x = shift; 13 | my $y = shift; 14 | my $num_elements = shift; 15 | ($x > 1) or die "x is invalid: $y"; 16 | ($y >1) or die "y is invalid: $y"; 17 | ($num_elements < ($x * $y) )or die; 18 | my $num_connections = 5; 19 | 20 | print "$num_elements $x $y\n"; 21 | 22 | 23 | #create a set of names. Use the ++ operator gives meaningless names, but thats 24 | #all I really need 25 | my $name = "a"; 26 | foreach my $i (0..$num_elements-1){ 27 | $names[$i] = $name; 28 | $name++; 29 | } 30 | 31 | foreach my $i (0..$num_elements-1){ 32 | print "$names[$i]\t"; 33 | #type is either reg or comb For now my program makes no distinction 34 | my $type = 1+ int(rand(2)); 35 | print "$type\t"; 36 | foreach my $j (0..$num_connections-1){ 37 | #get a random element 38 | my $random_connection = int(rand($num_elements)); 39 | print $names[$random_connection]; 40 | print "\t"; 41 | } 42 | print "END\n"; 43 | } 44 | -------------------------------------------------------------------------------- /datasets/prep_canneal_dataset.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################################### 4 | # Script to generate dataset for canneal (from PARSEC suite) 5 | # 6 | # nuKSM: NUMA-aware Memory De-duplication for Multi-socket Servers 7 | # Authors: Akash Panda, Ashish Panwar and Arkaprava Basu 8 | # 9 | ############################################################################### 10 | 11 | if [ $# -eq 2 ] && [ $2 != "--no-verbose" ]; then 12 | echo "************************************************************************" 13 | echo "MICRO'21 - Artifact Evaluation - nuKSM - DATASET PREPARATION" 14 | echo "************************************************************************" 15 | fi 16 | 17 | ROOT=$(dirname `readlink -f "$0"`) 18 | OUT=$ROOT/canneal_small 19 | 20 | if [ -e $OUT ]; then 21 | # already present 22 | exit 23 | fi 24 | 25 | SRC_SCRIPT="$ROOT/canneal_netlist.pl" 26 | 27 | URL_SCRIPT="https://parsec.cs.princeton.edu/download/other/canneal_netlist.pl" 28 | if [ ! -e $SRC_SCRIPT ]; then 29 | echo "Canneal gen script is missing. Downloading it now..." 30 | wget $URL_SCRIPT -P $ROOT/ 31 | if [ $? -ne 0 ]; then 32 | echo "error in downloading canneal gen script" 33 | exit 34 | fi 35 | fi 36 | 37 | chmod +x $SRC_SCRIPT 38 | echo "Preparing small dataset. This will take a while..." 39 | $SRC_SCRIPT 10000 11000 100000000 > $OUT 40 | echo "Dataset is ready now..." 41 | -------------------------------------------------------------------------------- /datasets/prep_fragmentation_dataset.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import os 4 | 5 | root = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) 6 | sample_src=os.path.join(root, 'datasets/canneal_small') 7 | 8 | 9 | def prepare_dataset(): 10 | # -- get the size of sample file 11 | sample_size = int(os.stat(sample_src).st_size) 12 | print(sample_size) 13 | 14 | # --- get total memory size of node-0 15 | cmd = 'numactl -H | grep \'node 0 size\' | awk \'{print $4}\'' 16 | total = os.popen(cmd).read().strip() 17 | total = int(total) * 1024 * 1024 18 | print('nr_copies = %d' % ((total/sample_size) / 2)) 19 | nr_copies = int((total/sample_size)/2) 20 | os.mkdir(os.path.join(root, 'datasets/fragmentation')) 21 | # --- prepare file-1 22 | print('preparing file-1...') 23 | for i in range(nr_copies): 24 | src = os.path.join(root, 'datasets/canneal_small') 25 | dst = os.path.join(root, 'datasets/fragmentation/file-1') 26 | cmd = 'cat %s >> %s' %(src, dst) 27 | os.system(cmd) 28 | 29 | print('preparing file-2...') 30 | # --- copy file-1 to file-2 31 | src = os.path.join(root, 'datasets/fragmentation/file-1') 32 | dst = os.path.join(root, 'datasets/fragmentation/file-2') 33 | cmd = 'cp %s %s' %(src, dst) 34 | os.system(cmd) 35 | 36 | if __name__ == '__main__': 37 | if not os.path.exists(sample_src): 38 | print('generating sample file from canneal first...') 39 | src = os.path.join(root, 'datasets/prepare_canneal_datasets.sh') 40 | cmd = str(src) + ' small' 41 | print(cmd) 42 | os.system(cmd) 43 | 44 | print('preparing dataset for fragmenting memory...') 45 | prepare_dataset() 46 | -------------------------------------------------------------------------------- /datasets/prep_svm_dataset.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################################### 4 | # Script to generate dataset for SVM 5 | # 6 | # nuKSM: NUMA-aware Memory De-duplication for Multi-socket Servers 7 | # Authors: Akash Panda, Ashish Panwar and Arkaprava Basu 8 | # 9 | ############################################################################### 10 | 11 | if [ $# -eq 2 ] && [ $2 != "--no-verbose" ]; then 12 | echo "************************************************************************" 13 | echo "MICRO'21 - Artifact Evaluation - nuKSM - DATASET PREPARATION" 14 | echo "************************************************************************" 15 | fi 16 | 17 | ROOT=$(dirname `readlink -f "$0"`) 18 | 19 | URL="wget https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/kdd12.bz2" 20 | 21 | if [ ! -e $ROOT/kdd12 ]; then 22 | echo "Downloading kdd12 dataset..." 23 | wget -c $URL -P $ROOT 24 | echo "Download Completed." 25 | echo "Extracting now. This may take a while..." 26 | bunzip2 -f $ROOT/kdd12.bz2 > $ROOT/kdd12 27 | else 28 | echo "Dataset already present..." 29 | fi 30 | -------------------------------------------------------------------------------- /scripts/cleanup_datasets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPTS=$(dirname `readlink -f "$0"`) 4 | ROOT="$(dirname "$SCRIPTS")" 5 | 6 | echo "Removing canneal dataset..." 7 | rm -rf $ROOT/datasets/canneal_small 8 | echo "Removing svm dataset..." 9 | rm -rf $ROOT/datasets/*kdd* 10 | echo "Removing fragmentation related dataset..." 11 | rm -rf $ROOT/datasets/fragmentation 12 | sync 13 | echo "Done..." 14 | -------------------------------------------------------------------------------- /scripts/configs.sh: -------------------------------------------------------------------------------- 1 | #!/bin.bash 2 | 3 | VMIMAGE=trident 4 | 5 | GUESTUSER=micro21ae 6 | GUESTIP=192.168.123.149 7 | 8 | PERF_EVENTS='cycles,dtlb_load_misses.walk_active,dtlb_store_misses.walk_active' 9 | #PERF_EVENTS='cycles,instructions' 10 | 11 | PROFILE_PERF_EVENTS="yes" #no 12 | 13 | FRAG_FILE_1=$ROOT/datasets/fragmentation/file-1 14 | FRAG_FILE_2=$ROOT/datasets/fragmentation/file-2 15 | 16 | # number of hugetlb pages 17 | HUGETLB_2MB_PAGES=70000 18 | HUGETLB_1GB_PAGES=140 19 | 20 | # number of hugetlb pages 21 | VM_HUGETLB_2MB_PAGES=80000 22 | VM_HUGETLB_1GB_PAGES=160 23 | -------------------------------------------------------------------------------- /scripts/fragment.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ''' 4 | This script creates fragmentation by reading a large file randomly in pages. 5 | This it will keep on doing for a specific time which has to be prementioned. 6 | This we will do it with multi threaded 7 | ''' 8 | 9 | import sys, time, random, string, os 10 | from multiprocessing import Process, Manager 11 | 12 | FILE_NAME1 = sys.argv[1] 13 | FILE_NAME2 = sys.argv[2] 14 | #FILE_SIZE = int(sys.argv[2]) 15 | #BLOAT = int(sys.argv[3]) 16 | NR_SECONDS = int(sys.argv[3]) 17 | NR_THREADS = int(sys.argv[4]) 18 | 19 | #print 'FILE_NAME', FILE_NAME 20 | #print 'FILE_SIZE', FILE_SIZE 21 | #print 'BLOAT', BLOAT 22 | print 'NR_SECONDS', NR_SECONDS 23 | print 'NR_THREADS', NR_THREADS 24 | 25 | ns = Manager().Namespace() 26 | ns.ops = 0 27 | 28 | def fragment_file(): 29 | #print 'entered new process' 30 | #print 'opening file' 31 | f = open(FILE_NAME1, 'r') 32 | f.seek(0, os.SEEK_END) 33 | FILE_SIZE = f.tell(); 34 | #print 'opened file' 35 | ops = 0 36 | t_end = time.time() + NR_SECONDS 37 | while time.time() < t_end: 38 | r = random.randint(0, FILE_SIZE - 10); 39 | f.seek(r) 40 | t = f.read(20); 41 | ops += 1; 42 | f.close() 43 | ns.ops += ops 44 | 45 | def fragment_file2(): 46 | #print 'opening file' 47 | f = open(FILE_NAME2, 'r') 48 | f.seek(0, os.SEEK_END) 49 | FILE_SIZE = f.tell(); 50 | #print 'opened file' 51 | ops = 0 52 | t_end = time.time() + NR_SECONDS 53 | while time.time() < t_end: 54 | r = random.randint(0, FILE_SIZE - 10); 55 | f.seek(r) 56 | t = f.read(20); 57 | ops += 1; 58 | f.close() 59 | ns.ops += ops 60 | 61 | procs = [] 62 | 63 | for i in range(NR_THREADS): 64 | #print 'creating new process' 65 | p = Process(target = fragment_file) 66 | p2 = Process(target = fragment_file2) 67 | #print 'created new process' 68 | procs.append(p) 69 | procs.append(p2) 70 | #print 'starting thread', i 71 | p.start() 72 | p2.start() 73 | print 'started thread', i 74 | 75 | print 'Created the threads. Waiting for then to complete' 76 | for p in procs: 77 | p.join() 78 | print 'All threads joined' 79 | procs = [] 80 | 81 | print 'Read operations performed are :', ns.ops; 82 | 83 | -------------------------------------------------------------------------------- /scripts/prep_all_datasets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPTS=$(dirname `readlink -f "$0"`) 4 | ROOT="$(dirname "$SCRIPTS")" 5 | 6 | echo "Generating canneal and svm datasets..." 7 | bash $ROOT/datasets/prep_canneal_dataset.sh > /dev/null 2>&1 & 8 | PID1=$! 9 | bash $ROOT/datasets/prep_svm_dataset.sh >/dev/null 2>&1 & 10 | PID2=$! 11 | wait $PID1 12 | echo "Generating fragmentation datasets..." 13 | $ROOT/datasets/prep_fragmentation_dataset.py 14 | wait $PID2 15 | sync 16 | echo "Done..." 17 | -------------------------------------------------------------------------------- /scripts/run_figure_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BENCHMARKS="xsbench gups svm redis btree graph500 memcached canneal pr cc bc cg" 4 | CONFIGS="4KB 2MBTHP 2MBHUGE" #1GBHUGE 5 | # For 1GBHUGE, boot kernel with command-line parameter "default_hugepagesz=1G" 6 | # and uncomment the following line 7 | #CONFIGS="1GBHUGE" 8 | 9 | SCRIPTS=$(dirname `readlink -f "$0"`) 10 | ROOT="$(dirname "$SCRIPTS")" 11 | source $SCRIPTS/common.sh 12 | source $SCRIPTS/configs.sh 13 | 14 | for CONFIG in $CONFIGS; do 15 | for BENCHMARK in $BENCHMARKS; do 16 | cleanup_system_configs 17 | setup_4kb_configs 18 | drop_caches 19 | prepare_args 20 | prepare_system_configs 21 | prepare_paths 22 | launch_workload 23 | done 24 | done 25 | -------------------------------------------------------------------------------- /scripts/run_figure_10.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BENCHMARKS="xsbench gups svm redis btree graph500 memcached canneal" 4 | CONFIGS="2MBTHP-F TRIDENT-F" #HAWKEYE-F 5 | # -- For HAWKEYE-F, boot system with HawkEye and uncomment the following line 6 | #CONFIGS="HAWKEYE-F" 7 | 8 | SCRIPTS=$(dirname `readlink -f "$0"`) 9 | ROOT="$(dirname "$SCRIPTS")" 10 | source $SCRIPTS/common.sh 11 | source $SCRIPTS/configs.sh 12 | 13 | for BENCHMARK in $BENCHMARKS; do 14 | for CONFIG in $CONFIGS; do 15 | cleanup_system_configs 16 | setup_4kb_configs 17 | fragment_memory 18 | prepare_args 19 | prepare_system_configs 20 | prepare_paths 21 | launch_workload 22 | done 23 | done 24 | -------------------------------------------------------------------------------- /scripts/run_figure_11.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BENCHMARKS="xsbench gups svm redis btree graph500 memcached canneal" 4 | #CONFIGS="2MBTHP TRIDENT TRIDENT-1G TRIDENT-NC TRIDENT-1G-F TRIDENT-NC-F" 5 | # -- Better to re-use 2MBTHP and TRIDENT from Figure-9 6 | CONFIGS="TRIDENT-1G TRIDENT-NC TRIDENT-1G-F TRIDENT-NC-F" 7 | 8 | SCRIPTS=$(dirname `readlink -f "$0"`) 9 | ROOT="$(dirname "$SCRIPTS")" 10 | source $SCRIPTS/common.sh 11 | source $SCRIPTS/configs.sh 12 | 13 | for BENCHMARK in $BENCHMARKS; do 14 | for CONFIG in $CONFIGS; do 15 | cleanup_system_configs 16 | setup_4kb_configs 17 | fragment_memory 18 | prepare_args 19 | prepare_system_configs 20 | prepare_paths 21 | launch_workload 22 | done 23 | done 24 | -------------------------------------------------------------------------------- /scripts/run_figure_12.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BENCHMARKS="xsbench gups svm redis btree graph500 memcached canneal" 4 | CONFIGS="2MBTHP-2MBTHP TRIDENT-TRIDENT" #HAWKEYE-HAWKEYE 5 | # -- For HAWKEYE-HAWKEYE, boot system with HawkEye and uncomment the following line 6 | #CONFIGS="HAWKEYE-HAWKEYE" 7 | 8 | SCRIPTS=$(dirname `readlink -f "$0"`) 9 | ROOT="$(dirname "$SCRIPTS")" 10 | source $SCRIPTS/common.sh 11 | source $SCRIPTS/configs.sh 12 | 13 | for CONFIG in $CONFIGS; do 14 | cleanup_system_configs 15 | setup_4kb_configs 16 | drop_caches 17 | prepare_system_configs 18 | prepare_kvm_vm 19 | SRC=$SCRIPTS/run_guest.sh 20 | for BENCHMARK in $BENCHMARKS; do 21 | ssh $GUESTUSER@$GUESTIP "\"$SRC\" \"$BENCHMARK\" \"$CONFIG\"" 22 | done 23 | done 24 | -------------------------------------------------------------------------------- /scripts/run_figure_13.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BENCHMARKS="xsbench gups svm redis btree graph500 memcached canneal" 4 | CONFIGS="2MBTHP-2MBTHP-F TRIDENT-TRIDENT-F TRIDENTPV-TRIDENTPV-F" 5 | 6 | SCRIPTS=$(dirname `readlink -f "$0"`) 7 | ROOT="$(dirname "$SCRIPTS")" 8 | source $SCRIPTS/common.sh 9 | source $SCRIPTS/configs.sh 10 | 11 | for CONFIG in $CONFIGS; do 12 | cleanup_system_configs 13 | setup_4kb_configs 14 | drop_caches 15 | prepare_system_configs 16 | prepare_kvm_vm 17 | SRC=$SCRIPTS/run_guest.sh 18 | for BENCHMARK in $BENCHMARKS; do 19 | ssh $GUESTUSER@$GUESTIP "\"$SRC\" \"$BENCHMARK\" \"$CONFIG\"" 20 | done 21 | done 22 | -------------------------------------------------------------------------------- /scripts/run_figure_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BENCHMARKS="xsbench gups svm redis btree graph500 memcached canneal pr cc bc cg" 4 | CONFIGS="4KB-4KB 2MBHUGE-2MBHUGE" #1GBHUGE-1GBHUGE 5 | # For 1GBHUGE-1GBHUGE, boot host kernel with command-line parameter "default_hugepagesz=1G" 6 | # and uncomment the following line 7 | #CONFIGS="1GBHUGE-1GBHUGE" 8 | 9 | SCRIPTS=$(dirname `readlink -f "$0"`) 10 | ROOT="$(dirname "$SCRIPTS")" 11 | source $SCRIPTS/common.sh 12 | source $SCRIPTS/configs.sh 13 | 14 | for CONFIG in $CONFIGS; do 15 | cleanup_system_configs 16 | setup_4kb_configs 17 | drop_caches 18 | prepare_system_configs 19 | prepare_kvm_vm 20 | SRC=$SCRIPTS/run_guest.sh 21 | for BENCHMARK in $BENCHMARKS; do 22 | ssh $GUESTUSER@$GUESTIP "\"$SRC\" \"$BENCHMARK\" \"$CONFIG\"" 23 | done 24 | done 25 | -------------------------------------------------------------------------------- /scripts/run_figure_9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BENCHMARKS="xsbench gups svm redis btree graph500 memcached canneal" 4 | #CONFIGS="2MBTHP TRIDENT" #HAWKEYE 5 | # -- Better to re-use 2MBTHP from Figure-1 6 | CONFIGS="TRIDENT" 7 | # -- For HAWKEYE, boot system with HawkEye and uncomment the following line 8 | #CONFIGS="HAWKEYE" 9 | 10 | SCRIPTS=$(dirname `readlink -f "$0"`) 11 | ROOT="$(dirname "$SCRIPTS")" 12 | source $SCRIPTS/common.sh 13 | source $SCRIPTS/configs.sh 14 | 15 | for BENCHMARK in $BENCHMARKS; do 16 | for CONFIG in $CONFIGS; do 17 | cleanup_system_configs 18 | setup_4kb_configs 19 | drop_caches 20 | prepare_args 21 | prepare_system_configs 22 | prepare_paths 23 | launch_workload 24 | done 25 | done 26 | -------------------------------------------------------------------------------- /scripts/run_guest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BENCHMARK=$1 4 | CONFIG=$2 5 | if [ $# -ne 2 ]; then 6 | echo "Supply benchmark name and config." 7 | exit 8 | fi 9 | 10 | SCRIPTS=$(dirname `readlink -f "$0"`) 11 | ROOT="$(dirname "$SCRIPTS")" 12 | source $SCRIPTS/common.sh 13 | source $SCRIPTS/configs.sh 14 | 15 | cleanup_system_configs 16 | setup_4kb_configs # --- setup everything with normal system config 17 | fragment_memory 18 | prepare_args 19 | prepare_system_configs 20 | prepare_paths 21 | launch_workload 22 | cleanup_system_configs 23 | -------------------------------------------------------------------------------- /trident-workloads/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.o-omp 3 | *.a 4 | *.so 5 | *.o-mt 6 | *.o-omp-omp 7 | -------------------------------------------------------------------------------- /trident-workloads/README.md: -------------------------------------------------------------------------------- 1 | Workloads for Trident MICRO'21 Artifact Evaluation 2 | =================================================== 3 | -------------------------------------------------------------------------------- /trident-workloads/bin/.gitignore: -------------------------------------------------------------------------------- 1 | bench_* 2 | *_dump 3 | *_mt 4 | *_st -------------------------------------------------------------------------------- /trident-workloads/btree/Makefile: -------------------------------------------------------------------------------- 1 | program = BTree 2 | source = btree1.c 3 | obj = $(source:.c=.o) 4 | objomp = $(source:.c=.o-omp) 5 | 6 | # Standard Flags 7 | CFLAGS := -std=gnu99 -Wall -O3 8 | 9 | # compiler 10 | CC = gcc 11 | 12 | 13 | $(program): $(obj) Makefile 14 | $(CC) $(CFLAGS) $(obj) -o $@ $(LDFLAGS) 15 | 16 | libbtree.a: $(obj) Makefile 17 | ar rcs $@ $(obj) 18 | 19 | libbtreeomp.a: $(objomp) Makefile 20 | ar rcs $@ $(objomp) 21 | 22 | %.o: %.c Makefile 23 | $(CC) $(CFLAGS) -c $< -o $@ 24 | 25 | %.o-omp: %.c Makefile 26 | $(CC) $(CFLAGS) -fopenmp -c $< -o $@ 27 | 28 | clean: 29 | rm -rf $(program) $(obj) 30 | rm -f *.a 31 | rm -f *.o-omp 32 | -------------------------------------------------------------------------------- /trident-workloads/canneal/.gitignore: -------------------------------------------------------------------------------- 1 | canneal -------------------------------------------------------------------------------- /trident-workloads/canneal/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007 Princeton University 2 | All rights reserved. 3 | Authors: Daniel Schwartz-Narbonne 4 | Christian Bienia 5 | -------------------------------------------------------------------------------- /trident-workloads/canneal/LICENSE: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 2 | 3 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 4 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 5 | 6 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 10 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 11 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 12 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 13 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 14 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 15 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 16 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17 | -------------------------------------------------------------------------------- /trident-workloads/canneal/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for parallel simulated annealer 2 | 3 | PREFIX=${PARSECDIR}/pkgs/kernels/canneal/inst/${PARSECPLAT} 4 | 5 | TARGET=canneal 6 | LIBS:=$(LIBS) -lm 7 | 8 | 9 | CXXFLAGS=-msse3 -O3 -march=native 10 | 11 | ifdef version 12 | ifeq "$(version)" "pthreads" 13 | CXXFLAGS+=-DENABLE_THREADS -pthread 14 | endif 15 | endif 16 | 17 | all: 18 | $(CXX) $(CXXFLAGS) annealer_thread.cpp -c -o annealer_thread.o 19 | $(CXX) $(CXXFLAGS) rng.cpp -c -o rng.o 20 | $(CXX) $(CXXFLAGS) netlist.cpp -c -o netlist.o 21 | $(CXX) $(CXXFLAGS) main.cpp -c -o main.o 22 | $(CXX) $(CXXFLAGS) netlist_elem.cpp -c -o netlist_elem.o 23 | 24 | $(CXX) $(CXXFLAGS) -DENABLE_THREADS -pthread annealer_thread.cpp -c -o annealer_thread.o-mt 25 | $(CXX) $(CXXFLAGS) -DENABLE_THREADS -pthread rng.cpp -c -o rng.o-mt 26 | $(CXX) $(CXXFLAGS) -DENABLE_THREADS -pthread netlist.cpp -c -o netlist.o-mt 27 | $(CXX) $(CXXFLAGS) -DENABLE_THREADS -pthread main.cpp -c -o main.o-mt 28 | $(CXX) $(CXXFLAGS) -DENABLE_THREADS -pthread netlist_elem.cpp -c -o netlist_elem.o-mt 29 | 30 | $(CXX) $(CXXFLAGS) $(LDFLAGS) *.o $(LIBS) -o $(TARGET) 31 | 32 | ar rcs libcanneal.a *.o 33 | ar rcs libcannealmt.a *.o-mt 34 | 35 | clean: 36 | rm -f *.o $(TARGET) 37 | rm -f *.a 38 | rm -f *.o-mt 39 | 40 | install: 41 | mkdir -p $(PREFIX)/bin 42 | cp -f $(TARGET) $(PREFIX)/bin/$(TARGET) 43 | 44 | -------------------------------------------------------------------------------- /trident-workloads/canneal/annealer_thread.h: -------------------------------------------------------------------------------- 1 | // annealer_thread.h 2 | // 3 | // Created by Daniel Schwartz-Narbonne on 14/04/07. 4 | // Modified by Christian Bienia 5 | // 6 | // Copyright 2007-2008 Princeton University 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without 10 | // modification, are permitted provided that the following conditions 11 | // are met: 12 | // 1. Redistributions of source code must retain the above copyright 13 | // notice, this list of conditions and the following disclaimer. 14 | // 2. Redistributions in binary form must reproduce the above copyright 15 | // notice, this list of conditions and the following disclaimer in the 16 | // documentation and/or other materials provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | // SUCH DAMAGE. 29 | 30 | 31 | #ifndef ANNEALER_THREAD_H 32 | #define ANNEALER_THREAD_H 33 | 34 | #ifdef ENABLE_THREADS 35 | #include 36 | #endif 37 | 38 | #include 39 | 40 | #include "annealer_types.h" 41 | #include "netlist.h" 42 | #include "netlist_elem.h" 43 | #include "rng.h" 44 | 45 | class annealer_thread 46 | { 47 | public: 48 | enum move_decision_t{ 49 | move_decision_accepted_good, 50 | move_decision_accepted_bad, 51 | move_decision_rejected 52 | }; 53 | 54 | annealer_thread( 55 | netlist* netlist, 56 | int nthreads, 57 | int swaps_per_temp, 58 | int start_temp, 59 | int number_temp_steps 60 | ) 61 | :_netlist(netlist), 62 | _keep_going_global_flag(true), 63 | _moves_per_thread_temp(swaps_per_temp/nthreads), 64 | _start_temp(start_temp), 65 | _number_temp_steps(number_temp_steps) 66 | { 67 | assert(_netlist != NULL); 68 | #ifdef ENABLE_THREADS 69 | pthread_barrier_init(&_barrier, NULL, nthreads); 70 | #endif 71 | }; 72 | 73 | ~annealer_thread() { 74 | #ifdef ENABLE_THREADS 75 | pthread_barrier_destroy(&_barrier); 76 | #endif 77 | } 78 | void Run(); 79 | 80 | protected: 81 | move_decision_t accept_move(routing_cost_t delta_cost, double T, Rng* rng); 82 | routing_cost_t calculate_delta_routing_cost(netlist_elem* a, netlist_elem* b); 83 | bool keep_going(int temp_steps_completed, int accepted_good_moves, int accepted_bad_moves); 84 | 85 | protected: 86 | netlist* _netlist; 87 | bool _keep_going_global_flag; 88 | int _moves_per_thread_temp; 89 | int _start_temp; 90 | int _number_temp_steps; 91 | #ifdef ENABLE_THREADS 92 | pthread_barrier_t _barrier; 93 | #endif 94 | }; 95 | 96 | #endif 97 | 98 | -------------------------------------------------------------------------------- /trident-workloads/canneal/annealer_types.h: -------------------------------------------------------------------------------- 1 | // annealer_types.h 2 | // 3 | // Created by Daniel Schwartz-Narbonne on 13/04/07. 4 | // 5 | // Copyright 2007 Princeton University 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions 10 | // are met: 11 | // 1. Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // 2. Redistributions in binary form must reproduce the above copyright 14 | // notice, this list of conditions and the following disclaimer in the 15 | // documentation and/or other materials provided with the distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | // SUCH DAMAGE. 28 | 29 | 30 | #ifndef ALLEALER_TYPES_H 31 | #define ALLEALER_TYPES_H 32 | 33 | typedef double routing_cost_t; 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /trident-workloads/canneal/atomic/atomic.h: -------------------------------------------------------------------------------- 1 | #ifndef _ATOMIC_H_ 2 | #define _ATOMIC_H_ 3 | 4 | #include 5 | 6 | /* Define several macros which we need */ 7 | #ifndef __STRING 8 | #define __STRING(x) #x /* stringify without expanding x */ 9 | #endif 10 | 11 | #ifndef __XSTRING 12 | #define __XSTRING(x) __STRING(x) /* expand x, then stringify */ 13 | #endif 14 | 15 | #define u_char unsigned char 16 | #define u_short unsigned short 17 | #define u_int unsigned int 18 | #define u_long unsigned long 19 | 20 | 21 | /* Note: The header files were taken from the source of the BSD kernel. More architectures than listed below are supported by BSD. To add another atomic.h for an architecture ${ARCH}, simply copy the atomic.h file which is located in the sys/${ARCH}/include directory of the kernel source tree. You'll also need any files from that directory on which atomic.h depends, and you'll probably have to slightly adapt the files. */ 22 | 23 | /* Include the correct atomic.h header file for this machine */ 24 | 25 | #if defined(__i386__) || defined(__i386) || defined(i386) || defined(__I386__) 26 | # include "i386/atomic.h" 27 | #elif defined(__amd64__) || defined(__amd64) || defined(amd64) || defined(__AMD64__) 28 | # include "amd64/atomic.h" 29 | #elif defined(__powerpc__) || defined(__powerpc) || defined(powerpc) || defined(__POWERPC__) 30 | # include "powerpc/atomic.h" 31 | #elif defined(__sparc__) || defined(__sparc) || defined(sparc) || defined(__SPARC__) 32 | # include "sparc/atomic.h" 33 | #elif defined(__ia64__) || defined(__ia64) || defined(ia64) || defined(__IA64__) 34 | # include "ia64/atomic.h" 35 | #elif defined(__alpha__) || defined(__alpha) || defined(alpha) || defined(__ALPHA__) 36 | # include "alpha/atomic.h" 37 | #else 38 | # error Architecture not supported by atomic.h 39 | #endif 40 | 41 | #endif /* _ATOMIC_H_ */ 42 | -------------------------------------------------------------------------------- /trident-workloads/canneal/atomic/sparc/cpufunc.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 Jake Burkholder. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: src/sys/sparc64/include/cpufunc.h,v 1.20.2.1 2005/08/05 19:46:13 jhb Exp $ 27 | */ 28 | 29 | #ifndef _MACHINE_CPUFUNC_H_ 30 | #define _MACHINE_CPUFUNC_H_ 31 | 32 | #include "asi.h" 33 | 34 | /* 35 | * membar operand macros for use in other macros when # is a special 36 | * character. Keep these in sync with what the hardware expects. 37 | */ 38 | #define C_Lookaside (0) 39 | #define C_MemIssue (1) 40 | #define C_Sync (2) 41 | #define M_LoadLoad (0) 42 | #define M_StoreLoad (1) 43 | #define M_LoadStore (2) 44 | #define M_StoreStore (3) 45 | 46 | #define CMASK_SHIFT (4) 47 | #define MMASK_SHIFT (0) 48 | 49 | #define CMASK_GEN(bit) ((1 << (bit)) << CMASK_SHIFT) 50 | #define MMASK_GEN(bit) ((1 << (bit)) << MMASK_SHIFT) 51 | 52 | #define Lookaside CMASK_GEN(C_Lookaside) 53 | #define MemIssue CMASK_GEN(C_MemIssue) 54 | #define Sync CMASK_GEN(C_Sync) 55 | #define LoadLoad MMASK_GEN(M_LoadLoad) 56 | #define StoreLoad MMASK_GEN(M_StoreLoad) 57 | #define LoadStore MMASK_GEN(M_LoadStore) 58 | #define StoreStore MMASK_GEN(M_StoreStore) 59 | 60 | #define casa(rs1, rs2, rd, asi) ({ \ 61 | u_int __rd = (uint32_t)(rd); \ 62 | __asm __volatile("casa [%2] %3, %4, %0" \ 63 | : "+r" (__rd), "=m" (*rs1) \ 64 | : "r" (rs1), "n" (asi), "r" (rs2), "m" (*rs1)); \ 65 | __rd; \ 66 | }) 67 | 68 | #define casxa(rs1, rs2, rd, asi) ({ \ 69 | u_long __rd = (uint64_t)(rd); \ 70 | __asm __volatile("casxa [%2] %3, %4, %0" \ 71 | : "+r" (__rd), "=m" (*rs1) \ 72 | : "r" (rs1), "n" (asi), "r" (rs2), "m" (*rs1)); \ 73 | __rd; \ 74 | }) 75 | 76 | #define membar(mask) do { \ 77 | __asm __volatile("membar %0" : : "n" (mask) : "memory"); \ 78 | } while (0) 79 | 80 | #undef LDNC_GEN 81 | #undef STNC_GEN 82 | 83 | #endif /* !_MACHINE_CPUFUNC_H_ */ 84 | -------------------------------------------------------------------------------- /trident-workloads/canneal/location_t.h: -------------------------------------------------------------------------------- 1 | // location_t.h 2 | // 3 | // Created by Daniel Schwartz-Narbonne on 14/04/07. 4 | // 5 | // Copyright 2007 Princeton University 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions 10 | // are met: 11 | // 1. Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // 2. Redistributions in binary form must reproduce the above copyright 14 | // notice, this list of conditions and the following disclaimer in the 15 | // documentation and/or other materials provided with the distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | // SUCH DAMAGE. 28 | 29 | 30 | #ifndef LOCATION_T_H 31 | #define LOCATION_T_H 32 | 33 | class location_t { 34 | public: 35 | int x; 36 | int y; 37 | }; 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /trident-workloads/canneal/netlist.h: -------------------------------------------------------------------------------- 1 | // netlist.h 2 | // 3 | // Created by Daniel Schwartz-Narbonne on 14/04/07. 4 | // 5 | // Copyright 2007 Princeton University 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions 10 | // are met: 11 | // 1. Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // 2. Redistributions in binary form must reproduce the above copyright 14 | // notice, this list of conditions and the following disclaimer in the 15 | // documentation and/or other materials provided with the distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | // SUCH DAMAGE. 28 | 29 | 30 | #ifndef NETLIST_H 31 | #define NETLIST_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #include "annealer_types.h" 38 | 39 | const long NO_MATCHING_ELEMENT = -1; 40 | 41 | class netlist_elem; 42 | class location_t; 43 | class Rng; 44 | 45 | class netlist 46 | { 47 | public: 48 | netlist(const std::string& filename); //ctor 49 | void get_random_pair(netlist_elem** a, netlist_elem** b, Rng* rng); // will return an element that we have a valid mutex on 50 | void swap_locations(netlist_elem* elem_a, netlist_elem* elem_b); 51 | void shuffle(Rng* rng); 52 | netlist_elem* netlist_elem_from_loc(location_t& loc); 53 | netlist_elem* netlist_elem_from_name(std::string& name); 54 | routing_cost_t total_routing_cost(); 55 | void print_locations(const std::string& filename); 56 | void release(netlist_elem* elem); 57 | netlist_elem* get_random_element(long* elem_id, long different_from, Rng* rng); 58 | 59 | protected: 60 | unsigned _num_elements; 61 | unsigned _max_x; 62 | unsigned _max_y; 63 | unsigned _chip_size; 64 | std::vector _elements;//store the actual elements here 65 | std::vector< std::vector > _locations;//store the actual locations here 66 | std::map _elem_names; 67 | netlist_elem* create_elem_if_necessary(std::string& name); 68 | //due to the pointers, perhaps I should make the copy operator protected to prevent copying 69 | }; 70 | 71 | 72 | 73 | #endif 74 | 75 | -------------------------------------------------------------------------------- /trident-workloads/canneal/netlist_elem.h: -------------------------------------------------------------------------------- 1 | // netlist_elem.h 2 | // 3 | // Created by Daniel Schwartz-Narbonne on 14/04/07. 4 | // 5 | // Copyright 2007 Princeton University 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions 10 | // are met: 11 | // 1. Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // 2. Redistributions in binary form must reproduce the above copyright 14 | // notice, this list of conditions and the following disclaimer in the 15 | // documentation and/or other materials provided with the distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | // SUCH DAMAGE. 28 | 29 | 30 | #ifndef NETLIST_ELEM_H 31 | #define NETLIST_ELEM_H 32 | 33 | #include 34 | #include 35 | 36 | #include "AtomicPtr.h" 37 | #include "location_t.h" 38 | #include "annealer_types.h" 39 | 40 | using threads::AtomicPtr; 41 | 42 | class netlist_elem{ 43 | public: 44 | netlist_elem(); 45 | routing_cost_t routing_cost_given_loc(location_t loc); 46 | routing_cost_t swap_cost(location_t* old_loc, location_t* new_loc); 47 | 48 | public: 49 | std::string item_name; 50 | std::vector fanin; 51 | std::vector fanout; 52 | AtomicPtr present_loc; 53 | 54 | protected: 55 | //char padding[64*1024]; 56 | }; 57 | 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /trident-workloads/canneal/rng.cpp: -------------------------------------------------------------------------------- 1 | // rng.cpp 2 | // 3 | // Created by Daniel Schwartz-Narbonne on 25/04/07. 4 | // 5 | // Copyright 2007 Princeton University 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions 10 | // are met: 11 | // 1. Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // 2. Redistributions in binary form must reproduce the above copyright 14 | // notice, this list of conditions and the following disclaimer in the 15 | // documentation and/or other materials provided with the distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | // SUCH DAMAGE. 28 | 29 | 30 | #include "rng.h" 31 | #include 32 | #include 33 | 34 | //global seed used for rng initialization 35 | unsigned int Rng::seed = 0; 36 | #ifdef ENABLE_THREADS 37 | pthread_mutex_t Rng::seed_lock = PTHREAD_MUTEX_INITIALIZER; 38 | #endif 39 | 40 | //actually declare the static member of the class. C++ can be ugly sometimes 41 | 42 | long Rng::rand(int max) 43 | { 44 | return _rng->randInt(max-1);//need to round off to keep BELOW max! 45 | } 46 | 47 | 48 | long Rng::rand() 49 | { 50 | return _rng->randInt(); 51 | } 52 | 53 | double Rng::drand() 54 | { 55 | return _rng->rand(); 56 | } 57 | 58 | -------------------------------------------------------------------------------- /trident-workloads/canneal/rng.h: -------------------------------------------------------------------------------- 1 | // rng.h 2 | // 3 | // Created by Daniel Schwartz-Narbonne on 25/04/07. 4 | // 5 | // Copyright 2007 Princeton University 6 | // All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without 9 | // modification, are permitted provided that the following conditions 10 | // are met: 11 | // 1. Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // 2. Redistributions in binary form must reproduce the above copyright 14 | // notice, this list of conditions and the following disclaimer in the 15 | // documentation and/or other materials provided with the distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | // SUCH DAMAGE. 28 | 29 | 30 | #ifndef RNG_H 31 | #define RNG_H 32 | 33 | #include 34 | 35 | #ifdef ENABLE_THREADS 36 | #include 37 | #endif 38 | 39 | #include "MersenneTwister.h" 40 | 41 | class Rng 42 | { 43 | public: 44 | Rng() { 45 | #ifdef ENABLE_THREADS 46 | pthread_mutex_lock(&seed_lock); 47 | _rng = new MTRand(seed++); 48 | pthread_mutex_unlock(&seed_lock); 49 | #else 50 | _rng = new MTRand(seed++); 51 | #endif //ENABLE_THREADS 52 | } 53 | ~Rng() { 54 | delete _rng; 55 | } 56 | long rand(); 57 | long rand(int max); 58 | double drand(); 59 | protected: 60 | //use same random seed for each run 61 | static unsigned int seed; 62 | static pthread_mutex_t seed_lock; 63 | MTRand *_rng; 64 | }; 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/.gitignore: -------------------------------------------------------------------------------- 1 | bc 2 | bfs 3 | cc 4 | converter 5 | pr 6 | sssp 7 | tc 8 | 9 | test/out/*.out 10 | 11 | benchmark/out/*.out 12 | benchmark/graphs/*.sg 13 | benchmark/graphs/*.wsg 14 | benchmark/graphs/raw/* 15 | *.a 16 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | cache: apt 3 | matrix: 4 | include: 5 | - compiler: gcc 6 | addons: 7 | apt: 8 | sources: 9 | - ubuntu-toolchain-r-test 10 | packages: 11 | - g++-4.7 12 | env: CXX=g++-4.7 13 | - compiler: clang 14 | addons: 15 | apt: 16 | sources: 17 | - ubuntu-toolchain-r-test 18 | - llvm-toolchain-precise-3.7 19 | packages: 20 | - clang-3.7 21 | env: CXX=clang++-3.7 SERIAL=1 22 | script: 23 | - make -j 24 | - make -j test 25 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Ways to Contribute 2 | ================= 3 | 4 | We appreciate contributions from the community! Some of the ways to contribute are: 5 | + Bug fixes, whether they be for performance or correctness 6 | + Support for additional input formats 7 | + Additional kernel implementations 8 | 9 | Although the GAP Benchmark Suite only specifies 6 graph kernels, we are open to adding more non-benchmark kernels to this repo. It is our goal to provide a set of portable high-performance baselines, so naturally there are plenty of remaining graph problems (e.g. MST, SCC, ALS, etc...). 10 | 11 | For code contributions, please focus on code simplicity and readability. This repo follows nearly all of the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html). If you open a pull request, our continuous-integration service run by Travis will do an immediate sanity-check. 12 | 13 | Before embarking on a large development task, feel to open an issue or email (sbeamer@lbl.gov) to ensure you are on a profitable path. 14 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, The Regents of the University of California (Regents). 2 | All Rights Reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 1. Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | 2. Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | 3. Neither the name of the Regents nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL REGENTS BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/Makefile: -------------------------------------------------------------------------------- 1 | # See LICENSE.txt for license details. 2 | 3 | CXX_FLAGS += -std=c++11 -O3 -Wall 4 | PAR_FLAG = -fopenmp 5 | 6 | ifneq (,$(findstring icpc,$(CXX))) 7 | PAR_FLAG = -openmp 8 | endif 9 | 10 | ifneq (,$(findstring sunCC,$(CXX))) 11 | CXX_FLAGS = -std=c++11 -xO3 -m64 -xtarget=native 12 | PAR_FLAG = -xopenmp 13 | endif 14 | 15 | ifneq ($(SERIAL), 1) 16 | CXX_FLAGS += $(PAR_FLAG) 17 | endif 18 | 19 | KERNELS = bc bfs cc cc_sv pr sssp tc 20 | SUITE = $(KERNELS) converter 21 | 22 | .PHONY: all 23 | all: $(SUITE) 24 | 25 | % : src/%.cc src/*.h 26 | $(CXX) $(CXX_FLAGS) $< -o $@ 27 | 28 | libpagerank.a : src/pr.cc src/*.h 29 | $(CXX) $(CXX_FLAGS) -c src/pr.cc -o src/pr.o 30 | ar rcv libpagerank.a src/pr.o 31 | 32 | # Testing 33 | include test/test.mk 34 | 35 | # Benchmark Automation 36 | include benchmark/bench.mk 37 | 38 | 39 | .PHONY: clean 40 | clean: 41 | rm -f *.a 42 | rm -f $(SUITE) test/out/* 43 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/src/benchmark.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, The Regents of the University of California (Regents) 2 | // See LICENSE.txt for license details 3 | 4 | #ifndef BENCHMARK_H_ 5 | #define BENCHMARK_H_ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "builder.h" 15 | #include "graph.h" 16 | #include "timer.h" 17 | #include "util.h" 18 | #include "writer.h" 19 | 20 | #define CONFIG_SHM_FILE_NAME "/tmp/alloctest-bench" 21 | 22 | /* 23 | GAP Benchmark Suite 24 | File: Benchmark 25 | Author: Scott Beamer 26 | 27 | Various helper functions to ease writing of kernels 28 | */ 29 | 30 | 31 | // Default type signatures for commonly used types 32 | typedef int64_t NodeID; 33 | typedef int64_t WeightT; 34 | typedef NodeWeight WNode; 35 | 36 | typedef CSRGraph Graph; 37 | typedef CSRGraph WGraph; 38 | 39 | typedef BuilderBase Builder; 40 | typedef BuilderBase WeightedBuilder; 41 | 42 | typedef WriterBase Writer; 43 | typedef WriterBase WeightedWriter; 44 | 45 | 46 | // Used to pick random non-zero degree starting points for search algorithms 47 | template 48 | class SourcePicker { 49 | public: 50 | explicit SourcePicker(const GraphT_ &g, NodeID given_source = -1) 51 | : given_source(given_source), rng(kRandSeed), udist(0, g.num_nodes()-1), 52 | g_(g) {} 53 | 54 | NodeID PickNext() { 55 | if (given_source != -1) 56 | return given_source; 57 | NodeID source; 58 | do { 59 | source = udist(rng); 60 | } while (g_.out_degree(source) == 0); 61 | return source; 62 | } 63 | 64 | private: 65 | NodeID given_source; 66 | std::mt19937 rng; 67 | std::uniform_int_distribution udist; 68 | const GraphT_ &g_; 69 | }; 70 | 71 | 72 | // Returns k pairs with largest values from list of key-value pairs 73 | template 74 | std::vector> TopK( 75 | const std::vector> &to_sort, size_t k) { 76 | std::vector> top_k; 77 | ValT min_so_far = 0; 78 | for (auto kvp : to_sort) { 79 | if ((top_k.size() < k) || (kvp.second > min_so_far)) { 80 | top_k.push_back(std::make_pair(kvp.second, kvp.first)); 81 | std::sort(top_k.begin(), top_k.end(), 82 | std::greater>()); 83 | if (top_k.size() > k) 84 | top_k.resize(k); 85 | min_so_far = top_k.back().first; 86 | } 87 | } 88 | return top_k; 89 | } 90 | 91 | 92 | bool VerifyUnimplemented(...) { 93 | std::cout << "** verify unimplemented **" << std::endl; 94 | return false; 95 | } 96 | 97 | 98 | // Calls (and times) kernel according to command line arguments 99 | template 101 | void BenchmarkKernel(const CLApp &cli, const GraphT_ &g, 102 | GraphFunc kernel, AnalysisFunc stats, 103 | VerifierFunc verify) { 104 | g.PrintStats(); 105 | double total_seconds = 0; 106 | Timer trial_timer; 107 | for (int iter=0; iter < cli.num_trials(); iter++) { 108 | trial_timer.Start(); 109 | auto result = kernel(g); 110 | trial_timer.Stop(); 111 | PrintTime("Trial Time", trial_timer.Seconds()); 112 | total_seconds += trial_timer.Seconds(); 113 | if (cli.do_analysis() && (iter == (cli.num_trials()-1))) 114 | stats(g, result); 115 | if (cli.do_verify()) { 116 | trial_timer.Start(); 117 | PrintLabel("Verification", 118 | verify(std::ref(g), std::ref(result)) ? "PASS" : "FAIL"); 119 | trial_timer.Stop(); 120 | PrintTime("Verification Time", trial_timer.Seconds()); 121 | } 122 | } 123 | FILE *fd2 = fopen(CONFIG_SHM_FILE_NAME ".done", "w"); 124 | if (fd2 == NULL) { 125 | fprintf (stderr, "ERROR: could not create the shared memory file descriptor\n"); 126 | exit(-1); 127 | } 128 | 129 | PrintTime("Average Time", total_seconds / cli.num_trials()); 130 | } 131 | 132 | #endif // BENCHMARK_H_ 133 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/src/bitmap.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, The Regents of the University of California (Regents) 2 | // See LICENSE.txt for license details 3 | 4 | #ifndef BITMAP_H_ 5 | #define BITMAP_H_ 6 | 7 | #include 8 | #include 9 | 10 | #include "platform_atomics.h" 11 | 12 | 13 | /* 14 | GAP Benchmark Suite 15 | Class: Bitmap 16 | Author: Scott Beamer 17 | 18 | Parallel bitmap that is thread-safe 19 | - Can set bits in parallel (set_bit_atomic) unlike std::vector 20 | */ 21 | 22 | 23 | class Bitmap { 24 | public: 25 | explicit Bitmap(size_t size) { 26 | uint64_t num_words = (size + kBitsPerWord - 1) / kBitsPerWord; 27 | start_ = new uint64_t[num_words]; 28 | end_ = start_ + num_words; 29 | } 30 | 31 | ~Bitmap() { 32 | delete[] start_; 33 | } 34 | 35 | void reset() { 36 | std::fill(start_, end_, 0); 37 | } 38 | 39 | void set_bit(size_t pos) { 40 | start_[word_offset(pos)] |= ((uint64_t) 1l << bit_offset(pos)); 41 | } 42 | 43 | void set_bit_atomic(size_t pos) { 44 | uint64_t old_val, new_val; 45 | do { 46 | old_val = start_[word_offset(pos)]; 47 | new_val = old_val | ((uint64_t) 1l << bit_offset(pos)); 48 | } while (!compare_and_swap(start_[word_offset(pos)], old_val, new_val)); 49 | } 50 | 51 | bool get_bit(size_t pos) const { 52 | return (start_[word_offset(pos)] >> bit_offset(pos)) & 1l; 53 | } 54 | 55 | void swap(Bitmap &other) { 56 | std::swap(start_, other.start_); 57 | std::swap(end_, other.end_); 58 | } 59 | 60 | private: 61 | uint64_t *start_; 62 | uint64_t *end_; 63 | 64 | static const uint64_t kBitsPerWord = 64; 65 | static uint64_t word_offset(size_t n) { return n / kBitsPerWord; } 66 | static uint64_t bit_offset(size_t n) { return n & (kBitsPerWord - 1); } 67 | }; 68 | 69 | #endif // BITMAP_H_ 70 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/src/converter.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, The Regents of the University of California (Regents) 2 | // See LICENSE.txt for license details 3 | 4 | #include 5 | 6 | #include "benchmark.h" 7 | #include "builder.h" 8 | #include "command_line.h" 9 | #include "graph.h" 10 | #include "reader.h" 11 | #include "writer.h" 12 | 13 | using namespace std; 14 | 15 | int main(int argc, char* argv[]) { 16 | CLConvert cli(argc, argv, "converter"); 17 | cli.ParseArgs(); 18 | if (cli.out_weighted()) { 19 | WeightedBuilder bw(cli); 20 | WGraph wg = bw.MakeGraph(); 21 | wg.PrintStats(); 22 | WeightedWriter ww(wg); 23 | ww.WriteGraph(cli.out_filename(), cli.out_sg()); 24 | } else { 25 | Builder b(cli); 26 | Graph g = b.MakeGraph(); 27 | g.PrintStats(); 28 | Writer w(g); 29 | w.WriteGraph(cli.out_filename(), cli.out_sg()); 30 | } 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/src/pvector.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, The Regents of the University of California (Regents) 2 | // See LICENSE.txt for license details 3 | 4 | #ifndef PVECTOR_H_ 5 | #define PVECTOR_H_ 6 | 7 | #include 8 | 9 | 10 | /* 11 | GAP Benchmark Suite 12 | Class: pvector 13 | Author: Scott Beamer 14 | 15 | Vector class with ability to not initialize or do initialize in parallel 16 | - std::vector (when resizing) will always initialize, and does it serially 17 | - When pvector is resized, new elements are uninitialized 18 | - Resizing is not thread-safe 19 | */ 20 | 21 | 22 | template 23 | class pvector { 24 | public: 25 | typedef T_* iterator; 26 | 27 | pvector() : start_(nullptr), end_size_(nullptr), end_capacity_(nullptr) {} 28 | 29 | explicit pvector(size_t num_elements) { 30 | start_ = new T_[num_elements]; 31 | end_size_ = start_ + num_elements; 32 | end_capacity_ = end_size_; 33 | } 34 | 35 | pvector(size_t num_elements, T_ init_val) : pvector(num_elements) { 36 | fill(init_val); 37 | } 38 | 39 | pvector(iterator copy_begin, iterator copy_end) 40 | : pvector(copy_end - copy_begin) { 41 | #pragma omp parallel for 42 | for (size_t i=0; i < capacity(); i++) 43 | start_[i] = copy_begin[i]; 44 | } 45 | 46 | // don't want this to be copied, too much data to move 47 | pvector(const pvector &other) = delete; 48 | 49 | // prefer move because too much data to copy 50 | pvector(pvector &&other) 51 | : start_(other.start_), end_size_(other.end_size_), 52 | end_capacity_(other.end_capacity_) { 53 | other.start_ = nullptr; 54 | other.end_size_ = nullptr; 55 | other.end_capacity_ = nullptr; 56 | } 57 | 58 | // want move assignment 59 | pvector& operator= (pvector &&other) { 60 | start_ = other.start_; 61 | end_size_ = other.end_size_; 62 | end_capacity_ = other.end_capacity_; 63 | other.start_ = nullptr; 64 | other.end_size_ = nullptr; 65 | other.end_capacity_ = nullptr; 66 | return *this; 67 | } 68 | 69 | ~pvector() { 70 | if (start_ != nullptr) 71 | delete[] start_; 72 | } 73 | 74 | // not thread-safe 75 | void reserve(size_t num_elements) { 76 | if (num_elements > capacity()) { 77 | T_ *new_range = new T_[num_elements]; 78 | #pragma omp parallel for 79 | for (size_t i=0; i < size(); i++) 80 | new_range[i] = start_[i]; 81 | end_size_ = new_range + size(); 82 | delete[] start_; 83 | start_ = new_range; 84 | end_capacity_ = start_ + num_elements; 85 | } 86 | } 87 | 88 | bool empty() { 89 | return end_size_ == start_; 90 | } 91 | 92 | void clear() { 93 | end_size_ = start_; 94 | } 95 | 96 | void resize(size_t num_elements) { 97 | reserve(num_elements); 98 | end_size_ = start_ + num_elements; 99 | } 100 | 101 | T_& operator[](size_t n) { 102 | return start_[n]; 103 | } 104 | 105 | const T_& operator[](size_t n) const { 106 | return start_[n]; 107 | } 108 | 109 | void push_back(T_ val) { 110 | if (size() == capacity()) { 111 | size_t new_size = capacity() == 0 ? 1 : capacity() * growth_factor; 112 | reserve(new_size); 113 | } 114 | *end_size_ = val; 115 | end_size_++; 116 | } 117 | 118 | void fill(T_ init_val) { 119 | #pragma omp parallel for 120 | for (T_* ptr=start_; ptr < end_size_; ptr++) 121 | *ptr = init_val; 122 | } 123 | 124 | size_t capacity() const { 125 | return end_capacity_ - start_; 126 | } 127 | 128 | size_t size() const { 129 | return end_size_ - start_; 130 | } 131 | 132 | iterator begin() const { 133 | return start_; 134 | } 135 | 136 | iterator end() const { 137 | return end_size_; 138 | } 139 | 140 | T_* data() const { 141 | return start_; 142 | } 143 | 144 | void swap(pvector &other) { 145 | std::swap(start_, other.start_); 146 | std::swap(end_size_, other.end_size_); 147 | std::swap(end_capacity_, other.end_capacity_); 148 | } 149 | 150 | 151 | private: 152 | T_* start_; 153 | T_* end_size_; 154 | T_* end_capacity_; 155 | static const size_t growth_factor = 2; 156 | }; 157 | 158 | #endif // PVECTOR_H_ 159 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/src/sliding_queue.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, The Regents of the University of California (Regents) 2 | // See LICENSE.txt for license details 3 | 4 | #ifndef SLIDING_QUEUE_H_ 5 | #define SLIDING_QUEUE_H_ 6 | 7 | #include 8 | 9 | #include "platform_atomics.h" 10 | 11 | 12 | /* 13 | GAP Benchmark Suite 14 | Class: SlidingQueue 15 | Author: Scott Beamer 16 | 17 | Double-buffered queue so appends aren't seen until SlideWindow() called 18 | - Use QueueBuffer when used in parallel to avoid false sharing by doing 19 | bulk appends from thread-local storage 20 | */ 21 | 22 | 23 | template 24 | class QueueBuffer; 25 | 26 | template 27 | class SlidingQueue { 28 | T *shared; 29 | size_t shared_in; 30 | size_t shared_out_start; 31 | size_t shared_out_end; 32 | friend class QueueBuffer; 33 | 34 | public: 35 | explicit SlidingQueue(size_t shared_size) { 36 | shared = new T[shared_size]; 37 | reset(); 38 | } 39 | 40 | ~SlidingQueue() { 41 | delete[] shared; 42 | } 43 | 44 | void push_back(T to_add) { 45 | shared[shared_in++] = to_add; 46 | } 47 | 48 | bool empty() const { 49 | return shared_out_start == shared_out_end; 50 | } 51 | 52 | void reset() { 53 | shared_out_start = 0; 54 | shared_out_end = 0; 55 | shared_in = 0; 56 | } 57 | 58 | void slide_window() { 59 | shared_out_start = shared_out_end; 60 | shared_out_end = shared_in; 61 | } 62 | 63 | typedef T* iterator; 64 | 65 | iterator begin() const { 66 | return shared + shared_out_start; 67 | } 68 | 69 | iterator end() const { 70 | return shared + shared_out_end; 71 | } 72 | 73 | size_t size() const { 74 | return end() - begin(); 75 | } 76 | }; 77 | 78 | 79 | template 80 | class QueueBuffer { 81 | size_t in; 82 | T *local_queue; 83 | SlidingQueue &sq; 84 | const size_t local_size; 85 | 86 | public: 87 | explicit QueueBuffer(SlidingQueue &master, size_t given_size = 16384) 88 | : sq(master), local_size(given_size) { 89 | in = 0; 90 | local_queue = new T[local_size]; 91 | } 92 | 93 | ~QueueBuffer() { 94 | delete[] local_queue; 95 | } 96 | 97 | void push_back(T to_add) { 98 | if (in == local_size) 99 | flush(); 100 | local_queue[in++] = to_add; 101 | } 102 | 103 | void flush() { 104 | T *shared_queue = sq.shared; 105 | size_t copy_start = fetch_and_add(sq.shared_in, in); 106 | std::copy(local_queue, local_queue+in, shared_queue+copy_start); 107 | in = 0; 108 | } 109 | }; 110 | 111 | #endif // SLIDING_QUEUE_H_ 112 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/src/timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, The Regents of the University of California (Regents) 2 | // See LICENSE.txt for license details 3 | 4 | #ifndef TIMER_H_ 5 | #define TIMER_H_ 6 | 7 | #include 8 | 9 | 10 | /* 11 | GAP Benchmark Suite 12 | Class: Timer 13 | Authors: Scott Beamer, Michael Sutton 14 | 15 | Simple timer that wraps std::chrono 16 | */ 17 | 18 | class Timer { 19 | public: 20 | Timer() {} 21 | 22 | void Start() { 23 | elapsed_time_ = start_time_ = std::chrono::high_resolution_clock::now(); 24 | } 25 | 26 | void Stop() { 27 | elapsed_time_ = std::chrono::high_resolution_clock::now(); 28 | } 29 | 30 | double Seconds() const { 31 | return std::chrono::duration_cast>(elapsed_time_ - start_time_).count(); 32 | } 33 | 34 | double Millisecs() const { 35 | return std::chrono::duration_cast>(elapsed_time_ - start_time_).count(); 36 | } 37 | 38 | double Microsecs() const { 39 | return std::chrono::duration_cast>(elapsed_time_ - start_time_).count(); 40 | } 41 | 42 | private: 43 | std::chrono::high_resolution_clock::time_point start_time_, elapsed_time_; 44 | }; 45 | 46 | // Times op's execution using the timer t 47 | #define TIME_OP(t, op) { t.Start(); (op); t.Stop(); } 48 | 49 | #endif // TIMER_H_ 50 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/src/util.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, The Regents of the University of California (Regents) 2 | // See LICENSE.txt for license details 3 | 4 | #ifndef UTIL_H_ 5 | #define UTIL_H_ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include "timer.h" 12 | 13 | 14 | /* 15 | GAP Benchmark Suite 16 | Author: Scott Beamer 17 | 18 | Miscellaneous helpers that don't fit into classes 19 | */ 20 | 21 | 22 | static const int64_t kRandSeed = 27491095; 23 | 24 | 25 | void PrintLabel(const std::string &label, const std::string &val) { 26 | printf("%-21s%7s\n", (label + ":").c_str(), val.c_str()); 27 | } 28 | 29 | void PrintTime(const std::string &s, double seconds) { 30 | printf("%-21s%3.5lf\n", (s + ":").c_str(), seconds); 31 | } 32 | 33 | void PrintStep(const std::string &s, int64_t count) { 34 | printf("%-14s%14" PRId64 "\n", (s + ":").c_str(), count); 35 | } 36 | 37 | void PrintStep(int step, double seconds, int64_t count = -1) { 38 | if (count != -1) 39 | printf("%5d%11" PRId64 " %10.5lf\n", step, count, seconds); 40 | else 41 | printf("%5d%23.5lf\n", step, seconds); 42 | } 43 | 44 | void PrintStep(const std::string &s, double seconds, int64_t count = -1) { 45 | if (count != -1) 46 | printf("%5s%11" PRId64 " %10.5lf\n", s.c_str(), count, seconds); 47 | else 48 | printf("%5s%23.5lf\n", s.c_str(), seconds); 49 | } 50 | 51 | // Runs op and prints the time it took to execute labelled by label 52 | #define TIME_PRINT(label, op) { \ 53 | Timer t_; \ 54 | t_.Start(); \ 55 | (op); \ 56 | t_.Stop(); \ 57 | PrintTime(label, t_.Seconds()); \ 58 | } 59 | 60 | 61 | template 62 | class RangeIter { 63 | T_ x_; 64 | public: 65 | explicit RangeIter(T_ x) : x_(x) {} 66 | bool operator!=(RangeIter const& other) const { return x_ != other.x_; } 67 | T_ const& operator*() const { return x_; } 68 | RangeIter& operator++() { 69 | ++x_; 70 | return *this; 71 | } 72 | }; 73 | 74 | template 75 | class Range{ 76 | T_ from_; 77 | T_ to_; 78 | public: 79 | explicit Range(T_ to) : from_(0), to_(to) {} 80 | Range(T_ from, T_ to) : from_(from), to_(to) {} 81 | RangeIter begin() const { return RangeIter(from_); } 82 | RangeIter end() const { return RangeIter(to_); } 83 | }; 84 | 85 | #endif // UTIL_H_ 86 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/src/writer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, The Regents of the University of California (Regents) 2 | // See LICENSE.txt for license details 3 | 4 | #ifndef WRITER_H_ 5 | #define WRITER_H_ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "graph.h" 14 | 15 | 16 | /* 17 | GAP Benchmark Suite 18 | Class: Writer 19 | Author: Scott Beamer 20 | 21 | Given filename and graph, writes out the graph to storage 22 | - Should use WriteGraph(filename, serialized) 23 | - If serialized, will write out as serialized graph, otherwise, as edgelist 24 | */ 25 | 26 | 27 | template 28 | class WriterBase { 29 | public: 30 | explicit WriterBase(CSRGraph &g) : g_(g) {} 31 | 32 | void WriteEL(std::fstream &out) { 33 | for (NodeID_ u=0; u < g_.num_nodes(); u++) { 34 | for (DestID_ v : g_.out_neigh(u)) 35 | out << u << " " << v << std::endl; 36 | } 37 | } 38 | 39 | void WriteSerializedGraph(std::fstream &out) { 40 | if (!std::is_same::value) { 41 | std::cout << "serialized graphs only allowed for 32b IDs" << std::endl; 42 | std::exit(-4); 43 | } 44 | if (!std::is_same::value && 45 | !std::is_same>::value) { 46 | std::cout << ".wsg only allowed for int32_t weights" << std::endl; 47 | std::exit(-8); 48 | } 49 | bool directed = g_.directed(); 50 | SGOffset num_nodes = g_.num_nodes(); 51 | SGOffset edges_to_write = g_.num_edges_directed(); 52 | std::streamsize index_bytes = (num_nodes+1) * sizeof(SGOffset); 53 | std::streamsize neigh_bytes; 54 | if (std::is_same::value) 55 | neigh_bytes = edges_to_write * sizeof(SGID); 56 | else 57 | neigh_bytes = edges_to_write * sizeof(NodeWeight); 58 | out.write(reinterpret_cast(&directed), sizeof(bool)); 59 | out.write(reinterpret_cast(&edges_to_write), sizeof(SGOffset)); 60 | out.write(reinterpret_cast(&num_nodes), sizeof(SGOffset)); 61 | pvector offsets = g_.VertexOffsets(false); 62 | out.write(reinterpret_cast(offsets.data()), index_bytes); 63 | out.write(reinterpret_cast(g_.out_neigh(0).begin()), neigh_bytes); 64 | if (directed) { 65 | offsets = g_.VertexOffsets(true); 66 | out.write(reinterpret_cast(offsets.data()), index_bytes); 67 | out.write(reinterpret_cast(g_.in_neigh(0).begin()), neigh_bytes); 68 | } 69 | } 70 | 71 | void WriteGraph(std::string filename, bool serialized = false) { 72 | if (filename == "") { 73 | std::cout << "No output filename given (Use -h for help)" << std::endl; 74 | std::exit(-8); 75 | } 76 | std::fstream file(filename, std::ios::out | std::ios::binary); 77 | if (!file) { 78 | std::cout << "Couldn't write to file " << filename << std::endl; 79 | std::exit(-5); 80 | } 81 | if (serialized) 82 | WriteSerializedGraph(file); 83 | else 84 | WriteEL(file); 85 | file.close(); 86 | } 87 | 88 | private: 89 | CSRGraph &g_; 90 | std::string filename_; 91 | }; 92 | 93 | #endif // WRITER_H_ 94 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/graphs/4.el: -------------------------------------------------------------------------------- 1 | 0 13 2 | 0 13 3 | 0 9 4 | 0 0 5 | 0 8 6 | 0 0 7 | 0 12 8 | 9 9 9 | 2 1 10 | 0 3 11 | 0 0 12 | 0 8 13 | 0 7 14 | 13 9 15 | 0 8 16 | 7 12 17 | 9 4 18 | 0 0 19 | 7 3 20 | 0 2 21 | 0 13 22 | 8 4 23 | 8 7 24 | 0 10 25 | 8 7 26 | 0 13 27 | 13 9 28 | 7 12 29 | 13 11 30 | 8 13 31 | 2 4 32 | 0 9 33 | 0 4 34 | 0 12 35 | 13 13 36 | 0 13 37 | 0 8 38 | 3 9 39 | 0 12 40 | 7 4 41 | 9 11 42 | 0 8 43 | 7 13 44 | 0 9 45 | 0 0 46 | 0 2 47 | 7 1 48 | 0 7 49 | 2 9 50 | 10 1 51 | 0 0 52 | 0 1 53 | 8 7 54 | 0 7 55 | 7 2 56 | 0 0 57 | 0 1 58 | 0 11 59 | 8 9 60 | 8 12 61 | 7 9 62 | 0 7 63 | 0 3 64 | 7 13 65 | 8 7 66 | 7 1 67 | 0 0 68 | 0 0 69 | 0 4 70 | 0 8 71 | 7 1 72 | 0 0 73 | 8 7 74 | 7 4 75 | 0 4 76 | 9 4 77 | 0 11 78 | 0 9 79 | 7 1 80 | 8 9 81 | 0 4 82 | 0 4 83 | 3 13 84 | 0 9 85 | 0 3 86 | 0 0 87 | 0 8 88 | 8 13 89 | 0 0 90 | 0 3 91 | 0 9 92 | 0 11 93 | 0 0 94 | 7 2 95 | 0 7 96 | 0 4 97 | 0 7 98 | 0 8 99 | 13 13 100 | 0 13 101 | 0 0 102 | 0 10 103 | 8 7 104 | 13 9 105 | 0 13 106 | 0 12 107 | 0 1 108 | 0 10 109 | 3 13 110 | 0 7 111 | 8 8 112 | 8 3 113 | 0 8 114 | 0 7 115 | 7 9 116 | 0 8 117 | 2 1 118 | 0 0 119 | 9 10 120 | 0 12 121 | 0 13 122 | 0 7 123 | 8 2 124 | 13 13 125 | 0 9 126 | 8 7 127 | 0 6 128 | 0 8 129 | 0 4 130 | 7 7 131 | 0 4 132 | 8 7 133 | 0 2 134 | 7 10 135 | 0 13 136 | 0 13 137 | 0 2 138 | 8 11 139 | 0 12 140 | 0 4 141 | 8 8 142 | 0 8 143 | 0 7 144 | 0 0 145 | 0 7 146 | 9 6 147 | 3 13 148 | 0 7 149 | 0 13 150 | 0 0 151 | 8 1 152 | 0 12 153 | 3 2 154 | 4 6 155 | 0 0 156 | 12 1 157 | 0 13 158 | 13 13 159 | 0 0 160 | 13 9 161 | 8 9 162 | 8 13 163 | 8 13 164 | 0 0 165 | 8 7 166 | 7 13 167 | 0 0 168 | 8 7 169 | 8 13 170 | 0 0 171 | 13 9 172 | 0 3 173 | 0 11 174 | 0 7 175 | 8 13 176 | 0 8 177 | 0 9 178 | 3 9 179 | 0 9 180 | 0 0 181 | 13 4 182 | 0 7 183 | 0 8 184 | 0 8 185 | 8 12 186 | 13 4 187 | 0 8 188 | 3 4 189 | 8 3 190 | 0 0 191 | 13 4 192 | 0 13 193 | 0 13 194 | 0 7 195 | 0 13 196 | 9 10 197 | 2 6 198 | 0 2 199 | 0 7 200 | 0 2 201 | 7 11 202 | 0 3 203 | 0 9 204 | 8 13 205 | 0 8 206 | 13 2 207 | 3 12 208 | 8 3 209 | 0 13 210 | 0 7 211 | 0 7 212 | 0 4 213 | 8 13 214 | 8 9 215 | 0 13 216 | 0 7 217 | 7 9 218 | 0 13 219 | 0 2 220 | 8 13 221 | 0 4 222 | 13 9 223 | 0 7 224 | 0 9 225 | 0 8 226 | 2 10 227 | 0 12 228 | 0 2 229 | 13 4 230 | 0 8 231 | 0 13 232 | 0 0 233 | 9 9 234 | 0 4 235 | 0 13 236 | 7 11 237 | 9 1 238 | 0 7 239 | 0 1 240 | 0 6 241 | 0 8 242 | 0 9 243 | 7 13 244 | 7 13 245 | 8 2 246 | 0 0 247 | 0 8 248 | 8 7 249 | 8 9 250 | 0 3 251 | 0 9 252 | 13 10 253 | 0 10 254 | 0 0 255 | 0 3 256 | 0 9 257 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/graphs/4.gr: -------------------------------------------------------------------------------- 1 | c converted from 4 2 | p sp 14 256 3 | a 1 14 92 4 | a 1 14 95 5 | a 1 10 152 6 | a 1 1 110 7 | a 1 9 180 8 | a 1 1 163 9 | a 1 13 107 10 | a 10 10 199 11 | a 3 2 199 12 | a 1 4 86 13 | a 1 1 130 14 | a 1 9 126 15 | a 1 8 244 16 | a 14 10 59 17 | a 1 9 141 18 | a 8 13 65 19 | a 10 5 237 20 | a 1 1 252 21 | a 8 4 251 22 | a 1 3 59 23 | a 1 14 67 24 | a 9 5 245 25 | a 9 8 79 26 | a 1 11 233 27 | a 9 8 201 28 | a 1 14 146 29 | a 14 10 212 30 | a 8 13 15 31 | a 14 12 200 32 | a 9 14 62 33 | a 3 5 167 34 | a 1 10 103 35 | a 1 5 86 36 | a 1 13 140 37 | a 14 14 202 38 | a 1 14 107 39 | a 1 9 68 40 | a 4 10 204 41 | a 1 13 84 42 | a 8 5 215 43 | a 10 12 139 44 | a 1 9 141 45 | a 8 14 189 46 | a 1 10 21 47 | a 1 1 171 48 | a 1 3 94 49 | a 8 2 163 50 | a 1 8 25 51 | a 3 10 22 52 | a 11 2 181 53 | a 1 1 103 54 | a 1 2 216 55 | a 9 8 25 56 | a 1 8 30 57 | a 8 3 95 58 | a 1 1 20 59 | a 1 2 104 60 | a 1 12 2 61 | a 9 10 140 62 | a 9 13 87 63 | a 8 10 101 64 | a 1 8 225 65 | a 1 4 178 66 | a 8 14 79 67 | a 9 8 169 68 | a 8 2 39 69 | a 1 1 200 70 | a 1 1 77 71 | a 1 5 8 72 | a 1 9 69 73 | a 8 2 247 74 | a 1 1 16 75 | a 9 8 236 76 | a 8 5 155 77 | a 1 5 72 78 | a 10 5 19 79 | a 1 12 25 80 | a 1 10 3 81 | a 8 2 61 82 | a 9 10 112 83 | a 1 5 54 84 | a 1 5 187 85 | a 4 14 229 86 | a 1 10 238 87 | a 1 4 43 88 | a 1 1 226 89 | a 1 9 11 90 | a 9 14 44 91 | a 1 1 111 92 | a 1 4 130 93 | a 1 10 65 94 | a 1 12 241 95 | a 1 1 54 96 | a 8 3 13 97 | a 1 8 229 98 | a 1 5 211 99 | a 1 8 177 100 | a 1 9 105 101 | a 14 14 252 102 | a 1 14 7 103 | a 1 1 7 104 | a 1 11 93 105 | a 9 8 227 106 | a 14 10 156 107 | a 1 14 104 108 | a 1 13 38 109 | a 1 2 199 110 | a 1 11 214 111 | a 4 14 121 112 | a 1 8 174 113 | a 9 9 161 114 | a 9 4 89 115 | a 1 9 72 116 | a 1 8 73 117 | a 8 10 200 118 | a 1 9 234 119 | a 3 2 40 120 | a 1 1 36 121 | a 10 11 141 122 | a 1 13 138 123 | a 1 14 178 124 | a 1 8 237 125 | a 9 3 29 126 | a 14 14 191 127 | a 1 10 139 128 | a 9 8 174 129 | a 1 7 128 130 | a 1 9 58 131 | a 1 5 184 132 | a 8 8 133 133 | a 1 5 252 134 | a 9 8 215 135 | a 1 3 223 136 | a 8 11 58 137 | a 1 14 30 138 | a 1 14 135 139 | a 1 3 30 140 | a 9 12 205 141 | a 1 13 140 142 | a 1 5 169 143 | a 9 9 5 144 | a 1 9 65 145 | a 1 8 252 146 | a 1 1 243 147 | a 1 8 195 148 | a 10 7 53 149 | a 4 14 148 150 | a 1 8 198 151 | a 1 14 26 152 | a 1 1 82 153 | a 9 2 45 154 | a 1 13 200 155 | a 4 3 250 156 | a 5 7 176 157 | a 1 1 64 158 | a 13 2 213 159 | a 1 14 88 160 | a 14 14 150 161 | a 1 1 81 162 | a 14 10 177 163 | a 9 10 187 164 | a 9 14 228 165 | a 9 14 243 166 | a 1 1 147 167 | a 9 8 251 168 | a 8 14 165 169 | a 1 1 118 170 | a 9 8 199 171 | a 9 14 191 172 | a 1 1 15 173 | a 14 10 174 174 | a 1 4 38 175 | a 1 12 76 176 | a 1 8 232 177 | a 9 14 130 178 | a 1 9 59 179 | a 1 10 149 180 | a 4 10 231 181 | a 1 10 95 182 | a 1 1 48 183 | a 14 5 193 184 | a 1 8 37 185 | a 1 9 149 186 | a 1 9 195 187 | a 9 13 26 188 | a 14 5 223 189 | a 1 9 17 190 | a 4 5 183 191 | a 9 4 132 192 | a 1 1 53 193 | a 14 5 29 194 | a 1 14 32 195 | a 1 14 95 196 | a 1 8 36 197 | a 1 14 9 198 | a 10 11 188 199 | a 3 7 199 200 | a 1 3 82 201 | a 1 8 18 202 | a 1 3 5 203 | a 8 12 72 204 | a 1 4 134 205 | a 1 10 199 206 | a 9 14 74 207 | a 1 9 229 208 | a 14 3 243 209 | a 4 13 130 210 | a 9 4 23 211 | a 1 14 69 212 | a 1 8 137 213 | a 1 8 68 214 | a 1 5 73 215 | a 9 14 23 216 | a 9 10 213 217 | a 1 14 29 218 | a 1 8 76 219 | a 8 10 222 220 | a 1 14 24 221 | a 1 3 210 222 | a 9 14 136 223 | a 1 5 74 224 | a 14 10 81 225 | a 1 8 250 226 | a 1 10 38 227 | a 1 9 219 228 | a 3 11 47 229 | a 1 13 254 230 | a 1 3 229 231 | a 14 5 181 232 | a 1 9 162 233 | a 1 14 16 234 | a 1 1 37 235 | a 10 10 88 236 | a 1 5 145 237 | a 1 14 6 238 | a 8 12 72 239 | a 10 2 115 240 | a 1 8 107 241 | a 1 2 19 242 | a 1 7 67 243 | a 1 9 107 244 | a 1 10 77 245 | a 8 14 248 246 | a 8 14 75 247 | a 9 3 82 248 | a 1 1 150 249 | a 1 9 254 250 | a 9 8 41 251 | a 9 10 191 252 | a 1 4 1 253 | a 1 10 164 254 | a 14 11 212 255 | a 1 11 201 256 | a 1 1 40 257 | a 1 4 171 258 | a 1 10 62 259 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/graphs/4.graph: -------------------------------------------------------------------------------- 1 | 14 53 100 2 | 2 3 4 5 7 8 9 10 11 12 13 14 3 | 4 | 2 5 7 10 11 5 | 3 5 10 13 14 6 | 7 7 | 8 | 9 | 2 3 4 5 10 11 12 13 14 10 | 2 3 4 5 8 10 12 13 14 11 | 2 5 7 11 12 12 | 2 13 | 14 | 2 15 | 3 5 10 11 12 16 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/graphs/4.mtx: -------------------------------------------------------------------------------- 1 | %%MatrixMarket matrix coordinate pattern general 2 | 14 14 256 3 | 1 5 4 | 1 13 5 | 1 14 6 | 1 9 7 | 1 13 8 | 1 9 9 | 1 10 10 | 1 1 11 | 1 3 12 | 1 8 13 | 1 1 14 | 1 2 15 | 1 8 16 | 1 1 17 | 1 2 18 | 1 12 19 | 1 8 20 | 1 4 21 | 1 14 22 | 1 8 23 | 1 14 24 | 1 3 25 | 1 8 26 | 1 3 27 | 1 4 28 | 1 10 29 | 1 9 30 | 1 14 31 | 1 8 32 | 1 8 33 | 1 5 34 | 1 14 35 | 1 8 36 | 1 14 37 | 1 3 38 | 1 5 39 | 1 8 40 | 1 10 41 | 1 1 42 | 1 1 43 | 1 5 44 | 1 9 45 | 1 1 46 | 1 5 47 | 1 12 48 | 1 10 49 | 1 5 50 | 1 5 51 | 1 10 52 | 1 4 53 | 1 1 54 | 1 9 55 | 1 1 56 | 1 4 57 | 1 10 58 | 1 12 59 | 1 1 60 | 1 8 61 | 1 5 62 | 1 1 63 | 1 1 64 | 1 1 65 | 1 4 66 | 1 12 67 | 1 8 68 | 1 9 69 | 1 10 70 | 1 10 71 | 1 1 72 | 1 8 73 | 1 9 74 | 1 9 75 | 1 9 76 | 1 1 77 | 1 14 78 | 1 8 79 | 1 9 80 | 1 14 81 | 1 1 82 | 1 11 83 | 1 14 84 | 1 13 85 | 1 2 86 | 1 11 87 | 1 8 88 | 1 9 89 | 1 8 90 | 1 9 91 | 1 1 92 | 1 13 93 | 1 14 94 | 1 8 95 | 1 10 96 | 1 7 97 | 1 9 98 | 1 9 99 | 1 13 100 | 1 3 101 | 1 9 102 | 1 14 103 | 1 1 104 | 1 5 105 | 1 14 106 | 1 8 107 | 1 2 108 | 1 7 109 | 1 9 110 | 1 10 111 | 1 1 112 | 1 9 113 | 1 4 114 | 1 10 115 | 1 11 116 | 1 1 117 | 1 4 118 | 1 10 119 | 1 5 120 | 1 5 121 | 1 3 122 | 1 14 123 | 1 14 124 | 1 3 125 | 1 13 126 | 1 5 127 | 1 9 128 | 1 8 129 | 1 1 130 | 1 8 131 | 1 8 132 | 1 14 133 | 1 1 134 | 1 13 135 | 1 1 136 | 1 14 137 | 1 1 138 | 1 14 139 | 1 14 140 | 1 10 141 | 1 1 142 | 1 9 143 | 1 1 144 | 1 13 145 | 1 4 146 | 1 1 147 | 1 9 148 | 1 8 149 | 1 9 150 | 1 1 151 | 1 3 152 | 1 14 153 | 1 11 154 | 1 14 155 | 1 10 156 | 3 10 157 | 3 7 158 | 3 2 159 | 3 11 160 | 3 2 161 | 3 5 162 | 4 10 163 | 4 13 164 | 4 14 165 | 4 10 166 | 4 5 167 | 4 14 168 | 4 14 169 | 4 3 170 | 5 7 171 | 8 5 172 | 8 14 173 | 8 2 174 | 8 3 175 | 8 10 176 | 8 14 177 | 8 12 178 | 8 10 179 | 8 2 180 | 8 2 181 | 8 5 182 | 8 2 183 | 8 3 184 | 8 14 185 | 8 10 186 | 8 12 187 | 8 14 188 | 8 14 189 | 8 8 190 | 8 11 191 | 8 13 192 | 8 4 193 | 8 13 194 | 9 8 195 | 9 10 196 | 9 13 197 | 9 14 198 | 9 4 199 | 9 14 200 | 9 10 201 | 9 14 202 | 9 8 203 | 9 8 204 | 9 10 205 | 9 14 206 | 9 10 207 | 9 14 208 | 9 14 209 | 9 8 210 | 9 8 211 | 9 14 212 | 9 14 213 | 9 13 214 | 9 4 215 | 9 8 216 | 9 9 217 | 9 4 218 | 9 3 219 | 9 8 220 | 9 3 221 | 9 8 222 | 9 10 223 | 9 8 224 | 9 12 225 | 9 9 226 | 9 2 227 | 9 5 228 | 9 8 229 | 9 8 230 | 9 14 231 | 10 12 232 | 10 11 233 | 10 5 234 | 10 11 235 | 10 10 236 | 10 2 237 | 10 7 238 | 10 10 239 | 10 5 240 | 11 2 241 | 13 2 242 | 14 14 243 | 14 3 244 | 14 10 245 | 14 10 246 | 14 5 247 | 14 5 248 | 14 5 249 | 14 14 250 | 14 10 251 | 14 14 252 | 14 5 253 | 14 11 254 | 14 14 255 | 14 10 256 | 14 10 257 | 14 10 258 | 14 12 259 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/graphs/4.wel: -------------------------------------------------------------------------------- 1 | 0 13 92 2 | 0 13 95 3 | 0 9 152 4 | 0 0 110 5 | 0 8 180 6 | 0 0 163 7 | 0 12 107 8 | 9 9 199 9 | 2 1 199 10 | 0 3 86 11 | 0 0 130 12 | 0 8 126 13 | 0 7 244 14 | 13 9 59 15 | 0 8 141 16 | 7 12 65 17 | 9 4 237 18 | 0 0 252 19 | 7 3 251 20 | 0 2 59 21 | 0 13 67 22 | 8 4 245 23 | 8 7 79 24 | 0 10 233 25 | 8 7 201 26 | 0 13 146 27 | 13 9 212 28 | 7 12 15 29 | 13 11 200 30 | 8 13 62 31 | 2 4 167 32 | 0 9 103 33 | 0 4 86 34 | 0 12 140 35 | 13 13 202 36 | 0 13 107 37 | 0 8 68 38 | 3 9 204 39 | 0 12 84 40 | 7 4 215 41 | 9 11 139 42 | 0 8 141 43 | 7 13 189 44 | 0 9 21 45 | 0 0 171 46 | 0 2 94 47 | 7 1 163 48 | 0 7 25 49 | 2 9 22 50 | 10 1 181 51 | 0 0 103 52 | 0 1 216 53 | 8 7 25 54 | 0 7 30 55 | 7 2 95 56 | 0 0 20 57 | 0 1 104 58 | 0 11 2 59 | 8 9 140 60 | 8 12 87 61 | 7 9 101 62 | 0 7 225 63 | 0 3 178 64 | 7 13 79 65 | 8 7 169 66 | 7 1 39 67 | 0 0 200 68 | 0 0 77 69 | 0 4 8 70 | 0 8 69 71 | 7 1 247 72 | 0 0 16 73 | 8 7 236 74 | 7 4 155 75 | 0 4 72 76 | 9 4 19 77 | 0 11 25 78 | 0 9 3 79 | 7 1 61 80 | 8 9 112 81 | 0 4 54 82 | 0 4 187 83 | 3 13 229 84 | 0 9 238 85 | 0 3 43 86 | 0 0 226 87 | 0 8 11 88 | 8 13 44 89 | 0 0 111 90 | 0 3 130 91 | 0 9 65 92 | 0 11 241 93 | 0 0 54 94 | 7 2 13 95 | 0 7 229 96 | 0 4 211 97 | 0 7 177 98 | 0 8 105 99 | 13 13 252 100 | 0 13 7 101 | 0 0 7 102 | 0 10 93 103 | 8 7 227 104 | 13 9 156 105 | 0 13 104 106 | 0 12 38 107 | 0 1 199 108 | 0 10 214 109 | 3 13 121 110 | 0 7 174 111 | 8 8 161 112 | 8 3 89 113 | 0 8 72 114 | 0 7 73 115 | 7 9 200 116 | 0 8 234 117 | 2 1 40 118 | 0 0 36 119 | 9 10 141 120 | 0 12 138 121 | 0 13 178 122 | 0 7 237 123 | 8 2 29 124 | 13 13 191 125 | 0 9 139 126 | 8 7 174 127 | 0 6 128 128 | 0 8 58 129 | 0 4 184 130 | 7 7 133 131 | 0 4 252 132 | 8 7 215 133 | 0 2 223 134 | 7 10 58 135 | 0 13 30 136 | 0 13 135 137 | 0 2 30 138 | 8 11 205 139 | 0 12 140 140 | 0 4 169 141 | 8 8 5 142 | 0 8 65 143 | 0 7 252 144 | 0 0 243 145 | 0 7 195 146 | 9 6 53 147 | 3 13 148 148 | 0 7 198 149 | 0 13 26 150 | 0 0 82 151 | 8 1 45 152 | 0 12 200 153 | 3 2 250 154 | 4 6 176 155 | 0 0 64 156 | 12 1 213 157 | 0 13 88 158 | 13 13 150 159 | 0 0 81 160 | 13 9 177 161 | 8 9 187 162 | 8 13 228 163 | 8 13 243 164 | 0 0 147 165 | 8 7 251 166 | 7 13 165 167 | 0 0 118 168 | 8 7 199 169 | 8 13 191 170 | 0 0 15 171 | 13 9 174 172 | 0 3 38 173 | 0 11 76 174 | 0 7 232 175 | 8 13 130 176 | 0 8 59 177 | 0 9 149 178 | 3 9 231 179 | 0 9 95 180 | 0 0 48 181 | 13 4 193 182 | 0 7 37 183 | 0 8 149 184 | 0 8 195 185 | 8 12 26 186 | 13 4 223 187 | 0 8 17 188 | 3 4 183 189 | 8 3 132 190 | 0 0 53 191 | 13 4 29 192 | 0 13 32 193 | 0 13 95 194 | 0 7 36 195 | 0 13 9 196 | 9 10 188 197 | 2 6 199 198 | 0 2 82 199 | 0 7 18 200 | 0 2 5 201 | 7 11 72 202 | 0 3 134 203 | 0 9 199 204 | 8 13 74 205 | 0 8 229 206 | 13 2 243 207 | 3 12 130 208 | 8 3 23 209 | 0 13 69 210 | 0 7 137 211 | 0 7 68 212 | 0 4 73 213 | 8 13 23 214 | 8 9 213 215 | 0 13 29 216 | 0 7 76 217 | 7 9 222 218 | 0 13 24 219 | 0 2 210 220 | 8 13 136 221 | 0 4 74 222 | 13 9 81 223 | 0 7 250 224 | 0 9 38 225 | 0 8 219 226 | 2 10 47 227 | 0 12 254 228 | 0 2 229 229 | 13 4 181 230 | 0 8 162 231 | 0 13 16 232 | 0 0 37 233 | 9 9 88 234 | 0 4 145 235 | 0 13 6 236 | 7 11 72 237 | 9 1 115 238 | 0 7 107 239 | 0 1 19 240 | 0 6 67 241 | 0 8 107 242 | 0 9 77 243 | 7 13 248 244 | 7 13 75 245 | 8 2 82 246 | 0 0 150 247 | 0 8 254 248 | 8 7 41 249 | 8 9 191 250 | 0 3 1 251 | 0 9 164 252 | 13 10 212 253 | 0 10 201 254 | 0 0 40 255 | 0 3 171 256 | 0 9 62 257 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/graphs/4w.graph: -------------------------------------------------------------------------------- 1 | 14 53 1 2 | 2 19 3 5 4 1 5 8 7 67 8 18 9 11 10 3 11 93 12 2 13 38 14 6 3 | 4 | 2 40 5 167 7 199 10 22 11 47 5 | 3 250 5 183 10 204 13 130 14 121 6 | 7 176 7 | 8 | 9 | 2 39 3 13 4 251 5 155 10 101 11 58 12 72 13 15 14 75 10 | 2 45 3 29 4 23 5 245 8 25 10 112 12 205 13 26 14 23 11 | 2 115 5 19 7 53 11 141 12 139 12 | 2 181 13 | 14 | 2 213 15 | 3 243 5 29 10 59 11 212 12 200 16 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/graphs/4w.mtx: -------------------------------------------------------------------------------- 1 | %%MatrixMarket matrix coordinate integer general 2 | 14 14 256 3 | 1 8 177 4 | 1 9 105 5 | 1 14 7 6 | 1 1 7 7 | 1 11 93 8 | 1 14 104 9 | 1 13 38 10 | 1 2 199 11 | 1 11 214 12 | 1 8 174 13 | 1 9 72 14 | 1 8 73 15 | 1 9 234 16 | 1 1 36 17 | 1 13 138 18 | 1 14 178 19 | 1 8 237 20 | 1 10 139 21 | 1 7 128 22 | 1 9 58 23 | 1 9 219 24 | 1 13 254 25 | 1 3 229 26 | 1 9 162 27 | 1 14 16 28 | 1 1 37 29 | 1 5 145 30 | 1 14 6 31 | 1 8 107 32 | 1 2 19 33 | 1 7 67 34 | 1 9 107 35 | 1 10 77 36 | 1 1 150 37 | 1 9 254 38 | 1 4 1 39 | 1 10 164 40 | 1 11 201 41 | 1 1 40 42 | 1 4 171 43 | 1 10 62 44 | 1 5 86 45 | 1 13 140 46 | 1 14 107 47 | 1 9 68 48 | 1 5 184 49 | 1 13 84 50 | 1 5 252 51 | 1 9 141 52 | 1 10 21 53 | 1 1 171 54 | 1 3 223 55 | 1 3 94 56 | 1 14 30 57 | 1 8 25 58 | 1 14 135 59 | 1 3 30 60 | 1 1 103 61 | 1 2 216 62 | 1 13 140 63 | 1 5 169 64 | 1 8 30 65 | 1 9 65 66 | 1 1 20 67 | 1 8 252 68 | 1 2 104 69 | 1 1 243 70 | 1 12 2 71 | 1 8 195 72 | 1 8 198 73 | 1 8 225 74 | 1 14 26 75 | 1 4 178 76 | 1 1 82 77 | 1 13 200 78 | 1 1 64 79 | 1 14 88 80 | 1 1 81 81 | 1 1 147 82 | 1 1 118 83 | 1 1 15 84 | 1 4 38 85 | 1 12 76 86 | 1 8 232 87 | 1 9 59 88 | 1 10 149 89 | 1 10 95 90 | 1 1 48 91 | 1 8 37 92 | 1 9 149 93 | 1 9 195 94 | 1 9 17 95 | 1 1 53 96 | 1 14 32 97 | 1 1 200 98 | 1 1 77 99 | 1 5 8 100 | 1 9 69 101 | 1 1 16 102 | 1 5 72 103 | 1 12 25 104 | 1 10 3 105 | 1 5 54 106 | 1 5 187 107 | 1 10 238 108 | 1 4 43 109 | 1 1 226 110 | 1 9 11 111 | 1 1 111 112 | 1 4 130 113 | 1 10 65 114 | 1 12 241 115 | 1 1 54 116 | 1 8 229 117 | 1 5 211 118 | 1 14 95 119 | 1 8 36 120 | 1 14 9 121 | 1 3 82 122 | 1 8 18 123 | 1 3 5 124 | 1 4 134 125 | 1 10 199 126 | 1 9 229 127 | 1 14 69 128 | 1 8 137 129 | 1 8 68 130 | 1 5 73 131 | 1 14 29 132 | 1 8 76 133 | 1 14 24 134 | 1 3 210 135 | 1 5 74 136 | 1 8 250 137 | 1 10 38 138 | 1 14 92 139 | 1 14 95 140 | 1 10 152 141 | 1 1 110 142 | 1 9 180 143 | 1 1 163 144 | 1 13 107 145 | 1 4 86 146 | 1 1 130 147 | 1 9 126 148 | 1 8 244 149 | 1 9 141 150 | 1 1 252 151 | 1 3 59 152 | 1 14 67 153 | 1 11 233 154 | 1 14 146 155 | 1 10 103 156 | 3 2 40 157 | 3 11 47 158 | 3 10 22 159 | 3 7 199 160 | 3 2 199 161 | 3 5 167 162 | 4 14 121 163 | 4 10 204 164 | 4 14 148 165 | 4 3 250 166 | 4 10 231 167 | 4 5 183 168 | 4 14 229 169 | 4 13 130 170 | 5 7 176 171 | 8 10 200 172 | 8 12 72 173 | 8 14 248 174 | 8 14 75 175 | 8 5 215 176 | 8 8 133 177 | 8 14 189 178 | 8 11 58 179 | 8 2 163 180 | 8 3 95 181 | 8 10 101 182 | 8 14 79 183 | 8 14 165 184 | 8 2 39 185 | 8 2 247 186 | 8 5 155 187 | 8 2 61 188 | 8 3 13 189 | 8 12 72 190 | 8 10 222 191 | 8 13 65 192 | 8 4 251 193 | 8 13 15 194 | 9 8 227 195 | 9 9 161 196 | 9 4 89 197 | 9 3 29 198 | 9 8 174 199 | 9 3 82 200 | 9 8 41 201 | 9 10 191 202 | 9 8 215 203 | 9 12 205 204 | 9 8 25 205 | 9 9 5 206 | 9 10 140 207 | 9 13 87 208 | 9 2 45 209 | 9 10 187 210 | 9 14 228 211 | 9 14 243 212 | 9 8 251 213 | 9 8 199 214 | 9 14 191 215 | 9 14 130 216 | 9 13 26 217 | 9 4 132 218 | 9 8 169 219 | 9 8 236 220 | 9 10 112 221 | 9 14 44 222 | 9 14 74 223 | 9 4 23 224 | 9 14 23 225 | 9 10 213 226 | 9 14 136 227 | 9 5 245 228 | 9 8 79 229 | 9 8 201 230 | 9 14 62 231 | 10 11 141 232 | 10 10 88 233 | 10 2 115 234 | 10 12 139 235 | 10 7 53 236 | 10 5 19 237 | 10 11 188 238 | 10 10 199 239 | 10 5 237 240 | 11 2 181 241 | 13 2 213 242 | 14 14 252 243 | 14 10 156 244 | 14 14 191 245 | 14 5 181 246 | 14 11 212 247 | 14 14 202 248 | 14 14 150 249 | 14 10 177 250 | 14 10 174 251 | 14 5 193 252 | 14 5 223 253 | 14 5 29 254 | 14 3 243 255 | 14 10 81 256 | 14 10 59 257 | 14 10 212 258 | 14 12 200 259 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/reference/graph-4.el.out: -------------------------------------------------------------------------------- 1 | Graph has 14 nodes and 53 directed edges for degree: 3 2 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/reference/graph-4.gr.out: -------------------------------------------------------------------------------- 1 | Graph has 14 nodes and 53 directed edges for degree: 3 2 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/reference/graph-4.graph.out: -------------------------------------------------------------------------------- 1 | Graph has 14 nodes and 53 directed edges for degree: 3 2 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/reference/graph-4.mtx.out: -------------------------------------------------------------------------------- 1 | Graph has 14 nodes and 53 directed edges for degree: 3 2 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/reference/graph-4.wel.out: -------------------------------------------------------------------------------- 1 | Graph has 14 nodes and 53 directed edges for degree: 3 2 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/reference/graph-4w.graph.out: -------------------------------------------------------------------------------- 1 | Graph has 14 nodes and 53 directed edges for degree: 3 2 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/reference/graph-4w.mtx.out: -------------------------------------------------------------------------------- 1 | Graph has 14 nodes and 53 directed edges for degree: 3 2 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/reference/graph-g10.out: -------------------------------------------------------------------------------- 1 | Graph has 1024 nodes and 10496 undirected edges for degree: 10 2 | -------------------------------------------------------------------------------- /trident-workloads/gapbs/test/reference/graph-u10.out: -------------------------------------------------------------------------------- 1 | Graph has 1024 nodes and 16104 undirected edges for degree: 15 2 | -------------------------------------------------------------------------------- /trident-workloads/graph500/COPYING: -------------------------------------------------------------------------------- 1 | Copyright 2010-2011, Georgia Institute of Technology, USA 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer listed 12 | in this license in the documentation and/or other materials 13 | provided with the distribution. 14 | 15 | - Neither the name of the copyright holders nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | ==== 31 | Included Kronecker graph generator: 32 | /* Copyright (C) 2009-2010 The Trustees of Indiana University. */ 33 | /* */ 34 | /* Use, modification and distribution is subject to the Boost Software */ 35 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 36 | /* http://www.boost.org/LICENSE_1_0.txt) */ 37 | 38 | 39 | 40 | 41 | Copyright © 2013 The Regents of the University of California (Regents). 42 | All Rights Reserved. Redistribution and use in source and binary forms, 43 | with or without modification, are permitted provided that the following 44 | conditions are met: 45 | * Redistributions of source code must retain the above 46 | copyright notice, this list of conditions and the following 47 | two paragraphs of disclaimer. 48 | * Redistributions in binary form must reproduce the above 49 | copyright notice, this list of conditions and the following 50 | two paragraphs of disclaimer in the documentation and/or other 51 | materials provided with the distribution. 52 | * Neither the name of the Regents nor the names of its contributors 53 | may be used to endorse or promote products derived from this 54 | software without specific prior written permission. 55 | 56 | IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 57 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, 58 | ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 59 | REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 60 | 61 | REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT 62 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 63 | A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF 64 | ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION 65 | TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 66 | MODIFICATIONS. 67 | -------------------------------------------------------------------------------- /trident-workloads/graph500/Makefile: -------------------------------------------------------------------------------- 1 | # -*- Makefile -*- 2 | # Copyright 2010-2011, Georgia Institute of Technology, USA. 3 | # See COPYING for license. 4 | BUILD_OPENMP = Yes 5 | BUILD_XMT = No 6 | include make.inc 7 | 8 | GRAPH500_SOURCES=graph500.c options.c rmat.c kronecker.c verify.c prng.c \ 9 | xalloc.c timer.c 10 | 11 | MAKE_EDGELIST_SOURCES=make-edgelist.c options.c rmat.c kronecker.c prng.c \ 12 | xalloc.c timer.c 13 | 14 | BIN=seq-list/seq-list seq-csr/seq-csr make-edgelist 15 | 16 | ifeq ($(BUILD_OPENMP), Yes) 17 | BIN += omp-csr/omp-csr 18 | endif 19 | 20 | ifeq ($(BUILD_MPI), Yes) 21 | BIN += mpi/graph500_mpi_simple 22 | endif 23 | 24 | ifeq ($(BUILD_XMT), Yes) 25 | BIN = xmt-csr/xmt-csr xmt-csr-local/xmt-csr-local 26 | endif 27 | 28 | GENERATOR_SRCS=splittable_mrg.c \ 29 | graph_generator.c \ 30 | make_graph.c utils.c 31 | 32 | .PHONY: all 33 | all: seq-csr/seq-csr.a seq-list/seq-list.a omp-csr/omp-csr.a 34 | 35 | CPPFLAGS += -I./generator 36 | 37 | %.o: %.c Makefile 38 | ${CC} ${CFLAGS} -O3 -msse3 -c $< -o $@ 39 | 40 | %.o-omp: %.c Makefile 41 | ${CC} ${CFLAGS} -O3 -msse3 -fopenmp -c $< -o $@ 42 | 43 | make-edgelist: CFLAGS:=$(CFLAGS) $(CFLAGS_OPENMP) 44 | make-edgelist: make-edgelist.c options.c rmat.c kronecker.c prng.c \ 45 | xalloc.c timer.c $(addprefix generator/,$(GENERATOR_SRCS)) 46 | 47 | SEQLIST_SRCS := seq-list/seq-list.c $(GRAPH500_SOURCES) $(addprefix generator/,$(GENERATOR_SRCS)) 48 | SEQLIST_OBJS := ${SEQLIST_SRCS:c=o} 49 | 50 | seq-list/seq-list.a : ${SEQLIST_OBJS} 51 | ar rcs $@ $^ 52 | 53 | SEQCSR_SRCS := seq-csr/seq-csr.c $(GRAPH500_SOURCES) $(addprefix generator/,$(GENERATOR_SRCS)) 54 | SEQCSR_OBJS := ${SEQCSR_SRCS:c=o} 55 | 56 | seq-csr/seq-csr.a : ${SEQCSR_OBJS} 57 | ar rcs $@ $^ 58 | 59 | OMP_SRCS := omp-csr/omp-csr.c omp-csr/bitmap.h $(GRAPH500_SOURCES) $(addprefix generator/,$(GENERATOR_SRCS)) 60 | OMP_OBJS := ${OMP_SRCS:c=o-omp} 61 | 62 | omp-csr/omp-csr.o-omp : omp-csr/omp-csr.c Makefile graph500.h 63 | ${CC} ${CFLAGS} -O3 -fopenmp -msse3 -c $< -o $@ 64 | 65 | omp-csr/omp-csr.a : ${OMP_OBJS} 66 | ar rcs $@ $^ 67 | 68 | 69 | seq-list/seq-list: seq-list/seq-list.c $(GRAPH500_SOURCES) \ 70 | $(addprefix generator/,$(GENERATOR_SRCS)) 71 | seq-csr/seq-csr: seq-csr/seq-csr.c $(GRAPH500_SOURCES) \ 72 | $(addprefix generator/,$(GENERATOR_SRCS)) 73 | 74 | omp-csr/omp-csr-old: CFLAGS:=$(CFLAGS) $(CFLAGS_OPENMP) 75 | omp-csr/omp-csr-old: omp-csr/omp-csr-old.c $(GRAPH500_SOURCES) \ 76 | $(addprefix generator/,$(GENERATOR_SRCS)) 77 | 78 | omp-csr/omp-csr: CFLAGS:=$(CFLAGS) $(CFLAGS_OPENMP) 79 | omp-csr/omp-csr: omp-csr/omp-csr.c omp-csr/bitmap.h $(GRAPH500_SOURCES) \ 80 | $(addprefix generator/,$(GENERATOR_SRCS)) 81 | 82 | xmt-csr/xmt-csr: CFLAGS:=$(CFLAGS) -pl xmt-csr/xmt-csr.pl 83 | xmt-csr/xmt-csr: xmt-csr/xmt-csr.c $(GRAPH500_SOURCES) \ 84 | $(addprefix generator/,$(GENERATOR_SRCS)) 85 | 86 | xmt-csr-local/xmt-csr-local: CFLAGS:=$(CFLAGS) -pl xmt-csr-local/xmt-csr-local.pl 87 | xmt-csr-local/xmt-csr-local: xmt-csr-local/xmt-csr-local.c $(GRAPH500_SOURCES) \ 88 | $(addprefix generator/,$(GENERATOR_SRCS)) 89 | 90 | generator/generator_test_seq: generator/generator_test_seq.c $(GENERATOR_SRCS) 91 | 92 | generator/generator_test_omp: generator/generator_test_omp.c $(GENERATOR_SRCS) 93 | 94 | mpi/graph500_mpi_simple mpi/graph500_mpi_one_sided mpi/graph500_mpi_replicated: 95 | $(MAKE) -C mpi 96 | 97 | .PHONY: clean 98 | clean: 99 | rm -f ./*/*.a 100 | rm -f generator/generator_test_seq generator/generator_test_omp \ 101 | $(BIN) 102 | rm -f *.o *.o-omp ./*/*.o ./*/*.o-omp 103 | rm -f ./*/*.a 104 | -$(MAKE) -C mpi clean 105 | -------------------------------------------------------------------------------- /trident-workloads/graph500/README: -------------------------------------------------------------------------------- 1 | Graph500 sequentual and shared-memory reference implementation 2 | 3 | See COPYING for the general license. Portions copyright 2010 by 4 | the Georgia Institute of Technology, and portions copyright 2009-2011 5 | by the Trustees of Indiana University. 6 | 7 | The specification is included both in plain text format (Graph500.org, 8 | with Emacs Org mode annotations) and exported HTML (Graph500.html). 9 | 10 | Included implementations: 11 | octave/Graph500.m : GNU Octave (may be Matlab(TM) compatible) from 12 | the specification. 13 | seq-list/seq-list : Sequential list-based implementation 14 | seq-csr/seq-csr : Sequential compressed-sparse-row implementation 15 | omp-csr/omp-csr : OpenMP compressed-sparse-row implementation 16 | xmt-csr/xmt-csr : Cray XMT compressed-sparse-row implementation 17 | xmt-csr-local/xmt-csr-local : Cray XMT compressed-sparse-row 18 | implementation accumulating vertices into a small buffer before 19 | storing globally 20 | mpi/ : Several implementations using MPI 21 | 22 | BUILDING INSTRUCTIONS 23 | 24 | The Makefile includes make.inc to define compiler and flag variables. 25 | Some sample make.inc files are in the make-incs directory. The 26 | Makefile relies heavily on implicit rules and is known to work using 27 | GNU Make. 28 | 29 | To build the MPI executables, set BUILD_MPI=Yes in your make.inc, and 30 | optionally set MPICC if needed. There is a separate README file in the mpi/ 31 | directory with more information. 32 | 33 | To build the OpenMP executables, set BUILD_OPENMP=Yes in your 34 | make.inc, and define CFLAGS_OPENMP appropriately. 35 | 36 | For the XMT, ensure the correct modules are loaded and set 37 | BUILD_XMT=Yes. This disables all other builds, including the 38 | sequential versions. 39 | 40 | RUNNING INSTRUCTIONS (OTHER THAN MPI VERSIONS) 41 | 42 | Options: 43 | v : version 44 | h|? : this message 45 | R : use R-MAT from SSCA2 (default: use Kronecker generator) 46 | s : R-MAT scale (default 14) 47 | e : R-MAT edge factor (default 16) 48 | A|a : R-MAT A (default 0.57) >= 0 49 | B|b : R-MAT B (default 0.19) >= 0 50 | C|c : R-MAT C (default 0.19) >= 0 51 | D|d : R-MAT D (default 0.05) >= 0 52 | Note: Setting 3 of A,B,C,D requires the arguments to sum to 53 | at most 1. Otherwise, the parameters are added and normalized 54 | so that the sum is 1. 55 | V : Enable extra (Verbose) output 56 | o : Read the edge list from (or dump to) the named file 57 | r : Read the BFS roots from (or dump to) the named file 58 | 59 | The -o and -r options to the graph500 executable read the data from 60 | binary files that must already match in byte order. The make-edgelist 61 | executable generates these files given the same options. 62 | 63 | Outputs take the form of "key: value", with keys: 64 | SCALE 65 | edgefactor 66 | construction_time 67 | min_time 68 | firstquartile_time 69 | median_time 70 | thirdquartile_time 71 | max_time 72 | mean_time 73 | stddev_time 74 | min_nedge 75 | firstquartile_nedge 76 | median_nedge 77 | thirdquartile_nedge 78 | max_nedge 79 | mean_nedge 80 | stddev_nedge 81 | min_TEPS 82 | firstquartile_TEPS 83 | median_TEPS 84 | thirdquartile_TEPS 85 | max_TEPS 86 | harmonic_mean_TEPS 87 | harmonic_stddev_TEPS 88 | -------------------------------------------------------------------------------- /trident-workloads/graph500/compat.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #if !defined(COMPAT_HEADER_) 5 | #define COMPAT_HEADER_ 6 | 7 | #define _FILE_OFFSET_BITS 64 8 | #define _THREAD_SAFE 9 | #define _XOPEN_SOURCE 600 10 | #define _XOPEN_SOURCE_EXTENDED 11 | //#define _SVID_SOURCE 12 | 13 | #if __STDC_VERSION__ >= 199901L 14 | #include 15 | #elif defined(__MTA__) 16 | #include 17 | #define PRId64 "d" 18 | #define SCNd64 "d" 19 | #else 20 | #warning "Defining long as int64_t." 21 | typedef long int64_t; 22 | typedef unsigned uint32_fast_t; 23 | #define PRId64 "ld" 24 | #define SCNd64 "ld" 25 | #if !defined(restrict) 26 | #define restrict 27 | #endif 28 | #endif 29 | 30 | 31 | #if defined(_OPENMP) 32 | #define OMP(x) _Pragma(x) 33 | #include 34 | #else 35 | #define OMP(x) 36 | #if defined(__GNUC__) 37 | static int omp_get_thread_num (void) __attribute__((unused)); 38 | static int omp_get_num_threads (void) __attribute__((unused)); 39 | int omp_get_thread_num (void) { return 0; } 40 | int omp_get_num_threads (void) { return 1; } 41 | #else 42 | static int omp_get_thread_num (void) { return 0; } 43 | static int omp_get_num_threads (void) { return 1; } 44 | #endif 45 | #endif 46 | 47 | #if defined(__MTA__) 48 | #define MTA(x) _Pragma(x) 49 | #else 50 | #define MTA(x) 51 | #endif 52 | 53 | #endif /* COMPAT_HEADER_ */ 54 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/LICENSE_1_0.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/Makefile.mpi: -------------------------------------------------------------------------------- 1 | CC = mpicc 2 | CFLAGS = -std=c99 -O3 -DGRAPH_GENERATOR_MPI -DGRAPHGEN_DISTRIBUTED_MEMORY -DNDEBUG # -g -pg 3 | # CFLAGS = -std=c99 -DGRAPH_GENERATOR_MPI -DGRAPHGEN_DISTRIBUTED_MEMORY -g 4 | LDFLAGS = -O3 5 | # LDFLAGS = -g 6 | MPICC = mpicc 7 | 8 | GENERATOR_SOURCES = graph_generator.c make_graph.c splittable_mrg.c utils.c 9 | GENERATOR_HEADERS = graph_generator.h make_graph.h mod_arith_32bit.h mod_arith_64bit.h mod_arith.h mod_arith_xmt.h splittable_mrg.h utils.h user_settings.h mrg_transitions.c 10 | 11 | all: generator_test_mpi 12 | 13 | generator_test_mpi: generator_test_mpi.c $(GENERATOR_SOURCES) $(GENERATOR_HEADERS) 14 | $(MPICC) $(CFLAGS) $(LDFLAGS) -o generator_test_mpi generator_test_mpi.c $(GENERATOR_SOURCES) -lm 15 | 16 | clean: 17 | -rm -f generator_test_mpi 18 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/Makefile.omp: -------------------------------------------------------------------------------- 1 | CC = gcc -fopenmp 2 | CFLAGS = -std=c99 -Wall -Drestrict=__restrict__ -O3 -DNDEBUG -ffast-math -DGRAPH_GENERATOR_OMP # -g -pg 3 | LDFLAGS = -O3 4 | 5 | GENERATOR_SOURCES = graph_generator.c make_graph.c splittable_mrg.c utils.c 6 | GENERATOR_HEADERS = graph_generator.h make_graph.h mod_arith_32bit.h mod_arith_64bit.h mod_arith.h mod_arith_xmt.h splittable_mrg.h utils.h user_settings.h mrg_transitions.c 7 | 8 | all: generator_test_omp 9 | 10 | generator_test_omp: generator_test_omp.c $(GENERATOR_SOURCES) $(GENERATOR_HEADERS) 11 | $(CC) $(CFLAGS) $(LDFLAGS) -o generator_test_omp generator_test_omp.c $(GENERATOR_SOURCES) -lm 12 | 13 | clean: 14 | -rm -f generator_test_omp 15 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/Makefile.seq: -------------------------------------------------------------------------------- 1 | CC = cc 2 | CFLAGS = -g -Wall -Drestrict=__restrict__ -O3 -DNDEBUG -ffast-math -DGRAPH_GENERATOR_SEQ # -g -pg 3 | # CFLAGS = -g -Wall -Drestrict=__restrict__ 4 | LDFLAGS = -g # -g -pg 5 | 6 | GENERATOR_SOURCES = graph_generator.c make_graph.c splittable_mrg.c utils.c 7 | GENERATOR_HEADERS = graph_generator.h make_graph.h mod_arith_32bit.h mod_arith_64bit.h mod_arith.h mod_arith_xmt.h splittable_mrg.h utils.h user_settings.h mrg_transitions.c 8 | 9 | all: generator_test_seq 10 | 11 | generator_test_seq: generator_test_seq.c $(GENERATOR_SOURCES) $(GENERATOR_HEADERS) 12 | $(CC) $(CFLAGS) $(LDFLAGS) -o generator_test_seq generator_test_seq.c $(GENERATOR_SOURCES) -lm 13 | 14 | clean: 15 | -rm -f generator_test_seq 16 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/Makefile.xmt: -------------------------------------------------------------------------------- 1 | CC = cc 2 | CFLAGS = -DNDEBUG 3 | LDFLAGS = $(CFLAGS) # -g -pg 4 | 5 | GENERATOR_SOURCES = graph_generator.c make_graph.c splittable_mrg.c utils.c 6 | GENERATOR_HEADERS = graph_generator.h make_graph.h mod_arith_32bit.h mod_arith_64bit.h mod_arith.h mod_arith_xmt.h splittable_mrg.h utils.h user_settings.h mrg_transitions.c 7 | 8 | all: generator_test_xmt 9 | 10 | generator_test_xmt: generator_test_xmt.c $(GENERATOR_SOURCES) $(GENERATOR_HEADERS) 11 | $(CC) $(CFLAGS) $(LDFLAGS) -o generator_test_xmt generator_test_xmt.c $(GENERATOR_SOURCES) -lm 12 | 13 | clean: 14 | -rm -f generator_test_xmt 15 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/README: -------------------------------------------------------------------------------- 1 | Graph500 Benchmark: Scalable Kronecker Graph Generator 2 | Jeremiah Willcock and Andrew Lumsdaine 3 | 4 | This directory contains a parallel Kronecker graph generator set up for the 5 | requirements of the Graph 500 Search benchmark. The generator is designed to 6 | produce reproducible results for a given graph size and seed, regardless of the 7 | level or type of parallelism in use. 8 | 9 | Four Makefiles are provided: Makefile.seq (sequential), Makefile.xmt (Cray 10 | XMT), Makefile.omp (OpenMP), and Makefile.mpi (MPI). There are four 11 | corresponding generator_test_* programs that demonstrate how to use the 12 | generator. The file make_graph.h declares a simplified interface suitable for 13 | benchmark implementations; this interface hides many of the parameters that are 14 | fixed in the benchmark specification. Most compile-time settings for user 15 | modification are in generator/user_settings.h and mpi/datatypes.h, with the 16 | Kronecker parameters set at the top of generator/graph_generator.c. 17 | 18 | Copyright (C) 2009-2011 The Trustees of Indiana University. 19 | 20 | Use, modification and distribution is subject to the Boost Software License, 21 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 22 | http://www.boost.org/LICENSE_1_0.txt) 23 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/generator_test_mpi.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2009-2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #include 11 | #include 12 | #include 13 | #ifndef __STDC_FORMAT_MACROS 14 | #define __STDC_FORMAT_MACROS 15 | #endif 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | #include "make_graph.h" 22 | 23 | int main(int argc, char* argv[]) { 24 | int log_numverts; 25 | int size, rank; 26 | unsigned long my_edges; 27 | unsigned long global_edges; 28 | double start, stop; 29 | size_t i; 30 | 31 | MPI_Init(&argc, &argv); 32 | 33 | log_numverts = 16; /* In base 2 */ 34 | if (argc >= 2) log_numverts = atoi(argv[1]); 35 | 36 | MPI_Comm_size(MPI_COMM_WORLD, &size); 37 | MPI_Comm_rank(MPI_COMM_WORLD, &rank); 38 | 39 | if (rank == 0) fprintf(stderr, "Graph size is %" PRId64 " vertices and %" PRId64 " edges\n", INT64_C(1) << log_numverts, INT64_C(16) << log_numverts); 40 | 41 | /* Start of graph generation timing */ 42 | MPI_Barrier(MPI_COMM_WORLD); 43 | start = MPI_Wtime(); 44 | int64_t nedges; 45 | packed_edge* result; 46 | make_graph(log_numverts, INT64_C(16) << log_numverts, 1, 2, &nedges, &result); 47 | MPI_Barrier(MPI_COMM_WORLD); 48 | stop = MPI_Wtime(); 49 | /* End of graph generation timing */ 50 | 51 | my_edges = nedges; 52 | 53 | for (i = 0; i < my_edges; ++i) { 54 | assert ((get_v0_from_edge(&result[i]) >> log_numverts) == 0); 55 | assert ((get_v1_from_edge(&result[i]) >> log_numverts) == 0); 56 | } 57 | 58 | xfree(result); 59 | 60 | MPI_Reduce(&my_edges, &global_edges, 1, MPI_UNSIGNED_LONG, MPI_SUM, 0, MPI_COMM_WORLD); 61 | if (rank == 0) { 62 | fprintf(stderr, "%lu edge%s generated in %fs (%f Medges/s on %d processor%s)\n", global_edges, (global_edges == 1 ? "" : "s"), (stop - start), global_edges / (stop - start) * 1.e-6, size, (size == 1 ? "" : "s")); 63 | } 64 | MPI_Finalize(); 65 | return 0; 66 | } 67 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/generator_test_omp.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2009-2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #include 11 | #include 12 | #include 13 | #ifndef __STDC_FORMAT_MACROS 14 | #define __STDC_FORMAT_MACROS 15 | #endif 16 | #include 17 | #include 18 | #include 19 | 20 | #include "make_graph.h" 21 | 22 | int main(int argc, char* argv[]) { 23 | int log_numverts; 24 | double start, time_taken; 25 | int64_t nedges, actual_nedges; 26 | packed_edge* result; 27 | 28 | log_numverts = 16; /* In base 2 */ 29 | if (argc >= 2) log_numverts = atoi(argv[1]); 30 | 31 | /* Start of graph generation timing */ 32 | start = omp_get_wtime(); 33 | 34 | make_graph(log_numverts, INT64_C(16) << log_numverts, 1, 2, &nedges, &result); 35 | 36 | time_taken = omp_get_wtime() - start; 37 | /* End of graph generation timing */ 38 | 39 | actual_nedges = nedges; 40 | 41 | fprintf(stderr, "%" PRIu64 " edge%s generated in %fs (%f Medges/s)\n", actual_nedges, (actual_nedges == 1 ? "" : "s"), time_taken, 1. * actual_nedges / time_taken * 1.e-6); 42 | 43 | free(result); 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/generator_test_seq.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2009-2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #include 11 | #include 12 | #include 13 | #ifndef __STDC_FORMAT_MACROS 14 | #define __STDC_FORMAT_MACROS 15 | #endif 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include "make_graph.h" 22 | 23 | inline double get_time() { 24 | struct timeval tv; 25 | gettimeofday(&tv, NULL); 26 | return tv.tv_sec + tv.tv_usec * 1.e-6; 27 | } 28 | 29 | int main(int argc, char* argv[]) { 30 | int log_numverts; 31 | double start, time_taken; 32 | int64_t nedges; 33 | packed_edge* result; 34 | 35 | log_numverts = 16; /* In base 2 */ 36 | if (argc >= 2) log_numverts = atoi(argv[1]); 37 | 38 | /* Start of graph generation timing */ 39 | start = get_time(); 40 | make_graph(log_numverts, INT64_C(16) << log_numverts, 1, 2, &nedges, &result); 41 | time_taken = get_time() - start; 42 | /* End of graph generation timing */ 43 | 44 | fprintf(stderr, "%" PRIu64 " edge%s generated in %fs (%f Medges/s)\n", nedges, (nedges == 1 ? "" : "s"), time_taken, 1. * nedges / time_taken * 1.e-6); 45 | 46 | free(result); 47 | 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/generator_test_xmt.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2009-2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #include 11 | #include 12 | #include 13 | #ifndef __STDC_FORMAT_MACROS 14 | #define __STDC_FORMAT_MACROS 15 | #endif 16 | #include 17 | #include 18 | #include 19 | 20 | #include "make_graph.h" 21 | 22 | int main(int argc, char* argv[]) { 23 | int log_numverts; 24 | unsigned int start, time_taken; 25 | size_t i; 26 | int64_t nedges, actual_nedges; 27 | packed_edge* result; 28 | 29 | log_numverts = 16; /* In base 2 */ 30 | if (argc >= 2) log_numverts = atoi(argv[1]); 31 | 32 | /* Start of graph generation timing */ 33 | #pragma mta fence 34 | start = mta_get_clock(0); 35 | 36 | make_graph(log_numverts, INT64_C(16) << log_numverts, 1, 2, &nedges, &result); 37 | 38 | #pragma mta fence 39 | time_taken = mta_get_clock(start); 40 | /* End of graph generation timing */ 41 | 42 | actual_nedges = nedges; 43 | 44 | fprintf(stderr, "%" PRIu64 " edge%s generated in %fs (%f Medges/s)\n", actual_nedges, (actual_nedges == 1 ? "" : "s"), time_taken * mta_clock_period(), 1. * actual_nedges / time_taken * 1.e-6 / mta_clock_period()); 45 | 46 | free(result); 47 | 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/graph_generator.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2009-2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #ifndef GRAPH_GENERATOR_H 11 | #define GRAPH_GENERATOR_H 12 | 13 | #include "user_settings.h" 14 | #include 15 | #include 16 | #include 17 | 18 | #ifndef __STDC_FORMAT_MACROS 19 | #define __STDC_FORMAT_MACROS 20 | #endif 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | 28 | 29 | /*typedef struct packed_edge { 30 | int64_t v0; 31 | int64_t v1; 32 | } packed_edge; 33 | */ 34 | typedef struct packed_edge { 35 | uint32_t v0; 36 | uint32_t v1; 37 | } packed_edge; 38 | 39 | static inline int64_t get_v0_from_edge(const packed_edge* p) { 40 | return p->v0; 41 | } 42 | 43 | static inline int64_t get_v1_from_edge(const packed_edge* p) { 44 | return p->v1; 45 | } 46 | 47 | static inline void write_edge(packed_edge* p, int64_t v0, int64_t v1) { 48 | if (v0 > 0x7fffffff || v1 > 0x7fffffff) { 49 | printf("WARNING EDGES TOO BIG!!! %lx %lx\n", v0, v1); 50 | } 51 | p->v0 = v0; 52 | p->v1 = v1; 53 | } 54 | 55 | /* Generate a range of edges (from start_edge to end_edge of the total graph), 56 | * writing into elements [0, end_edge - start_edge) of the edges array. This 57 | * code is parallel on OpenMP and XMT; it must be used with 58 | * separately-implemented SPMD parallelism for MPI. */ 59 | void generate_kronecker_range( 60 | const uint_fast32_t seed[5] /* All values in [0, 2^31 - 1) */, 61 | int logN /* In base 2 */, 62 | int64_t start_edge, int64_t end_edge /* Indices (in [0, M)) for the edges to generate */, 63 | packed_edge* edges /* Size >= end_edge - start_edge */ 64 | ); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* GRAPH_GENERATOR_H */ 71 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/make_graph.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2009-2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #ifndef MAKE_GRAPH_H 11 | #define MAKE_GRAPH_H 12 | 13 | #include 14 | #include "graph_generator.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Simplified interface for users; implemented in different ways on different 21 | * platforms. */ 22 | void make_graph( 23 | /* in */ int log_numverts /* log_2 of vertex count */, 24 | /* in */ int64_t desired_nedges /* Target number of edges */, 25 | /* in */ uint64_t userseed1 /* Arbitrary 64-bit seed value */, 26 | /* in */ uint64_t userseed2 /* Arbitrary 64-bit seed value */, 27 | /* out */ int64_t* nedges /* Number of generated edges */, 28 | /* out */ packed_edge** result /* Array of edges; allocated by 29 | make_graph() but must be freed using 30 | free() by user */ 31 | /* See functions in graph_generator.h for the definition of and how to 32 | * manipulate packed_edge objects (functions are write_edge, 33 | * get_v0_from_edge, get_v1_from_edge). */ 34 | ); 35 | 36 | /* PRNG interface for implementations; takes seed in same format as given by 37 | * users, and creates a vector of doubles in a reproducible (and 38 | * random-access) way. */ 39 | void make_random_numbers( 40 | /* in */ int64_t nvalues /* Number of values to generate */, 41 | /* in */ uint64_t userseed1 /* Arbitrary 64-bit seed value */, 42 | /* in */ uint64_t userseed2 /* Arbitrary 64-bit seed value */, 43 | /* in */ int64_t position /* Start index in random number stream */, 44 | /* out */ double* result /* Returned array of values */ 45 | ); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* MAKE_GRAPH_H */ 52 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/mod_arith.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #ifndef MOD_ARITH_H 11 | #define MOD_ARITH_H 12 | 13 | #include "user_settings.h" 14 | 15 | /* Various modular arithmetic operations for modulus 2^31-1 (0x7FFFFFFF). 16 | * These may need to be tweaked to get acceptable performance on some platforms 17 | * (especially ones without conditional moves). */ 18 | 19 | /* This code is now just a dispatcher that chooses the right header file to use 20 | * per-platform. */ 21 | 22 | #ifdef __MTA__ 23 | #include "mod_arith_xmt.h" 24 | #else 25 | #ifdef FAST_64BIT_ARITHMETIC 26 | #include "mod_arith_64bit.h" 27 | #else 28 | #include "mod_arith_32bit.h" 29 | #endif 30 | #endif 31 | 32 | #endif /* MOD_ARITH_H */ 33 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/mod_arith_64bit.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #ifndef MOD_ARITH_64BIT_H 11 | #define MOD_ARITH_64BIT_H 12 | 13 | #include 14 | #include 15 | 16 | /* Various modular arithmetic operations for modulus 2^31-1 (0x7FFFFFFF). 17 | * These may need to be tweaked to get acceptable performance on some platforms 18 | * (especially ones without conditional moves). */ 19 | 20 | static inline uint_fast32_t mod_add(uint_fast32_t a, uint_fast32_t b) { 21 | assert (a <= 0x7FFFFFFE); 22 | assert (b <= 0x7FFFFFFE); 23 | return (a + b) % 0x7FFFFFFF; 24 | } 25 | 26 | static inline uint_fast32_t mod_mul(uint_fast32_t a, uint_fast32_t b) { 27 | assert (a <= 0x7FFFFFFE); 28 | assert (b <= 0x7FFFFFFE); 29 | return (uint_fast32_t)((uint_fast64_t)a * b % 0x7FFFFFFF); 30 | } 31 | 32 | static inline uint_fast32_t mod_mac(uint_fast32_t sum, uint_fast32_t a, uint_fast32_t b) { 33 | assert (sum <= 0x7FFFFFFE); 34 | assert (a <= 0x7FFFFFFE); 35 | assert (b <= 0x7FFFFFFE); 36 | return (uint_fast32_t)(((uint_fast64_t)a * b + sum) % 0x7FFFFFFF); 37 | } 38 | 39 | static inline uint_fast32_t mod_mac2(uint_fast32_t sum, uint_fast32_t a, uint_fast32_t b, uint_fast32_t c, uint_fast32_t d) { 40 | assert (sum <= 0x7FFFFFFE); 41 | assert (a <= 0x7FFFFFFE); 42 | assert (b <= 0x7FFFFFFE); 43 | assert (c <= 0x7FFFFFFE); 44 | assert (d <= 0x7FFFFFFE); 45 | return (uint_fast32_t)(((uint_fast64_t)a * b + (uint_fast64_t)c * d + sum) % 0x7FFFFFFF); 46 | } 47 | 48 | static inline uint_fast32_t mod_mac3(uint_fast32_t sum, uint_fast32_t a, uint_fast32_t b, uint_fast32_t c, uint_fast32_t d, uint_fast32_t e, uint_fast32_t f) { 49 | assert (sum <= 0x7FFFFFFE); 50 | assert (a <= 0x7FFFFFFE); 51 | assert (b <= 0x7FFFFFFE); 52 | assert (c <= 0x7FFFFFFE); 53 | assert (d <= 0x7FFFFFFE); 54 | assert (e <= 0x7FFFFFFE); 55 | assert (f <= 0x7FFFFFFE); 56 | return (uint_fast32_t)(((uint_fast64_t)a * b + (uint_fast64_t)c * d + (uint_fast64_t)e * f + sum) % 0x7FFFFFFF); 57 | } 58 | 59 | static inline uint_fast32_t mod_mac4(uint_fast32_t sum, uint_fast32_t a, uint_fast32_t b, uint_fast32_t c, uint_fast32_t d, uint_fast32_t e, uint_fast32_t f, uint_fast32_t g, uint_fast32_t h) { 60 | assert (sum <= 0x7FFFFFFE); 61 | assert (a <= 0x7FFFFFFE); 62 | assert (b <= 0x7FFFFFFE); 63 | assert (c <= 0x7FFFFFFE); 64 | assert (d <= 0x7FFFFFFE); 65 | assert (e <= 0x7FFFFFFE); 66 | assert (f <= 0x7FFFFFFE); 67 | assert (g <= 0x7FFFFFFE); 68 | assert (h <= 0x7FFFFFFE); 69 | return (uint_fast32_t)(((uint_fast64_t)a * b + (uint_fast64_t)c * d + (uint_fast64_t)e * f + (uint_fast64_t)g * h + sum) % 0x7FFFFFFF); 70 | } 71 | 72 | /* The two constants x and y are special cases because they are easier to 73 | * multiply by on 32-bit systems. They are used as multipliers in the random 74 | * number generator. The techniques for fast multiplication by these 75 | * particular values are in L'Ecuyer's papers; we don't use them yet. */ 76 | 77 | static inline uint_fast32_t mod_mul_x(uint_fast32_t a) { 78 | return mod_mul(a, 107374182); 79 | } 80 | 81 | static inline uint_fast32_t mod_mul_y(uint_fast32_t a) { 82 | return mod_mul(a, 104480); 83 | } 84 | 85 | static inline uint_fast32_t mod_mac_y(uint_fast32_t sum, uint_fast32_t a) { 86 | return mod_mac(sum, a, 104480); 87 | } 88 | 89 | #endif /* MOD_ARITH_64BIT_H */ 90 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/splittable_mrg.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #ifndef SPLITTABLE_MRG_H 11 | #define SPLITTABLE_MRG_H 12 | 13 | #include 14 | 15 | /* Multiple recursive generator from L'Ecuyer, P., Blouin, F., and */ 16 | /* Couture, R. 1993. A search for good multiple recursive random number */ 17 | /* generators. ACM Trans. Model. Comput. Simul. 3, 2 (Apr. 1993), 87-98. */ 18 | /* DOI= http://doi.acm.org/10.1145/169702.169698 -- particular generator */ 19 | /* used is from table 3, entry for m = 2^31 - 1, k = 5 (same generator */ 20 | /* is used in GNU Scientific Library). */ 21 | 22 | /* See notes at top of splittable_mrg.c for information on this */ 23 | /* implementation. */ 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | typedef struct mrg_state { 30 | uint_fast32_t z1, z2, z3, z4, z5; 31 | } mrg_state; 32 | 33 | /* Returns integer value in [0, 2^31-1) using original transition matrix */ 34 | uint_fast32_t mrg_get_uint_orig(mrg_state* state); 35 | 36 | /* Returns real value in [0, 1) using original transition matrix */ 37 | double mrg_get_double_orig(mrg_state* state); 38 | 39 | /* Seed PRNG with a given array of five values in the range [0, 0x7FFFFFFE] and 40 | * not all zero. */ 41 | void mrg_seed(mrg_state* st, const uint_fast32_t seed[5]); 42 | 43 | /* Skip the PRNG ahead _exponent_ steps. This code treats the exponent as a 44 | * 192-bit word, even though the PRNG period is less than that. */ 45 | void mrg_skip(mrg_state* state, 46 | uint_least64_t exponent_high, 47 | uint_least64_t exponent_middle, 48 | uint_least64_t exponent_low); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* SPLITTABLE_MRG_H */ 55 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/user_settings.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2009-2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #ifndef USER_SETTINGS_H 11 | #define USER_SETTINGS_H 12 | 13 | /* Settings for user modification ----------------------------------- */ 14 | 15 | /* #define GENERATOR_USE_PACKED_EDGE_TYPE -- 48 bits per edge */ 16 | #undef GENERATOR_USE_PACKED_EDGE_TYPE /* 64 bits per edge */ 17 | 18 | #define FAST_64BIT_ARITHMETIC /* Use 64-bit arithmetic when possible. */ 19 | /* #undef FAST_64BIT_ARITHMETIC -- Assume 64-bit arithmetic is slower than 32-bit. */ 20 | 21 | /* End of user settings ----------------------------------- */ 22 | 23 | #endif /* USER_SETTINGS_H */ 24 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/utils.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | #define _POSIX_C_SOURCE 200809L 10 | #include 11 | #ifndef __STDC_CONSTANT_MACROS 12 | #define __STDC_CONSTANT_MACROS 13 | #endif 14 | #include "splittable_mrg.h" 15 | #include "graph_generator.h" 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #ifdef __MTA__ 22 | #include 23 | #endif 24 | #ifdef GRAPH_GENERATOR_MPI 25 | #include 26 | #endif 27 | #ifdef GRAPH_GENERATOR_OMP 28 | #include 29 | #endif 30 | #include "utils.h" 31 | 32 | #if defined(_OPENMP) 33 | #define OMP(x_) _Pragma(x_) 34 | #else 35 | #define OMP(x_) 36 | #endif 37 | #include 38 | 39 | #define ALIGNMET (8UL << 30) 40 | 41 | int posix_memalign(void **memptr, size_t alignment, size_t size); 42 | 43 | 44 | void * 45 | do_xmalloc_large (size_t sz) 46 | { 47 | void *memptr; 48 | printf("Allocating %zu MB\n", sz >> 20); 49 | if (posix_memalign(&memptr, 8UL<<30, sz)) { 50 | printf("ENOMEM\n"); 51 | exit(1); 52 | } 53 | return memptr; 54 | } 55 | 56 | void * 57 | xmalloc (size_t sz) 58 | { 59 | void * out; 60 | out = do_xmalloc_large (sz); 61 | if (!out) { 62 | fprintf(stderr, "Out of memory trying to allocate %zu byte(s)\n", sz); 63 | abort (); 64 | } 65 | memset(out, 0, sz); 66 | return out; 67 | } 68 | 69 | void * 70 | xcalloc (size_t n, size_t sz) 71 | { 72 | void * out; 73 | out = do_xmalloc_large ( n * sz); 74 | if (!out) { 75 | fprintf(stderr, 76 | "Out of memory trying to allocate/clear %zu items of %zu byte(s)\n", 77 | n, sz); 78 | abort (); 79 | } 80 | memset(out, 0, n * sz); 81 | return out; 82 | } 83 | void 84 | xfree (void * p, size_t sz) 85 | { 86 | free (p); 87 | } 88 | 89 | 90 | /* Spread the two 64-bit numbers into five nonzero values in the correct 91 | * range. */ 92 | void make_mrg_seed(uint64_t userseed1, uint64_t userseed2, uint_fast32_t* seed) { 93 | seed[0] = (uint32_t)(userseed1 & UINT32_C(0x3FFFFFFF)) + 1; 94 | seed[1] = (uint32_t)((userseed1 >> 30) & UINT32_C(0x3FFFFFFF)) + 1; 95 | seed[2] = (uint32_t)(userseed2 & UINT32_C(0x3FFFFFFF)) + 1; 96 | seed[3] = (uint32_t)((userseed2 >> 30) & UINT32_C(0x3FFFFFFF)) + 1; 97 | seed[4] = (uint32_t)((userseed2 >> 60) << 4) + (uint32_t)(userseed1 >> 60) + 1; 98 | } 99 | -------------------------------------------------------------------------------- /trident-workloads/graph500/generator/utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010 The Trustees of Indiana University. */ 2 | /* */ 3 | /* Use, modification and distribution is subject to the Boost Software */ 4 | /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ 5 | /* http://www.boost.org/LICENSE_1_0.txt) */ 6 | /* */ 7 | /* Authors: Jeremiah Willcock */ 8 | /* Andrew Lumsdaine */ 9 | 10 | #ifndef UTILS_H 11 | #define UTILS_H 12 | 13 | #include 14 | #include 15 | #include "splittable_mrg.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void* xmalloc(size_t n); 22 | void* xcalloc(size_t n, size_t k); 23 | void* xrealloc(void* p, size_t nbytes); /* In utils.c */ 24 | uint_fast64_t random_up_to(mrg_state* st, uint_fast64_t n); 25 | void make_mrg_seed(uint64_t userseed1, uint64_t userseed2, uint_fast32_t* seed); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif /* UTILS_H */ 32 | -------------------------------------------------------------------------------- /trident-workloads/graph500/graph500.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #if !defined(GRAPH500_HEADER_) 5 | #define GRAPH500_HEADER_ 6 | 7 | #define NAME "Graph500 sequential list" 8 | #define VERSION 0 9 | 10 | #include "generator/graph_generator.h" 11 | 12 | struct packed_edge; 13 | 14 | /** Pass the edge list to an external graph creation routine. */ 15 | int create_graph_from_edgelist (struct packed_edge *IJ, int64_t nedge); 16 | 17 | /** Create the BFS tree from a given source vertex. */ 18 | int make_bfs_tree (int64_t *bfs_tree_out, int64_t *max_vtx_out, 19 | int64_t srcvtx); 20 | 21 | /** Clean up. */ 22 | void destroy_graph (void); 23 | 24 | #endif /* GRAPH500_HEADER_ */ 25 | -------------------------------------------------------------------------------- /trident-workloads/graph500/kronecker.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #include "compat.h" 5 | #include 6 | 7 | #include "xalloc.h" 8 | #include "prng.h" 9 | #include "rmat.h" 10 | #include "generator/splittable_mrg.h" 11 | #include "generator/graph_generator.h" 12 | 13 | #if 0 14 | void 15 | kronecker_edgelist (struct packed_edge *IJ_in, int64_t nedge, int64_t SCALE, 16 | double A, double B, double C) 17 | { 18 | const int64_t nvtx = 1L< 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include /* Portable enough... */ 14 | #include 15 | #include 16 | 17 | #if !defined(__MTA__) 18 | #include 19 | #endif 20 | 21 | 22 | #include "graph500.h" 23 | #include "rmat.h" 24 | #include "kronecker.h" 25 | #include "verify.h" 26 | #include "prng.h" 27 | #include "xalloc.h" 28 | #include "options.h" 29 | #include "generator/splittable_mrg.h" 30 | #include "generator/make_graph.h" 31 | 32 | static int64_t nvtx_scale; 33 | 34 | static struct packed_edge * restrict IJ; 35 | static int64_t nedge; 36 | 37 | static int64_t bfs_root[NBFS_max]; 38 | 39 | int 40 | main (int argc, char **argv) 41 | { 42 | int * restrict has_adj; 43 | int fd; 44 | int64_t desired_nedge; 45 | if (sizeof (int64_t) < 8) { 46 | fprintf (stderr, "No 64-bit support.\n"); 47 | return EXIT_FAILURE; 48 | } 49 | 50 | if (argc > 1) 51 | get_options (argc, argv); 52 | 53 | nvtx_scale = 1L<= nvtx_scale); 60 | assert (desired_nedge >= edgefactor); 61 | 62 | 63 | if (VERBOSE) fprintf (stderr, "Generating edge list..."); 64 | if (use_RMAT) { 65 | nedge = desired_nedge; 66 | IJ = xmalloc_large_ext (nedge * sizeof (*IJ)); 67 | rmat_edgelist (IJ, nedge, SCALE, A, B, C); 68 | } else { 69 | make_graph(SCALE, desired_nedge, userseed, userseed, &nedge, (struct packed_edge**)(&IJ)); 70 | } 71 | if (VERBOSE) fprintf (stderr, " done.\n"); 72 | 73 | if (dumpname) 74 | fd = open (dumpname, O_WRONLY|O_CREAT|O_TRUNC, 0666); 75 | else 76 | fd = 1; 77 | 78 | if (fd < 0) { 79 | fprintf (stderr, "Cannot open output file : %s\n", 80 | (dumpname? dumpname : "stdout")); 81 | return EXIT_FAILURE; 82 | } 83 | 84 | write (fd, IJ, nedge * sizeof (*IJ)); 85 | 86 | close (fd); 87 | 88 | if (rootname) 89 | fd = open (rootname, O_WRONLY|O_CREAT|O_TRUNC, 0666); 90 | else 91 | fd = -1; 92 | 93 | if (rootname >= 0) { 94 | has_adj = xmalloc_large (nvtx_scale * sizeof (*has_adj)); 95 | OMP("omp parallel") { 96 | OMP("omp for") 97 | for (int64_t k = 0; k < nvtx_scale; ++k) 98 | has_adj[k] = 0; 99 | MTA("mta assert nodep") OMP("omp for") 100 | for (int64_t k = 0; k < nedge; ++k) { 101 | const int64_t i = get_v0_from_edge(&IJ[k]); 102 | const int64_t j = get_v1_from_edge(&IJ[k]); 103 | if (i != j) 104 | has_adj[i] = has_adj[j] = 1; 105 | } 106 | } 107 | 108 | /* Sample from {0, ..., nvtx_scale-1} without replacement. */ 109 | { 110 | int m = 0; 111 | int64_t t = 0; 112 | while (m < NBFS && t < nvtx_scale) { 113 | double R = mrg_get_double_orig (prng_state); 114 | if (!has_adj[t] || (nvtx_scale - t)*R > NBFS - m) ++t; 115 | else bfs_root[m++] = t++; 116 | } 117 | if (t >= nvtx_scale && m < NBFS) { 118 | if (m > 0) { 119 | fprintf (stderr, "Cannot find %d sample roots of non-self degree > 0, using %d.\n", 120 | NBFS, m); 121 | NBFS = m; 122 | } else { 123 | fprintf (stderr, "Cannot find any sample roots of non-self degree > 0.\n"); 124 | exit (EXIT_FAILURE); 125 | } 126 | } 127 | } 128 | 129 | xfree_large (has_adj); 130 | write (fd, bfs_root, NBFS * sizeof (*bfs_root)); 131 | close (fd); 132 | } 133 | 134 | return EXIT_SUCCESS; 135 | } 136 | -------------------------------------------------------------------------------- /trident-workloads/graph500/make-incs/make.inc-gcc: -------------------------------------------------------------------------------- 1 | # -*- Makefile -*- 2 | # Copyright 2010-2011, Georgia Institute of Technology, USA. 3 | # See COPYING for license. 4 | CC = gcc-4.6 -flto -fwhole-program 5 | CFLAGS = -g -std=c99 -Wall -O3 -march=native 6 | LDLIBS = -lm -lrt 7 | 8 | ## Uncomment if you have libnuma and want a numactl-aware malloc. 9 | # LDLIBS += -lnuma 10 | # CPPFLAGS += -DHAVE_LIBNUMA 11 | 12 | ## Uncomment to build OpenMP examples. 13 | # BUILD_OPENMP = Yes 14 | # CFLAGS_OPENMP = -fopenmp 15 | 16 | ## Uncomment to build the MPI code using default compilers, etc. 17 | # BUILD_MPI = Yes 18 | -------------------------------------------------------------------------------- /trident-workloads/graph500/make-incs/make.inc-osx: -------------------------------------------------------------------------------- 1 | # -*- Makefile -*- 2 | # Copyright 2010-2011, University of Illinois at Urbana-Champaign 3 | # See COPYING for license. 4 | CFLAGS = -g -std=c99 -Wall 5 | LDLIBS = -lm 6 | # OSX does not support MAP_ANON in POSIX mode and the timers for MacOSX are 7 | # not available for Leopard 8 | # Use HAVE_MACH_ABSOLUTE_TIME to get the Mac OSX Timer 9 | # Use HAVE_ALLOCA_H to include alloca.h 10 | # Use HAVE_MPI_INT64_T to use the MPI 2.2 Datatype for int64_t items 11 | # Use HAVE_UNISTD_H to include unistd.h (for getopt definitions) 12 | CPPFLAGS = -DHAVE_MACH_ABSOLUTE_TIME -DHAVE_ALLOCA_H -DHAVE_MPI_INT64_T -DHAVE_UNISTD_H 13 | BUILD_MPI = Yes 14 | BUILD_OPENMP = No 15 | -------------------------------------------------------------------------------- /trident-workloads/graph500/make-incs/make.inc-xmt: -------------------------------------------------------------------------------- 1 | # -*- Makefile -*- 2 | # Copyright 2010-2011, Georgia Institute of Technology, USA. 3 | # See COPYING for license. 4 | # Modules and Emacs+tramp don't cooperate at PNNL. 5 | #PATH:=/opt/mta-pe/6.5.0/bin:${PATH} 6 | CFLAGS = 7 | LDLIBS = -lprand -lm -lrt 8 | CPPFLAGS = -DNDEBUG 9 | 10 | BUILD_OPENMP = No 11 | CFLAGS_OPENMP = 12 | 13 | BUILD_XMT = Yes 14 | -------------------------------------------------------------------------------- /trident-workloads/graph500/make.inc: -------------------------------------------------------------------------------- 1 | # -*- Makefile -*- 2 | # Copyright 2010-2011, Georgia Institute of Technology, USA. 3 | # See COPYING for license. 4 | CC = gcc -flto -fwhole-program 5 | CFLAGS = -g -std=c99 -Wall -O3 -march=native 6 | LDLIBS = -lm -lrt 7 | 8 | ## Uncomment if you have libnuma and want a numactl-aware malloc. 9 | #LDLIBS += -lnuma 10 | #CPPFLAGS += -DHAVE_LIBNUMA 11 | 12 | ## Uncomment to use a file-backed mapping for large data. 13 | 14 | ## Uncomment to build OpenMP examples. 15 | BUILD_OPENMP = Yes 16 | CFLAGS_OPENMP = -fopenmp 17 | 18 | ## Uncomment to build the MPI code using default compilers, etc. 19 | # BUILD_MPI = Yes 20 | -------------------------------------------------------------------------------- /trident-workloads/graph500/octave/Graph500.m: -------------------------------------------------------------------------------- 1 | SCALE = 10; 2 | edgefactor = 16; 3 | NBFS = 64; 4 | 5 | rand ("seed", 103); 6 | 7 | ij = kronecker_generator (SCALE, edgefactor); 8 | 9 | tic; 10 | G = kernel_1 (ij); 11 | kernel_1_time = toc; 12 | 13 | N = size (G, 1); 14 | coldeg = full (spstats (G)); 15 | search_key = randperm (N); 16 | search_key(coldeg(search_key) == 0) = []; 17 | if length (search_key) > NBFS, 18 | search_key = search_key(1:NBFS); 19 | else 20 | NBFS = length (search_key); 21 | end 22 | search_key = search_key - 1; 23 | 24 | kernel_2_time = Inf * ones (NBFS, 1); 25 | kernel_2_nedge = zeros (NBFS, 1); 26 | 27 | indeg = histc (ij(:), 1:N); % For computing the number of edges 28 | 29 | for k = 1:NBFS, 30 | tic; 31 | parent = kernel_2 (G, search_key(k)); 32 | kernel_2_time(k) = toc; 33 | err = validate (parent, ij, search_key (k)); 34 | if err <= 0, 35 | error (sprintf ("BFS %d from search key %d failed to validate: %d", 36 | k, search_key(k), err)); 37 | end 38 | kernel_2_nedge(k) = sum (indeg(parent >= 0))/2; % Volume/2 39 | end 40 | 41 | output (SCALE, edgefactor, NBFS, kernel_1_time, kernel_2_time, kernel_2_nedge); 42 | -------------------------------------------------------------------------------- /trident-workloads/graph500/octave/kernel_1.m: -------------------------------------------------------------------------------- 1 | function G = kernel_1 (ij) 2 | %% Compute a sparse adjacency matrix representation 3 | %% of the graph with edges from ij. 4 | 5 | %% Remove self-edges. 6 | ij(:, ij(1,:) == ij(2,:)) = []; 7 | %% Adjust away from zero labels. 8 | ij = ij + 1; 9 | %% Find the maximum label for sizing. 10 | N = max (max (ij)); 11 | %% Create the matrix, ensuring it is square. 12 | G = sparse (ij(1,:), ij(2,:), ones (1, size (ij, 2)), N, N); 13 | %% Symmetrize to model an undirected graph. 14 | G = spones (G + G.'); 15 | -------------------------------------------------------------------------------- /trident-workloads/graph500/octave/kernel_2.m: -------------------------------------------------------------------------------- 1 | function parent = kernel_2 (G, root) 2 | %% Compute a sparse adjacency matrix representation 3 | %% of the graph with edges from ij. 4 | 5 | N = size (G, 1); 6 | %% Adjust from zero labels. 7 | root = root + 1; 8 | parent = zeros (N, 1); 9 | parent (root) = root; 10 | 11 | vlist = zeros (N, 1); 12 | vlist(1) = root; 13 | lastk = 1; 14 | for k = 1:N, 15 | v = vlist(k); 16 | if v == 0, break; end 17 | [I,J,V] = find (G(:, v)); 18 | nxt = I(parent(I) == 0); 19 | parent(nxt) = v; 20 | vlist(lastk + (1:length (nxt))) = nxt; 21 | lastk = lastk + length (nxt); 22 | end 23 | 24 | %% Adjust to zero labels. 25 | parent = parent - 1; 26 | 27 | -------------------------------------------------------------------------------- /trident-workloads/graph500/octave/kronecker_generator.m: -------------------------------------------------------------------------------- 1 | function ij = kronecker_generator (SCALE, edgefactor) 2 | %% Generate an edgelist according to the Graph500 3 | %% parameters. In this sample, the edge list is 4 | %% returned in an array with two rows, where StartVertex 5 | %% is first row and EndVertex is the second. The vertex 6 | %% labels start at zero. 7 | %% 8 | %% Example, creating a sparse matrix for viewing: 9 | %% ij = kronecker_generator (10, 16); 10 | %% G = sparse (ij(1,:)+1, ij(2,:)+1, ones (1, size (ij, 2))); 11 | %% spy (G); 12 | %% The spy plot should appear fairly dense. Any locality 13 | %% is removed by the final permutations. 14 | 15 | %% Set number of vertices. 16 | N = 2^SCALE; 17 | 18 | %% Set number of edges. 19 | M = edgefactor * N; 20 | 21 | %% Set initiator probabilities. 22 | [A, B, C] = deal (0.57, 0.19, 0.19); 23 | 24 | %% Create index arrays. 25 | ij = ones (2, M); 26 | %% Loop over each order of bit. 27 | ab = A + B; 28 | c_norm = C/(1 - (A + B)); 29 | a_norm = A/(A + B); 30 | 31 | for ib = 1:SCALE, 32 | %% Compare with probabilities and set bits of indices. 33 | ii_bit = rand (1, M) > ab; 34 | jj_bit = rand (1, M) > ( c_norm * ii_bit + a_norm * not (ii_bit) ); 35 | ij = ij + 2^(ib-1) * [ii_bit; jj_bit]; 36 | end 37 | 38 | %% Permute vertex labels 39 | p = randperm (N); 40 | ij = p(ij); 41 | 42 | %% Permute the edge list 43 | p = randperm (M); 44 | ij = ij(:, p); 45 | 46 | %% Adjust to zero-based labels. 47 | ij = ij - 1; 48 | -------------------------------------------------------------------------------- /trident-workloads/graph500/octave/output.m: -------------------------------------------------------------------------------- 1 | function output (SCALE, edgefactor, NBFS, kernel_1_time, kernel_2_time, kernel_2_nedge) 2 | printf ("SCALE: %d\n", SCALE); 3 | printf ("edgefactor: %d\n", edgefactor); 4 | printf ("NBFS: %d\n", NBFS); 5 | printf ("construction_time: %20.17e\n", kernel_1_time); 6 | 7 | S = statistics (kernel_2_time); 8 | printf ("min_time: %20.17e\n", S(1)); 9 | printf ("firstquartile_time: %20.17e\n", S(2)); 10 | printf ("median_time: %20.17e\n", S(3)); 11 | printf ("thirdquartile_time: %20.17e\n", S(4)); 12 | printf ("max_time: %20.17e\n", S(5)); 13 | printf ("mean_time: %20.17e\n", S(6)); 14 | printf ("stddev_time: %20.17e\n", S(7)); 15 | 16 | S = statistics (kernel_2_nedge); 17 | printf ("min_nedge: %20.17e\n", S(1)); 18 | printf ("firstquartile_nedge: %20.17e\n", S(2)); 19 | printf ("median_nedge: %20.17e\n", S(3)); 20 | printf ("thirdquartile_nedge: %20.17e\n", S(4)); 21 | printf ("max_nedge: %20.17e\n", S(5)); 22 | printf ("mean_nedge: %20.17e\n", S(6)); 23 | printf ("stddev_nedge: %20.17e\n", S(7)); 24 | 25 | TEPS = kernel_2_nedge ./ kernel_2_time; 26 | N = length (TEPS); 27 | S = statistics (TEPS); 28 | S(6) = mean (TEPS, 'h'); 29 | %% Harmonic standard deviation from: 30 | %% Nilan Norris, The Standard Errors of the Geometric and Harmonic 31 | %% Means and Their Application to Index Numbers, 1940. 32 | %% http://www.jstor.org/stable/2235723 33 | tmp = zeros (N, 1); 34 | tmp(TEPS > 0) = 1./TEPS(TEPS > 0); 35 | tmp = tmp - 1/S(6); 36 | S(7) = (sqrt (sum (tmp.^2)) / (N-1)) * S(6)^2; 37 | 38 | printf ("min_TEPS: %20.17e\n", S(1)); 39 | printf ("firstquartile_TEPS: %20.17e\n", S(2)); 40 | printf ("median_TEPS: %20.17e\n", S(3)); 41 | printf ("thirdquartile_TEPS: %20.17e\n", S(4)); 42 | printf ("max_TEPS: %20.17e\n", S(5)); 43 | printf ("harmonic_mean_TEPS: %20.17e\n", S(6)); 44 | printf ("harmonic_stddev_TEPS: %20.17e\n", S(7)); 45 | -------------------------------------------------------------------------------- /trident-workloads/graph500/octave/validate.m: -------------------------------------------------------------------------------- 1 | function out = validate (parent, ij, search_key) 2 | out = 1; 3 | parent = parent + 1; 4 | search_key = search_key + 1; 5 | 6 | if parent (search_key) != search_key, 7 | out = 0; 8 | return; 9 | end 10 | 11 | ij = ij + 1; 12 | N = max (max (ij)); 13 | slice = find (parent > 0); 14 | 15 | level = zeros (size (parent)); 16 | level (slice) = 1; 17 | P = parent (slice); 18 | mask = P != search_key; 19 | k = 0; 20 | while any (mask), 21 | level(slice(mask)) = level(slice(mask)) + 1; 22 | P = parent (P); 23 | mask = P != search_key; 24 | k = k + 1; 25 | if k > N, 26 | %% There must be a cycle in the tree. 27 | out = -3; 28 | return; 29 | end 30 | end 31 | 32 | lij = level (ij); 33 | neither_in = lij(1,:) == 0 & lij(2,:) == 0; 34 | both_in = lij(1,:) > 0 & lij(2,:) > 0; 35 | if any (not (neither_in | both_in)), 36 | out = -4; 37 | return 38 | end 39 | respects_tree_level = abs (lij(1,:) - lij(2,:)) <= 1; 40 | if any (not (neither_in | respects_tree_level)), 41 | out = -5; 42 | return 43 | end 44 | -------------------------------------------------------------------------------- /trident-workloads/graph500/omp-csr/bitmap.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013, Regents of the University of California, USA. */ 2 | /* See COPYING for license. */ 3 | #ifndef BITMAP_H 4 | #define BITMAP_H 5 | 6 | #include "../compat.h" 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | /* Implemented in .h (without a .c) to allow optimizing compiler to inline 13 | For best performance, compile with -O3 or equivalent */ 14 | 15 | extern int int64_cas(int64_t* p, int64_t oldval, int64_t newval); 16 | 17 | #define WORD_OFFSET(n) (n/64) 18 | #define BIT_OFFSET(n) (n & 0x3f) 19 | 20 | typedef struct { 21 | uint64_t *start; 22 | uint64_t *end; 23 | } bitmap_t; 24 | 25 | static inline void 26 | bm_reset(bitmap_t* bm) 27 | { 28 | OMP("omp for") 29 | for(uint64_t* it=bm->start; itend; it++) 30 | *it = 0; 31 | } 32 | 33 | static inline void 34 | bm_init(bitmap_t* bm, int size) 35 | { 36 | int num_longs = (size + 63) / 64; 37 | bm->start = (uint64_t*) xmalloc(sizeof(uint64_t) * num_longs); 38 | bm->end = bm->start + num_longs; 39 | bm_reset(bm); 40 | } 41 | 42 | static inline uint64_t 43 | bm_get_bit(bitmap_t* bm, long pos) 44 | { 45 | return bm->start[WORD_OFFSET(pos)] & (1l<start + WORD_OFFSET(pos); 54 | uint64_t temp = (*it); 55 | if (bit_offset != 63) { 56 | temp = temp >> (bit_offset+1); 57 | } else { 58 | temp = 0; 59 | } 60 | if (!temp) { 61 | next = (next & 0xffffffc0); 62 | while (!temp) { 63 | it++; 64 | if (it >= bm->end) 65 | return -1; 66 | temp = *it; 67 | next += 64; 68 | } 69 | } else { 70 | next++; 71 | } 72 | while(!(temp&1)) { 73 | temp = temp >> 1; 74 | next++; 75 | } 76 | return next; 77 | } 78 | 79 | static inline void 80 | bm_set_bit(bitmap_t* bm, long pos) 81 | { 82 | bm->start[WORD_OFFSET(pos)] |= ((uint64_t) 1l<start + WORD_OFFSET(pos); 90 | do { 91 | old_val = *loc; 92 | new_val = old_val | ((uint64_t) 1l<start; 100 | a->start = b->start; 101 | b->start = temp; 102 | temp = a->end; 103 | a->end = b->end; 104 | b->end = temp; 105 | } 106 | 107 | static inline void 108 | bm_free(bitmap_t* bm) 109 | { 110 | free(bm->start); 111 | } 112 | 113 | #endif // BITMAP_H 114 | -------------------------------------------------------------------------------- /trident-workloads/graph500/options.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #if !defined(OPTIONS_HEADER_) 5 | #define OPTIONS_HEADER_ 6 | 7 | extern int VERBOSE; 8 | extern int use_RMAT; 9 | extern char *dumpname; 10 | extern char *rootname; 11 | 12 | #define A_PARAM 0.57 13 | #define B_PARAM 0.19 14 | #define C_PARAM 0.19 15 | /* Hence D = 0.05. */ 16 | 17 | extern double A, B, C, D; 18 | 19 | 20 | #ifdef _OPENMP 21 | #define NBFS_max 64 22 | #else 23 | #define NBFS_max 4 24 | #endif 25 | extern int NBFS; 26 | 27 | #define default_SCALE ((int64_t)14) 28 | #define default_edgefactor ((int64_t)16) 29 | 30 | extern int64_t SCALE; 31 | extern int64_t edgefactor; 32 | 33 | void get_options (int argc, char **argv); 34 | 35 | #endif /* OPTIONS_HEADER_ */ 36 | -------------------------------------------------------------------------------- /trident-workloads/graph500/prng.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #include "compat.h" 5 | #include 6 | #include 7 | #include 8 | 9 | #include "generator/splittable_mrg.h" 10 | 11 | uint64_t userseed; 12 | uint_fast32_t prng_seed[5]; 13 | static mrg_state prng_state_store; 14 | void *prng_state = &prng_state_store; 15 | 16 | /* Spread the two 64-bit numbers into five nonzero values in the correct 17 | * range. */ 18 | static void make_mrg_seed(uint64_t userseed, uint_fast32_t* seed) { 19 | seed[0] = (userseed & 0x3FFFFFFF) + 1; 20 | seed[1] = ((userseed >> 30) & 0x3FFFFFFF) + 1; 21 | seed[2] = (userseed & 0x3FFFFFFF) + 1; 22 | seed[3] = ((userseed >> 30) & 0x3FFFFFFF) + 1; 23 | seed[4] = ((userseed >> 60) << 4) + (userseed >> 60) + 1; 24 | } 25 | 26 | void 27 | init_random (void) 28 | { 29 | long seed = -1; 30 | if (getenv ("SEED")) { 31 | errno = 0; 32 | seed = strtol (getenv ("SEED"), NULL, 10); 33 | if (errno) seed = -1; 34 | } 35 | 36 | if (seed < 0) seed = 0xDECAFBAD; 37 | userseed = seed; 38 | make_mrg_seed (seed, prng_seed); 39 | mrg_seed(&prng_state_store, prng_seed); 40 | } 41 | -------------------------------------------------------------------------------- /trident-workloads/graph500/prng.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #if !defined(PRNG_HEADER_) 5 | #define PRNG_HEADER_ 6 | 7 | /** Initialze the PRNG, called in a sequential context. */ 8 | void init_random (void); 9 | 10 | extern uint64_t userseed; 11 | extern uint_fast32_t prng_seed[5]; 12 | extern void *prng_state; 13 | 14 | #endif /* PRNG_HEADER_ */ 15 | -------------------------------------------------------------------------------- /trident-workloads/graph500/rmat.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #if !defined(RMAT_HEADER_) 5 | #define RMAT_HEADER_ 6 | 7 | #include "generator/graph_generator.h" 8 | 9 | /** Fill IJ with a randomly permuted R-MAT generated edge list. */ 10 | void rmat_edgelist (struct packed_edge *IJ, int64_t nedge, int SCALE, 11 | double A, double B, double C); 12 | void permute_vertex_labels (struct packed_edge * IJ, int64_t nedge, int64_t max_nvtx, 13 | void * st, int64_t * newlabel); 14 | void permute_edgelist (struct packed_edge * IJ, int64_t nedge, void *st); 15 | 16 | #endif /* RMAT_HEADER_ */ 17 | -------------------------------------------------------------------------------- /trident-workloads/graph500/seq-list/seq-list.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #define _FILE_OFFSET_BITS 64 5 | #define _THREAD_SAFE 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include "../compat.h" 12 | #include "../graph500.h" 13 | #include "../xalloc.h" 14 | 15 | static int64_t maxvtx, maxdeg, nIJ; 16 | static const struct packed_edge * restrict IJ; 17 | static int64_t * restrict head, * restrict deg, * restrict next; 18 | 19 | /** Pass the edge list to an external graph creation routine. */ 20 | int create_graph_from_edgelist (struct packed_edge *IJ_in, int64_t nedge) 21 | { 22 | int err = 0; 23 | 24 | IJ = IJ_in; 25 | nIJ = nedge; 26 | maxvtx = -1; 27 | maxdeg = -1; 28 | 29 | int64_t k; 30 | for (k = 0; k < nedge; ++k) { 31 | if (get_v0_from_edge(&IJ[k]) > maxvtx) 32 | maxvtx = get_v0_from_edge(&IJ[k]); 33 | if (get_v1_from_edge(&IJ[k]) > maxvtx) 34 | maxvtx = get_v1_from_edge(&IJ[k]); 35 | } 36 | 37 | head = xmalloc ((2*(maxvtx+1) + 2*nIJ) * sizeof (int64_t)); 38 | if (!head) return -1; 39 | deg = &head[maxvtx+1]; 40 | next = °[maxvtx+1]; 41 | 42 | for (k = 0; k <= maxvtx; ++k) { 43 | head[k] = -1; 44 | deg[k] = 0; 45 | } 46 | 47 | for (k = 0; k < nedge; ++k) { 48 | const int64_t i = get_v0_from_edge(&IJ[k]); 49 | const int64_t j = get_v1_from_edge(&IJ[k]); 50 | int64_t t_head, t; 51 | 52 | if (i >= 0 && j >= 0 && i != j) { 53 | next[2*k] = -1; 54 | next[1+2*k] = -1; 55 | t = 2*k+1; /* Point at the *other* end. */ 56 | t_head = head[i]; 57 | head[i] = t; 58 | assert (t_head < 2*nIJ); 59 | next[t] = t_head; 60 | ++deg[i]; 61 | 62 | --t; 63 | t_head = head[j]; 64 | head[j] = t; 65 | assert (t_head < 2*nIJ); 66 | next[t] = t_head; 67 | ++deg[j]; 68 | } 69 | } 70 | 71 | for (int64_t kg = 0; kg <= maxvtx; ++kg) 72 | if (deg[kg] > maxdeg) 73 | maxdeg = deg[kg]; 74 | 75 | return err; 76 | } 77 | 78 | int 79 | make_bfs_tree (int64_t *bfs_tree_out, int64_t *max_vtx_out, 80 | int64_t srcvtx) 81 | { 82 | int64_t * restrict bfs_tree = bfs_tree_out; 83 | int err = 0; 84 | const int64_t nv = maxvtx+1; 85 | 86 | int64_t k, k1, k2; 87 | int64_t * restrict vlist; 88 | 89 | *max_vtx_out = maxvtx; 90 | 91 | bfs_tree[srcvtx] = srcvtx; 92 | 93 | vlist = xmalloc (nv * sizeof (*vlist)); 94 | if (!vlist) return -1; 95 | bfs_tree[srcvtx] = srcvtx; 96 | k1 = 0; k2 = 1; 97 | vlist[0] = srcvtx; 98 | 99 | for (k = 0; k < srcvtx; ++k) 100 | bfs_tree[k] = -1; 101 | for (k = srcvtx+1; k < nv; ++k) 102 | bfs_tree[k] = -1; 103 | 104 | while (k1 != k2) { 105 | int64_t k, newk2 = k2; 106 | for (k = k1; k < k2; ++k) { 107 | const int64_t parent = vlist[k]; 108 | int64_t p = head[parent]; 109 | while (p >= 0) { 110 | const int64_t newv = ((p % 2) ? get_v1_from_edge(&IJ[p / 2]) : get_v0_from_edge(&IJ[p / 2])); 111 | if (bfs_tree[newv] < 0) { 112 | bfs_tree[newv] = parent; 113 | vlist[newk2++] = newv; 114 | } 115 | p = next[p]; 116 | } 117 | k1 = k2; 118 | k2 = newk2; 119 | } 120 | } 121 | free (vlist); 122 | 123 | return err; 124 | } 125 | 126 | void 127 | destroy_graph (void) 128 | { 129 | free (head); 130 | } 131 | -------------------------------------------------------------------------------- /trident-workloads/graph500/timer.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #include "compat.h" 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #if defined(__MTA__) 13 | #include 14 | long tic_ts; 15 | #elif defined(__MacOSX__) 16 | static AbsoluteTime tic_ts; 17 | #elif defined(HAVE_MACH_ABSOLUTE_TIME) 18 | #include 19 | static uint64_t tic_ts; 20 | #else 21 | #if defined(CLOCK_MONOTONIC) 22 | #define TICTOC_CLOCK CLOCK_MONOTONIC 23 | #define TICTOC_CLOCK_NAME "CLOCK_MONOTONIC" 24 | #elif defined(CLOCK_REALTIME) 25 | #define TICTOC_CLOCK CLOCK_REALTIME 26 | #define TICTOC_CLOCK_NAME "CLOCK_REALTIME" 27 | #else 28 | #error "Failed to find a timing clock." 29 | #endif 30 | 31 | static struct timespec tic_ts; 32 | #endif 33 | 34 | void 35 | tic (void) 36 | { 37 | #if defined(__MTA__) 38 | MTA("mta fence") 39 | tic_ts = mta_get_clock (0); 40 | #elif defined(HAVE_MACH_ABSOLUTE_TIME) 41 | tic_ts = mach_absolute_time(); 42 | #else 43 | clock_gettime (TICTOC_CLOCK, &tic_ts); 44 | #endif 45 | } 46 | 47 | double 48 | toc (void) 49 | { 50 | double out; 51 | #if defined(__MTA__) 52 | long ts; 53 | MTA("mta fence") 54 | ts = mta_get_clock (tic_ts); 55 | out = ((double)ts) * mta_clock_period (); 56 | /*fprintf (stderr, "%ld %g %g %g\n", ts, out, mta_clock_period(), mta_clock_freq());*/ 57 | #elif defined(HAVE_MACH_ABSOLUTE_TIME) 58 | uint64_t ts, nanosec; 59 | static mach_timebase_info_data_t info = {0,0}; 60 | if (info.denom == 0) { 61 | mach_timebase_info(&info); 62 | } 63 | ts = mach_absolute_time(); 64 | nanosec = (ts - tic_ts) * (info.numer / info.denom); 65 | out = 1.0e-9 * nanosec; 66 | #else 67 | struct timespec ts; 68 | clock_gettime (TICTOC_CLOCK, &ts); 69 | out = (ts.tv_nsec - (double)tic_ts.tv_nsec) * 1.0e-9; 70 | out += (ts.tv_sec - (double)tic_ts.tv_sec); 71 | #endif 72 | 73 | return out; 74 | } 75 | -------------------------------------------------------------------------------- /trident-workloads/graph500/timer.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #if !defined(TIMER_HEADER_) 5 | #define TIMER_HEADER_ 6 | 7 | /** Start timing. */ 8 | void tic (void); 9 | 10 | /** Return seconds since last tic. */ 11 | double toc (void); 12 | 13 | /** Macro to time a block. */ 14 | #define TIME(timevar, what) do { tic (); what; timevar = toc(); } while (0) 15 | 16 | #endif /* TIMER_HEADER_ */ 17 | -------------------------------------------------------------------------------- /trident-workloads/graph500/verify.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #if !defined(VERIFY_HEADER_) 5 | #define VERIFY_HEADER_ 6 | 7 | #include "generator/graph_generator.h" 8 | 9 | /** Verify a BFS tree, return volume or -1 if failed. */ 10 | int64_t verify_bfs_tree (int64_t *bfs_tree, int64_t max_bfsvtx, 11 | int64_t root, 12 | const struct packed_edge *IJ, int64_t nedge); 13 | 14 | #endif /* VERIFY_HEADER_ */ 15 | -------------------------------------------------------------------------------- /trident-workloads/graph500/xalloc.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #include "compat.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | 18 | #if !defined(MAP_POPULATE) 19 | #define MAP_POPULATE 0 20 | #endif 21 | #if !defined(MAP_NOSYNC) 22 | #define MAP_NOSYNC 0 23 | #endif 24 | /* Unused... for now. */ 25 | #if !defined(MAP_HUGETLB) 26 | #define MAP_HUGETLB 0 27 | #endif 28 | 29 | extern void *xmalloc (size_t); 30 | 31 | #if defined(__MTA__)||defined(USE_MMAP_LARGE)||defined(USE_MMAP_LARGE_EXT) 32 | #define MAX_LARGE 32 33 | static int n_large_alloc = 0; 34 | static struct { 35 | void * p; 36 | size_t sz; 37 | int fd; 38 | } large_alloc[MAX_LARGE]; 39 | 40 | static int installed_handler = 0; 41 | static void (*old_abort_handler)(int); 42 | 43 | static void 44 | exit_handler (void) 45 | { 46 | int k; 47 | for (k = 0; k < n_large_alloc; ++k) { 48 | if (large_alloc[k].p) 49 | munmap (large_alloc[k].p, large_alloc[k].sz); 50 | if (large_alloc[k].fd >= 0) 51 | close (large_alloc[k].fd); 52 | large_alloc[k].p = NULL; 53 | large_alloc[k].fd = -1; 54 | } 55 | } 56 | 57 | static void 58 | abort_handler (int passthrough) 59 | { 60 | exit_handler (); 61 | if (old_abort_handler) old_abort_handler (passthrough); 62 | } 63 | #endif 64 | 65 | #if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) 66 | #define MAP_ANONYMOUS MAP_ANON 67 | #endif 68 | 69 | #define ALIGNMET (8UL << 30) 70 | 71 | void * 72 | xmalloc_large (size_t sz) 73 | { 74 | void *memptr; 75 | printf("Allocating %zu MB\n", sz >> 20); 76 | if (posix_memalign(&memptr, ALIGNMET, sz)) { 77 | printf("ENOMEM\n"); 78 | exit(1); 79 | } 80 | memset(memptr, 0, sz); 81 | return memptr; 82 | } 83 | 84 | void 85 | xfree_large (void *p) 86 | { 87 | free (p); 88 | } 89 | 90 | void * 91 | xmalloc_large_ext (size_t sz) 92 | { 93 | return xmalloc_large (sz); 94 | } 95 | -------------------------------------------------------------------------------- /trident-workloads/graph500/xalloc.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; mode: folding; fill-column: 70; -*- */ 2 | /* Copyright 2010-2011, Georgia Institute of Technology, USA. */ 3 | /* See COPYING for license. */ 4 | #if !defined(XALLOC_HEADER_) 5 | #define XALLOC_HEADER_ 6 | 7 | void * xmalloc (size_t); 8 | void * xmalloc_large (size_t); 9 | void xfree_large (void *); 10 | void * xmalloc_large_ext (size_t); 11 | 12 | #endif /* XALLOC_HEADER_ */ 13 | -------------------------------------------------------------------------------- /trident-workloads/gups/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: libgupsmp.a libgups.a 3 | 4 | libgupsmp.a: gupsmp.o 5 | ar rcs $@ $^ 6 | 7 | libgups.a: gups.o 8 | ar rcs $@ $^ 9 | 10 | libgupstoy.a: gupstoy.o 11 | ar rcs $@ $^ 12 | 13 | gupsmp.o : gups.c 14 | gcc -c -O3 -fopenmp -o $@ $< 15 | 16 | gups.o : gups.c 17 | gcc -c -O3 -o $@ $< 18 | 19 | gupstoy.o : gupstoy.c 20 | gcc -c -O3 -o $@ $< 21 | 22 | clean: 23 | rm -f *.o *.a 24 | 25 | -------------------------------------------------------------------------------- /trident-workloads/gups/gups.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #ifdef _OPENMP 17 | #include 18 | #endif 19 | 20 | 21 | extern FILE *opt_file_out; 22 | 23 | /* 24 | * ============================================================================ 25 | * HPCC RandomAccess 26 | * ============================================================================ 27 | */ 28 | 29 | 30 | ///< The number of updates to the table 31 | //#define NUPDATE (1 * TableSize) 32 | //#define NUPDATE (1UL << 28) 33 | 34 | #ifdef _OPENMP 35 | #define NUPDATE (1UL << 28) 36 | #else 37 | #define NUPDATE (1UL << 28) 38 | #endif 39 | 40 | 41 | ///< parameters for ther andom table 42 | #define POLY 0x0000000000000007UL 43 | #define PERIOD 1317624576693539401L 44 | 45 | 46 | static uint64_t 47 | HPCC_starts(int64_t n) 48 | { 49 | int i, j; 50 | uint64_t m2[64]; 51 | uint64_t temp, ran; 52 | 53 | while (n < 0) n += PERIOD; 54 | while (n > PERIOD) n -= PERIOD; 55 | if (n == 0) return 0x1; 56 | 57 | temp = 0x1; 58 | for (i=0; i<64; i++) { 59 | m2[i] = temp; 60 | temp = (temp << 1) ^ ((int64_t) temp < 0 ? POLY : 0); 61 | temp = (temp << 1) ^ ((int64_t) temp < 0 ? POLY : 0); 62 | } 63 | 64 | for (i=62; i>=0; i--) 65 | if ((n >> i) & 1) 66 | break; 67 | 68 | ran = 0x2; 69 | while (i > 0) { 70 | temp = 0; 71 | for (j=0; j<64; j++) 72 | if ((ran >> j) & 1) 73 | temp ^= m2[j]; 74 | ran = temp; 75 | i -= 1; 76 | if ((n >> i) & 1) 77 | ran = (ran << 1) ^ ((int64_t) ran < 0 ? POLY : 0); 78 | } 79 | 80 | return ran; 81 | } 82 | 83 | ///< the name of the shared memory file created 84 | #define CONFIG_SHM_FILE_NAME "/tmp/alloctest-bench" 85 | 86 | 87 | int real_main(int argc, char *argv[]); 88 | int real_main(int argc, char *argv[]) 89 | { 90 | size_t mem = ((size_t)64UL << 30); 91 | if (argc == 2) { 92 | mem = strtoull(argv[1], NULL, 10) << 30; 93 | } 94 | 95 | for (int i = 0; i < 64; i++) { 96 | if (1ULL << i > mem) { 97 | mem = 1ULL << (i - 1); 98 | break; 99 | } 100 | } 101 | 102 | 103 | fprintf(opt_file_out, "\n", mem); 104 | 105 | struct timespec time1, time2; 106 | 107 | 108 | uint64_t *Table = malloc(mem + 16); 109 | if (!Table) { 110 | fprintf(opt_file_out, "ERROR: Could not allocate table!\n"); 111 | return -1; 112 | } 113 | 114 | size_t TableSize = mem / sizeof(uint64_t); 115 | 116 | fprintf(opt_file_out, "\n", Table, TableSize); 117 | 118 | 119 | /* Initialize main table */ 120 | for (size_t i=0; i 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | //----------------------------------------------------------------------------- 16 | 17 | void MurmurHash3_x86_32 (const void *key, int len, uint32_t seed, void *out); 18 | 19 | void MurmurHash3_x86_128(const void *key, int len, uint32_t seed, void *out); 20 | 21 | void MurmurHash3_x64_128(const void *key, int len, uint32_t seed, void *out); 22 | 23 | //----------------------------------------------------------------------------- 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif // _MURMURHASH3_H_ -------------------------------------------------------------------------------- /trident-workloads/liblinear/COPYRIGHT: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2007-2017 The LIBLINEAR Project. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither name of copyright holders nor the names of its contributors 17 | may be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR 25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 28 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/Makefile: -------------------------------------------------------------------------------- 1 | CXX ?= g++ 2 | CC ?= gcc 3 | CFLAGS = -Wall -Wconversion -O3 -fPIC -fopenmp 4 | # CFLAGS += -DCV_OMP 5 | LIBS = blas/blas.a 6 | SHVER = 3 7 | OS = $(shell uname) 8 | #LIBS = -lblas 9 | AR = ar rcv 10 | 11 | all: train predict 12 | 13 | lib: linear.o tron.o blas/blas.a 14 | if [ "$(OS)" = "Darwin" ]; then \ 15 | SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,liblinear.so.$(SHVER)"; \ 16 | else \ 17 | SHARED_LIB_FLAG="-shared -Wl,-soname,liblinear.so.$(SHVER)"; \ 18 | fi; \ 19 | $(CXX) -fopenmp $${SHARED_LIB_FLAG} linear.o tron.o blas/blas.a -o liblinear.so.$(SHVER) 20 | 21 | train: tron.o linear.o train.c blas/blas.a 22 | $(CXX) $(CFLAGS) -o train train.c tron.o linear.o $(LIBS) 23 | 24 | liblinear.a : blas/blas.a tron.o linear.o train.c 25 | $(CXX) $(CFLAGS) -fopenmp -c -o train.o train.c 26 | $(AR) liblinear.a blas/*.o tron.o linear.o train.o 27 | 28 | 29 | predict: tron.o linear.o predict.c blas/blas.a 30 | $(CXX) $(CFLAGS) -o predict predict.c tron.o linear.o $(LIBS) 31 | 32 | tron.o: tron.cpp tron.h 33 | $(CXX) $(CFLAGS) -c -o tron.o tron.cpp 34 | 35 | linear.o: linear.cpp linear.h 36 | $(CXX) $(CFLAGS) -c -o linear.o linear.cpp 37 | 38 | blas/blas.a: blas/*.c blas/*.h 39 | make -C blas OPTFLAGS='$(CFLAGS)' CC='$(CC)'; 40 | 41 | clean: 42 | make -C blas clean 43 | make -C matlab clean 44 | rm -f *.a 45 | rm -f *~ tron.o linear.o lr train predict liblinear.so.$(SHVER) 46 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/Makefile.win: -------------------------------------------------------------------------------- 1 | CXX = cl.exe 2 | CFLAGS = /nologo /O2 /EHsc /I. /D _WIN64 /D _CRT_SECURE_NO_DEPRECATE /openmp 3 | TARGET = windows 4 | 5 | all: $(TARGET)\train.exe $(TARGET)\predict.exe lib 6 | 7 | $(TARGET)\train.exe: tron.obj linear.obj train.c blas\*.c 8 | $(CXX) $(CFLAGS) -Fe$(TARGET)\train.exe tron.obj linear.obj train.c blas\*.c 9 | 10 | $(TARGET)\predict.exe: tron.obj linear.obj predict.c blas\*.c 11 | $(CXX) $(CFLAGS) -Fe$(TARGET)\predict.exe tron.obj linear.obj predict.c blas\*.c 12 | 13 | linear.obj: linear.cpp linear.h 14 | $(CXX) $(CFLAGS) -c linear.cpp 15 | 16 | tron.obj: tron.cpp tron.h 17 | $(CXX) $(CFLAGS) -c tron.cpp 18 | 19 | lib: linear.cpp linear.h linear.def tron.obj 20 | $(CXX) $(CFLAGS) -LD linear.cpp tron.obj blas\*.c -Fe$(TARGET)\liblinear -link -DEF:linear.def 21 | 22 | clean: 23 | -erase /Q *.obj $(TARGET)\*.exe $(TARGET)\*.dll $(TARGET)\*.exp $(TARGET)\*.lib 24 | 25 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/blas/Makefile: -------------------------------------------------------------------------------- 1 | AR = ar rcv 2 | RANLIB = ranlib 3 | 4 | HEADERS = blas.h blasp.h 5 | FILES = dnrm2.o daxpy.o ddot.o dscal.o 6 | 7 | CFLAGS = $(OPTFLAGS) 8 | FFLAGS = $(OPTFLAGS) 9 | 10 | blas: $(FILES) $(HEADERS) 11 | $(AR) blas.a $(FILES) 12 | $(RANLIB) blas.a 13 | 14 | clean: 15 | - rm -f *.o 16 | - rm -f *.a 17 | - rm -f *~ 18 | 19 | .c.o: 20 | $(CC) $(CFLAGS) -c $*.c 21 | 22 | 23 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/blas/blas.h: -------------------------------------------------------------------------------- 1 | /* blas.h -- C header file for BLAS Ver 1.0 */ 2 | /* Jesse Bennett March 23, 2000 */ 3 | 4 | /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." 5 | 6 | - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ 7 | 8 | #ifndef BLAS_INCLUDE 9 | #define BLAS_INCLUDE 10 | 11 | /* Data types specific to BLAS implementation */ 12 | typedef struct { float r, i; } fcomplex; 13 | typedef struct { double r, i; } dcomplex; 14 | typedef int blasbool; 15 | 16 | #include "blasp.h" /* Prototypes for all BLAS functions */ 17 | 18 | #define FALSE 0 19 | #define TRUE 1 20 | 21 | /* Macro functions */ 22 | #define MIN(a,b) ((a) <= (b) ? (a) : (b)) 23 | #define MAX(a,b) ((a) >= (b) ? (a) : (b)) 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/blas/daxpy.c: -------------------------------------------------------------------------------- 1 | #include "blas.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | int daxpy_(int *n, double *sa, double *sx, int *incx, double *sy, 8 | int *incy) 9 | { 10 | long int i, m, ix, iy, nn, iincx, iincy; 11 | register double ssa; 12 | 13 | /* constant times a vector plus a vector. 14 | uses unrolled loop for increments equal to one. 15 | jack dongarra, linpack, 3/11/78. 16 | modified 12/3/93, array(1) declarations changed to array(*) */ 17 | 18 | /* Dereference inputs */ 19 | nn = *n; 20 | ssa = *sa; 21 | iincx = *incx; 22 | iincy = *incy; 23 | 24 | if( nn > 0 && ssa != 0.0 ) 25 | { 26 | if (iincx == 1 && iincy == 1) /* code for both increments equal to 1 */ 27 | { 28 | m = nn-3; 29 | for (i = 0; i < m; i += 4) 30 | { 31 | sy[i] += ssa * sx[i]; 32 | sy[i+1] += ssa * sx[i+1]; 33 | sy[i+2] += ssa * sx[i+2]; 34 | sy[i+3] += ssa * sx[i+3]; 35 | } 36 | for ( ; i < nn; ++i) /* clean-up loop */ 37 | sy[i] += ssa * sx[i]; 38 | } 39 | else /* code for unequal increments or equal increments not equal to 1 */ 40 | { 41 | ix = iincx >= 0 ? 0 : (1 - nn) * iincx; 42 | iy = iincy >= 0 ? 0 : (1 - nn) * iincy; 43 | for (i = 0; i < nn; i++) 44 | { 45 | sy[iy] += ssa * sx[ix]; 46 | ix += iincx; 47 | iy += iincy; 48 | } 49 | } 50 | } 51 | 52 | return 0; 53 | } /* daxpy_ */ 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/blas/ddot.c: -------------------------------------------------------------------------------- 1 | #include "blas.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | double ddot_(int *n, double *sx, int *incx, double *sy, int *incy) 8 | { 9 | long int i, m, nn, iincx, iincy; 10 | double stemp; 11 | long int ix, iy; 12 | 13 | /* forms the dot product of two vectors. 14 | uses unrolled loops for increments equal to one. 15 | jack dongarra, linpack, 3/11/78. 16 | modified 12/3/93, array(1) declarations changed to array(*) */ 17 | 18 | /* Dereference inputs */ 19 | nn = *n; 20 | iincx = *incx; 21 | iincy = *incy; 22 | 23 | stemp = 0.0; 24 | if (nn > 0) 25 | { 26 | if (iincx == 1 && iincy == 1) /* code for both increments equal to 1 */ 27 | { 28 | m = nn-4; 29 | for (i = 0; i < m; i += 5) 30 | stemp += sx[i] * sy[i] + sx[i+1] * sy[i+1] + sx[i+2] * sy[i+2] + 31 | sx[i+3] * sy[i+3] + sx[i+4] * sy[i+4]; 32 | 33 | for ( ; i < nn; i++) /* clean-up loop */ 34 | stemp += sx[i] * sy[i]; 35 | } 36 | else /* code for unequal increments or equal increments not equal to 1 */ 37 | { 38 | ix = 0; 39 | iy = 0; 40 | if (iincx < 0) 41 | ix = (1 - nn) * iincx; 42 | if (iincy < 0) 43 | iy = (1 - nn) * iincy; 44 | for (i = 0; i < nn; i++) 45 | { 46 | stemp += sx[ix] * sy[iy]; 47 | ix += iincx; 48 | iy += iincy; 49 | } 50 | } 51 | } 52 | 53 | return stemp; 54 | } /* ddot_ */ 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/blas/dnrm2.c: -------------------------------------------------------------------------------- 1 | #include /* Needed for fabs() and sqrt() */ 2 | #include "blas.h" 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | double dnrm2_(int *n, double *x, int *incx) 9 | { 10 | long int ix, nn, iincx; 11 | double norm, scale, absxi, ssq, temp; 12 | 13 | /* DNRM2 returns the euclidean norm of a vector via the function 14 | name, so that 15 | 16 | DNRM2 := sqrt( x'*x ) 17 | 18 | -- This version written on 25-October-1982. 19 | Modified on 14-October-1993 to inline the call to SLASSQ. 20 | Sven Hammarling, Nag Ltd. */ 21 | 22 | /* Dereference inputs */ 23 | nn = *n; 24 | iincx = *incx; 25 | 26 | if( nn > 0 && iincx > 0 ) 27 | { 28 | if (nn == 1) 29 | { 30 | norm = fabs(x[0]); 31 | } 32 | else 33 | { 34 | scale = 0.0; 35 | ssq = 1.0; 36 | 37 | /* The following loop is equivalent to this call to the LAPACK 38 | auxiliary routine: CALL SLASSQ( N, X, INCX, SCALE, SSQ ) */ 39 | 40 | for (ix=(nn-1)*iincx; ix>=0; ix-=iincx) 41 | { 42 | if (x[ix] != 0.0) 43 | { 44 | absxi = fabs(x[ix]); 45 | if (scale < absxi) 46 | { 47 | temp = scale / absxi; 48 | ssq = ssq * (temp * temp) + 1.0; 49 | scale = absxi; 50 | } 51 | else 52 | { 53 | temp = absxi / scale; 54 | ssq += temp * temp; 55 | } 56 | } 57 | } 58 | norm = scale * sqrt(ssq); 59 | } 60 | } 61 | else 62 | norm = 0.0; 63 | 64 | return norm; 65 | 66 | } /* dnrm2_ */ 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/blas/dscal.c: -------------------------------------------------------------------------------- 1 | #include "blas.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | int dscal_(int *n, double *sa, double *sx, int *incx) 8 | { 9 | long int i, m, nincx, nn, iincx; 10 | double ssa; 11 | 12 | /* scales a vector by a constant. 13 | uses unrolled loops for increment equal to 1. 14 | jack dongarra, linpack, 3/11/78. 15 | modified 3/93 to return if incx .le. 0. 16 | modified 12/3/93, array(1) declarations changed to array(*) */ 17 | 18 | /* Dereference inputs */ 19 | nn = *n; 20 | iincx = *incx; 21 | ssa = *sa; 22 | 23 | if (nn > 0 && iincx > 0) 24 | { 25 | if (iincx == 1) /* code for increment equal to 1 */ 26 | { 27 | m = nn-4; 28 | for (i = 0; i < m; i += 5) 29 | { 30 | sx[i] = ssa * sx[i]; 31 | sx[i+1] = ssa * sx[i+1]; 32 | sx[i+2] = ssa * sx[i+2]; 33 | sx[i+3] = ssa * sx[i+3]; 34 | sx[i+4] = ssa * sx[i+4]; 35 | } 36 | for ( ; i < nn; ++i) /* clean-up loop */ 37 | sx[i] = ssa * sx[i]; 38 | } 39 | else /* code for increment not equal to 1 */ 40 | { 41 | nincx = nn * iincx; 42 | for (i = 0; i < nincx; i += iincx) 43 | sx[i] = ssa * sx[i]; 44 | } 45 | } 46 | 47 | return 0; 48 | } /* dscal_ */ 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/linear.def: -------------------------------------------------------------------------------- 1 | LIBRARY liblinear 2 | EXPORTS 3 | train @1 4 | cross_validation @2 5 | save_model @3 6 | load_model @4 7 | get_nr_feature @5 8 | get_nr_class @6 9 | get_labels @7 10 | predict_values @8 11 | predict @9 12 | predict_probability @10 13 | free_and_destroy_model @11 14 | free_model_content @12 15 | destroy_param @13 16 | check_parameter @14 17 | check_probability_model @15 18 | set_print_string_function @16 19 | get_decfun_coef @17 20 | get_decfun_bias @18 21 | check_regression_model @19 22 | find_parameter_C @20 23 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/linear.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBLINEAR_H 2 | #define _LIBLINEAR_H 3 | 4 | #define LIBLINEAR_VERSION 220 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | extern int liblinear_version; 11 | 12 | struct feature_node 13 | { 14 | int index; 15 | double value; 16 | }; 17 | 18 | struct problem 19 | { 20 | int l, n; 21 | double *y; 22 | struct feature_node **x; 23 | double bias; /* < 0 if no bias term */ 24 | }; 25 | 26 | enum { L2R_LR, L2R_L2LOSS_SVC_DUAL, L2R_L2LOSS_SVC, L2R_L1LOSS_SVC_DUAL, MCSVM_CS, L1R_L2LOSS_SVC, L1R_LR, L2R_LR_DUAL, L2R_L2LOSS_SVR = 11, L2R_L2LOSS_SVR_DUAL, L2R_L1LOSS_SVR_DUAL }; /* solver_type */ 27 | 28 | struct parameter 29 | { 30 | int solver_type; 31 | 32 | /* these are for training only */ 33 | double eps; /* stopping criteria */ 34 | double C; 35 | int nr_thread; 36 | int nr_weight; 37 | int *weight_label; 38 | double* weight; 39 | double p; 40 | double *init_sol; 41 | }; 42 | 43 | struct model 44 | { 45 | struct parameter param; 46 | int nr_class; /* number of classes */ 47 | int nr_feature; 48 | double *w; 49 | int *label; /* label of each class */ 50 | double bias; 51 | }; 52 | 53 | struct model* train(const struct problem *prob, const struct parameter *param); 54 | void cross_validation(const struct problem *prob, const struct parameter *param, int nr_fold, double *target); 55 | void find_parameter_C(const struct problem *prob, const struct parameter *param, int nr_fold, double start_C, double max_C, double *best_C, double *best_rate); 56 | 57 | double predict_values(const struct model *model_, const struct feature_node *x, double* dec_values); 58 | double predict(const struct model *model_, const struct feature_node *x); 59 | double predict_probability(const struct model *model_, const struct feature_node *x, double* prob_estimates); 60 | 61 | int save_model(const char *model_file_name, const struct model *model_); 62 | struct model *load_model(const char *model_file_name); 63 | 64 | int get_nr_feature(const struct model *model_); 65 | int get_nr_class(const struct model *model_); 66 | void get_labels(const struct model *model_, int* label); 67 | double get_decfun_coef(const struct model *model_, int feat_idx, int label_idx); 68 | double get_decfun_bias(const struct model *model_, int label_idx); 69 | 70 | void free_model_content(struct model *model_ptr); 71 | void free_and_destroy_model(struct model **model_ptr_ptr); 72 | void destroy_param(struct parameter *param); 73 | 74 | const char *check_parameter(const struct problem *prob, const struct parameter *param); 75 | int check_probability_model(const struct model *model); 76 | int check_regression_model(const struct model *model); 77 | void set_print_string_function(void (*print_func) (const char*)); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif /* _LIBLINEAR_H */ 84 | 85 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/matlab/Makefile: -------------------------------------------------------------------------------- 1 | # This Makefile is used under Linux 2 | 3 | MATLABDIR ?= /usr/local/matlab 4 | CXX ?= g++ 5 | #CXX = g++-3.3 6 | CC ?= gcc 7 | CFLAGS = -Wall -Wconversion -O3 -fPIC -I$(MATLABDIR)/extern/include -I.. -fopenmp 8 | LDFLAGS += -fopenmp 9 | 10 | MEX = $(MATLABDIR)/bin/mex 11 | MEX_OPTION = CC="$(CXX)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" 12 | # comment the following line if you use MATLAB on a 32-bit computer 13 | MEX_OPTION += -largeArrayDims 14 | MEX_EXT = $(shell $(MATLABDIR)/bin/mexext) 15 | 16 | all: matlab 17 | 18 | matlab: binary 19 | 20 | octave: 21 | @echo "please type make under Octave" 22 | binary: train.$(MEX_EXT) predict.$(MEX_EXT) libsvmread.$(MEX_EXT) libsvmwrite.$(MEX_EXT) 23 | 24 | train.$(MEX_EXT): train.c ../linear.h ../tron.o ../linear.o linear_model_matlab.o ../blas/blas.a 25 | $(MEX) $(MEX_OPTION) train.c ../tron.o ../linear.o linear_model_matlab.o ../blas/blas.a 26 | 27 | predict.$(MEX_EXT): predict.c ../linear.h ../tron.o ../linear.o linear_model_matlab.o ../blas/blas.a 28 | $(MEX) $(MEX_OPTION) predict.c ../tron.o ../linear.o linear_model_matlab.o ../blas/blas.a 29 | 30 | libsvmread.$(MEX_EXT): libsvmread.c 31 | $(MEX) $(MEX_OPTION) libsvmread.c 32 | 33 | libsvmwrite.$(MEX_EXT): libsvmwrite.c 34 | $(MEX) $(MEX_OPTION) libsvmwrite.c 35 | 36 | linear_model_matlab.o: linear_model_matlab.c ../linear.h 37 | $(CXX) $(CFLAGS) -c linear_model_matlab.c 38 | 39 | ../linear.o: ../linear.cpp ../linear.h 40 | make -C .. linear.o 41 | 42 | ../tron.o: ../tron.cpp ../tron.h 43 | make -C .. tron.o 44 | 45 | ../blas/blas.a: ../blas/*.c ../blas/*.h 46 | make -C ../blas OPTFLAGS='$(CFLAGS)' CC='$(CC)'; 47 | 48 | clean: 49 | make -C ../blas clean 50 | rm -f *~ *.o *.mex* *.obj ../linear.o ../tron.o 51 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/matlab/README.multicore: -------------------------------------------------------------------------------- 1 | Introduction 2 | ============ 3 | 4 | This extension of liblinear provides a matlab interface to multi-core parallel learning. 5 | 6 | Usage 7 | ===== 8 | 9 | The usage of train function is the same as liblinear except for the additional option: 10 | 11 | -n nr_thread: use nr_thread threads for training (only for -s 0, -s 1, -s 2, -s 3 and -s 11) 12 | 13 | Examples 14 | ======== 15 | 16 | matlab> [label, instance] = libsvmread('../heart_scale'); 17 | matlab> model = train(label, instance, '-s 0 -n 8'); 18 | 19 | will run L2-regularized logistic regression primal solver with 8 threads. 20 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/matlab/libsvmwrite.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "mex.h" 5 | 6 | #ifdef MX_API_VER 7 | #if MX_API_VER < 0x07030000 8 | typedef int mwIndex; 9 | #endif 10 | #endif 11 | 12 | void exit_with_help() 13 | { 14 | mexPrintf( 15 | "Usage: libsvmwrite('filename', label_vector, instance_matrix);\n" 16 | ); 17 | } 18 | 19 | static void fake_answer(int nlhs, mxArray *plhs[]) 20 | { 21 | int i; 22 | for(i=0;i 0) 88 | { 89 | exit_with_help(); 90 | fake_answer(nlhs, plhs); 91 | return; 92 | } 93 | 94 | // Transform the input Matrix to libsvm format 95 | if(nrhs == 3) 96 | { 97 | char filename[256]; 98 | if(!mxIsDouble(prhs[1]) || !mxIsDouble(prhs[2])) 99 | { 100 | mexPrintf("Error: label vector and instance matrix must be double\n"); 101 | return; 102 | } 103 | 104 | mxGetString(prhs[0], filename, mxGetN(prhs[0])+1); 105 | 106 | if(mxIsSparse(prhs[2])) 107 | libsvmwrite(filename, prhs[1], prhs[2]); 108 | else 109 | { 110 | mexPrintf("Instance_matrix must be sparse\n"); 111 | return; 112 | } 113 | } 114 | else 115 | { 116 | exit_with_help(); 117 | return; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/matlab/linear_model_matlab.h: -------------------------------------------------------------------------------- 1 | const char *model_to_matlab_structure(mxArray *plhs[], struct model *model_); 2 | const char *matlab_matrix_to_model(struct model *model_, const mxArray *matlab_struct); 3 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/matlab/make.m: -------------------------------------------------------------------------------- 1 | % This make.m is for MATLAB and OCTAVE under Windows, Mac, and Unix 2 | function make() 3 | try 4 | % This part is for OCTAVE 5 | if(exist('OCTAVE_VERSION', 'builtin')) 6 | mex libsvmread.c 7 | mex libsvmwrite.c 8 | setenv('CFLAGS', strcat(getenv('CFLAGS'), ' -fopenmp')) 9 | setenv('CXXFLAGS', strcat(getenv('CXXFLAGS'), ' -fopenmp')) 10 | mex -I.. -lgomp train.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/daxpy.c ../blas/ddot.c ../blas/dnrm2.c ../blas/dscal.c 11 | mex -I.. -lgomp predict.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/daxpy.c ../blas/ddot.c ../blas/dnrm2.c ../blas/dscal.c 12 | % This part is for MATLAB 13 | % Add -largeArrayDims on 64-bit machines of MATLAB 14 | else 15 | mex -largeArrayDims libsvmread.c 16 | mex -largeArrayDims libsvmwrite.c 17 | mex CFLAGS='$CFLAGS -fopenmp' CXXFLAGS='$CXXFLAGS -fopenmp' -I.. -largeArrayDims -lgomp train.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/daxpy.c ../blas/ddot.c ../blas/dnrm2.c ../blas/dscal.c 18 | mex CFLAGS='$CFLAGS -fopenmp' CXXFLAGS='$CXXFLAGS -fopenmp' -I.. -largeArrayDims -lgomp predict.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/daxpy.c ../blas/ddot.c ../blas/dnrm2.c ../blas/dscal.c 19 | end 20 | catch err 21 | fprintf('Error: %s failed (line %d)\n', err.stack(1).file, err.stack(1).line); 22 | disp(err.message); 23 | fprintf('=> Please check README for detailed instructions.\n'); 24 | end 25 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/python/Makefile: -------------------------------------------------------------------------------- 1 | all = lib 2 | 3 | lib: 4 | make -C .. lib 5 | -------------------------------------------------------------------------------- /trident-workloads/liblinear/tron.h: -------------------------------------------------------------------------------- 1 | #ifndef _TRON_H 2 | #define _TRON_H 3 | 4 | class function 5 | { 6 | public: 7 | virtual double fun(double *w) = 0 ; 8 | virtual void grad(double *w, double *g) = 0 ; 9 | virtual void Hv(double *s, double *Hs) = 0 ; 10 | 11 | virtual int get_nr_variable(void) = 0 ; 12 | virtual void get_diagH(double *M) = 0 ; 13 | virtual ~function(void){} 14 | }; 15 | 16 | class TRON 17 | { 18 | public: 19 | TRON(const function *fun_obj, double eps = 0.1, double eps_cg = 0.1, int max_iter = 1000); 20 | ~TRON(); 21 | 22 | void tron(double *w); 23 | void set_print_string(void (*i_print) (const char *buf)); 24 | 25 | private: 26 | int trpcg(double delta, double *g, double *M, double *s, double *r, bool *reach_boundary); 27 | double norm_inf(int n, double *x); 28 | 29 | double eps; 30 | double eps_cg; 31 | int max_iter; 32 | function *fun_obj; 33 | void info(const char *fmt,...); 34 | void (*tron_print_string)(const char *buf); 35 | }; 36 | #endif 37 | -------------------------------------------------------------------------------- /trident-workloads/memops/.gitignore: -------------------------------------------------------------------------------- 1 | bench_* 2 | memlatency -------------------------------------------------------------------------------- /trident-workloads/memops/Makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | CFLAGS = -O2 3 | 4 | all: bench_memops 5 | 6 | bench_memops : mmapbench.c 7 | $(CC) $(CFLAGS) mmapbench.c -o bench_memops -lnuma -lrt 8 | 9 | clean: 10 | rm -f bench_memops 11 | -------------------------------------------------------------------------------- /trident-workloads/memops/mmapbench-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # disable THP 4 | 5 | NUMACTL="../numactl/numactl" 6 | 7 | NODESTR=$(numactl --hardware | grep available) 8 | NODE_MAX=$(echo ${NODESTR##*: } | cut -d " " -f 1) 9 | NODE_MAX=`expr $NODE_MAX - 1` 10 | 11 | for NPAGES in 1 256 2048; do 12 | for THP in never always; do 13 | echo $THP | sudo tee /sys/kernel/mm/transparent_hugepage/enabled > /dev/null 14 | sudo mount -o remount,huge=$THP /dev/shm 15 | for MITOSIS in ON OFF; do 16 | 17 | OPTMIT="" 18 | ARGMIT="" 19 | if [ "$MITOSIS" == "ON" ]; then 20 | OPTMIT="--pgtablerepl=0-$NODE_MAX" 21 | ARGMIT="-m" 22 | fi 23 | 24 | ARGTHP="" 25 | if [ "$THP" == "always" ]; then 26 | ARGTHP="-l" 27 | fi 28 | 29 | $NUMACTL $OPTMIT -N 0 -m 0 -- ./mmapbench $ARGMIT -s $NPAGES $ARGTHP 30 | done 31 | done 32 | done 33 | 34 | 35 | echo "====================================================" 36 | 37 | for NPAGES in 1 256 2048; do 38 | for THP in never always; do 39 | echo $THP | sudo tee /sys/kernel/mm/transparent_hugepage/enabled > /dev/null 40 | sudo mount -o remount,huge=$THP /dev/shm 41 | for MITOSIS in ON OFF; do 42 | 43 | OPTMIT="" 44 | ARGMIT="" 45 | if [ "$MITOSIS" == "ON" ]; then 46 | OPTMIT="--pgtablerepl=0-$NODE_MAX" 47 | ARGMIT="-m" 48 | fi 49 | 50 | ARGTHP="" 51 | if [ "$THP" == "always" ]; then 52 | ARGTHP="-l" 53 | fi 54 | echo "NPAGES=$NPAGES, THP=$THP, MITOSIS=$MITOSIS" 55 | time $NUMACTL $OPTMIT -N 0 -m 0 -- ./mmapbench $ARGMIT -s $NPAGES $ARGTHP 56 | done 57 | done 58 | done 59 | -------------------------------------------------------------------------------- /trident-workloads/stream/.gitignore: -------------------------------------------------------------------------------- 1 | stream 2 | stream_numa 3 | -------------------------------------------------------------------------------- /trident-workloads/stream/LICENSE.txt: -------------------------------------------------------------------------------- 1 | *======================================================================= 2 | *----------------------------------------------------------------------- 3 | * Copyright 1991-2003: John D. McCalpin 4 | *----------------------------------------------------------------------- 5 | * License: 6 | * 1. You are free to use this program and/or to redistribute 7 | * this program. 8 | * 2. You are free to modify this program for your own use, 9 | * including commercial use, subject to the publication 10 | * restrictions in item 3. 11 | * 3. You are free to publish results obtained from running this 12 | * program, or from works that you derive from this program, 13 | * with the following limitations: 14 | * 3a. In order to be referred to as "STREAM benchmark results", 15 | * published results must be in conformance to the STREAM 16 | * Run Rules, (briefly reviewed below) published at 17 | * http://www.cs.virginia.edu/stream/ref.html 18 | * and incorporated herein by reference. 19 | * As the copyright holder, John McCalpin retains the 20 | * right to determine conformity with the Run Rules. 21 | * 3b. Results based on modified source code or on runs not in 22 | * accordance with the STREAM Run Rules must be clearly 23 | * labelled whenever they are published. Examples of 24 | * proper labelling include: 25 | * "tuned STREAM benchmark results" 26 | * "based on a variant of the STREAM benchmark code" 27 | * Other comparable, clear and reasonable labelling is 28 | * acceptable. 29 | * 3c. Submission of results to the STREAM benchmark web site 30 | * is encouraged, but not required. 31 | * 4. Use of this program or creation of derived works based on this 32 | * program constitutes acceptance of these licensing restrictions. 33 | * 5. Absolutely no warranty is expressed or implied. 34 | *----------------------------------------------------------------------- 35 | -------------------------------------------------------------------------------- /trident-workloads/stream/Makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | CFLAGS = -O2 -fopenmp 3 | 4 | FC = gfortran 5 | FFLAGS = -O2 -fopenmp 6 | 7 | all: stream_f.exe stream_c.exe stream stream_numa 8 | 9 | stream_f.exe: stream.f mysecond.o 10 | $(CC) $(CFLAGS) -c mysecond.c 11 | $(FC) $(FFLAGS) -c stream.f 12 | $(FC) $(FFLAGS) stream.o mysecond.o -o stream_f.exe 13 | 14 | stream_c.exe: stream.c 15 | $(CC) $(CFLAGS) stream.c -o stream_c.exe -lnuma 16 | 17 | stream_numa : stream.c 18 | $(CC) $(CFLAGS) stream.c -o stream_numa -DSTREAM_ARRAY_SIZE=1342177280 -lnuma 19 | 20 | stream : stream.c 21 | $(CC) $(CFLAGS) stream.c -o stream -D__RUN_FOREVER__ -DSTREAM_ARRAY_SIZE=1000000000 22 | 23 | 24 | clean: 25 | rm -f stream_f.exe stream_c.exe *.o stream 26 | rm -f *.a 27 | 28 | # an example of a more complex build line for the Intel icc compiler 29 | stream.icc: stream.c 30 | icc -O3 -xCORE-AVX2 -ffreestanding -qopenmp -DSTREAM_ARRAY_SIZE=80000000 -DNTIMES=20 stream.c -o stream.omp.AVX2.80M.20x.icc 31 | -------------------------------------------------------------------------------- /trident-workloads/stream/mysecond.c: -------------------------------------------------------------------------------- 1 | /* A gettimeofday routine to give access to the wall 2 | clock timer on most UNIX-like systems. 3 | 4 | This version defines two entry points -- with 5 | and without appended underscores, so it *should* 6 | automagically link with FORTRAN */ 7 | 8 | #include 9 | 10 | double mysecond() 11 | { 12 | /* struct timeval { long tv_sec; 13 | long tv_usec; }; 14 | 15 | struct timezone { int tz_minuteswest; 16 | int tz_dsttime; }; */ 17 | 18 | struct timeval tp; 19 | struct timezone tzp; 20 | int i; 21 | 22 | i = gettimeofday(&tp,&tzp); 23 | return ( (double) tp.tv_sec + (double) tp.tv_usec * 1.e-6 ); 24 | } 25 | 26 | double mysecond_() {return mysecond();} 27 | 28 | -------------------------------------------------------------------------------- /trident-workloads/xsbench/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2018 Argonne National Laboratory 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /trident-workloads/xsbench/docs/XSBench_Theory.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/trident-workloads/xsbench/docs/XSBench_Theory.pdf -------------------------------------------------------------------------------- /trident-workloads/xsbench/docs/XSBench_Theory.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csl-iisc/Trident-MICRO21-artifact/27a9280557aebc62dfc3ef8996f68de7084a13de/trident-workloads/xsbench/docs/XSBench_Theory.tex -------------------------------------------------------------------------------- /trident-workloads/xsbench/src/Makefile: -------------------------------------------------------------------------------- 1 | #=============================================================================== 2 | # User Options 3 | #=============================================================================== 4 | 5 | COMPILER = gnu 6 | OPTIMIZE = yes 7 | DEBUG = no 8 | PROFILE = no 9 | MPI = no 10 | PAPI = no 11 | VEC_INFO = no 12 | VERIFY = no 13 | BINARY_DUMP = no 14 | BINARY_READ = no 15 | 16 | #=============================================================================== 17 | # Program name & source code list 18 | #=============================================================================== 19 | 20 | program = XSBench 21 | 22 | source = \ 23 | Main.c \ 24 | io.c \ 25 | Simulation.c \ 26 | CalculateXS.c \ 27 | GridInit.c \ 28 | XSutils.c \ 29 | Materials.c 30 | 31 | obj = $(source:.c=.o) 32 | 33 | #=============================================================================== 34 | # Sets Flags 35 | #=============================================================================== 36 | 37 | # Standard Flags 38 | CFLAGS := -std=gnu99 -Wall 39 | 40 | # Linker Flags 41 | LDFLAGS = -lm 42 | 43 | # Regular gcc Compiler 44 | ifeq ($(COMPILER),gnu) 45 | CC = gcc 46 | CFLAGS += -fopenmp -flto 47 | endif 48 | 49 | # Intel Compiler 50 | ifeq ($(COMPILER),intel) 51 | CC = icc 52 | CFLAGS += -qopenmp 53 | endif 54 | 55 | # BG/Q gcc Cross-Compiler 56 | ifeq ($(MACHINE),bluegene) 57 | CC = mpicc 58 | endif 59 | 60 | # Debug Flags 61 | ifeq ($(DEBUG),yes) 62 | CFLAGS += -g 63 | LDFLAGS += -g 64 | endif 65 | 66 | # Profiling Flags 67 | ifeq ($(PROFILE),yes) 68 | CFLAGS += -pg 69 | LDFLAGS += -pg 70 | endif 71 | 72 | # Optimization Flags 73 | ifeq ($(OPTIMIZE),yes) 74 | CFLAGS += -O3 75 | endif 76 | 77 | # Compiler Vectorization (needs -O3 flag) information 78 | ifeq ($(VEC_INFO),yes) 79 | CFLAGS += -ftree-vectorizer-verbose=6 80 | endif 81 | 82 | # PAPI source (you may need to provide -I and -L pointing 83 | # to PAPI depending on your installation 84 | ifeq ($(PAPI),yes) 85 | source += papi.c 86 | CFLAGS += -DPAPI 87 | #CFLAGS += -I/soft/apps/packages/papi/papi-5.1.1/include 88 | #LDFLAGS += -L/soft/apps/packages/papi/papi-5.1.1/lib -lpapi 89 | LDFLAGS += -lpapi 90 | endif 91 | 92 | # MPI 93 | ifeq ($(MPI),yes) 94 | CC = mpicc 95 | CFLAGS += -DMPI 96 | endif 97 | 98 | # Verification of results mode 99 | ifeq ($(VERIFY),yes) 100 | CFLAGS += -DVERIFICATION 101 | endif 102 | 103 | # Binary dump for file I/O based initialization 104 | ifeq ($(BINARY_DUMP),yes) 105 | CFLAGS += -DBINARY_DUMP 106 | endif 107 | 108 | # Binary read for file I/O based initialization 109 | ifeq ($(BINARY_READ),yes) 110 | CFLAGS += -DBINARY_READ 111 | endif 112 | 113 | 114 | #=============================================================================== 115 | # Targets to Build 116 | #=============================================================================== 117 | 118 | $(program): $(obj) XSbench_header.h Makefile 119 | $(CC) $(CFLAGS) $(obj) -o $@ $(LDFLAGS) 120 | 121 | libxsbench.a: $(obj) XSbench_header.h Makefile 122 | ar rcs $@ $(obj) 123 | 124 | %.o: %.c Makefile 125 | $(CC) $(CFLAGS) -c $< -o $@ 126 | 127 | clean: 128 | rm -rf $(program) $(obj) 129 | rm -f *.a 130 | 131 | edit: 132 | vim -p $(source) papi.c XSbench_header.h 133 | 134 | run: 135 | ./$(program) 136 | 137 | bgqrun: 138 | qsub -t 10 -n 1 -O test XSBench 139 | -------------------------------------------------------------------------------- /trident-workloads/xsbench/src/papi.c: -------------------------------------------------------------------------------- 1 | #include "XSbench_header.h" 2 | 3 | void counter_init( int *eventset, int *num_papi_events ) 4 | { 5 | char error_str[PAPI_MAX_STR_LEN]; 6 | // int events[] = {PAPI_TOT_INS,PAPI_BR_INS,PAPI_SR_INS}; 7 | int events[] = {PAPI_TOT_CYC,PAPI_L3_TCM}; 8 | int stat; 9 | 10 | int thread = omp_get_thread_num(); 11 | if( thread == 0 ) 12 | printf("Initializing PAPI counters...\n"); 13 | 14 | *num_papi_events = sizeof(events) / sizeof(int); 15 | 16 | if ((stat = PAPI_thread_init((long unsigned int (*)(void)) omp_get_thread_num)) != PAPI_OK){ 17 | PAPI_perror("PAPI_thread_init"); 18 | exit(1); 19 | } 20 | 21 | if ( (stat= PAPI_create_eventset(eventset)) != PAPI_OK){ 22 | PAPI_perror("PAPI_create_eventset"); 23 | exit(1); 24 | } 25 | 26 | for( int i = 0; i < *num_papi_events; i++ ){ 27 | if ((stat=PAPI_add_event(*eventset,events[i])) != PAPI_OK){ 28 | PAPI_perror("PAPI_add_event"); 29 | exit(1); 30 | } 31 | } 32 | 33 | if ((stat=PAPI_start(*eventset)) != PAPI_OK){ 34 | PAPI_perror("PAPI_start"); 35 | exit(1); 36 | } 37 | } 38 | 39 | // Stops the papi counters and prints results 40 | void counter_stop( int * eventset, int num_papi_events ) 41 | { 42 | int * events = malloc(num_papi_events * sizeof(int)); 43 | int n = num_papi_events; 44 | PAPI_list_events( *eventset, events, &n ); 45 | PAPI_event_info_t info; 46 | 47 | long_long * values = malloc( num_papi_events * sizeof(long_long)); 48 | PAPI_stop(*eventset, values); 49 | int thread = omp_get_thread_num(); 50 | 51 | #pragma omp critical (papi) 52 | { 53 | printf("Thread %d\n", thread); 54 | for( int i = 0; i < num_papi_events; i++ ) 55 | { 56 | PAPI_get_event_info(events[i], &info); 57 | printf("%-15lld\t%s\t%s\n", values[i],info.symbol,info.long_descr); 58 | } 59 | free(events); 60 | free(values); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /trident-workloads/xsbench/src/results.txt: -------------------------------------------------------------------------------- 1 | 112 3449147 2 | -------------------------------------------------------------------------------- /vmconfigs/samples/4KB.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | trident 4 | f8a03c5c-bea1-4fcf-b5c2-a4e13a3571cb 5 | 146800640 6 | 146800640 7 | 24 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | hvm 36 | /boot/vmlinuz-4.17.3-Trident+ 37 | /boot/initrd.img-4.17.3-Trident+ 38 | console=ttyS0 root=/dev/sda1 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | destroy 52 | restart 53 | destroy 54 | 55 | 56 | 57 | 58 | 59 | /usr/bin/kvm-spice 60 | 61 | 62 | 63 | 64 |
65 | 66 | 67 |
68 | 69 | 70 | 71 |
72 | 73 | 74 | 75 |
76 | 77 | 78 | 79 |
80 | 81 | 82 | 83 |
84 | 85 | 86 | 87 | 88 | 89 |
90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /vmconfigs/samples/HAWKEYE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | trident 4 | f8a03c5c-bea1-4fcf-b5c2-a4e13a3571cb 5 | 146800640 6 | 146800640 7 | 24 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | hvm 36 | /boot/vmlinuz-4.3.0-HawkEye+ 37 | /boot/initrd.img-4.3.0-HawkEye+ 38 | console=ttyS0 root=/dev/sda1 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | destroy 52 | restart 53 | destroy 54 | 55 | 56 | 57 | 58 | 59 | /usr/bin/kvm-spice 60 | 61 | 62 | 63 | 64 |
65 | 66 | 67 |
68 | 69 | 70 | 71 |
72 | 73 | 74 | 75 |
76 | 77 | 78 | 79 |
80 | 81 | 82 | 83 |
84 | 85 | 86 | 87 | 88 | 89 |
90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 |
103 | 104 | 105 | 106 | --------------------------------------------------------------------------------