Skip to content

Commit

Permalink
cleanup HPC Scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
shirubana committed Nov 16, 2023
1 parent 21cb1c9 commit 4ae5f3a
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 33 deletions.
8 changes: 6 additions & 2 deletions bifacial_radiance/HPCScripts/BasicSimulations/addNewModule.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import bifacial_radiance
import os

rad_obj = bifacial_radiance.RadianceObj('makemod', 'TEMP')
testfolder = 'TEMP'

rad_obj.getEPW(37.42, -110)
if not os.path.exists(testfolder):
os.makedirs(testfolder)

rad_obj = bifacial_radiance.RadianceObj('makemod', testfolder)

moduletype='tutorial-module'
x = 2
Expand Down
29 changes: 0 additions & 29 deletions bifacial_radiance/HPCScripts/BasicSimulations/dask_template.sbatch

This file was deleted.

51 changes: 51 additions & 0 deletions bifacial_radiance/HPCScripts/BasicSimulations/run_sbatch.sbatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/bash

#SBATCH --job-name="demo_run"
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=36
#SBATCH --time=15
#SBATCH --export=ALL
#SBATCH --account=pvsoiling
# --partition=debug
#SBATCH --mail-type=ALL
#SBATCH --mail-user=silvana.ovaitt@nrel.gov

# Save info
python3 /home/sayala/BasicSimulations/addNewModule.py

#-----------------------
export BASE=/scratch/$USER
mkdir -p $BASE/$SLURM_JOB_ID
cd $BASE/$SLURM_JOB_ID
# Record starting time
date

# Save info
cat $0 > $SLURM_JOB_ID.script
printenv > $SLURM_JOB_ID.env
cp /home/sayala/BasicSimulations/simulate_tracking_gendaylit.py .

# Start up dask scheduler
dask-scheduler --interface ib0 \
--scheduler-file=/scratch/sayala/dask_testing/scheduler.json &

# Wait for scheduler to start
sleep 5

# Start up dask worker on all nodes (Note, script is used to also set
# environment variables on all the nodes. If these were set by default
# (using bash_profile for example), the commented command below could
# be used to start up workers.
srun /home/sayala/BasicSimulations/dask_on_node.sh &

mkdir RUNS
cd RUNS

# Wait for workers to start
sleep 5

# Run script to submit tasks
python3 /home/sayala/BasicSimulations/simulate_tracking_gendaylit.py

# Record ending time
date
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def simulate_single(tilt=None, results_folder_fmt=None, weather_file=None):
sim_general_name = 'bifacial_example'
lat = 37.5
lon = -77.6
moduletype = 'Prism Solar Bi60 landscape'
moduletype = 'tutorial-module'
pitch = 3
clearance_height = 0.2
azimuth = 180
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def simulate_single(daydate=None, results_folder_fmt=None, weather_file=None):
sim_general_name = 'bifacial_example'
lat = 37.5
lon = -77.6
moduletype = 'Prism Solar Bi60 landscape'
moduletype = 'tutorial-module'
gcr = 0.35
hub_height = 0.2

Expand Down

0 comments on commit 4ae5f3a

Please sign in to comment.