/*
 *  test_global_rng.sli
 *
 *  This file is part of NEST.
 *
 *  Copyright (C) 2004 The NEST Initiative
 *
 *  NEST is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  NEST is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with NEST.  If not, see <http://www.gnu.org/licenses/>.
 *
 */


/* BeginDocumentation
Name: testsuite::test_global_rng - check whether global rng gives consistent results

Synopsis: nest_indirect test_global_rng.sli -> compare results for different numbers of jobs 

Description:

The scripts test whether in simulations distributed over different numbers of 
processors the global random number generator gives identical results on all 
jobs and for different numbers of jobs.
See #186 for discussion.

Author:  July 2009, Diesmann
SeeAlso: unittest::distributed_assert_or_die
*/


/unittest (9715) require
/unittest using


[1 2 4]                                      
{                                            
 ResetKernel
 0 << /grng_seed 12 >> SetStatus  % ResetKernel does not reset global rng

 GetGlobalRNG /rng Set [ 20 ] { ; rng 100 irand } Table

}
distributed_rank_invariant_collect_assert_or_die   
                            % a variant of this function will have an extra argument
                            % which specifies the test carried out to compare the 
                            % simulation results (not implemented 090716 MD)