<commit_before>// $Id: MolmecSupport_bench.C,v 1.2 2002/06/16 19:12:55 oliver Exp $
#include <BALL/CONCEPT/benchmark.h>

///////////////////////////

#include <BALL/MOLMEC/COMMON/support.h>
#include <BALL/KERNEL/system.h>

///////////////////////////

using namespace BALL;

// args: benchmark name (without '"'), reference time in seconds, CVS ID string
START_BENCHMARK(MolmecSupport, 4.0, "$Id: MolmecSupport_bench.C,v 1.2 2002/06/16 19:12:55 oliver Exp $")


/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////


System S;
ForceField ff;

ff.options.setVector(PeriodicBoundary::Option::PERIODIC_BOX_LOWER, Vector3(-6.0));
ff.options.setVector(PeriodicBoundary::Option::PERIODIC_BOX_UPPER, Vector3(6.0));
ff.periodic_boundary.enable();
ff.setup(S);

ForceField::PairVector pair_vector;
pair_vector.reserve(2000000);
START_SECTION(calculateNonBondedAtomPairs(type = HASH_GRID, periodic_boundary = true), 0.4)
	START_TIMER
		MolmecSupport::calculateNonBondedAtomPairs
			(pair_vector, ff.getAtoms(), ff.periodic_boundary.getBox(),
			 4.0, true, MolmecSupport::HASH_GRID);
	STOP_TIMER
END_SECTION
std::cout << pair_vector.size() << std::endl;

pair_vector.clear();
START_SECTION(calculateNonBondedAtomPairs(type = BRUTE_FORCE, periodic_boundary = true), 0.4)
	START_TIMER
		MolmecSupport::calculateNonBondedAtomPairs
			(pair_vector, ff.getAtoms(), ff.periodic_boundary.getBox(),
			 4.0, true, MolmecSupport::BRUTE_FORCE);
	STOP_TIMER
END_SECTION
std::cout << pair_vector.size() << std::endl;

pair_vector.clear();
START_SECTION(calculateNonBondedAtomPairs(type = HASH_GRID, periodic_boundary = false), 0.1)
	START_TIMER
		MolmecSupport::calculateNonBondedAtomPairs
			(pair_vector, ff.getAtoms(), ff.periodic_boundary.getBox(),
			 4.0, false, MolmecSupport::HASH_GRID);
	STOP_TIMER
END_SECTION
std::cout << pair_vector.size() << std::endl;

pair_vector.clear();
START_SECTION(calculateNonBondedAtomPairs(type = BRUTE_FORCE, periodic_boundary = false), 0.1)
	START_TIMER
		MolmecSupport::calculateNonBondedAtomPairs
			(pair_vector, ff.getAtoms(), ff.periodic_boundary.getBox(),
			 4.0, false, MolmecSupport::BRUTE_FORCE);
	STOP_TIMER
END_SECTION
std::cout << pair_vector.size() << std::endl;
std::cout << S.countAtoms() << std::endl;

/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////

END_BENCHMARK<commit_msg>added: reasonable tests for calculateNonbondedPairs<commit_after>// $Id: MolmecSupport_bench.C,v 1.3 2002/12/17 16:33:26 oliver Exp $
#include <BALL/CONCEPT/benchmark.h>

///////////////////////////

#include <BALL/MOLMEC/COMMON/support.h>
#include <BALL/KERNEL/system.h>

///////////////////////////

using namespace BALL;

// args: benchmark name (without '"'), reference time in seconds, CVS ID string
START_BENCHMARK(MolmecSupport, 4.0, "$Id: MolmecSupport_bench.C,v 1.3 2002/12/17 16:33:26 oliver Exp $")


/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////

// Create a system filled with solvent (water) only
System S;
ForceField ff;
ff.options.setVector(PeriodicBoundary::Option::PERIODIC_BOX_LOWER, Vector3(-25.0));
ff.options.setVector(PeriodicBoundary::Option::PERIODIC_BOX_UPPER, Vector3(25.0));
ff.periodic_boundary.enable();
ff.setup(S);

ForceField::PairVector pair_vector;
pair_vector.reserve(2000000);
STATUS("number of atoms: " << S.countAtoms())
START_SECTION(calculateNonBondedAtomPairs(type = HASH_GRID, periodic_boundary = true), 0.25)
	START_TIMER
		MolmecSupport::calculateNonBondedAtomPairs
			(pair_vector, ff.getAtoms(), ff.periodic_boundary.getBox(),
			 8.0, true, MolmecSupport::HASH_GRID);
	STOP_TIMER
END_SECTION
STATUS(pair_vector.size())

START_SECTION(calculateNonBondedAtomPairs(type = BRUTE_FORCE, periodic_boundary = true), 0.25)
	pair_vector.clear();
	START_TIMER
		MolmecSupport::calculateNonBondedAtomPairs
			(pair_vector, ff.getAtoms(), ff.periodic_boundary.getBox(),
			 8.0, true, MolmecSupport::BRUTE_FORCE);
	STOP_TIMER
END_SECTION
STATUS(pair_vector.size())

START_SECTION(calculateNonBondedAtomPairs(type = HASH_GRID, periodic_boundary = false), 0.25)
	pair_vector.clear();
	START_TIMER
		MolmecSupport::calculateNonBondedAtomPairs
			(pair_vector, ff.getAtoms(), ff.periodic_boundary.getBox(),
			 8.0, false, MolmecSupport::HASH_GRID);
	STOP_TIMER
END_SECTION
STATUS(pair_vector.size())

START_SECTION(calculateNonBondedAtomPairs(type = BRUTE_FORCE, periodic_boundary = false), 0.25)
	pair_vector.clear();
	START_TIMER
		MolmecSupport::calculateNonBondedAtomPairs
			(pair_vector, ff.getAtoms(), ff.periodic_boundary.getBox(),
			 8.0, false, MolmecSupport::BRUTE_FORCE);
	STOP_TIMER
END_SECTION
STATUS(pair_vector.size())

/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////

END_BENCHMARK
{'fraction_non_alphanumeric': 0.2346876895087932, 'fraction_numerical': 0.026682838083687082, 'mean_word_length': 3.287694974003466, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6705729', 'n_tokens_mistral': 1863, 'n_tokens_neox': 1685, 'n_words': 262}