Esempio n. 1
0
int hoc_atan2() {
	double d, *getarg();
	d = atan2(*getarg(1), *getarg(2));
	hoc_ret();
	pushx(d);
	return 0;
}
Esempio n. 2
0
void Setcolor(void)
{
    double i;
    i = set_color((int)*getarg(1));
    ret();
    pushx(i);
}
Esempio n. 3
0
void hoc_Lw(void)
{
    char *s;
    static int dev=2;
#ifndef WIN32
    if (ifarg(1)) {
        s = gargstr(1);
        if (ifarg(2)) {
            dev = *getarg(2);
        }
        if (s[0] != '\0') {
            Fig_file(s, dev);
        } else {
            Fig_file((char *)0, dev);
        }
    } else {
        Fig_file((char *) 0, dev);
    }
#endif
    ret();
    pushx(0.);
}
Esempio n. 4
0
void Plt(void)
{
    int mode;
    double x, y;
#ifndef WIN32
    mode = *getarg(1);
    if (mode >= 0 || ifarg(2))
    {
        if ((x = *getarg(2)) > 2047)
            x = 2047;
        else if (x < 0)
            x = 0;
        if ((y = *getarg(3)) > 2047)
            y = 2047;
        else if (y < 0)
            y = 0;
    } else {
        x=y=0.;
    }
    plt(mode, x, y);
#endif
    ret();
    pushx(1.);
}
Esempio n. 5
0
hoc_parallel_begin() {
#if !OCSMALL
		  Symbol *sym;
        double first, last;
        char *method, *getenv();
	int parallel_hoc_main();
	int i, j;


        last = xpop();
        first = xpop();
	sym = spop();
	pushs(sym);

        method = getenv("NEURON_PARALLEL_METHOD");
        if (!method) {
                pushx(first);
                pushx(last);
                return;
        }
        if (parallel_seen++) {
                hoc_warning("Only one parallel loop per batch run allowed.",
			    "This loop is being executed serially");
                pushx(first);
                pushx(last);
                return;
        }
      
	if (!parallel_sub) { /* if 0 then master */
	    /* the master instance executes the following portion of the loop */
	    for (i = ((int)first)+1; i <= (int)last; i++) {
		char buf[10], *pnt = parallel_argv;

		/* increment pnt to "00000" */
		for (j = 0; j < 2; j++) {
		    /*EMPTY*/
		    while (*pnt++);
		}
		
		/* replace "00000" with actual value */
		sprintf(buf, "%5d", i);
		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 */
	    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)) {
		if (sym->subtype == USERDOUBLE) {
		    pval = sym->u.pval;
		} else {
		    pval = OPVAL(sym);
		}
	    } else {
		if (sym->subtype == USERDOUBLE) {
		    pval = sym->u.pval + araypt(sym, SYMBOL);
		} else {
		    pval = OPVAL(sym) + araypt(sym, OBJECTVAR);	
		}
	    }
	    end_val = last + 1;

	} else {
Esempio n. 6
0
int redis_list::rpushx(const char* key, const char* value, size_t len)
{
	return pushx("RPUSHX", key, value, len);
}
Esempio n. 7
0
hoc_fmenu() {ret();pushx(0.);}
Esempio n. 8
0
hoc_axis(){ret();pushx(0.);}
Esempio n. 9
0
hoc_Plot(){ret();pushx(0.);}
Esempio n. 10
0
hoc_settext(){ret(); pushx(0.);}
Esempio n. 11
0
hoc_Lw(){ret(); pushx(0.);}
Esempio n. 12
0
hoc_Setcolor(){ret(); pushx(0.);}
Esempio n. 13
0
hoc_ploty(){ret();pushx(0.);}
Esempio n. 14
0
hoc_regraph(){ret();pushx(0.);}
Esempio n. 15
0
hoc_Graph(){ret();pushx(0.);}
Esempio n. 16
0
hoc_Graphmode(){ret();pushx(0.);}