3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/tests/mpich.nix
Ludovic Courtès cfce376628 Add an MPI test using two nodes.
svn path=/nixos/trunk/; revision=27335
2011-05-31 10:21:37 +00:00

41 lines
1.1 KiB
Nix

# 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");
'';
}