diff --git a/docs/removed_features.rst b/docs/removed_features.rst index bf198393ef..0018a19558 100644 --- a/docs/removed_features.rst +++ b/docs/removed_features.rst @@ -43,3 +43,8 @@ To that end, the following table's columns constitute: - This legacy macOS toolkit was deprecated in 2012 and removed from macOS 10.15 - `#1869 `_ - 8fecd77 + * - LINDA + - Linda is a coordination model that aids communication in parallel computing environments. + Side note: the bulletin board implemented within the ParallelContext is NEURON's analogy to LINDA's conceptual functionality of tuple space. + - `#1919 `_ + - a5c36e9 diff --git a/src/oc/hoc.cpp b/src/oc/hoc.cpp index 769a3ea265..7fc240d331 100644 --- a/src/oc/hoc.cpp +++ b/src/oc/hoc.cpp @@ -227,34 +227,6 @@ void nrn_exit(int i) { exit(i); } -#if LINDA - -int hoc_retreat_flag; -#define RETREAT_SIGNAL SIGHUP - -static RETSIGTYPE retreat_handler(int sig) /* catch interrupt */ -{ - /*ARGSUSED*/ - if (hoc_retreat_flag++) { - /* never managed the first one properly */ - nrn_exit(1); - } - if (!lookup("linda_retreat")) { - hoc_retreat_flag = 0; - /* user did not give us a safe retreat so it would be nice */ - /* to take up later exactly at this point */ - nrn_exit(1); - } - IGNORE(signal(RETREAT_SIGNAL, retreat_handler)); -} - -void hoc_retreat(void) { - hoc_obj_run("linda_retreat()\n", nullptr); - exit(0); -} - -#endif - #if defined(WIN32) || defined(MAC) #define HAS_SIGPIPE 0 #else @@ -935,8 +907,6 @@ void hoc_main1_init(const char* pname, const char** envp) { nrn_exit(1); } - save_parallel_envp(); - hoc_init(); initplot(); #if defined(__GO32__) @@ -1000,9 +970,6 @@ int hoc_main1(int argc, const char** argv, const char** envp) /* hoc6 */ hoc_audit_from_hoc_main1(argc, argv, envp); hoc_main1_init(argv[0], envp); -#if LINDA - signal(RETREAT_SIGNAL, retreat_handler); -#endif #if HAS_SIGPIPE signal(SIGPIPE, sigpipe_handler); #endif diff --git a/src/oc/hocdec.h b/src/oc/hocdec.h index 7bb1845f75..0a5bc90b1e 100644 --- a/src/oc/hocdec.h +++ b/src/oc/hocdec.h @@ -299,21 +299,7 @@ int ilint; #define Printf nrnpy_pr #endif -/* EINTR handling for LINDA */ -#if LINDA -#include -#define ERRCHK(c1) \ - { \ - errno = EINTR; \ - while (errno == EINTR) { \ - errno = 0; \ - c1 \ - } \ - } - -#else #define ERRCHK(c1) c1 -#endif #define IFGUI if (hoc_usegui) { #define ENDGUI } diff --git a/src/oc/math.cpp b/src/oc/math.cpp index c4c7b8fa92..cf9a98573b 100644 --- a/src/oc/math.cpp +++ b/src/oc/math.cpp @@ -121,10 +121,6 @@ double errcheck(double d, const char* s) /* check result of library call */ int hoc_errno_check(void) { int ierr; -#if LINDA - static parallel_eagain = 0; -#endif - #if 1 errno = 0; return 0; @@ -158,17 +154,6 @@ int hoc_errno_check(void) { case ERANGE: fprintf(stderr, "A math function was called that returned an out of range value\n"); break; -#if LINDA - /* regularly set by eval() and perhaps other linda commands */ - case EAGAIN: - if (parallel_eagain++ == 0) { - perror("oc"); - fprintf(stderr, - "oc: This error occurs often from LINDA and thus will not be further " - "reported.\n"); - } - break; -#endif default: perror("oc"); break; diff --git a/src/oc/oc_ansi.h b/src/oc/oc_ansi.h index 273b55fa81..acc07653f7 100644 --- a/src/oc/oc_ansi.h +++ b/src/oc/oc_ansi.h @@ -231,7 +231,6 @@ std::size_t hoc_total_array(Symbol*); void hoc_menu_cleanup(); void frame_debug(); void hoc_oop_initaftererror(); -void save_parallel_envp(); void save_parallel_argv(int, const char**); void hoc_init(); void initplot(); diff --git a/src/oc/ocmain.cpp b/src/oc/ocmain.cpp index 57a842f63e..f3d4ad4064 100644 --- a/src/oc/ocmain.cpp +++ b/src/oc/ocmain.cpp @@ -54,11 +54,7 @@ static void setnrnhome(const char* arg) { #endif } -#if LINDA /* LINDA (SAF) */ -real_main(int argc, const char** argv, const char** envp) { -#else int main(int argc, const char** argv, const char** envp) { -#endif int err; nrn_isdouble(nullptr, 0., 0.); #if MAC @@ -75,23 +71,13 @@ int main(int argc, const char** argv, const char** envp) { } #if EXPRESS exit(0); -#else -#if LINDA - lexit(0); #else return err; #endif -#endif } void hoc_single_event_run() { /* for interviews, ivoc make use of own main */ -#if LINDA - extern int hoc_retreat_flag; - if (hoc_retreat_flag) { - hoc_retreat(); - } -#endif #if INTERVIEWS && 0 single_event_run(); #endif diff --git a/src/oc/parallel.cpp b/src/oc/parallel.cpp index f0c3e9595c..8d18aadf28 100644 --- a/src/oc/parallel.cpp +++ b/src/oc/parallel.cpp @@ -81,36 +81,11 @@ void hoc_parallel_begin(void) { strcpy(pnt, buf); } /* farm-out all but the first instance of the loop */ -#if LINDA - /* place arguments for eval() into tuple space, Linda - doesn't seem to want to let the fxn in an eval take - arrays as args */ - __linda_out("parallel sargs", sargv, senvp); - __linda_out("parallel args", parallel_argv : sargv, parallel_envp : senvp); - __linda_eval("parallel run", parallel_hoc_main(i), i); -#endif } -#if LINDA - /* do first pass though loop on master node (first to first) */ - pushx(first); - pushx(first); -#else - /* run in serial if not LINDA */ + /* run in serial */ pushx(first); pushx(last); -#endif - - /* block until all instances of loop have finished */ -#if LINDA - i = (int) last - (int) first; - while (i-- > 0) { - int err_val, err_num; - - __linda_in("parallel run", ?err_val, ?err_num); - /* could test err_val != 0 but currently will always equal 0 */ - } -#endif /* assign value of symbol to last+1 as would be upon exiting a serial loop */ if (!ISARRAY(sym)) { @@ -143,12 +118,7 @@ void hoc_parallel_end(void) { /* need to exit after for-loop for all sub-processes */ if (parallel_sub) { hoc_final_exit(); -#if LINDA - lexit(0); -#else exit(0); -#endif - } else { /* assign loop counter the proper end value */ *pval = end_val; @@ -166,20 +136,8 @@ int parallel_hoc_main(int i) { int j, _largc; _largv = static_cast(emalloc(NUM_ARGS * sizeof(char*))); _lenvp = static_cast(emalloc(NUM_ARGS * sizeof(char*))); -#if LINDA - char name[20]; - - gethostname(name, 20); - Fprintf(stderr, "\nLaunching sub-process on %s.\n\t1\n", name); - - __linda_in("parallel sargs", ?sargv, ?senvp); -#endif targv = static_cast(emalloc(sargv)); tenvp = static_cast(emalloc(senvp)); - /* pointers need to point to memory that will be filled by __linda_in() */ -#if LINDA - __linda_in("parallel args", ? targv :, ? tenvp :); -#endif pnt = targv; for (j = 0; *pnt; j++) { @@ -249,43 +207,3 @@ void save_parallel_argv(int argc, const char** argv) { #endif #endif } - -void save_parallel_envp(void) { -#if LINDA -#if !defined(__APPLE__) - extern char** environ; - char** envp = environ; -#endif -#if defined(__APPLE__) - char** envp = (*_NSGetEnviron()); -#endif - char* pnt; - int j; - char** envp = environ; - - /* count how long the block of memory should be */ - for (j = 0; envp[j]; j++) { - pnt = envp[j]; - while (*pnt++) { - senvp++; - } - senvp++; /* add room for '\0' */ - } - - /* need room for extra '\0' at end, each space is of size (char) */ - senvp = (senvp + 1) * sizeof(char); - - /* malloc blocks of memory */ - parallel_envp = static_cast(emalloc(senvp)); - - /* place the strings into the memory block separated by '\0' */ - pnt = parallel_envp; - for (j = 0; envp[j]; j++) { - strcpy(pnt, envp[j]); - /*EMPTY*/ - while (*pnt++) - ; - } - *pnt = '\0'; /* place extra '\0' at end */ -#endif -}