Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Ddlog update #376

Merged
merged 5 commits into from
Sep 24, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add support for autoset parallelism for extractors in ddlog
  • Loading branch information
feiranwang committed Sep 4, 2015
commit 0b387b388a2d182e0b4e26f4bff3ba7ee1f74864
1 change: 1 addition & 0 deletions examples/spouse_example/postgres/incremental/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export PGUSER=${PGUSER:-`whoami`}
export PGPASSWORD=${PGPASSWORD:-}
export PGPORT=${PGPORT:-5432}
export PGHOST=${PGHOST:-localhost}
export PARALLELISM=1
9 changes: 9 additions & 0 deletions shell/deepdive-run
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ fullConfig=$run_dir/deepdive.conf
ddlog compile "${ddlogFiles[@]}"
export PIPELINE= # XXX ddlog shouldn't emit this
: ${Pipeline:=endtoend}

# set PARALLELISM env var, use max parallelism if the variable is not set
if [[ $(uname) = 'Linux' ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking if nproc or sysctl is available makes more sense than relying on uname. You could chain the options with something like:

: ${PARALLELISM:=$({
    # Linux typically has coreutils which includes nproc
    nproc ||
    # OS X
    sysctl -n hw.ncpu ||
    # fall back to 1
    echo 1
} 2>/dev/null)}

parallelism=$(nproc)
else
parallelism=$(sysctl -n hw.ncpu)
fi
: ${PARALLELISM:=$parallelism}
export PARALLELISM
}

# user's deepdive.conf overrides anything compiled from DDlog
Expand Down