void prim_online(PRIM_PROTOTYPE) { CHECKOP(0); if (mlev < (tp_compatible_muf ? LM3 : LM2)) abort_interp(tp_compatible_muf ? "M3 prim" : "M2 prim"); result = pcount(); CHECKOFLOW(result + 1); while (result) { ref = pdbref(result--); PushObject(ref); } result = pcount(); PushInt(result); }
//********************************************************************************************************************** vector<string> TreeGroupCommand::setParameters(){ try { CommandParameter pshared("shared", "InputTypes", "", "", "PhylipColumnShared", "PhylipColumnShared", "none","tree",false,false,true); parameters.push_back(pshared); CommandParameter pphylip("phylip", "InputTypes", "", "", "PhylipColumnShared", "PhylipColumnShared", "none","tree",false,false); parameters.push_back(pphylip); CommandParameter pname("name", "InputTypes", "", "", "NameCount", "none", "ColumnName","",false,false); parameters.push_back(pname); CommandParameter pcount("count", "InputTypes", "", "", "NameCount", "none", "countcolumn","",false,false); parameters.push_back(pcount); CommandParameter pcolumn("column", "InputTypes", "", "", "PhylipColumnShared", "PhylipColumnShared", "ColumnName-countcolumn","tree",false,false); parameters.push_back(pcolumn); CommandParameter piters("iters", "Number", "", "1000", "", "", "","",false,false); parameters.push_back(piters); CommandParameter psubsample("subsample", "String", "", "", "", "", "","",false,false); parameters.push_back(psubsample); CommandParameter pcutoff("cutoff", "Number", "", "10", "", "", "","",false,false); parameters.push_back(pcutoff); CommandParameter pprecision("precision", "Number", "", "100", "", "", "","",false,false); parameters.push_back(pprecision); CommandParameter plabel("label", "String", "", "", "", "", "","",false,false); parameters.push_back(plabel); CommandParameter pgroups("groups", "String", "", "", "", "", "","",false,false); parameters.push_back(pgroups); CommandParameter pcalc("calc", "Multiple", "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan-kstest-sharednseqs-ochiai-anderberg-kulczynski-kulczynskicody-lennon-morisitahorn-braycurtis-whittaker-odum-canberra-structeuclidean-structchord-hellinger-manhattan-structpearson-soergel-spearman-structkulczynski-speciesprofile-hamming-structchi2-gower-memchi2-memchord-memeuclidean-mempearson-jsd-rjsd", "jclass-thetayc", "", "", "","",true,false,true); parameters.push_back(pcalc); CommandParameter pprocessors("processors", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pprocessors); //CommandParameter poutput("output", "Multiple", "lt-square", "lt", "", "", "",false,false); parameters.push_back(poutput); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "TreeGroupCommand", "setParameters"); exit(1); } }
int main() { int *arr; int count = 0; unsigned int size = 5000*5000; struct timeval ptimes,ptimee,ptimed,stimes,stimee,stimed; arr = (int*) malloc (sizeof(int) * size); initMat(arr,size); gettimeofday(&stimes, NULL); scount(arr,size,&count); gettimeofday(&stimee, NULL); printf("Count : %d\n",count); count = 0; gettimeofday(&ptimes, NULL); count = pcount(arr,size); gettimeofday(&ptimee, NULL); printf("Count : %d\n",count); timersub(&stimee,&stimes,&stimed); timersub(&ptimee,&ptimes,&ptimed); printf("Sequential time : %f. \n",stimed.tv_sec*1000.0 + stimed.tv_usec/1000.0); printf("Parallel time : %f. \n",ptimed.tv_sec*1000.0 + ptimed.tv_usec/1000.0); return 0; }
//********************************************************************************************************************** vector<string> GetSeqsCommand::setParameters(){ try { CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "FNGLT", "none","fasta",false,false,true); parameters.push_back(pfasta); CommandParameter pfastq("fastq", "InputTypes", "", "", "none", "FNGLT", "none","fastq",false,false,true); parameters.push_back(pfastq); CommandParameter pname("name", "InputTypes", "", "", "NameCount", "FNGLT", "none","name",false,false,true); parameters.push_back(pname); CommandParameter pcount("count", "InputTypes", "", "", "NameCount-CountGroup", "FNGLT", "none","count",false,false,true); parameters.push_back(pcount); CommandParameter pgroup("group", "InputTypes", "", "", "CountGroup", "FNGLT", "none","group",false,false,true); parameters.push_back(pgroup); CommandParameter plist("list", "InputTypes", "", "", "none", "FNGLT", "none","list",false,false,true); parameters.push_back(plist); CommandParameter ptaxonomy("taxonomy", "InputTypes", "", "", "none", "FNGLT", "none","taxonomy",false,false,true); parameters.push_back(ptaxonomy); CommandParameter palignreport("alignreport", "InputTypes", "", "", "none", "FNGLT", "none","alignreport",false,false); parameters.push_back(palignreport); CommandParameter pqfile("qfile", "InputTypes", "", "", "none", "FNGLT", "none","qfile",false,false); parameters.push_back(pqfile); CommandParameter paccnos("accnos", "InputTypes", "", "", "none", "none", "none","",false,true,true); parameters.push_back(paccnos); CommandParameter pdups("dups", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(pdups); CommandParameter pseed("seed", "Number", "", "0", "", "", "","",false,false); parameters.push_back(pseed); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); CommandParameter paccnos2("accnos2", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(paccnos2); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "GetSeqsCommand", "setParameters"); exit(1); } }
//********************************************************************************************************************** vector<string> PreClusterCommand::setParameters(){ try { CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none","fasta-name",false,true,true); parameters.push_back(pfasta); CommandParameter pname("name", "InputTypes", "", "", "NameCount", "none", "none","name",false,false,true); parameters.push_back(pname); CommandParameter pcount("count", "InputTypes", "", "", "NameCount-CountGroup", "none", "none","count",false,false,true); parameters.push_back(pcount); CommandParameter pgroup("group", "InputTypes", "", "", "CountGroup", "none", "none","",false,false,true); parameters.push_back(pgroup); CommandParameter pdiffs("diffs", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pdiffs); CommandParameter pprocessors("processors", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pprocessors); CommandParameter palign("align", "Multiple", "needleman-gotoh-blast-noalign", "needleman", "", "", "","",false,false); parameters.push_back(palign); CommandParameter pmatch("match", "Number", "", "1.0", "", "", "","",false,false); parameters.push_back(pmatch); CommandParameter pmismatch("mismatch", "Number", "", "-1.0", "", "", "","",false,false); parameters.push_back(pmismatch); CommandParameter pgapopen("gapopen", "Number", "", "-2.0", "", "", "","",false,false); parameters.push_back(pgapopen); CommandParameter pgapextend("gapextend", "Number", "", "-1.0", "", "", "","",false,false); parameters.push_back(pgapextend); CommandParameter ptopdown("topdown", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(ptopdown); CommandParameter pseed("seed", "Number", "", "0", "", "", "","",false,false); parameters.push_back(pseed); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "PreClusterCommand", "setParameters"); exit(1); } }
//********************************************************************************************************************** vector<string> ClusterCommand::setParameters(){ try { CommandParameter pphylip("phylip", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "none","list",false,false,true); parameters.push_back(pphylip); CommandParameter pname("name", "InputTypes", "", "", "NameCount", "none", "ColumnName","rabund-sabund",false,false,true); parameters.push_back(pname); CommandParameter pcount("count", "InputTypes", "", "", "NameCount", "none", "none","",false,false,true); parameters.push_back(pcount); CommandParameter pcolumn("column", "InputTypes", "", "", "PhylipColumn", "PhylipColumn", "ColumnName","list",false,false,true); parameters.push_back(pcolumn); CommandParameter pcutoff("cutoff", "Number", "", "10", "", "", "","",false,false,true); parameters.push_back(pcutoff); CommandParameter pprecision("precision", "Number", "", "100", "", "", "","",false,false); parameters.push_back(pprecision); CommandParameter pmethod("method", "Multiple", "furthest-nearest-average-weighted", "average", "", "", "","",false,false,true); parameters.push_back(pmethod); CommandParameter pshowabund("showabund", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(pshowabund); CommandParameter ptiming("timing", "Boolean", "", "F", "", "", "","",false,false); parameters.push_back(ptiming); CommandParameter psim("sim", "Boolean", "", "F", "", "", "","",false,false); parameters.push_back(psim); CommandParameter phard("hard", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(phard); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); //CommandParameter padjust("adjust", "String", "", "F", "", "", "","",false,false); parameters.push_back(padjust); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "ClusterCommand", "setParameters"); exit(1); } }
//********************************************************************************************************************** vector<string> ClassifyOtuCommand::setParameters(){ try { CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none","",false,true,true); parameters.push_back(plist); CommandParameter ptaxonomy("taxonomy", "InputTypes", "", "", "none", "none", "none","constaxonomy",false,true,true); parameters.push_back(ptaxonomy); CommandParameter preftaxonomy("reftaxonomy", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(preftaxonomy); CommandParameter pname("name", "InputTypes", "", "", "NameCount", "none", "none","",false,false,true); parameters.push_back(pname); CommandParameter pcount("count", "InputTypes", "", "", "NameCount-CountGroup", "none", "none","",false,false,true); parameters.push_back(pcount); CommandParameter pgroup("group", "InputTypes", "", "", "CountGroup", "none", "none","",false,false,true); parameters.push_back(pgroup); CommandParameter ppersample("persample", "Boolean", "", "F", "", "", "","",false,false); parameters.push_back(ppersample); CommandParameter plabel("label", "String", "", "", "", "", "","",false,false); parameters.push_back(plabel); CommandParameter pbasis("basis", "Multiple", "otu-sequence", "otu", "", "", "","",false,false); parameters.push_back(pbasis); CommandParameter pcutoff("cutoff", "Number", "", "51", "", "", "","",false,true); parameters.push_back(pcutoff); CommandParameter pprobs("probs", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(pprobs); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "ClassifyOtuCommand", "setParameters"); exit(1); } }
//********************************************************************************************************************** vector<string> ChopSeqsCommand::setParameters(){ try { CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none","fasta",false,true,true); parameters.push_back(pfasta); CommandParameter pqfile("qfile", "InputTypes", "", "", "none", "none", "none","qfile",false,false,true); parameters.push_back(pqfile); CommandParameter pname("name", "InputTypes", "", "", "NameCount", "none", "none","name",false,false,true); parameters.push_back(pname); CommandParameter pcount("count", "InputTypes", "", "", "NameCount-CountGroup", "none", "none","count",false,false,true); parameters.push_back(pcount); CommandParameter pgroup("group", "InputTypes", "", "", "CountGroup", "none", "none","group",false,false,true); parameters.push_back(pgroup); CommandParameter pprocessors("processors", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pprocessors); CommandParameter pnumbases("numbases", "Number", "", "0", "", "", "","",false,true,true); parameters.push_back(pnumbases); CommandParameter pcountgaps("countgaps", "Boolean", "", "F", "", "", "","",false,false); parameters.push_back(pcountgaps); CommandParameter pshort("short", "Boolean", "", "F", "", "", "","",false,false); parameters.push_back(pshort); CommandParameter pkeep("keep", "Multiple", "front-back", "front", "", "", "","",false,false); parameters.push_back(pkeep); CommandParameter pkeepn("keepn", "Boolean", "", "f", "", "", "","",false,false); parameters.push_back(pkeepn); CommandParameter pseed("seed", "Number", "", "0", "", "", "","",false,false); parameters.push_back(pseed); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "ChopSeqsCommand", "setParameters"); exit(1); } }
void xsignal(struct sem *s) { int count; assert(psend(s->fid, 1) == 0); assert(pcount(s->fid, &count) == 0); //assert(count == 1); XXX assert(count < 2); }
void prim_concount(PRIM_PROTOTYPE) { /* -- int */ CHECKOP(0); result = pcount(); CHECKOFLOW(1); PushInt(result); }
int main(void *arg) { int i, count, fid, pid; struct tst16 *p = NULL; int pids[2 * NB_PROCS]; (void)arg; p = (struct tst16*) shm_create("test16_shm"); assert(p != NULL); assert(getprio(getpid()) == 128); for (count = 1; count <= 100; count++) { fid = pcreate(count); assert(fid >= 0); p->count = count; p->fid = fid; pid = start("proc16_1", 2000, 128, 0); assert(pid > 0); for (i=0; i<=count; i++) { assert(psend(fid, i) == 0); test_it(); } assert(waitpid(pid, 0) == pid); assert(pdelete(fid) == 0); } p->count = 20000; fid = pcreate(50); assert(fid >= 0); p->fid = fid; for (i = 0; i< NB_PROCS; i++) { pid = start("proc16_2", 2000, 127, 0); assert(pid > 0); pids[i] = pid; } for (i=0; i < NB_PROCS; i++) { pid = start("proc16_3", 2000, 127, 0); assert(pid > 0); pids[NB_PROCS + i] = pid; } for (i=0; i < 2 * NB_PROCS; i++) { assert(waitpid(pids[i], 0) == pids[i]); } assert(pcount(fid, &count) == 0); assert(count == 0); assert(pdelete(fid) == 0); shm_release("test16_shm"); printf("ok.\n"); return 0; }
char * SQLQuery::preview_char() { *this << ends; #ifdef __USLC__ strstreambuf *tmpbuf = rdbuf(); uint length = tmpbuf->pcount(); #else uint length = pcount(); #endif char *s = new char[length+1]; get(s, length, '\0'); seekg (0,ios::beg); seekp (-1,ios::cur); return s; }
//------------------------------------------------------------------------ // ip_in - handle IP packet coming in from the network //------------------------------------------------------------------------ int ip_in(struct epacket *packet, int icmpp, int lim) { struct udp *udpptr; struct ip *ipptr; struct netq *nqptr; int dport; int i; int to; int ps; ipptr = (struct ip *)packet->ep_data; switch (ipptr->i_proto) { case IPRO_ICMP: // ICMP: pass to icmp input routine return icmp_in(packet, icmpp, lim); case IPRO_UDP: // UDP: demultiplex based on UDP "port" udpptr = (struct udp *)ipptr->i_data; dport = net2hs(udpptr->u_dport); for (i = 0; i < NETQS; i++) { nqptr = &Net.netqs[i]; if (nqptr->uport == dport) { // drop instead of blocking on psend if (pcount(nqptr->xport) >= NETQLEN) { Net.ndrop++; Net.nover++; freebuf(packet); return SYSERR; } psend(nqptr->xport, (uword)packet); ps = disable(); to = nqptr->pid; if (!isbadpid(to)) { nqptr->pid = BADPID; send(to, OK); } restore(ps); return OK; } } break; default: break; } Net.ndrop++; freebuf(packet); return OK; }
void prim_descriptors(PRIM_PROTOTYPE) { int mydescr, mycount = 0; int di, dcount, descr; int* darr; CHECKOP(1); oper1 = POP(); if (mlev < LM3) abort_interp("M3 prim"); if (oper1->type != PROG_OBJECT) abort_interp("Argument not a dbref"); if (oper1->data.objref != NOTHING && !valid_object(oper1)) abort_interp("Bad dbref"); ref = oper1->data.objref; if ((ref != NOTHING) && (!valid_player(oper1))) abort_interp("Non-player argument"); CLEAR(oper1); CHECKOP(0); if (ref == NOTHING) { for (result = pcount(); result; result--) { CHECKOFLOW(1); mydescr = pdescr(result); PushInt(mydescr); mycount++; } } else { if (Typeof(ref) == TYPE_PLAYER) { darr = DBFETCH(ref)->sp.player.descrs; dcount = DBFETCH(ref)->sp.player.descr_count; if (!darr) dcount = 0; } else { darr = NULL; dcount = 0; } for (di = 0; di < dcount; di++) { CHECKOFLOW(1); descr = index_descr(darr[di]); PushInt(descr); mycount++; } } CHECKOFLOW(1); PushInt(mycount); }
void prim_conboot(PRIM_PROTOTYPE) { /* int -- */ CHECKOP(1); if (mlev < (tp_compatible_muf ? LMAGE : LARCH)) abort_interp(tp_compatible_muf ? "Mage prim" : "Arch prim"); oper1 = POP(); if (oper1->type != PROG_INTEGER) abort_interp("Argument not an integer (1)"); result = oper1->data.number; if ((result < 1) || (result > pcount())) abort_interp("Invalid connection number (1)"); CLEAR(oper1); pboot(result); }
//********************************************************************************************************************** vector<string> DeconvoluteCommand::setParameters(){ try { CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none","fasta-name",false,true,true); parameters.push_back(pfasta); CommandParameter pname("name", "InputTypes", "", "", "namecount", "none", "none","name",false,false,true); parameters.push_back(pname); CommandParameter pcount("count", "InputTypes", "", "", "namecount", "none", "none","count",false,false,true); parameters.push_back(pcount); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "DeconvoluteCommand", "setParameters"); exit(1); } }
void prim_condescr(PRIM_PROTOTYPE) { /* int -- int */ CHECKOP(1); oper1 = POP(); if (mlev < LM3) abort_interp("M3 prim"); if (oper1->type != PROG_INTEGER) abort_interp("Argument not an integer (1)"); result = oper1->data.number; if ((result < 1) || (result > pcount())) abort_interp("Invalid connection number (1)"); result = pdescr(result); CLEAR(oper1); PushInt(result); }
//********************************************************************************************************************** vector<string> SetCurrentCommand::setParameters(){ try { CommandParameter pprocessors("processors", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pprocessors); CommandParameter pflow("flow", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pflow); CommandParameter pfile("file", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pfile); CommandParameter pbiom("biom", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pbiom); CommandParameter pphylip("phylip", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pphylip); CommandParameter pcolumn("column", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pcolumn); CommandParameter psummary("summary", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(psummary); CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pfasta); CommandParameter pname("name", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pname); CommandParameter pgroup("group", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pgroup); CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(plist); CommandParameter ptaxonomy("taxonomy", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(ptaxonomy); CommandParameter pconstaxonomy("constaxonomy", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pconstaxonomy); CommandParameter pcontigsreport("contigsreport", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pcontigsreport); CommandParameter pqfile("qfile", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pqfile); CommandParameter paccnos("accnos", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(paccnos); CommandParameter prabund("rabund", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(prabund); CommandParameter psabund("sabund", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(psabund); CommandParameter pdesign("design", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pdesign); CommandParameter porder("order", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(porder); CommandParameter ptree("tree", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(ptree); CommandParameter pshared("shared", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pshared); CommandParameter pordergroup("ordergroup", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pordergroup); CommandParameter pcount("count", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pcount); CommandParameter pcurrent("current", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pcurrent); CommandParameter prelabund("relabund", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(prelabund); CommandParameter psff("sff", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(psff); CommandParameter poligos("oligos", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(poligos); CommandParameter pclear("clear", "String", "", "", "", "", "","",false,false); parameters.push_back(pclear); CommandParameter pseed("seed", "Number", "", "0", "", "", "","",false,false); parameters.push_back(pseed); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "SetCurrentCommand", "setParameters"); exit(1); } }
void prim_condbref(PRIM_PROTOTYPE) { /* int -- dbref */ CHECKOP(1); oper1 = POP(); if (mlev < (tp_compatible_muf ? LM3 : LM2)) abort_interp(tp_compatible_muf ? "M3 prim" : "M2 prim"); if (oper1->type != PROG_INTEGER) abort_interp("Argument not an integer (1)"); result = oper1->data.number; if ((result < 1) || (result > pcount())) abort_interp("Invalid connection number (1)"); result = pdbref(result); CHECKOFLOW(1); CLEAR(oper1); PushObject(result); }
//********************************************************************************************************************** vector<string> GetSAbundCommand::setParameters(){ try { CommandParameter plist("list", "InputTypes", "", "", "LRSS", "LRSS", "none","sabund",false,false, true); parameters.push_back(plist); CommandParameter pcount("count", "InputTypes", "", "", "none", "none", "none","",false,false, false); parameters.push_back(pcount); CommandParameter prabund("rabund", "InputTypes", "", "", "LRSS", "LRSS", "none","sabund",false,false, true); parameters.push_back(prabund); CommandParameter plabel("label", "String", "", "", "", "", "","",false,false); parameters.push_back(plabel); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "GetSAbundCommand", "setParameters"); exit(1); } }
//********************************************************************************************************************** vector<string> SummaryQualCommand::setParameters(){ try { CommandParameter pqual("qfile", "InputTypes", "", "", "none", "none", "none","summary",false,true,true); parameters.push_back(pqual); CommandParameter pname("name", "InputTypes", "", "", "namecount", "none", "none","",false,false,true); parameters.push_back(pname); CommandParameter pcount("count", "InputTypes", "", "", "namecount", "none", "none","",false,false,true); parameters.push_back(pcount); CommandParameter pprocessors("processors", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pprocessors); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "SummaryQualCommand", "setParameters"); exit(1); } }
//------------------------------------------------------------------------ // netdump - dump the contents of Net struct and udp demux queues //------------------------------------------------------------------------ int netdump(void) { kprintf("Network: buffer pool=%d, mutex=%d, next udp #=%d,", Net.netpool, Net.nmutex, Net.nxtprt); kprintf(" addr is %svalid\n", Net.mavalid ? "" : "in"); kprintf("Packets: recvd=%d, tossed=%d (%d for queue overflow)\n", Net.npacket, Net.ndrop, Net.nover); for (int i = 0; i < NETQS; i++) { struct netq *nqptr = &Net.netqs[i]; if (nqptr->valid) kprintf("%2d. uport=%4d, pid=%3d, xprt=%2d, size=%2d\n", i, nqptr->uport, nqptr->pid, nqptr->xport, pcount(nqptr->xport)); } return OK; }
/*------------------------------------------------------------------------ * tcptimer - TCP timer process *------------------------------------------------------------------------ */ PROCESS tcptimer(void) { long now, lastrun; /* times from system clock */ int delta; /* time since last iteration */ struct tqent *tq; /* temporary delta list ptr */ lastrun = ctr100; /* initialize to "now" */ tqmutex = screate(1); /* mutual exclusion semaphore */ tqpid = getpid(); /* record timer process id */ signal(Net.sema); /* start other network processes*/ while (TRUE) { sleep10(TIMERGRAN); /* real-time delay */ if (tqhead == 0) /* block timer process if delta */ suspend(tqpid); /* list is empty */ wait(tqmutex); now = ctr100; delta = now - lastrun; /* compute elapsed time */ /* Note: check for possible clock reset (time moved */ /* backward or delay was over an order of magnitude too */ /* long) */ if (delta < 0 || delta > TIMERGRAN*100) delta = TIMERGRAN*10; /* estimate the delay */ lastrun = now; while (tqhead != 0 && tqhead->tq_timeleft <= delta) { delta -= tqhead->tq_timeleft; if (pcount(tqhead->tq_port) <= tqhead->tq_portlen) psend(tqhead->tq_port, (int)tqhead->tq_msg); tq = tqhead; tqhead = tqhead->tq_next; freemem(tq, sizeof(struct tqent)); } if (tqhead) tqhead->tq_timeleft -=delta; signal(tqmutex); } }
void prim_conport(PRIM_PROTOTYPE) { /* int -- char * */ char *pname; CHECKOP(1); oper1 = POP(); if (mlev < LMAGE) abort_interp("Mage prim"); if (oper1->type != PROG_INTEGER) abort_interp("Argument not an integer (1)"); result = oper1->data.number; if ((result < 1) || (result > pcount())) abort_interp("Invalid connection number (1)"); pname = pport(result); CHECKOFLOW(1); CLEAR(oper1); PushString(pname); }
//********************************************************************************************************************** vector<string> SplitGroupCommand::setParameters(){ try { CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none","fasta",false,true,true); parameters.push_back(pfasta); CommandParameter pname("name", "InputTypes", "", "", "NameCount", "none", "none","name",false,false,true); parameters.push_back(pname); CommandParameter pcount("count", "InputTypes", "", "", "NameCount-CountGroup", "CountGroup", "none","count",false,false,true); parameters.push_back(pcount); CommandParameter pgroup("group", "InputTypes", "", "", "CountGroup", "CountGroup", "none","group",false,false,true); parameters.push_back(pgroup); CommandParameter pgroups("groups", "String", "", "", "", "", "","",false,false); parameters.push_back(pgroups); CommandParameter pseed("seed", "Number", "", "0", "", "", "","",false,false); parameters.push_back(pseed); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "SplitGroupCommand", "setParameters"); exit(1); } }
const char * mfn_online(MFUNARGS) { int list_limit = MAX_MFUN_LIST_LEN; int count = pcount(); char buf2[BUFFER_LEN]; if (!(mesgtyp & MPI_ISBLESSED)) ABORT_MPI("ONLINE", "Permission denied."); *buf = '\0'; while (count && list_limit--) { if (*buf) strcatn(buf, BUFFER_LEN, "\r"); ref2str(pdbref(count), buf2, sizeof(buf2)); if ((strlen(buf) + strlen(buf2)) >= (BUFFER_LEN - 3)) break; strcatn(buf, BUFFER_LEN, buf2); count--; } return buf; }
/*------------------------------------------------------------------------ * netdump - dump the contents of Net struct and udp demux queues *------------------------------------------------------------------------ */ netdump() { #ifdef notdef int i; struct netq *pnq; kprintf("Network: buffer pool=%d, mutex=%d, next udp #=%d,", Net.netpool, Net.nmutex, Net.nxtprt); kprintf(" addr is %svalid\n", Net.mavalid?"":"in"); kprintf("Packets: recvd=%d, tossed=%d (%d for queue overflow)\n", Net.npacket, Net.ndrop, Net.nover); for (i=0; i<NETQS; i++) { pnq = &Net.netqs[i]; if (pnq->nq_valid) kprintf("%2d. port=%4d, pid=%3d, xprt=%2d, size=%2d\n", i, pnq->nq_port, pnq->nq_pid, pnq->nq_xport, pcount(pnq->nq_xport) ); } #endif notdef return(OK); }
//********************************************************************************************************************** vector<string> SharedCommand::setParameters(){ try { CommandParameter pbiom("biom", "InputTypes", "", "", "BiomListGroup", "BiomListGroup", "none","shared",false,false); parameters.push_back(pbiom); CommandParameter plist("list", "InputTypes", "", "", "BiomListGroup", "BiomListGroup", "ListGroup","shared",false,false,true); parameters.push_back(plist); CommandParameter pcount("count", "InputTypes", "", "", "none", "GroupCount", "none","",false,false); parameters.push_back(pcount); CommandParameter pgroup("group", "InputTypes", "", "", "none", "GroupCount", "ListGroup","",false,false,true); parameters.push_back(pgroup); CommandParameter plabel("label", "String", "", "", "", "", "","",false,false); parameters.push_back(plabel); CommandParameter pgroups("groups", "String", "", "", "", "", "","group",false,false); parameters.push_back(pgroups); CommandParameter pseed("seed", "Number", "", "0", "", "", "","",false,false); parameters.push_back(pseed); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "SharedCommand", "setParameters"); exit(1); } }
void prim_connotify(PRIM_PROTOTYPE) { /* int string -- */ CHECKOP(2); oper2 = POP(); /* string */ oper1 = POP(); /* int */ if (mlev < (tp_compatible_muf ? LM3 : LM2)) abort_interp(tp_compatible_muf ? "M3 prim" : "M2 prim"); if (oper1->type != PROG_INTEGER) abort_interp("Argument not an integer (1)"); if (oper2->type != PROG_STRING) abort_interp("Argument not an string (2)"); result = oper1->data.number; if ((result < 1) || (result > pcount())) abort_interp("Invalid connection number (1)"); if (oper2->data.string) pnotify(result, oper2->data.string->data); CLEAR(oper1); CLEAR(oper2); }
//********************************************************************************************************************** vector<string> PreClusterCommand::setParameters(){ try { CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none","fasta-name",false,true,true); parameters.push_back(pfasta); CommandParameter pname("name", "InputTypes", "", "", "NameCount", "none", "none","name",false,false,true); parameters.push_back(pname); CommandParameter pcount("count", "InputTypes", "", "", "NameCount-CountGroup", "none", "none","count",false,false,true); parameters.push_back(pcount); CommandParameter pgroup("group", "InputTypes", "", "", "CountGroup", "none", "none","",false,false,true); parameters.push_back(pgroup); CommandParameter pdiffs("diffs", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pdiffs); CommandParameter pprocessors("processors", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pprocessors); CommandParameter ptopdown("topdown", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(ptopdown); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector<string> myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } return myArray; } catch(exception& e) { m->errorOut(e, "PreClusterCommand", "setParameters"); exit(1); } }