View Foo.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Foo.hpp" | |
#include <iostream> | |
using namespace std; | |
Foo::Foo(int _a, int _b): a(_a), b(_b){ | |
cout << "C++ side, constructor" << endl; | |
} | |
Foo::~Foo(){ |
View potential.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pairs: # Non bonded atoms pairs | |
- atoms: [*, *] # Default value | |
type: NullPotential | |
- atoms: [He, He] | |
type: LennardJones | |
sigma: 3.4 A | |
epsilon: 0.45 kJ/mol | |
- atoms: [He, Ar] | |
type: LennardJones | |
sigma: 2.8 A |
View potentials.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Potential { | |
fn energy(&self) -> f64; | |
} | |
// This is just a marker trait, to know which potentials can be used as pair | |
// potentials. I also have AnglePotential, GlobalPotential, ... | |
trait PairPotential: Potential {} | |
impl Clone for Box<PairPotential> { | |
fn clone(&self) -> Box<PairPotential> { |
View build.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PyCall | |
# Change that to whatever packages you need. | |
const PACKAGES = ["pyyaml"] | |
# Import pip | |
try | |
@pyimport pip | |
catch | |
# If it is not found, install it |
View molecules.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::slice; | |
pub struct Vector3d([f64; 3]); | |
pub struct Atom { | |
pub position: Vector3d, | |
pub velocity: Vector3d, | |
pub name: String | |
} |
View MolecularDynamics.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[input] | |
version = 1.0 | |
[[systems]] | |
cell = 20 # Cubic cell | |
positions = "initial.xyz" | |
velocities = {init = "300 K"} | |
potentials = "potentials.toml" | |
[[simulations]] |
View valgrind.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==24579== Memcheck, a memory error detector | |
==24579== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. | |
==24579== Using Valgrind-3.11.0.SVN and LibVEX; rerun with -h for copyright info | |
==24579== Command: tests/xyz | |
==24579== | |
--24579-- run: /usr/bin/dsymutil "tests/xyz" | |
==24579== Conditional jump or move depends on uninitialised value(s) | |
==24579== at 0x10000BAB1: boost::filesystem::detail::recur_dir_itr_imp::push_directory(boost::system::error_code&) (operations.hpp:1054) | |
==24579== by 0x10000B900: boost::filesystem::detail::recur_dir_itr_imp::increment(boost::system::error_code*) (operations.hpp:1085) | |
==24579== by 0x1000079E0: ____C_A_T_C_H____T_E_S_T____102() (operations.hpp:1278) |
View dilated.pdb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CRYST1 100.000 100.000 100.000 90.00 90.00 90.00 P 1 1 | |
HETATM 1 He RES X 1 4.905 84.135 0.777 1.00 0.00 He | |
HETATM 2 He RES X 2 88.376 32.438 11.077 1.00 0.00 He | |
HETATM 3 He RES X 3 84.431 8.811 41.520 1.00 0.00 He | |
HETATM 4 He RES X 4 101.038 20.851 52.080 1.00 0.00 He | |
HETATM 5 He RES X 5 97.902 6.895 72.124 1.00 0.00 He | |
HETATM 6 He RES X 6 6.789 11.264 7.060 1.00 0.00 He | |
HETATM 7 He RES X 7 88.061 9.591 13.068 1.00 0.00 He | |
HETATM 8 He RES X 8 1.762 9.043 29.016 1.00 0.00 He | |
HETATM 9 He RES X 9 6.755 39.358 58.695 1.00 0.00 He |
View Linux Intel Xeon E5-2680
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cargo benchcmp safe.log unsafe.log --threshold=2 | |
name safe.log ns/iter unsafe.log ns/iter diff ns/iter diff % | |
cache_move_all_rigid_molecules 1,463,817 1,168,495 -295,322 -20.17% | |
cache_move_all_rigid_molecules_ewald 10,620,984 8,721,128 -1,899,856 -17.89% | |
cache_move_all_rigid_molecules_wolf 8,386,407 10,278,223 1,891,816 22.56% | |
cache_move_particle 201,875 244,669 42,794 21.20% | |
cache_move_particle_ewald 528,745 491,710 -37,035 -7.00% | |
cache_move_particles 354,655 282,355 -72,300 -20.39% | |
cache_move_particles_ewald 1,025,460 887,721 -137,739 -13.43% | |
cache_move_particles_wolf 507,774 553,008 45,234 8.91% |
View lazy_benchmarks.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Cargo.toml b/Cargo.toml | |
index 68e2fc36..5389a05e 100644 | |
--- a/Cargo.toml | |
+++ b/Cargo.toml | |
@@ -26,6 +26,7 @@ clap = "2" | |
[dev-dependencies] | |
bencher = "0.1" | |
+lazy_static = "0.2" | |
rand = "0.3" |
OlderNewer