1 #include <../../nrnconf.h>
19 #define MD 2147483647.
35 char* (*nrnpy_po2pickle)(
Object*,
size_t*);
36 Object* (*nrnpy_pickle2po)(
char*, size_t);
37 char* (*nrnpy_callpicklef)(
char*, size_t, int,
size_t*);
38 Object* (*nrnpympi_alltoall_type)(int, int);
42 double nrnmpi_transfer_wait_;
48 double nrnmpi_dbl_allreduce(
double,
int);
49 void nrnmpi_dbl_allreduce_vec(
double* src,
double* dest,
int cnt,
int type);
50 void nrnmpi_dbl_allgather(
double*,
double*,
int);
57 extern void nrnmpi_subworld_size(
int n);
81 OcBBS(
int nhost_request);
121 int id,
i, firstarg, style;
144 pname = (*nrnpy_po2pickle)(ob, &size);
154 bbs->
pkstr(ob->ctemplate->sym->name);
174 bbs->
pkint(argtypes);
265 nrnmpi_subworld_size(
n);
348 hoc_execerror(
"pc.unpack can only unpack str, scalar, or Vector.",
349 "use pc.upkpyobj to unpack a Python Object");
371 return (
const char**) ps;
385 return vec->temp_objvar();
393 Object* po = (*nrnpy_pickle2po)(s,
n);
418 size = int(
chkarg(2, -1, 2.14748e9));
420 Object* po = (*nrnpympi_alltoall_type)(size,
type);
482 return ((
OcBBS*)
v)->time();
490 }
else if (mode == 1) {
493 return nrnmpi_transfer_wait_;
524 double w = ((
OcBBS*)
v)->wait_time();
529 double w = ((
OcBBS*)
v)->integ_time();
555 return ((
OcBBS*)
v)->send_time();
591 bool gid_compress =
true;
597 gid_compress = (
chkarg(2, 0, 1) ? true :
false);
600 xchng_meth = (int)
chkarg(3, 0, 15);
616 int backbone_style = 2;
617 int reducedtree_host = 0;
620 sid = (int)
chkarg(2, 0, (
double) (0x7fffffff));
623 backbone_style = (int)
chkarg(3, 0, 2);
680 double tstop =
chkarg(1,
t, 1e9);
685 }
else if (enabled == 0) {
690 return double(enabled);
700 int nsend, nsendmax, nrecv, nrecv_useful;
702 nsend = nsendmax = nrecv = nrecv_useful = 0;
713 return double(nsendmax);
777 double* dest =
new double[
n];
778 nrnmpi_dbl_allreduce_vec(px, dest,
n,
type);
779 for (
int i = 0;
i <
n; ++
i) {
792 val = nrnmpi_dbl_allreduce(val,
type);
808 nrnmpi_dbl_allgather(&val, px, 1);
826 hoc_execerror(
"size of source counts vector is not nhost", 0);
829 int* scnt =
new int[np];
830 int* sdispl =
new int[np + 1];
832 for (
i = 0;
i < np; ++
i) {
834 sdispl[
i + 1] = sdispl[
i] + scnt[
i];
836 if (ns != sdispl[np]) {
837 hoc_execerror(
"sum of source counts is not the size of the src vector", 0);
842 int* rcnt =
new int[np];
843 int* rdispl =
new int[np + 1];
844 int*
c =
new int[np];
846 for (
i = 0;
i < np; ++
i) {
848 rdispl[
i + 1] =
i + 1;
852 for (
i = 0;
i < np; ++
i) {
853 rdispl[
i + 1] = rdispl[
i] + rcnt[
i];
864 for (
i = 0;
i < ns; ++
i) {
922 ip = int(
chkarg(2, 0, 1));
968 return double(
sec->pnode[0]->_nt->id);
1008 "nrncore_write: optional second arg is not a number (True or False append flag)",
NULL);
1063 "master_works_on_jobs",
1104 "mpiabort_on_error",
1140 "splitcell_connect",
1164 "thread_how_many_proc",
1179 "nrnbbcore_register_mapping",
1232 int size = strlen(s) + 1;
1269 fprintf(stderr,
"%s[%d] is not an Object in this process\n", s,
i);
1276 hoc_execerror(
"with subworlds, this submit style not implemented", 0);
1278 }
else if (style == 3) {
1288 int size = strlen(s) + 1;
1297 if (style != 3 && !
fname) {
1306 for (
j = argtypes; (
i =
j % 5) != 0;
j /= 5) {
1315 }
else if (
i == 2) {
1319 int size = strlen(
sarg[ns]) + 1;
1325 }
else if (
i == 3) {
1360 rs = (*nrnpy_callpicklef)(s, npickle,
narg, size);
1374 for (
i = 0;
i < ns; ++
i) {
static void nrnmpi_int_alltoallv(int *s, int *scnt, int *sdispl, int *r, int *rcnt, int *rdispl)
static void nrnmpi_dbl_alltoallv(double *s, int *scnt, int *sdispl, double *r, int *rcnt, int *rdispl)
static void nrnmpi_barrier()
Section * chk_access(void)
bool look_take(const char *)
void spike_record(int, IvocVect *, IvocVect *)
Object ** gid_connect(int)
void master_works(int flag)
void set_gid2node(int, int)
void upkvec(int n, double *px)
void netpar_solve(double)
void pkvec(int n, double *px)
bool working(int &id, double &x, int &userid)
IvocVect * netpar_max_histogram(IvocVect *)
void netpar_spanning_statistics(int *, int *, int *, int *)
void pkpickle(const char *, size_t size)
double netpar_mindelay(double maxdelay)
char * upkpickle(size_t *size)
virtual void return_args(int userid)
char * execute_helper(size_t *, int id, bool exec=true)
virtual void upkvec(int, double *)=0
virtual char * upkstr()=0
virtual double upkdouble()=0
virtual char * upkpickle(size_t *)=0
virtual void unref() const
Symbol * hoc_table_lookup(const char *, Symlist *)
sprintf(buf, " if (secondorder) {\n" " int _i;\n" " for (_i = 0; _i < %d; ++_i) {\n" " _p[_slist%d[_i]] += dt*_p[_dlist%d[_i]];\n" " }}\n", numeqn, listnum, listnum)
double chkarg(int, double low, double high)
void hoc_execerror(const char *, const char *)
int hoc_is_object_arg(int narg)
void hoc_pushstr(char **d)
int vector_arg_px(int, double **)
void hoc_pushobj(Object **d)
int hoc_is_str_arg(int narg)
void hoc_assign_str(char **cpp, const char *buf)
double hoc_call_objfunc(Symbol *s, int narg, Object *ob)
int hoc_is_double_arg(int narg)
void hoc_obj_ref(Object *obj)
char * hoc_object_name(Object *ob)
Symbol * hoc_lookup(const char *)
int hoc_is_pdouble_arg(int narg)
double * hoc_pgetarg(int narg)
void hoc_obj_unref(Object *obj)
int nrn_mpiabort_on_error_
char ** hoc_pgargstr(int narg)
Object ** hoc_objgetarg(int)
int hoc_obj_run(const char *, Object *)
int vector_capacity(Vect *v)
void vector_resize(Vect *v, int n)
double * vector_vec(Vect *v)
Object ** hoc_temp_objptr(Object *)
#define ITERATE(itm, lst)
static double nrnmpi_splitcell_wait_
static double nrnmpi_wtime()
static void phase_begin(const char *name)
static void phase_end(const char *name)
void nrn_seg_or_x_arg(int iarg, Section **psec, double *px)
int const size_t const size_t n
int nrnmpi_numprocs_world
void class2oc(const char *, void *(*cons)(Object *), void(*destruct)(void *), Member_func *, int(*checkpoint)(void **), Member_ret_obj_func *, Member_ret_str_func *)
static const char ** pname(void *v)
static double spike_record(void *v)
static double spike_stat(void *v)
int nrncore_run(const char *)
int nrn_set_timeout(int timeout)
static double step_time(void *v)
static double partition(void *)
char *(* nrnpy_po2pickle)(Object *, size_t *)
size_t nrnbbcore_register_mapping()
For BBP use case, we want to write section-segment mapping to gid_3.dat file.
static Object ** upkpyobj(void *v)
static double nhost(void *v)
static double nthrd(void *)
static Object ** upkvec(void *v)
void ParallelContext_reg()
Symbol * hoc_which_template(Symbol *)
static double userid(void *v)
static double nrncorerun(void *)
void nrn_prcellstate(int gid, const char *suffix)
static double pctime(void *v)
static double thread_dt(void *)
static double prcellstate(void *v)
static void unpack_help(int, OcBBS *)
static double nhost_world(void *v)
static double look_take(void *v)
static double working(void *v)
static double send_time(void *v)
static double alltoall(void *)
static double wait_time(void *v)
int nrn_allow_busywait(int)
void nrn_thread_partition(int, Object *)
static double outputcell(void *v)
static double master_works(void *v)
static double done(void *v)
static Object ** gid2cell(void *v)
static double event_time(void *v)
static Member_ret_str_func retstr_members[]
static double thread_stat(void *)
static Member_func members[]
int nrncore_is_file_mode()
double nrn_bgp_receive_time(int)
static void * cons(Object *)
static double set_gid2node(void *v)
static void pack_help(int, OcBBS *)
static double nrncorewrite_argvec(void *)
int nrncore_psolve(double tstop, int file_mode)
static double rank_bbs(void *v)
static void destruct(void *v)
static double retval(void *v)
static Object ** py_gather(void *)
static double context(void *v)
static Object ** py_alltoall_type(int type)
static double spcompress(void *v)
static void nrnmpi_dbl_broadcast(double *, int, int)
static double nrn_thread_t(void *)
static double thread_how_many_proc(void *)
static double thread_ctime(void *)
static double splitcell_connect(void *v)
static double gid_clear(void *v)
static double source_var(void *)
static void nrnmpi_char_broadcast(char *, int, int)
static double setup_transfer(void *)
static Object ** py_broadcast(void *)
static double allgather(void *)
static double threshold(void *v)
static double nhost_bbs(void *v)
static double integ_time(void *v)
char *(* nrnpy_callpicklef)(char *, size_t, int, size_t *)
static double sec_in_thread(void *)
static double thread_busywait(void *)
static double take(void *v)
static double step_wait(void *v)
static Object ** pyret(void *v)
static double subworlds(void *v)
static double vtransfer_time(void *v)
static double pack(void *v)
double nrnmpi_rtcomp_time_
int nrn_how_many_processors()
static double cell(void *v)
static double mech_time(void *v)
static void nrnmpi_int_broadcast(int *, int, int)
static Object ** py_alltoall(void *)
Object *(* nrnpympi_alltoall_type)(int, int)
static double set_timeout(void *v)
void nrnmpi_gid_clear(int)
static double multisplit(void *v)
void nrn_threads_create(int, int)
int nrnmpi_spike_compress(int nspike, bool gid_compress, int xchng_meth)
static double nrncorewrite_argappend(void *)
static double post(void *v)
static double rank_world(void *v)
static double gid_exists(void *v)
static double set_maxstep(void *v)
static Member_ret_obj_func retobj_members[]
static double submit(void *v)
static double worker(void *v)
static Object ** gid_connect(void *v)
static Object ** py_allgather(void *)
static double nrn_rank(void *v)
static double target_var(void *)
static double broadcast(void *)
static Object ** gid2obj(void *v)
void nrnmpi_setup_transfer()
int nrnmpi_multisplit(Section *, double x, int sid, int backbonestyle)
static double barrier(void *)
bool nrn_trajectory_request_per_time_step_
static Object ** py_scatter(void *)
static int submit_help(OcBBS *)
static double unpack(void *v)
Object *(* nrnpy_pickle2po)(char *, size_t)
static const char ** upkstr(void *v)
int nrnmpi_splitcell_connect(int that_host)
static double upkscalar(void *v)
static double maxhist(void *v)
static double look(void *v)
static double psolve(void *v)
static double allreduce(void *)
static double set_mpiabort_on_error(void *)
check_obj_type(o, "SectionList")
HocStruct cTemplate * ctemplate
static const char * fname(const char *name)