Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Add OpenMP support to forward modeling modules in gravmag. #106

Merged
merged 9 commits into from Jul 3, 2014

Commits on Jun 6, 2014

  1. Multithreaded gravmag.sphere with OpenMP

    Using Cython prange function in gravmag.sphere yields a 2x speedup in my
    i5 processor with 4 threads on a (200x200) grid. On smaller grids
    (20x20) it is at worse the same speed.
    
    Had to separate the kernel Cython functions because I couldn't do
    "elif field ==" without the GIL.
    
    Putting the gz kernel on a cdef inline function actually made it much
    faster.
    leouieda committed Jun 6, 2014
    Copy the full SHA
    ee836fa View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    9287564 View commit details
    Browse the repository at this point in the history
  3. OpenMP support for gravmag.prism

    Had to change the coordinate system shift (x[0] = x2 - xp[l]) to use
    dx = x[i] - xp[l] inside the integration loops because I can't alter the
    x array in parallel.
    
    Benchmarks show 2x speedup in an i5 processor with 4 threads.
    harvester doesn't seem to be much faster though.
    leouieda committed Jun 6, 2014
    Copy the full SHA
    3c5300e View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2014

  1. Merge branch 'kernel-functions' into kernel-openmp

    Conflicts:
    	setup.py
    
    Changed the setup for building extension modules. Getting a list of
    module names plus extra compile args.
    leouieda committed Jul 3, 2014
    Copy the full SHA
    69e87e3 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    70d96bc View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    a9913de View commit details
    Browse the repository at this point in the history
  4. OpenMP for gravmag.polyprism

    Benchmarks are very good! Sometimes more than 2x speedup over numpy
    version.
    Moved the vertices loop out of kernels to avoid segfaults.
    Had to change the way PolygonalPrism makes .x and .y attributes so that
    they are C contiguous arrays.
    leouieda committed Jul 3, 2014
    Copy the full SHA
    5db1796 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    843dbe2 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    2e3791a View commit details
    Browse the repository at this point in the history