Resources
How to Run PyCBC on Any Cluster
This tutorial guides you through installing PyCBC, Pegasus, and all necessary dependencies on a cluster, enabling you to confidently execute full gravitational wave search pipelines.
Step 1: Install Conda
Download the latest installer from:
https://repo.anaconda.com/archive/
$ bash Anaconda3-2023.09-0-Linux-x86_64.sh
$ source ~/.bashrc
Step 2: Install PyCBC
$git clone https://github.com/gwastro/pycbc
$ cd pycbc/
$ pip install .
$ pip install -r requirements.txt
$ pip install -r companion.txt
Step 3: Run a Test Example
Navigate to the PyCBC example directory and run:
$ bash gen.sh
This example:
- Generates a bank using
bank.sh
- Downloads frames using
get.sh
- Generates stats with
stats.sh
Step 4: Install Java (for Pegasus)
- Download Java 8 (JRE) from Oracle: Link
- Copy it to the cluster:
- Extract and configure:
$ scp jre-8u391-linux-x64.tar username@ldas-grid.gw.iucaa.in:~/soft/
$ cd ~/soft
$ tar -xf jre-8u391-linux-x64.tar
$ vi ~/.bashrc
export PATH="/home/username/soft/jre1.8.0_391/bin:$PATH"
$ source ~/.bashrc
$ java -version
Step 5: Install Pegasus
- Check system architecture:
- Check OS version:
- Download the correct binary from: Pegasus Downloads
- Copy and extract:
$ arch
$ condor_status -long | grep '^OpSys'
$ scp pegasus-binary-5.0.6-x86_64_ubuntu_20.tar username@ldas-grid.gw.iucaa.in:~/soft/
$ cd ~/soft
$ tar -xf pegasus-binary-5.0.6-x86_64_ubuntu_20.tar
$ vi ~/.bashrc
export PATH="/home/username/soft/pegasus-5.0.6/bin:$PATH"
$ source ~/.bashrc
$ pegasus-version
Quick Checklist
Component | Status Command |
---|---|
Conda | $ conda --version |
PyCBC | $ pycbc_version |
Java | $ java -version |
Pegasus | $ pegasus-version |
If all commands return version info, you're good to go!
Happy GW searching!
How to Submit Your First HTCondor Job?
Need to run your analysis across a cluster? HTCondor is your friend. Here's a quick and clean guide to get your job running in no time.
Step 1: Create a Run Script
This is the script that HTCondor will execute. Make sure it runs your full pipeline or Python script.
# run.sh
#!/bin/bash
set -e
source /path/to/your/env.sh # Activate your conda env, load modules, etc.
python my_analysis.py --config config.yaml
Tip: Make it executable with chmod +x run.sh
.
Step 2: Write a Submit File
This file tells Condor how to run your job, how many resources to request, and where to save logs.
# job_submit.sub
universe = vanilla
executable = run.sh
log = job.log
output = job.out
error = job.err
request_cpus = 2
request_memory = 8GB
request_disk = 4GB
queue
Pro tip: Customize cpus
and memory
for your job size!
Step 3: Submit Your Job
Fire off your job with this one-liner:
condor_submit job_submit.sub
Step 4: Monitor and Debug
Watch your job queue or troubleshoot with these commands:
condor_q
— See your jobs in the queuecondor_history
— View completed jobscondor_q -better-analyze
— Diagnose why a job isn’t running
Learn More
Cool Vim Hack
1. Replace a word throughout a large file
Goal: Replace every instance of GWOSG
with GWOSG_FREE
.
:%s/GWOSG/GWOSG_FREE/g
Explanation: %
means the entire file, s
is for substitution, and g
makes it apply globally on each line.
Bonus: Remove all extra spaces at end of lines
:%s/\s\+$//g
Explanation: This removes all trailing whitespace from every line in the file.