compiling different files with different compiler options

Dear all,

I have recently encountered a problem when compiling LAMMPS with different
compiler flags. I used the XLC compiler for BG/Q systems.

When I compiled LAMMPS with the following flags
CCFLAGS = -g -O3 -qarch=qp -qtune=qp -qsmp=omp -qsimd=auto -qhot=level=2 -qprefetch -qunroll=yes
the output in the dump files was incorrect (the atom ID and type as well as some coordinates were set
to 0) Aside from this problem, it seems that the simulation has run fine. Files written with the write_data
command were correct, i.e. atomIDs and types were *not* set to zero.

When I compiled LAMMPS with
CCFLAGS = -g
the output in the dump file was correct, but the simulation was approximately 4 times slower.

My questions are:

1.) Which of the compiler flags above is in your opinion most likely responsible for the incorrect behavior
of the output in the dump files.
2.) Is it possible do compile the files for writing the dump files with different compiler flags than those
that are used for the rest of the code? Would you recommend trying this or would you suggest to set
the compiler flags less brutal?

Best,
Rolf

Dear all,

I have recently encountered a problem when compiling LAMMPS with different
compiler flags. I used the XLC compiler for BG/Q systems.

When I compiled LAMMPS with the following flags
CCFLAGS = -g -O3 -qarch=qp -qtune=qp -qsmp=omp -qsimd=auto -qhot=level=2 -qprefetch -qunroll=yes
the output in the dump files was incorrect (the atom ID and type as well as some coordinates were set
to 0) Aside from this problem, it seems that the simulation has run fine. Files written with the write_data
command were correct, i.e. atomIDs and types were *not* set to zero.

When I compiled LAMMPS with
CCFLAGS = -g
the output in the dump file was correct, but the simulation was approximately 4 times slower.

My questions are:

1.) Which of the compiler flags above is in your opinion most likely responsible for the incorrect behavior
of the output in the dump files.

all of them. IBMs xlC compilers have always been quite ticklish and it
often depended on specific patch levels whether they would work or not
(much more than the corresponding fortran compilers).

i would do a test with -O2 instead of -O3 and without -qhot first.

2.) Is it possible do compile the files for writing the dump files with different compiler flags than those
that are used for the rest of the code? Would you recommend trying this or would you suggest to set
the compiler flags less brutal?

yes, that should be possible and since compiler optimization should
have little impact on i/o, reducing compiler optimization for those
files only is a good idea.

axel.

Hi,

thanks for your help.

I recompiled the dump* files with
CCFLAGS = -g -qsmp=omp

Things are working now.

Best,
Rolf

You can put a rule in your low-level Makefile that tells
how to compile a specific file. It will override the generic
.o:.cpp rule.

Steve