Add an MPI test using two nodes.

svn path=/nixos/trunk/; revision=27335
This commit is contained in:
Ludovic Courtès 2011-05-31 10:21:37 +00:00
parent b65a4840b8
commit cfce376628
2 changed files with 41 additions and 0 deletions

View file

@ -13,6 +13,7 @@ with import ../lib/testing.nix { inherit nixpkgs system; };
ipv6 = makeTest (import ./ipv6.nix);
kde4 = makeTest (import ./kde4.nix);
login = makeTest (import ./login.nix);
mpich = makeTest (import ./mpich.nix);
nat = makeTest (import ./nat.nix);
nfs = makeTest (import ./nfs.nix);
openssh = makeTest (import ./openssh.nix);

40
tests/mpich.nix Normal file
View file

@ -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->mustSucceed("echo 'MPD_SECRETWORD=secret' > /etc/mpd.conf");
$master->mustSucceed("chmod 600 /etc/mpd.conf");
$master->mustSucceed("mpd --daemon --ifhn=master --listenport=4444");
$slave->mustSucceed("echo 'MPD_SECRETWORD=secret' > /etc/mpd.conf");
$slave->mustSucceed("chmod 600 /etc/mpd.conf");
$slave->mustSucceed("mpd --daemon --host=master --port=4444");
$master->mustSucceed("mpicc -o example -Wall ${./mpich-example.c}");
$slave->mustSucceed("mpicc -o example -Wall ${./mpich-example.c}");
$master->mustSucceed("mpiexec -n 2 ./example >&2");
'';
}