about summary refs log tree commit diff
path: root/nixos/tests/mpich.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-10 13:28:20 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-10 13:28:20 +0200
commit5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010 (patch)
treea6c0f605be6de3f372ae69905b331f9f75452da7 /nixos/tests/mpich.nix
parent6070bc016bd2fd945b04347e25cfd3738622d2ac (diff)
downloadnixlib-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar
nixlib-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.gz
nixlib-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.bz2
nixlib-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.lz
nixlib-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.xz
nixlib-5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010.tar.zst
nixlib-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.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixos/tests/mpich.nix b/nixos/tests/mpich.nix
new file mode 100644
index 000000000000..d57512ebdfed
--- /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");
+    '';
+}