/*
 *  test_gsd_FixedTotalNumber.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_gsd_FixedTotalNumber - Test global spike detector with MPI

Synopsis: nest_indirect test_gsd_FixedTotalNumber.sli -> -

Description:
This scripts tests the 'fixed_total_number' connection rule in combination
with the gsd spike detector scheme. A network is created on 2 MPI
processes with 0 recording procs and on 3 MPI procs with 1 recording
proc. The script should yield the very same connections for both cases.

Author: Kunkel, Schmidt
FirstVersion: February 2014
 */


(unittest) run
/unittest using

[2 3]
{
     NumProcesses /num_mpi_procs Set
     num_mpi_procs 3 eq
     {
       1 SetNumRecProcesses
     }
     if
    
     0 <<
      	 /total_num_virtual_procs num_mpi_procs
	 /grng_seed 10
       >> SetStatus
    
     /iaf_neuron 10 Create pop
     [1 10] Range /pop_a Set
     pop_a pop_a << /rule /fixed_total_number /N 10 >> << /model /static_synapse /weight 1. /delay 1. >> Connect
    
     << >> GetConnections { GetStatus /target get} Map /targets Set %%% Retrieve all local connections and put them into a dictionary
     << >> GetConnections { GetStatus /source get} Map /sources Set %%% so that the distributed_process_invariant_events... function
     << /sources sources /targets targets >>		           %%% can be used.

} distributed_process_invariant_events_assert_or_die
 
