Skip to content

Commit

Permalink
remove parallel for per #2266 (#2268)
Browse files Browse the repository at this point in the history
* remove `parallel for` per #2266
* remove refs to save_parallel_argv
  • Loading branch information
mgeplf committed Mar 16, 2023
1 parent 10e8f74 commit e631662
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 252 deletions.
6 changes: 3 additions & 3 deletions bin/nrnocmodl.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ fi
echo '#include <stdio.h>
#include "hocdec.h"
extern "C" void modl_reg() {
NOT_PARALLEL_SUB(fprintf(stderr, "Additional mechanisms from files'$newline'");)
fprintf(stderr, "Additional mechanisms from files'$newline'");
' > mod_func.cpp

for i in $files
do
echo 'NOT_PARALLEL_SUB(fprintf(stderr," '$i'.mod");)' >>mod_func.cpp
echo 'fprintf(stderr," '$i'.mod");' >>mod_func.cpp
done
echo 'NOT_PARALLEL_SUB(fprintf(stderr, "'$newline'");)' >>mod_func.cpp
echo 'fprintf(stderr, "'$newline'");' >>mod_func.cpp

for i in $files
do
Expand Down
1 change: 0 additions & 1 deletion cmake/NeuronFileLists.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ set(OC_FILE_LIST
nonlin.cpp
nrnfilewrap.cpp
ocerf.cpp
parallel.cpp
plot.cpp
plt.cpp
regexp.cpp
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/HOCInterpreter/HOCInterpreter.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ _**call()**_ will continue on to check the symbol, which tells us we are callin
315
-> 316 hoc_sprint1(&buf, 1);
317 d = (int) strlen(buf);
318 NOT_PARALLEL_SUB(plprint(buf);)
318 plprint(buf);
319 fflush(stdout);
Target 0: (nrniv) stopped.
```
Expand Down
2 changes: 0 additions & 2 deletions src/ivoc/checkpnt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ static struct HocInst {
{hoc_newline, 0},
{hoc_delete_symbol, "s"},
{hoc_cyclic, 0},
{hoc_parallel_begin, 0},
{hoc_parallel_end, 0},
{dep_make, 0},
{eqn_name, 0},
{eqn_init, 0},
Expand Down
2 changes: 1 addition & 1 deletion src/oc/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern void hoc_argrefasgn(void), hoc_argref(void), hoc_iterator(void), hoc_iter
extern void funcret(void), procret(void), Break(void), Continue(void), Stop(void);
extern void debug(void), hoc_evalpointer(void);
extern void hoc_newline(void), hoc_delete_symbol(void), hoc_stringarg(void), hoc_push_string(void);
extern void hoc_parallel_begin(void), hoc_parallel_end(void), hoc_argrefarg(void);
extern void hoc_argrefarg(void);
extern void hoc_arayinstal(void);

/* OOP */
Expand Down
2 changes: 0 additions & 2 deletions src/oc/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ void debugzz(Inst* p) {
prcod(hoc_newline, "newline\n");
prcod(hoc_delete_symbol, "delete_symbol\n");
prcod(hoc_cyclic, "cyclic\n");
prcod(hoc_parallel_begin, "parallel_begin\n");
prcod(hoc_parallel_end, "parallel_end\n");

prcod(dep_make, "DEPENDENT\n");
prcod(eqn_name, "EQUATION\n");
Expand Down
2 changes: 1 addition & 1 deletion src/oc/fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void PRintf(void) /* printf function */

hoc_sprint1(&buf, 1);
d = (int) strlen(buf);
NOT_PARALLEL_SUB(plprint(buf);)
plprint(buf);
fflush(stdout);
ret();
pushx(d);
Expand Down
12 changes: 4 additions & 8 deletions src/oc/hoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,13 +856,10 @@ void hoc_main1_init(const char* pname, const char** envp) {
ctp = cbuf;
frin = nrn_fw_set_stdin();
fout = stdout;
if (!parallel_sub) {
if (!nrn_is_cable()) {
Fprintf(stderr, "OC INTERPRETER %s %s\n", RCS_hoc_version, RCS_hoc_date);
Fprintf(
stderr,
if (!nrn_is_cable()) {
Fprintf(stderr, "OC INTERPRETER %s %s\n", RCS_hoc_version, RCS_hoc_date);
Fprintf(stderr,
"Copyright 1992 - Michael Hines, Neurobiology Dept., DUMC, Durham, NC. 27710\n");
}
}
progname = pname;
hoc_init();
Expand Down Expand Up @@ -921,7 +918,6 @@ int hoc_main1(int argc, const char** argv, const char** envp) {
#if PVM
init_parallel(&argc, argv);
#endif
save_parallel_argv(argc, argv);

hoc_audit_from_hoc_main1(argc, argv, envp);
hoc_main1_init(argv[0], envp);
Expand Down Expand Up @@ -1019,7 +1015,7 @@ void hoc_final_exit(void) {

/* Don't close the plots for the sub-processes when they finish,
by default they are then closed when the master process ends */
NOT_PARALLEL_SUB(hoc_close_plot();)
hoc_close_plot();
#if READLINE && !defined(MINGW) && !defined(MAC)
rl_deprep_terminal();
#endif
Expand Down
1 change: 0 additions & 1 deletion src/oc/hoc_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ static struct { /* Keywords */
{"local", LOCAL},
{"localobj", LOCALOBJ},
{"strdef", STRDEF},
{"parallel", PARALLEL},
{"help", HELP},
{"iterator", ITERKEYWORD},
{"iterator_statement", ITERSTMT},
Expand Down
2 changes: 1 addition & 1 deletion src/oc/hoc_oop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void hoc_obvar_declare(Symbol* sym, int type, int pmes) {
b = (hoc_fin == stdin);
#endif
if (nrnmpi_myid_world == 0 && (hoc_print_first_instance && b)) {
NOT_PARALLEL_SUB(Printf("first instance of %s\n", sym->name);)
Printf("first instance of %s\n", sym->name);
}
sym->defined_on_the_fly = 1;
}
Expand Down
7 changes: 0 additions & 7 deletions src/oc/hocdec.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,6 @@ using neuron::Sprintf;

extern int hoc_usegui; /* when 0 does not make interviews calls */
extern int nrn_istty_;
extern int parallel_sub; /* for use with parallel neuron (see parallel.cl) */

#define NOT_PARALLEL_SUB(c1) \
{ \
if (!parallel_sub) \
c1 \
}

/* Enter handling for PVM NJP 11/21/94 */
#ifdef PVM
Expand Down
1 change: 0 additions & 1 deletion src/oc/oc_ansi.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ std::size_t hoc_total_array(Symbol*);
void hoc_menu_cleanup();
void frame_debug();
void hoc_oop_initaftererror();
void save_parallel_argv(int, const char**);
void hoc_init();
void initplot();
void hoc_audit_command(const char*);
Expand Down
209 changes: 0 additions & 209 deletions src/oc/parallel.cpp

This file was deleted.

15 changes: 1 addition & 14 deletions src/oc/parse.ypp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void hoc_opasgn_invalid(int op);
%token <sym> NUMBER STRING PRINT parseDELETE VAR BLTIN UNDEF WHILE IF ELSE FOR
%token <sym> FUNCTION PROCEDURE RETURN FUNC parsePROC HOCOBJFUNC READ parseDOUBLE
%token <sym> DEBUG EDIT FUN_BLTIN DEPENDENT EQUATION LOCAL HOCOBJFUNCTION
%token <sym> BREAK CONTINUE AUTO STRDEF STOPSTMT CSTRING PARALLEL HELP
%token <sym> BREAK CONTINUE AUTO STRDEF STOPSTMT CSTRING HELP
%token <sym> ITERATOR ITERKEYWORD ITERSTMT STRINGFUNC OBJECTFUNC
%token <sym> LOCALOBJ AUTOOBJ
%token <narg> ARG NUMZERO ARGREF
Expand Down Expand Up @@ -390,19 +390,6 @@ if (0){YYERROR;}
{ $$ = $2; ($<inst>8)[1].i = relative($9, $<inst>8, 1); /* body */
($<inst>8)[2].i = relative($10, $<inst>8, 2); /* exit */
}
| PARALLEL FOR varname
{ Symbol *s; $<inst>$ = Code(varpush); codesym(s = spop());
hoc_obvar_declare(s, VAR, 1);
}
ROP expr ',' expr
{TPD; TPD; hoc_opasgn_invalid($5);
code(hoc_parallel_begin);
$<inst>$ = code(shortfor); codei(0); codei(0);}
stmt end
{ $$ = $3; ($<inst>9)[1].i = relative($10, $<inst>9, 1); /* body */
($<inst>9)[2].i = relative($11, $<inst>9, 2); /* exit */
code(hoc_parallel_end);
}
| while cond stmt end
{
($1)[1].i = relative($3, $1, 1); /* body of loop */
Expand Down

0 comments on commit e631662

Please sign in to comment.