Tiny bug in pair_comb3

Hello!

Using the most recent stable release (16Feb16), I get a segmentation fault
when I try to use the COMB3 pair style without screen output.

This also occurred with the “in.comb3” example under /examples/comb/.
So the following runs fine:
lammps_binary -in in.comb3
But the following quickly exits with a segfault:
lammps_binary -in in.comb3 -screen none

When looking at the pair_comb3.cpp file,
it seems that some fprintf(screen, … ) calls are made
without checking whether screen output is actually enabled.

The pair_comb3.cpp file can be fixed by just adding an additional
“screen” condition to the if statements encapsulating those fprintf calls.
This command performs the fix:
sed -i “/fprintf/ s/comm->me == 0/comm->me == 0 && screen/” pair_comb3.cpp

After recompiling LAMMPS, the in.comb3 example without screen output
ran without problems.

I hope you can reproduce the problem.
If so, is this indeed the proper way to fix it?

Regards,
Maxime

Hello!

Using the most recent stable release (16Feb16), I get a segmentation fault
when I try to use the COMB3 pair style without screen output.

This also occurred with the "in.comb3" example under /examples/comb/.
So the following runs fine:
lammps_binary -in in.comb3
But the following quickly exits with a segfault:
lammps_binary -in in.comb3 -screen none

When looking at the pair_comb3.cpp file,
it seems that some fprintf(screen, ... ) calls are made
without checking whether screen output is actually enabled.

The pair_comb3.cpp file can be fixed by just adding an additional
"screen" condition to the if statements encapsulating those fprintf calls.
This command performs the fix:
sed -i "/fprintf/ s/comm->me == 0/comm->me == 0 \&\& screen/"
pair_comb3.cpp

After recompiling LAMMPS, the in.comb3 example without screen output
ran without problems.

thanks for reporting this and providing a solution as well.
i've integrated these changes into my branch so they won't get lost.

axel.