To access the ParallelCluster’s head node, use the SSH command below with your private key and the head node’s public IP:
ssh -i ~/.ssh/id_rsa ec2-user@<head-node-ip-address>- Finding the Head Node IP: In the AWS Console, navigate to EC2, locate your head node, and copy its public IP address.
- Once connected, continue with the following commands to set up the environment.
We’ll install Miniconda to manage Python dependencies:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh- Note: During installation, press
Enterto proceed, then typeyeswhen prompted. - After installation, activate the Miniconda environment:
source ~/.bashrcNow we’ll create a Python environment specifically for reV and install the necessary packages:
conda create --name rev python=3.9
conda activate rev
pip install NREL-reV
git clone https://github.com/switchbox-data/rev-parallel-cluster-example-files.gitTo verify that SLURM and the environment are set up correctly, we’ll run a simple SLURM job:
echo -e '#!/bin/bash\nsleep 30\necho "Hello World from $(hostname)"' > my_script.sh
chmod +x my_script.sh
sbatch my_script.shAfter submitting the job, check the SLURM controller status:
sudo systemctl status slurmctld- Monitor the Job: Use
squeueto check job status. If auto-provisioning is enabled, the job will remain in theCF(configuring) state until nodes are provisioned. Once running, the status changes toR.
Here’s an enhanced version of the examples with more details about the data size and expected performance:
This example demonstrates reV functionality with a small dataset, designed to run quickly on a single node. This setup is ideal for initial testing or when analyzing fewer than 10 GIDs, as it completes relatively fast.
-
Navigate to the Example Folder:
cd rev-parallel-cluster-example-files/example-1 -
Run the Single-Node Job: Execute the command:
reV generation -c AWS_test_config_generation.json
-
Monitor Execution:
- Use
squeueto check the job status on the cluster. - Run
reV statusto confirm the job is progressing without issues.
- Use
-
Check Logs:
- If any issues arise, such as 503 errors or connection timeouts, inspect the logs in
/logs/stdout/for detailed error messages.
Note: This configuration, processing fewer than 10 GIDs, should complete relatively quickly (under a minute) as it only requires a single node and minimal compute resources.
- If any issues arise, such as 503 errors or connection timeouts, inspect the logs in
In this example, reV processes 2,500 GIDs across multiple nodes, using reV pipeline to execute multiple steps in sequence. The --monitor flag is crucial here, as it ensures that each pipeline step (e.g., generation, collect, multi-year) runs in the correct order, with dependent steps starting immediately after the previous step completes. Without --monitor, subsequent steps would not initiate, making it impossible to proceed through the full pipeline.
-
Navigate to the Example Folder:
cd rev-parallel-cluster-example-files/example-2 -
Run the Multi-Node Job with Sequential Pipeline Execution: Use the
--monitorflag to ensure that dependent steps run in the intended sequence:reV pipeline config_pipeline.json --monitor
- The
--monitorflag enables dependent steps, such ascollectandmulti-year, to begin processing as soon as the preceding step (likegeneration) completes. - Without
--monitor, each stage would wait indefinitely, preventing the pipeline from progressing.
- The
-
Scaling Nodes:
- Given the large data load (2,500 GIDs), the job will scale across multiple nodes to distribute the workload.
- Use
squeueto monitor node activity and ensure resources are utilized effectively.
-
Retrying Failed Jobs:
- If any job fails, re-running
reV pipelinewith--monitorwill restart only the incomplete stages, ensuring continuity without redundant processing.
- If any job fails, re-running
-
Performance Considerations:
- Processing 2,500 GIDs across dependent steps is optimized by the
--monitoroption, enabling each stage to run sequentially without delay. - Tip: To further optimize performance, consider adjusting the node count based on data size.
In this example, we use
reVbatch mode to analyze 17,000 GIDs over two years. Initially, it was thought that batch processing would execute each year sequentially. However, further investigation showed that batch processing split the resources, allocating half the nodes to each year, causing each job to use only half the available nodes. This configuration effectively doubled the runtime, as both years ran concurrently on a reduced number of nodes.Despite the doubled runtime, we found that by adjusting the
sites_per_workerparameter to a lower value (10), we reduced the risk of CPU overload, allowing the jobs to run efficiently without overloading the compute resources.To analyze:
- 17,000 GIDs (geospatial locations).
- Two years of data (2011 and 2012).
This setup enables the system to handle a large data load by reducing the intensity of parallelization. However, since batch processing does not enforce sequential execution, each job may still share the allocated resources.
- CPU Utilization: Setting
sites_per_workerto a lower value helped limit CPU usage, preventing the CPU from maxing out even when both years were processed concurrently. - Execution Time: Since batch mode does not enforce sequential execution, each year’s job used only half the nodes, effectively doubling the runtime compared to using all nodes for a single year.
- Scaling with Data Size: Increasing data size requires scaling the number of nodes. Lowering
sites_per_workeris an effective way to control resource usage, but may still necessitate additional nodes if data volume exceeds current capacity.
- Batch Configuration: The batch file splits the task by year, with 8 nodes automatically allocated to each year by SLURM.
- Execution Control:
- 16 Nodes: Using 16 nodes allows each year to utilize 8 nodes concurrently.
- Parallelization Parameters:
sites_per_worker: Set to 10 to reduce the load per worker, avoiding CPU overload.max_workers: Set to 1 to control the level of concurrency within each worker.
-
Navigate to the Example Folder:
cd rev-parallel-cluster-example-files/example-3 -
Run the Batch Job: Execute the batch job with:
reV batch -c config_batch.json
-
Monitor Execution:
- Check
squeueto observe how SLURM allocates nodes between the years. - Use
reV statusto track the progression and see that both years are processed concurrently on separate node groups.
- Check
-
Check Logs:
- If issues such as CPU overload occur, inspect logs in
year-2011/logs/stdout/oryear-2012/logs/stdout/. - If needed, consider increasing nodes or lowering
sites_per_workerto reduce CPU load further.
- If issues such as CPU overload occur, inspect logs in
- Batch Mode and Parallelism: Batch processing itself does not enforce sequential processing. Instead, it may split resources between jobs, which can lead to each job using only a subset of the allocated nodes.
- Reducing Sites per Worker: Lowering
sites_per_workereffectively reduces CPU demand, allowing the job to run with less intensive resource usage. However, this may extend the runtime, as each worker processes fewer sites concurrently. - Scaling Recommendations: For very large datasets, you may still need to increase node count to meet resource requirements, especially if batch mode splits resources across jobs.
- Processing 2,500 GIDs across dependent steps is optimized by the
- Scaling Requirements: As data volume increases, adding nodes (or vCPUs) becomes essential. With
reV’s current design, the data load is proportionally distributed across available nodes. For a target use case, such as analyzing 10 years of data for 17,000 GIDs, we recommend scaling up nodes incrementally. - Sequential Execution Workaround: If a team prefers to limit the number of EC2 instances in use (e.g., only 4 instances at a time), a good approach is to manually batch jobs by year or GID subsets.
In this example, we use reV pipeline with a configuration that runs multiple jobs sequentially, processing a large dataset year by year. This approach is effective for handling extensive data across multiple years without overloading compute resources. By running each year independently and sequentially, you can control the resource load on your nodes, making it suitable for situations where limited compute resources are available.
To process:
- Data from multiple years sequentially (2007, 2008, 2009).
- Multi-year analysis on the collected data after each individual year has been processed.
This setup effectively distributes the workload across time and minimizes resource strain, as each job uses a defined subset of resources, preventing CPU overload.
The configuration below splits data processing for each year into separate generation steps, which are executed sequentially, followed by a multi-year step for aggregating results across the years.
{
"logging": {
"log_file": "./logs/pipeline.log",
"log_level": "DEBUG"
},
"pipeline": [
{
"command": "generation",
"generation_2007": "./config_gen1.json"
},
{
"command": "generation",
"generation_2008": "./config_gen2.json"
},
{
"command": "generation",
"generation_2009": "./config_gen3.json"
},
{
"multi-year": "./config_multi-year.json"
}
]
}Explanation:
- Each
generationcommand processes data for a specific year, with unique configurations for 2007, 2008, and 2009. - Once all
generationsteps are complete, themulti-yearstep performs analysis across the combined data.
This configuration allows each year to be processed independently, reducing CPU load by processing fewer sites per job and ensuring a controlled use of resources.
-
Save the Configuration File: Save the pipeline configuration as
config_pipeline.json. -
Run the Pipeline Command: To start the pipeline, execute the following command with
--monitorto manage sequential execution:reV pipeline -c config_pipeline.json --monitor
-
Explanation of the Command:
reV pipeline -c config_pipeline.json: Specifies the pipeline configuration file.--monitor: Ensures that each step waits for the previous one to complete before starting the next. This flag is essential for sequential execution, particularly for steps likemulti-yearthat depend on the completion of previous years.
-
Monitor Execution:
- Use
squeueto observe job status on SLURM. - Run
reV statusto track the pipeline’s progress and verify that each stage runs in sequence.
- Use
-
Check Logs:
- Check the
./logs/pipeline.logfile for detailed information on each step’s execution. - If you encounter issues (e.g., CPU overload or memory constraints), consider lowering the
sites_per_workerparameter in thegenerationconfigurations or increasing node resources.
- Check the
- Sequential Processing: This configuration ensures that each year is processed in sequence, avoiding overload and optimizing resource allocation.
- Efficient Resource Management: By processing fewer sites per worker and controlling node usage, this setup helps manage large datasets without maxing out compute capacity.
- Scalability: This approach is easily scalable; to add more years, simply duplicate the
generationconfiguration with updated file paths and year parameters.
Configuration files are the foundation of reV commands, defining resources, settings, and parameters. These files are in JSON, JSON5, YAML, or TOML formats and are essential for specifying inputs, outputs, and processing details.
Each command example section below includes a link to configuration files used with that command.
reV pipeline runs a series of jobs in sequence, like generation, collect, and aggregation, according to a predefined order in the configuration. Each step is executed one at a time, allowing users to automate an end-to-end workflow.
reV pipeline -c config_pipeline.json --monitor- Sequential Execution: Set each analysis step to run one after the other.
- Execution Monitoring: Add
--monitorto letreVcheck for completion and progress in real-time. - Batch Processing: To run a
pipelinewith multiple configurations, consider usingreV batchinstead. - Collection Pattern: Set
collect_patternto"PIPELINE"in configuration files to ensure thatreV collectgathers outputs from each step in the pipeline automatically.
reV batch runs a pipeline with multiple configurations, allowing users to test variations by running the same pipeline across different scenarios.
reV batch -c config_batch.json --monitor- Use for Multiple Configurations: Ideal for running the same pipeline across different parameter sets.
- Unique Set Tags: Ensure each configuration variation has a unique
set_tagto avoid confusion.
reV generation calculates renewable energy production by simulating energy generation at individual sites or across areas using SAM (System Advisor Model) configurations. It pulls data from renewable resources (like wind or solar) and outputs energy estimates.
reV generation -c config_gen.jsonHere’s an example of an execution_control block commonly used with reV generation:
"execution_control": {
"option": "awspc",
"qos": "normal",
"walltime": 1,
"allocation": "revcluster",
"nodes": 16,
"sites_per_worker": 20,
"max_workers": 1,
"timeout": 1800
}- option: Specifies the execution environment, using AWS ParallelCluster (
awspc) in this case. - qos: Quality of Service level, typically set to
normalfor standard priority. - walltime: Expected duration in hours for the job to complete.
- allocation: Defines the cluster allocation (e.g.,
revcluster). - nodes: Maximum number of vCPUs to use for the job. SLURM will automatically provision the required number of nodes based on this value. Each compute instance in this cluster uses a
c5.xlargeinstance type, which has 4 vCPUs. Therefore, specifying16 nodeswould provision 4 EC2 instances. sites_per_worker: Specifies the number of project sites each worker processes in parallel. Lowering this number reduces the level of parallel computation, which can be useful for managing resource usage. For example, settingsites_per_workerto 10 will result in a slower job execution but will help prevent overuse of compute resources by reducing the load on each worker. Tinkering withsites_per_workerin combination with the number ofnodeswill be essential for determining the optimal amount of compute resources your job requires. Adjusting both settings allows you to balance execution time with resource utilization, helping to fine-tune the efficiency and performance of your workload.- max_workers: Number of workers per vCPU, controlling the level of parallelization within each node.
- timeout: Timeout in seconds for each job or task before it is marked as failed.
reV bespoke performs layout optimization for wind projects by adjusting turbine placement for maximum efficiency or minimal cost per grid point. It provides a detailed, location-specific analysis for wind projects.
reV bespoke -c config_bespoke.json- For wind projects requiring individual grid point optimization, use
reV bespoke.
reV econ calculates the financial performance of renewable energy projects, such as Levelized Cost of Energy (LCOE), by analyzing project and maintenance costs and revenue data.
reV econ -c config_econ.json --monitor- Typically follows
generationin the pipeline. - Requires project cost and revenue data.
reV collect gathers data from multiple nodes or outputs, merging it into a single HDF5 file, which simplifies data analysis by consolidating distributed data into one file.
reV collect -c config_collect.json --monitor- Set
collect_patternandsource_filestoPIPELINEfor automatic integration. - Ideal for use within a pipeline to centralize outputs.
reV multi-year aggregates data from multiple years of simulation, helping analyze long-term renewable energy production trends by combining data from multiple yearly outputs.
reV multi-year -c config_multi_year.json --monitor- Use
PIPELINEpaths to ensure continuous execution in a multi-step pipeline. - Best used for long-term trend analysis across multiple data years.
These commands aggregate and analyze energy supply data across grid points. Supply-Curve-Aggregation consolidates data, while Supply-Curve performs economic and capacity assessments for grid-based renewable sites.
reV supply-curve -c config_supply_curve.json --monitorcollect_pattern: Set toPIPELINEfor streamlined integration.- Use these commands in sequence for optimal grid-wide assessment.
Each of these commands has unique applications, from rep-profiles for representative profile generation to nrwal for lifecycle assessments, qa-qc for quality checks, and script for custom scripts.
For each of these:
- Summary: Tailor based on specific functionality, such as quality checks or profile generation.
- Sample Command: Follow a consistent format:
reV <command> -c config_<command>.json --monitor
For detailed uses, see each command’s documentation:
- rep-profiles: Documentation
- hybrids: Documentation
- nrwal: Documentation
- qa-qc: Documentation
-
Project Points: These are specific locations or grid points analyzed within the reV framework. They can be generated using site data and selected based on project requirements.
-
Resource Files: Resource files contain renewable energy data, like wind speeds or solar irradiance, usually from datasets like the NREL Weather Toolkit (WTK).
-
SAM Files: SAM (System Advisor Model) files include settings for simulating energy production, such as solar panel configuration or wind turbine specs.
After completing the analysis, you can upload the results to an Amazon S3 bucket for easy access and storage. This step allows you to keep your data organized and accessible, especially useful when working with large datasets.
-
Identify Your Output Files: Locate the files you want to upload in your output directory. For example:
example-4_generation_2007.h5example-4_generation_2008.h5example-4_generation_2009.h5example-4_multi-year.h5(or your specific multi-year result file)
-
Run the AWS CLI Command: Use the
aws s3 cpcommand to copy files to your S3 bucket. Replaceyour-s3-bucket-namewith your actual S3 bucket name and adjust the file paths as needed.aws s3 cp /path/to/your/results/example-4_generation_2007.h5 s3://your-s3-bucket-name/results/ aws s3 cp /path/to/your/results/example-4_generation_2008.h5 s3://your-s3-bucket-name/results/ aws s3 cp /path/to/your/results/example-4_generation_2009.h5 s3://your-s3-bucket-name/results/ aws s3 cp /path/to/your/results/example-4_multi-year.h5 s3://your-s3-bucket-name/results/
-
Verify the Upload:
- You can list files in the S3 bucket to confirm they were uploaded successfully:
aws s3 ls s3://your-s3-bucket-name/results/
- You can list files in the S3 bucket to confirm they were uploaded successfully:
If you have multiple files in a folder and want to upload them all at once, you can use the --recursive flag:
aws s3 cp /path/to/your/results/ s3://your-s3-bucket-name/results/ --recursiveThis will copy all files in the specified folder to the S3 bucket, maintaining your results in a central, accessible location.