csu-hmc / opty

A library for using direct collocation in the optimization of dynamic systems.
http://opty.readthedocs.io
Other
86 stars 20 forks source link

openmp doesn't seem to work on Windows #159

Open moorepants opened 1 month ago

moorepants commented 1 month ago

From a CI run in #158:

Run conda install openmp pydy
Channels:
 - conda-forge
 - defaults
Platform: win-64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: C:\Users\runneradmin\miniconda3\envs\opty-dev

  added / updated specs:
    - openmp
    - pydy

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pydy-0.7.1                 |   py38haa244fe_2         4.9 MB  conda-forge
    pywin32-306                |   py38hd3f51b4_2         5.6 MB  conda-forge
    ------------------------------------------------------------
                                           Total:        10.5 MB

The following NEW packages will be INSTALLED:

  pydy               conda-forge/win-64::pydy-0.7.1-py38haa244fe_2 
  pywin32            conda-forge/win-64::pywin32-306-py38hd3f51b4_2 

Downloading and Extracting Packages: ...working... done
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
test.c
Time for non-parallel: 12.008871599999999
Time for parallelized: 11.966323799999998
moorepants commented 1 month ago

I fixed the flag in https://github.com/csu-hmc/opty/pull/158/commits/e9728f9bdf603b563ab73826d73441257b6d3bc1 and the compilation seems to work, but no speed up.

Run python examples/parallel_example.py
test.c
Time for non-parallel: 12.084284799999978
Time for parallelized: 11.949921199999949