-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.sh
More file actions
executable file
·41 lines (33 loc) · 1.06 KB
/
config.sh
File metadata and controls
executable file
·41 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
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
36
37
38
39
40
41
#!/bin/bash
# Author: Andrew Habib
# Created on: 31 August 2018
# Defining various paths used by our scripts
export CHECKERS_ROOT="$PWD/static-checkers"
export D4J_ROOT="$PWD/defects4j"
export D4J_BUGGY="${D4J_ROOT}/projects/b"
export D4J_FIXED="${D4J_ROOT}/projects/f"
export PY_SCRIPTS_ROOT="$PWD/python"
export STUDY_ROOT="$PWD/study"
export OUT_BUGGY="${STUDY_ROOT}/output-buggy"
export OUT_FIXED="${STUDY_ROOT}/output-fixed"
export DIFFS_FILE="${STUDY_ROOT}/diffs_parsed.json"
# Find out which os am I running on
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) MACHINE=Linux;;
Darwin*) MACHINE=Mac;;
CYGWIN*) MACHINE=Cygwin;;
MINGW*) MACHINE=MinGw;;
*) MACHINE="UNKNOWN:${unameOut}"
esac
export $MACHINE
# Use 2/3 of the number of available cores
# Ubuntu-like OS:
if [ $MACHINE = "Linux" ]; then
JOBS=$((`grep -c ^processor /proc/cpuinfo` * 2/3))
elif [ $MACHINE = "Mac" ]; then
JOBS=$((`sysctl -n hw.ncpu` * 2/3))
else
JOBS=`python -c 'import multiprocessing as mp; print(mp.cpu_count()*2/3)'`
fi
export $"JOBS"