From 47e3e4a674be6d6da1314da3856e205a856efb8c Mon Sep 17 00:00:00 2001 From: Jessica Mitchell Date: Mon, 9 Sep 2024 15:30:50 +0200 Subject: [PATCH] remove dry run related code --- nestkernel/mpi_manager.h | 12 ------ nestkernel/nest.cpp | 6 --- nestkernel/nest.h | 2 - nestkernel/nestmodule.cpp | 13 ------ nestkernel/nestmodule.h | 46 --------------------- testsuite/regressiontests/ticket-566.sli | 52 ------------------------ 6 files changed, 131 deletions(-) delete mode 100644 testsuite/regressiontests/ticket-566.sli diff --git a/nestkernel/mpi_manager.h b/nestkernel/mpi_manager.h index 6b6b2a6dea..a8f4fcea7e 100644 --- a/nestkernel/mpi_manager.h +++ b/nestkernel/mpi_manager.h @@ -91,12 +91,6 @@ class MPIManager : public ManagerInterface */ size_t get_num_processes() const; - /** - * Set the number of processes state variable. - * This is used by dryrun_mode. - */ - void set_num_processes( size_t n_procs ); - /** * Get rank of MPI process */ @@ -502,12 +496,6 @@ MPIManager::get_num_processes() const return num_processes_; } -inline void -MPIManager::set_num_processes( size_t n_procs ) -{ - num_processes_ = n_procs; -} - inline size_t MPIManager::get_rank() const { diff --git a/nestkernel/nest.cpp b/nestkernel/nest.cpp index 1289365adf..2add49bcb6 100644 --- a/nestkernel/nest.cpp +++ b/nestkernel/nest.cpp @@ -62,12 +62,6 @@ reset_kernel() kernel().reset(); } -void -enable_dryrun_mode( const size_t n_procs ) -{ - kernel().mpi_manager.set_num_processes( n_procs ); -} - void register_logger_client( const deliver_logging_event_ptr client_callback ) { diff --git a/nestkernel/nest.h b/nestkernel/nest.h index 8255758ec7..e49c7dcb5e 100644 --- a/nestkernel/nest.h +++ b/nestkernel/nest.h @@ -49,8 +49,6 @@ void install_module( const std::string& module_name ); void reset_kernel(); -void enable_dryrun_mode( const size_t n_procs ); - void register_logger_client( const deliver_logging_event_ptr client_callback ); /** diff --git a/nestkernel/nestmodule.cpp b/nestkernel/nestmodule.cpp index 81c95514af..77e8d3ae7d 100644 --- a/nestkernel/nestmodule.cpp +++ b/nestkernel/nestmodule.cpp @@ -878,18 +878,6 @@ NestModule::NumProcessesFunction::execute( SLIInterpreter* i ) const i->EStack.pop(); } -void -NestModule::SetFakeNumProcesses_iFunction::execute( SLIInterpreter* i ) const -{ - i->assert_stack_load( 1 ); - long n_procs = getValue< long >( i->OStack.pick( 0 ) ); - - enable_dryrun_mode( n_procs ); - - i->OStack.pop( 1 ); - i->EStack.pop(); -} - void NestModule::SyncProcessesFunction::execute( SLIInterpreter* i ) const { @@ -2139,7 +2127,6 @@ NestModule::init( SLIInterpreter* i ) i->createcommand( "Rank", &rankfunction ); i->createcommand( "NumProcesses", &numprocessesfunction ); - i->createcommand( "SetFakeNumProcesses", &setfakenumprocesses_ifunction ); i->createcommand( "SyncProcesses", &syncprocessesfunction ); i->createcommand( "TimeCommunication_i_i_b", &timecommunication_i_i_bfunction ); i->createcommand( "TimeCommunicationv_i_i", &timecommunicationv_i_ifunction ); diff --git a/nestkernel/nestmodule.h b/nestkernel/nestmodule.h index ef874f16ef..d381e699b6 100644 --- a/nestkernel/nestmodule.h +++ b/nestkernel/nestmodule.h @@ -647,52 +647,6 @@ class NestModule : public SLIModule void execute( SLIInterpreter* ) const override; } numprocessesfunction; - /** @BeginDocumentation - * Name: SetFakeNumProcesses - Set a fake number of MPI processes. - * Synopsis: n_procs SetFakeNumProcesses -> - - * Description: - * Sets the number of MPI processes to n_procs. Used for benchmarking purposes - * of memory consumption only. - * Please note: - * - Simulation of the network will not be possible after setting fake - * processes. - * - It is not possible to use this function when running a script on multiple - * actual MPI processes. - * - The setting of the fake number of processes has to happen before the kernel - * reset and before the setting of the local number of threads. - * After calling SetFakeNumProcesses, it is obligatory to call either - * ResetKernel or SetStatus on the Kernel for the setting of the fake - * number of processes to come into effect. - * - * A typical use case would be to test if a neuronal network fits on a machine - * of given size without using the actual resources. - * - * Example: - * %%% Set fake number of processes - * 100 SetFakeNumProcesses - * - * %%% Build network - * /iaf_psc_alpha 100 Create - * [1 100] Range /n Set - * - * << /source n /target n >> Connect - * - * %%% Measure memory consumption - * memory_thisjob == - * - * Execute this script with - * mpirun -np 1 nest example.sli - * - * Availability: NEST 2.2 - * Author: Susanne Kunkel - * FirstVersion: July 2011 - * SeeAlso: NumProcesses - */ - class SetFakeNumProcesses_iFunction : public SLIFunction - { - void execute( SLIInterpreter* ) const override; - } setfakenumprocesses_ifunction; - /** @BeginDocumentation * Name: SyncProcesses - Synchronize all MPI processes. * Synopsis: SyncProcesses -> - diff --git a/testsuite/regressiontests/ticket-566.sli b/testsuite/regressiontests/ticket-566.sli deleted file mode 100644 index d6db690ede..0000000000 --- a/testsuite/regressiontests/ticket-566.sli +++ /dev/null @@ -1,52 +0,0 @@ -/* - * ticket-566.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 . - * - */ - -/** @BeginDocumentation - -Name: testsuite::ticket-566 - Regression test for setting a fake number of processes. - -Synopsis: (ticket-566) run -> NEST exits if test fails - -Description: -Ensure that kernel set status of num_procs does no longer work and -check that SetFakeNumProcesses sets num_processes in the kernel. - -Author: Susanne Kunkel, 2012-12-04 - */ - -(unittest) run -/unittest using - -M_ERROR setverbosity - -{ - << /num_procs 777 >> SetKernelStatus -} -fail_or_die - -{ - 777 SetFakeNumProcesses - GetKernelStatus /num_processes get 777 eq -} -assert_or_die - -endusing