diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-10 13:28:20 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-10 13:28:20 +0200 |
commit | 5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010 (patch) | |
tree | a6c0f605be6de3f372ae69905b331f9f75452da7 /nixos/tests/mpich.nix | |
parent | 6070bc016bd2fd945b04347e25cfd3738622d2ac (diff) | |
download | nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.gz nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.bz2 nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.lz nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.xz nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.zst nixpkgs-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.zip |
Move all of NixOS to nixos/ in preparation of the repository merge
Diffstat (limited to 'nixos/tests/mpich.nix')
-rw-r--r-- | nixos/tests/mpich.nix | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/nixos/tests/mpich.nix b/nixos/tests/mpich.nix new file mode 100644 index 00000000000..d57512ebdfe --- /dev/null +++ b/nixos/tests/mpich.nix @@ -0,0 +1,40 @@ +# Simple example to showcase distributed tests using NixOS VMs. + +{ pkgs, ... }: + +with pkgs; + +{ + nodes = { + master = + { config, pkgs, ... }: { + environment.systemPackages = [ gcc mpich2 ]; + #boot.kernelPackages = pkgs.kernelPackages_2_6_29; + }; + + slave = + { config, pkgs, ... }: { + environment.systemPackages = [ gcc mpich2 ]; + }; + }; + + # Start master/slave MPI daemons and compile/run a program that uses both + # nodes. + testScript = + '' + startAll; + + $master->succeed("echo 'MPD_SECRETWORD=secret' > /etc/mpd.conf"); + $master->succeed("chmod 600 /etc/mpd.conf"); + $master->succeed("mpd --daemon --ifhn=master --listenport=4444"); + + $slave->succeed("echo 'MPD_SECRETWORD=secret' > /etc/mpd.conf"); + $slave->succeed("chmod 600 /etc/mpd.conf"); + $slave->succeed("mpd --daemon --host=master --port=4444"); + + $master->succeed("mpicc -o example -Wall ${./mpich-example.c}"); + $slave->succeed("mpicc -o example -Wall ${./mpich-example.c}"); + + $master->succeed("mpiexec -n 2 ./example >&2"); + ''; +} |