/*
 *  test_all_to_all.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_all_to_all - Test correct connection with many targets
    Synopsis: (test_all_to_all) run -> - 

    Description:
    test_all_to_all.sli checks that all-to-all connections are created
    correctly if the number of targets exceeds the number of local nodes.
    
    Author: Hans Ekkehard Plesser
    SeeAlso: testsuite::test_one_to_one, testsuite::test_fixed_indegree,
    testsuite::test_pairwise_bernoulli
*/

(unittest) run
/unittest using

% With one MPI process, conventional looping is used. We use that as
% reference case. For 4 processes, we will have fewer local nodes than
% targets and inverse looping is used. 
[1 4]
{
  /nrns 1 /iaf_psc_alpha 4 Create cvgidcollection def
  
  nrns nrns /all_to_all Connect
  
  << >> GetConnections { cva 2 Take }  Map
} distributed_process_invariant_collect_assert_or_die
