brucefan1983 / NEP_CPU

CPU version of NEP
GNU General Public License v3.0
49 stars 15 forks source link

Revert back to std::cout from printf #1

Closed elindgren closed 2 years ago

elindgren commented 2 years ago

@brucefan1983 Would it be possible to revert back to using std::cout for logging/prints instead of printf? Capturing the output from nep.cpp becomes difficult if it is written with printf, as it does not write to the same output stream as std::cout.

Here is an example of the difference between the two:

Old:

std::cout << "Use the NEP2 potential with " << paramb.num_types << " atom type(s).\n";

New:

printf("Use the NEP2 potential with %d atom type.\n", paramb.num_types);
brucefan1983 commented 2 years ago

sure, you do this or I do it?

brucefan1983 commented 2 years ago

I have been mixing iostream and stdio a lot, which is bad. It is better to unify to use the C++ way.

elindgren commented 2 years ago

I can do it :)

brucefan1983 commented 2 years ago

ok, you can make a PR. I will add you as developer for this repo.