Coder Social home page Coder Social logo

renewablesimulator's Introduction

Hi there ๐Ÿ‘‹

My name is Weiming Hu. I'm a researcher in โšก Renewable Energy โšก and โ˜๏ธ Weather Forecasting โ˜๏ธ .

I'm also an enthusiast for free software and the open-source movement.

  • ๐Ÿšง I'm working on ๐Ÿšง

    • Developing R and Python packages for the scientific community
    • Becoming a Bangle.JS contributor.
  • ๐Ÿ’ฌ Ask me about ๐Ÿ’ฌ

    • R, Python, C++, Supercomputers
  • ๐Ÿ“ซ How to reach me ๐Ÿ“ซ

Top Langs

renewablesimulator's People

Contributors

weiming-hu avatar

Stargazers

 avatar

Watchers

 avatar  avatar

renewablesimulator's Issues

Parallel efficiency

This is the time profiling from 4 nodes, 72 processes on each node:

****************** Simple Clock Summary ******************
Total wall time: 5807.40820813179s
Reading file: 2727.614988088608s
Sun position calculation: 658.7170560359955s
Scenario 00000 simulation: 1468.309131860733s
Scenario 00000 simulation for analogs: 596.2754669189453s
Scenario 00000 simulation: 140.38229155540466s
Scenario 00000 simulation for forecasts: 45.32916855812073s
Scenario 00000 simulation: 133.69862699508667s
Scenario 00000 simulation for analysis: 37.081478118896484s
*************** End of Simple Clock Summary **************

This is the time profiling from 2 nodes, 72 processes on each node:

****************** Simple Clock Summary ******************
Total wall time: 7323.613418340683s
Reading file: 1980.4284970760345s
Sun position calculation: 1295.2253940105438s
Scenario 00000 simulation with analogs: 3146.107565164566s
Scenario 00000 writing simulation for analogs: 274.17069029808044s
Scenario 00000 simulation with forecasts: 273.43497824668884s
Scenario 00000 writing simulation for forecasts: 51.14760994911194s
Scenario 00000 simulation with analysis: 278.81663608551025s
Scenario 00000 writing simulation for analysis: 24.282047510147095s
*************** End of Simple Clock Summary **************

The overall wall time is improved when more processes are created. And the computation parts (e.g. various stages for simulation) show good parallelization efficiency. But the file I/O overhead is significant.

The significant file I/O could be related to parallel access to NetCDF files. All processes are accessing the same file which could slow down the process.

A better model for parallel file I/O would be a hierarchical structure where only a handful of processes carry out the file I/O.

Simulation on HPC

XSEDE Stampede2

To prepare the evergreen with MPI capability on Stampede2, we need to enable several modules and build netCDF4 with the parallel enabled NetCDF package.

On a login node, the following code prepares the environment.

# Clear all pre-loaded modules
module purge

# Load required modules
module load intel/18.0.2 impi/18.0.2 pnetcdf/1.11.0 python3/3.7.0 phdf5/1.10.4 parallel-netcdf/4.6.2

# Initialize virtual environment with python3
virtualenv -p python3 $HOME/venv

# Start the virtual environment
source $HOME/venv/bin/activate

# Install python modules with no extra setup.
# netCDF4 is installed later separately.
#
pip install pandas numpy pvlib progress Cython mpi4py pyyaml pyinstrument line_profiler tqdm

# Install netCDF4 with extra setup to support parallel I/O
# There are some steps involved.
#

# Download source code
wget https://codeload.github.com/Unidata/netcdf4-python/zip/master -O netCDF4.tar.gz

# Define environment variables
export HDF5_DIR=$TACC_HDF5_DIR
export MPI_INCDIR=$TACC_IMPI_INC

# Manual installation
pip install netCDF4.tar.gz

# Remove the source files
rm netCDF4.tar.gz

On a compute node, the following code tests the environment.

# Start the environment properly
module purge
module load intel/18.0.2 impi/18.0.2 pnetcdf/1.11.0 python3/3.7.0 phdf5/1.10.4 parallel-netcdf/4.6.2
source $HOME/venv/bin/activate

# Run a small test case
ibrun -n 10 python evergreen.py --nc ~/scratch/AnEn/4000_analogs.nc --profile --stations 20

Linking problem in build tree on MacOS

RPATH linking problem persists on MacOS in the build tree. When I try to run the built executable, I get the following error:

$ ./RenewableSimulator 
dyld: Library not loaded: ssc.dylib
  Referenced from: /Users/wuh20/github/RenewableSimulator/output/bin/./RenewableSimulator
  Reason: image not found

I used otool to look into the linked libraries. The library scc.dylib is clearly wrong. I've been trying to use different parameters and setting in CMakeLists.txt file but in vein.

$ otool -L RenewableSimulator 
RenewableSimulator:
	ssc.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/local/opt/gcc/lib/gcc/8/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.25.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
	/usr/local/lib/gcc/8/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.