# Modify gmx analysis code (gmx saxs) for OpenMP acceleration

**URL:** <https://gromacs.bioexcel.eu/t/modify-gmx-analysis-code-gmx-saxs-for-openmp-acceleration/8779>\
**Category:** User discussions\
**Tags:** analysis-tools\
**Created:** [April 3, 2024, 4:30pm UTC](https://gromacs.bioexcel.eu/t/modify-gmx-analysis-code-gmx-saxs-for-openmp-acceleration/8779 "2024-04-03T16:30:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nano](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@nano](https://gromacs.bioexcel.eu/u/nano)\
**Post date:** [April 3, 2024, 4:30pm UTC](https://gromacs.bioexcel.eu/t/modify-gmx-analysis-code-gmx-saxs-for-openmp-acceleration/8779/1 "2024-04-03T16:30:09Z")

</div>

Dear GROMACS developers,

I was using _gmx saxs_ for structural characterization. However, the system is very big and the number of frames for analysis is large, I was therefore trying to apply OpenMP for the _gmx saxs_ as I noticed that the current version (2022.2) does not come with OpenMP like _gmx hbond_ does.

Since the main code for the structure factor calculation is four loops (wave vector, i, j, k and particle p), this is very suitable for OpenMP acceleration.

Here is the pseudocode of what I did:

```auto
#if GMX_OPENMP 
#pragma omp parallel default(shared) \
                         private(i, j, k,\
                         kx, ky, kz,\
                         krr, kr,\
                         p, asf, kdotx)
    /*the parallel code*/
#else
    /*the original code*/
#endif

```

Then I compiled it with:

```auto
make
sudo make install

```

However, when I run the code, it is still running the serial version, skipping the OpenMP part. I was wondering what I missed. Any suggestions or comments are highly appreciated.
