weird behaviour compiling with USER-INTEL and Intel compiler

Hi all,

I am experiencing some weird bug when I compile my code with Intel
compiler. I try to take advantage of the speedup offered by
USER-INTEL, but I am facing some weird behaviour.

I have written a new fix as roughly followed:

/* ---------------------------------------------------------------------- */

int FixFOO::setmask() {
  int mask = 0;
  mask |= INITIAL_INTEGRATE;
  return mask;
}

void FixFOO::initial_integrate(int /*vflag*/) {
  // printf("AM I HERE? \n");
  if (igroup == atom->firstgroup)
    nlocal = atom->nfirst;

  for (i = 0; i < nlocal; i++) {
    if (mask[i] & groupbit) {
        valA[i] = valAset;
      }
    }
  }
}

/* ---------------------------------------------------------------------- */

where valA is defined via fix property/atom at the beginning of the
input script and search for inside the code:

/* ---------------------------------------------------------------------- */
  // find the concentration property
  int fvalA;
  int ivalA = atom->find_custom("valA", fvalA);
  if (ivalA < 0)
    error->all(FLERR,
               "Can't find property valA");
  valA = atom->dvector[icA];
/* ---------------------------------------------------------------------- */

It behaves as expected when compiling with GCC + OpenMPI - the value
valA is reset to valAset at the beginning of each time step. However,
when using Intel/2018 with either IMPI or OpenMPI or MVAPICH, the
result is not the same. The code will print out "AM I HERE?" if I
uncomment the print statement, but the value is not reset.

Is there some thing extra inside USER-INTEL that I might have
overlooked upon creating this fix? Or do I have to do something more
to resolve the issue with Intel compiler?

Many thanks,
Quang

i currently don't see, how this can be related to USER-INTEL. if at
all, it would have to be due to something, that you don't show here.

try compiling without the USER-INTEL package, but with the intel
compiler (and make sure you have all bugfixes and updates for that
compiler).
if the problem persists, try out different compiler flags. the example
makefiles for using USER-INTEL use very aggressive compiler settings
and thus are more likely to trigger bugs in the compiler, than a
generic makefile with just basic optimizations.

axel.