denovoassembler-devel Mailing List for Ray: scalable assembly (Page 3)
Ray -- Parallel genome assemblies for parallel DNA sequencing
Brought to you by:
sebhtml
You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(42) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(8) |
Dec
(4) |
2013 |
Jan
(6) |
Feb
(21) |
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(3) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
(8) |
Mar
(10) |
Apr
|
May
(1) |
Jun
(5) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Sébastien B. <seb...@ul...> - 2013-02-01 21:34:29
|
You plugin is not being registered. On 02/01/2013 03:58 PM, Charles Joly Beauparlant wrote: > This plugin comes from RayPlatform-example. > > Signed-off-by: Charles Joly Beauparlant <Cha...@cr...> > --- > code/plugin_Example/Example.cpp | 278 +++++++++++++++++++++++++++++++++++++++ > code/plugin_Example/Example.h | 117 ++++++++++++++++ > code/plugin_Example/Makefile | 3 + > 3 files changed, 398 insertions(+), 0 deletions(-) > create mode 100644 code/plugin_Example/Example.cpp > create mode 100644 code/plugin_Example/Example.h > create mode 100644 code/plugin_Example/Makefile > > diff --git a/code/plugin_Example/Example.cpp b/code/plugin_Example/Example.cpp > new file mode 100644 > index 0000000..baf949b > --- /dev/null > +++ b/code/plugin_Example/Example.cpp > @@ -0,0 +1,278 @@ > +/* > + Ray -- Parallel genome assemblies for parallel DNA sequencing > + Copyright (C) 2013 Charles Joly Beauparlant > + > + http://DeNovoAssembler.SourceForge.Net/ > + > + This program is free software: you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation, version 3 of the License. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You have received a copy of the GNU General Public License > + along with this program (gpl-3.0.txt). > + see <http://www.gnu.org/licenses/> > + > + This is derived from RayPlatform-example. > + > +*/ > + > +#include "Example.h" > + > +__CreatePlugin(Example); > + > +__CreateMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_A); > +__CreateMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_B); > +__CreateMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_C); > + > +__CreateSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_A); > +__CreateSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_B); > +__CreateSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_C); > + > +__CreateMessageTagAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); > +__CreateMessageTagAdapter(Example,RAY_MPI_TAG_TIME_BOMB); > + > +Example::Example(){ > + m_doneA=false; > + m_doneB=false; > + m_doneC=false; > +} > + > +void Example::call_RAY_MASTER_MODE_STEP_A(){ > + if(m_doneA==false){ > + m_doneA=true; > + cout<<"Rank "<<m_core->getRank()<<" call_RAY_MASTER_MODE_STEP_A"<<endl; > + > + m_core->getSwitchMan()->openMasterMode(m_core->getOutbox(),m_core->getRank()); > + }else if(m_core->getSwitchMan()->allRanksAreReady()){ > + m_core->getSwitchMan()->closeMasterMode(); > + } > +} > + > +void Example::call_RAY_MASTER_MODE_STEP_B(){ > + if(m_doneB==false){ > + m_doneB=true; > + cout<<"Rank "<<MASTER_RANK<<" call_RAY_MASTER_MODE_STEP_B"<<endl; > + m_core->getSwitchMan()->openMasterMode(m_core->getOutbox(),m_core->getRank()); > + }else if(m_core->getSwitchMan()->allRanksAreReady()){ > + m_core->getSwitchMan()->closeMasterMode(); > + } > +} > + > +void Example::call_RAY_MASTER_MODE_STEP_C(){ > + if(m_doneC==false){ > + m_doneC=true; > + cout<<"Rank "<<MASTER_RANK<<" call_RAY_MASTER_MODE_STEP_C"<<endl; > + m_core->getSwitchMan()->openMasterMode(m_core->getOutbox(),m_core->getRank()); > + }else if(m_core->getSwitchMan()->allRanksAreReady()){ > + m_core->getSwitchMan()->closeMasterMode(); > + } > +} > + > +void Example::call_RAY_SLAVE_MODE_STEP_A(){ > + cout<<"I am "<<m_core->getRank()<<" doing call_RAY_SLAVE_MODE_STEP_A"<<endl; > + > + m_core->getSwitchMan()->closeSlaveModeLocally(m_core->getOutbox(),m_core->getRank()); > +} > + > +void Example::call_RAY_SLAVE_MODE_STEP_B(){ > + cout<<"I am "<<m_core->getRank()<<" doing call_RAY_SLAVE_MODE_STEP_B"<<endl; > + > + m_core->getSwitchMan()->closeSlaveModeLocally(m_core->getOutbox(),m_core->getRank()); > +} > + > +void Example::call_RAY_SLAVE_MODE_STEP_C(){ > + > + cout<<"I am "<<m_core->getRank()<<" doing call_RAY_SLAVE_MODE_STEP_C, now I die"<<endl; > + cout<<"This is over "<<endl; > + > + if(m_core->getRank()==0){ > + uint64_t*buffer=(uint64_t*)m_core->getOutboxAllocator()->allocate(1*sizeof(uint64_t)); > + buffer[0]=100; > + > + // compute the next destination > + Rank destination=m_core->getRank()+1; > + if(destination==m_core->getSize()) > + destination=0; > + > + Message aMessage(buffer,1,destination,RAY_MPI_TAG_TIME_BOMB,m_core->getRank()); > + > + // send the bomb to another rank > + m_core->getOutbox()->push_back(&aMessage); > + } > + > + // do nothing now > + m_core->getSwitchMan()->setSlaveMode(RAY_SLAVE_MODE_DO_NOTHING); > +} > + > +void Example::call_RAY_MPI_TAG_TIME_BOMB(Message*message){ > + uint64_t*buffer=message->getBuffer(); > + > + if(buffer[0]==0){ > + cout<<"The bomb exploded on rank "<<m_core->getRank()<<" !"<<endl; > + > + // kill everyone > + > + m_core->sendEmptyMessageToAll(RAY_MPI_TAG_STOP_AND_DIE); > + }else{ > + uint64_t*bufferOut=(uint64_t*)m_core->getOutboxAllocator()->allocate(1*sizeof(uint64_t)); > + bufferOut[0]=buffer[0]-1; > + > + cout<<"Remaining time before the explosion is "<<bufferOut[0]<<" according to rank "<<m_core->getRank()<<endl; > + > + // compute the next destination > + Rank destination=m_core->getRank()+1; > + if(destination==m_core->getSize()) > + destination=0; > + > + Message aMessage(bufferOut,1,destination,RAY_MPI_TAG_TIME_BOMB,m_core->getRank()); > + > + // send the bomb to another rank > + m_core->getOutbox()->push_back(&aMessage); > + } > +} > + > +void Example::call_RAY_MPI_TAG_STOP_AND_DIE(Message*message){ > + > + cout<<"rank "<<m_core->getRank()<<" received message RAY_MPI_TAG_STOP_AND_DIE, this kills the batman"<<endl; > + > + m_core->stop(); > +} > + > +void Example::registerPlugin(ComputeCore*core){ > + > + /** register the m_plugin with the core **/ > + > + m_plugin=core->allocatePluginHandle(); > + > + core->setPluginName(m_plugin,"Example"); > + core->setPluginDescription(m_plugin,"Minimal plugin example"); > + core->setPluginAuthors(m_plugin,"Charles Joly Beauparlant"); > + core->setPluginLicense(m_plugin,"GNU General Public License version 3"); > + > + // for each master mode, we allocate a handle > + // after that, we register a handler for it > + // > + // allocateMasterModeHandle takes 1 arguments > + // - the plugin handle > + > + RAY_MASTER_MODE_STEP_A=core->allocateMasterModeHandle(m_plugin); > + core->setMasterModeObjectHandler(m_plugin,RAY_MASTER_MODE_STEP_A, > + __GetAdapter(Example,RAY_MASTER_MODE_STEP_A)); > + > + core->setMasterModeSymbol(m_plugin,RAY_MASTER_MODE_STEP_A,"RAY_MASTER_MODE_STEP_A"); > + > + core->setMasterModePublicAccess(m_plugin, RAY_MASTER_MODE_STEP_A); > + > + RAY_MASTER_MODE_STEP_B=core->allocateMasterModeHandle(m_plugin); > + core->setMasterModeObjectHandler(m_plugin,RAY_MASTER_MODE_STEP_B, > + __GetAdapter(Example,RAY_MASTER_MODE_STEP_B)); > + > + core->setMasterModeSymbol(m_plugin,RAY_MASTER_MODE_STEP_B,"RAY_MASTER_MODE_STEP_B"); > + > + RAY_MASTER_MODE_STEP_C=core->allocateMasterModeHandle(m_plugin); > + core->setMasterModeObjectHandler(m_plugin,RAY_MASTER_MODE_STEP_C, > + __GetAdapter(Example,RAY_MASTER_MODE_STEP_C)); > + > + core->setMasterModeSymbol(m_plugin,RAY_MASTER_MODE_STEP_C,"RAY_MASTER_MODE_STEP_C"); > + > + // for each slave mode, we allocate a handle > + // after that, we register a handler for it > + > + RAY_SLAVE_MODE_STEP_A=core->allocateSlaveModeHandle(m_plugin); > + core->setSlaveModeObjectHandler(m_plugin,RAY_SLAVE_MODE_STEP_A, > + __GetAdapter(Example,RAY_SLAVE_MODE_STEP_A)); > + > + core->setSlaveModeSymbol(m_plugin,RAY_SLAVE_MODE_STEP_A,"RAY_SLAVE_MODE_STEP_A"); > + > + RAY_SLAVE_MODE_STEP_B=core->allocateSlaveModeHandle(m_plugin); > + core->setSlaveModeObjectHandler(m_plugin,RAY_SLAVE_MODE_STEP_B, > + __GetAdapter(Example,RAY_SLAVE_MODE_STEP_B)); > + > + core->setSlaveModeSymbol(m_plugin,RAY_SLAVE_MODE_STEP_B,"RAY_SLAVE_MODE_STEP_B"); > + > + RAY_SLAVE_MODE_STEP_C=core->allocateSlaveModeHandle(m_plugin); > + core->setSlaveModeObjectHandler(m_plugin,RAY_SLAVE_MODE_STEP_C, > + __GetAdapter(Example,RAY_SLAVE_MODE_STEP_C)); > + > + core->setSlaveModeSymbol(m_plugin,RAY_SLAVE_MODE_STEP_C,"RAY_SLAVE_MODE_STEP_C"); > + > + RAY_MPI_TAG_START_STEP_A=core->allocateMessageTagHandle(m_plugin); > + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_START_STEP_A, "RAY_MPI_TAG_START_STEP_A"); > + RAY_MPI_TAG_START_STEP_B=core->allocateMessageTagHandle(m_plugin); > + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_START_STEP_B, "RAY_MPI_TAG_START_STEP_B"); > + RAY_MPI_TAG_START_STEP_C=core->allocateMessageTagHandle(m_plugin); > + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_START_STEP_C, "RAY_MPI_TAG_START_STEP_C"); > + > + // now, we register the order of the master modes > + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_STEP_A,RAY_MASTER_MODE_STEP_B); > + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_STEP_B,RAY_MASTER_MODE_STEP_C); > + > + // configure which control message to send given a master mode > + core->setMasterModeToMessageTagSwitch(m_plugin,RAY_MASTER_MODE_STEP_A,RAY_MPI_TAG_START_STEP_A); > + core->setMasterModeToMessageTagSwitch(m_plugin,RAY_MASTER_MODE_STEP_B,RAY_MPI_TAG_START_STEP_B); > + core->setMasterModeToMessageTagSwitch(m_plugin,RAY_MASTER_MODE_STEP_C,RAY_MPI_TAG_START_STEP_C); > + > + // configure which slave mode to set given a message tag > + core->setMessageTagToSlaveModeSwitch(m_plugin,RAY_MPI_TAG_START_STEP_A,RAY_SLAVE_MODE_STEP_A); > + core->setMessageTagToSlaveModeSwitch(m_plugin,RAY_MPI_TAG_START_STEP_B,RAY_SLAVE_MODE_STEP_B); > + core->setMessageTagToSlaveModeSwitch(m_plugin,RAY_MPI_TAG_START_STEP_C,RAY_SLAVE_MODE_STEP_C); > + > + // finally, we define an entry point > +// core->setFirstMasterMode(m_plugin,RAY_MASTER_MODE_STEP_A); > + > + m_core=core; > + > + // configure the two message tags > + RAY_MPI_TAG_TIME_BOMB=core->allocateMessageTagHandle(m_plugin); > + core->setMessageTagObjectHandler(m_plugin,RAY_MPI_TAG_TIME_BOMB, > + __GetAdapter(Example,RAY_MPI_TAG_TIME_BOMB)); > + > + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_TIME_BOMB, "RAY_MPI_TAG_TIME_BOMB"); > + > + RAY_MPI_TAG_STOP_AND_DIE=core->allocateMessageTagHandle(m_plugin); > + core->setMessageTagObjectHandler(m_plugin,RAY_MPI_TAG_STOP_AND_DIE, > + __GetAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE)); > + > + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_STOP_AND_DIE, "RAY_MPI_TAG_STOP_AND_DIE"); > + > + /* a plugin can share any of its object with other plugins **/ > + /** other plugins have to resolve the symbol. **/ > + void*object=&m_doneA; > + core->setObjectSymbol(m_plugin,object,"BooleanState"); > +} > + > +void Example::resolveSymbols(ComputeCore*core){ > + > + // here, we resolve symbols owned by other m_plugins > + // but needed by the current m_plugin > + // obviously, this is not needed here because > + // we only have one m_plugin > + > + RAY_SLAVE_MODE_STEP_A=core->getSlaveModeFromSymbol(m_plugin,"RAY_SLAVE_MODE_STEP_A"); > + > + // this slave mode is registered somewhere in RayPlatform > + RAY_SLAVE_MODE_DO_NOTHING=core->getSlaveModeFromSymbol(m_plugin,"RAY_SLAVE_MODE_DO_NOTHING"); > + > + bool*example=(bool*) core->getObjectFromSymbol(m_plugin,"BooleanState"); > + > + if(*example) > + *example=false; > + > + __BindPlugin(Example); > + > + __BindAdapter(Example,RAY_MASTER_MODE_STEP_A); > + __BindAdapter(Example,RAY_MASTER_MODE_STEP_B); > + __BindAdapter(Example,RAY_MASTER_MODE_STEP_C); > + > + __BindAdapter(Example,RAY_SLAVE_MODE_STEP_A); > + __BindAdapter(Example,RAY_SLAVE_MODE_STEP_B); > + __BindAdapter(Example,RAY_SLAVE_MODE_STEP_C); > + > + __BindAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); > + __BindAdapter(Example,RAY_MPI_TAG_TIME_BOMB); > +} > diff --git a/code/plugin_Example/Example.h b/code/plugin_Example/Example.h > new file mode 100644 > index 0000000..600afe8 > --- /dev/null > +++ b/code/plugin_Example/Example.h > @@ -0,0 +1,117 @@ > +/* > + Ray -- Parallel genome assemblies for parallel DNA sequencing > + Copyright (C) 2013 Charles Joly Beauparlant > + > + http://DeNovoAssembler.SourceForge.Net/ > + > + This program is free software: you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation, version 3 of the License. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You have received a copy of the GNU General Public License > + along with this program (gpl-3.0.txt). > + see <http://www.gnu.org/licenses/> > + > + This is derived from RayPlatform-example. > + > +*/ > + > +#ifndef _Example_h > +#define _Example_h > + > +#include <RayPlatform/core/ComputeCore.h> > + > +__DeclarePlugin(Example); > + > +__DeclareMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_A); > +__DeclareMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_B); > +__DeclareMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_C); > + > +__DeclareSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_A); > +__DeclareSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_B); > +__DeclareSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_C); > + > +__DeclareMessageTagAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); > +__DeclareMessageTagAdapter(Example,RAY_MPI_TAG_TIME_BOMB); > + > +/** > + * The plugin Example > + * > + * \author Charles Joly Beauparlant > + **/ > +class Example: public CorePlugin{ > + > + __AddAdapter(Example,RAY_MASTER_MODE_STEP_A); > + __AddAdapter(Example,RAY_MASTER_MODE_STEP_B); > + __AddAdapter(Example,RAY_MASTER_MODE_STEP_C); > + > + __AddAdapter(Example,RAY_SLAVE_MODE_STEP_A); > + __AddAdapter(Example,RAY_SLAVE_MODE_STEP_B); > + __AddAdapter(Example,RAY_SLAVE_MODE_STEP_C); > + > + __AddAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); > + __AddAdapter(Example,RAY_MPI_TAG_TIME_BOMB); > + > +/** > + * A list of master modes > + */ > + MasterMode RAY_MASTER_MODE_STEP_A; > + MasterMode RAY_MASTER_MODE_STEP_B; > + MasterMode RAY_MASTER_MODE_STEP_C; > + > +/** slave modes **/ > + SlaveMode RAY_SLAVE_MODE_STEP_A; > + SlaveMode RAY_SLAVE_MODE_STEP_B; > + SlaveMode RAY_SLAVE_MODE_STEP_C; > + SlaveMode RAY_SLAVE_MODE_DO_NOTHING; > + > + > + MessageTag RAY_MPI_TAG_START_STEP_A; > + MessageTag RAY_MPI_TAG_START_STEP_B; > + MessageTag RAY_MPI_TAG_START_STEP_C; > + > + MessageTag RAY_MPI_TAG_TIME_BOMB; > + MessageTag RAY_MPI_TAG_STOP_AND_DIE; > + > + ComputeCore*m_core; > + > +/** states for progression **/ > + bool m_doneA; > + bool m_doneB; > + bool m_doneC; > + bool m_doneExample; > + > +/** Example state **/ > + bool m_example; > +public: > + > + Example(); > + > +/** callbacks for master modes **/ > + void call_RAY_MASTER_MODE_STEP_A(); > + void call_RAY_MASTER_MODE_STEP_B(); > + void call_RAY_MASTER_MODE_STEP_C(); > + > +/** callbacks for slave modes **/ > + void call_RAY_SLAVE_MODE_STEP_A(); > + void call_RAY_SLAVE_MODE_STEP_B(); > + void call_RAY_SLAVE_MODE_STEP_C(); > + > + void call_RAY_MPI_TAG_TIME_BOMB(Message*message); > + void call_RAY_MPI_TAG_STOP_AND_DIE(Message*message); > + > +/** the following two methods are required by the interface CorePlugin **/ > + > +/** register the plugin with the core **/ > + void registerPlugin(ComputeCore*core); > + > +/** resolve symbols not owned by the current plugin **/ > + void resolveSymbols(ComputeCore*core); > +}; > + > +#endif > diff --git a/code/plugin_Example/Makefile b/code/plugin_Example/Makefile > new file mode 100644 > index 0000000..50b1ba4 > --- /dev/null > +++ b/code/plugin_Example/Makefile > @@ -0,0 +1,3 @@ > +Example-y += code/plugin_Example/Example.o > + > +obj-y += $(Example-y) > -- > 1.7.7.6 > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_jan > _______________________________________________ > Denovoassembler-devel mailing list > Den...@li... > https://lists.sourceforge.net/lists/listinfo/denovoassembler-devel > |
From: Charles J. B. <Cha...@cr...> - 2013-02-01 21:24:16
|
This plugin comes from RayPlatform-example. The example is activated with the -example option. Will work without input sequences. Signed-off-by: Charles Joly Beauparlant <Cha...@cr...> --- code/application_core/Machine.cpp | 4 +- code/application_core/Machine.h | 5 +- code/plugin_Example/Example.cpp | 278 +++++++++++++++++++++++++++ code/plugin_Example/Example.h | 117 +++++++++++ code/plugin_Example/Makefile | 3 + code/plugin_MachineHelper/MachineHelper.cpp | 63 ++++--- code/plugin_MachineHelper/MachineHelper.h | 7 +- 7 files changed, 446 insertions(+), 31 deletions(-) create mode 100644 code/plugin_Example/Example.cpp create mode 100644 code/plugin_Example/Example.h create mode 100644 code/plugin_Example/Makefile diff --git a/code/application_core/Machine.cpp b/code/application_core/Machine.cpp index 704c477..dc5c184 100644 --- a/code/application_core/Machine.cpp +++ b/code/application_core/Machine.cpp @@ -1,6 +1,7 @@ /* - Ray + Ray -- Parallel genome assemblies for parallel DNA sequencing Copyright (C) 2010, 2011, 2012 Sébastien Boisvert + Copyright (C) 2013 Charles Joly Beauparlant http://DeNovoAssembler.SourceForge.Net/ @@ -813,6 +814,7 @@ void Machine::registerPlugins(){ m_computeCore.registerPlugin(&m_genomeNeighbourhood); m_computeCore.registerPlugin(&m_ontologyPlugin); m_computeCore.registerPlugin(&m_mock); + m_computeCore.registerPlugin(&m_example); // resolve the symbols // this is done here because we want to write a summary for diff --git a/code/application_core/Machine.h b/code/application_core/Machine.h index a65a0a5..65ea98c 100644 --- a/code/application_core/Machine.h +++ b/code/application_core/Machine.h @@ -1,6 +1,7 @@ /* - Ray + Ray -- Parallel genome assemblies for parallel DNA sequencing Copyright (C) 2010, 2011, 2012 Sébastien Boisvert + Copyright (C) 2013 Charles Joly Beauparlant http://DeNovoAssembler.SourceForge.Net/ @@ -63,6 +64,7 @@ #include <code/plugin_GenomeNeighbourhood/GenomeNeighbourhood.h> #include <code/plugin_GeneOntology/GeneOntology.h> #include <code/plugin_Mock/Mock.h> +#include <code/plugin_Example/Example.h> @@ -159,6 +161,7 @@ class Machine : public MiniRank{ EdgePurger m_edgePurger; PhylogenyViewer m_phylogeny; GeneOntology m_ontologyPlugin; + Example m_example; KmerAcademyBuilder m_kmerAcademyBuilder; bool m_initialisedAcademy; diff --git a/code/plugin_Example/Example.cpp b/code/plugin_Example/Example.cpp new file mode 100644 index 0000000..baf949b --- /dev/null +++ b/code/plugin_Example/Example.cpp @@ -0,0 +1,278 @@ +/* + Ray -- Parallel genome assemblies for parallel DNA sequencing + Copyright (C) 2013 Charles Joly Beauparlant + + http://DeNovoAssembler.SourceForge.Net/ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You have received a copy of the GNU General Public License + along with this program (gpl-3.0.txt). + see <http://www.gnu.org/licenses/> + + This is derived from RayPlatform-example. + +*/ + +#include "Example.h" + +__CreatePlugin(Example); + +__CreateMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_A); +__CreateMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_B); +__CreateMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_C); + +__CreateSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_A); +__CreateSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_B); +__CreateSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_C); + +__CreateMessageTagAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); +__CreateMessageTagAdapter(Example,RAY_MPI_TAG_TIME_BOMB); + +Example::Example(){ + m_doneA=false; + m_doneB=false; + m_doneC=false; +} + +void Example::call_RAY_MASTER_MODE_STEP_A(){ + if(m_doneA==false){ + m_doneA=true; + cout<<"Rank "<<m_core->getRank()<<" call_RAY_MASTER_MODE_STEP_A"<<endl; + + m_core->getSwitchMan()->openMasterMode(m_core->getOutbox(),m_core->getRank()); + }else if(m_core->getSwitchMan()->allRanksAreReady()){ + m_core->getSwitchMan()->closeMasterMode(); + } +} + +void Example::call_RAY_MASTER_MODE_STEP_B(){ + if(m_doneB==false){ + m_doneB=true; + cout<<"Rank "<<MASTER_RANK<<" call_RAY_MASTER_MODE_STEP_B"<<endl; + m_core->getSwitchMan()->openMasterMode(m_core->getOutbox(),m_core->getRank()); + }else if(m_core->getSwitchMan()->allRanksAreReady()){ + m_core->getSwitchMan()->closeMasterMode(); + } +} + +void Example::call_RAY_MASTER_MODE_STEP_C(){ + if(m_doneC==false){ + m_doneC=true; + cout<<"Rank "<<MASTER_RANK<<" call_RAY_MASTER_MODE_STEP_C"<<endl; + m_core->getSwitchMan()->openMasterMode(m_core->getOutbox(),m_core->getRank()); + }else if(m_core->getSwitchMan()->allRanksAreReady()){ + m_core->getSwitchMan()->closeMasterMode(); + } +} + +void Example::call_RAY_SLAVE_MODE_STEP_A(){ + cout<<"I am "<<m_core->getRank()<<" doing call_RAY_SLAVE_MODE_STEP_A"<<endl; + + m_core->getSwitchMan()->closeSlaveModeLocally(m_core->getOutbox(),m_core->getRank()); +} + +void Example::call_RAY_SLAVE_MODE_STEP_B(){ + cout<<"I am "<<m_core->getRank()<<" doing call_RAY_SLAVE_MODE_STEP_B"<<endl; + + m_core->getSwitchMan()->closeSlaveModeLocally(m_core->getOutbox(),m_core->getRank()); +} + +void Example::call_RAY_SLAVE_MODE_STEP_C(){ + + cout<<"I am "<<m_core->getRank()<<" doing call_RAY_SLAVE_MODE_STEP_C, now I die"<<endl; + cout<<"This is over "<<endl; + + if(m_core->getRank()==0){ + uint64_t*buffer=(uint64_t*)m_core->getOutboxAllocator()->allocate(1*sizeof(uint64_t)); + buffer[0]=100; + + // compute the next destination + Rank destination=m_core->getRank()+1; + if(destination==m_core->getSize()) + destination=0; + + Message aMessage(buffer,1,destination,RAY_MPI_TAG_TIME_BOMB,m_core->getRank()); + + // send the bomb to another rank + m_core->getOutbox()->push_back(&aMessage); + } + + // do nothing now + m_core->getSwitchMan()->setSlaveMode(RAY_SLAVE_MODE_DO_NOTHING); +} + +void Example::call_RAY_MPI_TAG_TIME_BOMB(Message*message){ + uint64_t*buffer=message->getBuffer(); + + if(buffer[0]==0){ + cout<<"The bomb exploded on rank "<<m_core->getRank()<<" !"<<endl; + + // kill everyone + + m_core->sendEmptyMessageToAll(RAY_MPI_TAG_STOP_AND_DIE); + }else{ + uint64_t*bufferOut=(uint64_t*)m_core->getOutboxAllocator()->allocate(1*sizeof(uint64_t)); + bufferOut[0]=buffer[0]-1; + + cout<<"Remaining time before the explosion is "<<bufferOut[0]<<" according to rank "<<m_core->getRank()<<endl; + + // compute the next destination + Rank destination=m_core->getRank()+1; + if(destination==m_core->getSize()) + destination=0; + + Message aMessage(bufferOut,1,destination,RAY_MPI_TAG_TIME_BOMB,m_core->getRank()); + + // send the bomb to another rank + m_core->getOutbox()->push_back(&aMessage); + } +} + +void Example::call_RAY_MPI_TAG_STOP_AND_DIE(Message*message){ + + cout<<"rank "<<m_core->getRank()<<" received message RAY_MPI_TAG_STOP_AND_DIE, this kills the batman"<<endl; + + m_core->stop(); +} + +void Example::registerPlugin(ComputeCore*core){ + + /** register the m_plugin with the core **/ + + m_plugin=core->allocatePluginHandle(); + + core->setPluginName(m_plugin,"Example"); + core->setPluginDescription(m_plugin,"Minimal plugin example"); + core->setPluginAuthors(m_plugin,"Charles Joly Beauparlant"); + core->setPluginLicense(m_plugin,"GNU General Public License version 3"); + + // for each master mode, we allocate a handle + // after that, we register a handler for it + // + // allocateMasterModeHandle takes 1 arguments + // - the plugin handle + + RAY_MASTER_MODE_STEP_A=core->allocateMasterModeHandle(m_plugin); + core->setMasterModeObjectHandler(m_plugin,RAY_MASTER_MODE_STEP_A, + __GetAdapter(Example,RAY_MASTER_MODE_STEP_A)); + + core->setMasterModeSymbol(m_plugin,RAY_MASTER_MODE_STEP_A,"RAY_MASTER_MODE_STEP_A"); + + core->setMasterModePublicAccess(m_plugin, RAY_MASTER_MODE_STEP_A); + + RAY_MASTER_MODE_STEP_B=core->allocateMasterModeHandle(m_plugin); + core->setMasterModeObjectHandler(m_plugin,RAY_MASTER_MODE_STEP_B, + __GetAdapter(Example,RAY_MASTER_MODE_STEP_B)); + + core->setMasterModeSymbol(m_plugin,RAY_MASTER_MODE_STEP_B,"RAY_MASTER_MODE_STEP_B"); + + RAY_MASTER_MODE_STEP_C=core->allocateMasterModeHandle(m_plugin); + core->setMasterModeObjectHandler(m_plugin,RAY_MASTER_MODE_STEP_C, + __GetAdapter(Example,RAY_MASTER_MODE_STEP_C)); + + core->setMasterModeSymbol(m_plugin,RAY_MASTER_MODE_STEP_C,"RAY_MASTER_MODE_STEP_C"); + + // for each slave mode, we allocate a handle + // after that, we register a handler for it + + RAY_SLAVE_MODE_STEP_A=core->allocateSlaveModeHandle(m_plugin); + core->setSlaveModeObjectHandler(m_plugin,RAY_SLAVE_MODE_STEP_A, + __GetAdapter(Example,RAY_SLAVE_MODE_STEP_A)); + + core->setSlaveModeSymbol(m_plugin,RAY_SLAVE_MODE_STEP_A,"RAY_SLAVE_MODE_STEP_A"); + + RAY_SLAVE_MODE_STEP_B=core->allocateSlaveModeHandle(m_plugin); + core->setSlaveModeObjectHandler(m_plugin,RAY_SLAVE_MODE_STEP_B, + __GetAdapter(Example,RAY_SLAVE_MODE_STEP_B)); + + core->setSlaveModeSymbol(m_plugin,RAY_SLAVE_MODE_STEP_B,"RAY_SLAVE_MODE_STEP_B"); + + RAY_SLAVE_MODE_STEP_C=core->allocateSlaveModeHandle(m_plugin); + core->setSlaveModeObjectHandler(m_plugin,RAY_SLAVE_MODE_STEP_C, + __GetAdapter(Example,RAY_SLAVE_MODE_STEP_C)); + + core->setSlaveModeSymbol(m_plugin,RAY_SLAVE_MODE_STEP_C,"RAY_SLAVE_MODE_STEP_C"); + + RAY_MPI_TAG_START_STEP_A=core->allocateMessageTagHandle(m_plugin); + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_START_STEP_A, "RAY_MPI_TAG_START_STEP_A"); + RAY_MPI_TAG_START_STEP_B=core->allocateMessageTagHandle(m_plugin); + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_START_STEP_B, "RAY_MPI_TAG_START_STEP_B"); + RAY_MPI_TAG_START_STEP_C=core->allocateMessageTagHandle(m_plugin); + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_START_STEP_C, "RAY_MPI_TAG_START_STEP_C"); + + // now, we register the order of the master modes + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_STEP_A,RAY_MASTER_MODE_STEP_B); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_STEP_B,RAY_MASTER_MODE_STEP_C); + + // configure which control message to send given a master mode + core->setMasterModeToMessageTagSwitch(m_plugin,RAY_MASTER_MODE_STEP_A,RAY_MPI_TAG_START_STEP_A); + core->setMasterModeToMessageTagSwitch(m_plugin,RAY_MASTER_MODE_STEP_B,RAY_MPI_TAG_START_STEP_B); + core->setMasterModeToMessageTagSwitch(m_plugin,RAY_MASTER_MODE_STEP_C,RAY_MPI_TAG_START_STEP_C); + + // configure which slave mode to set given a message tag + core->setMessageTagToSlaveModeSwitch(m_plugin,RAY_MPI_TAG_START_STEP_A,RAY_SLAVE_MODE_STEP_A); + core->setMessageTagToSlaveModeSwitch(m_plugin,RAY_MPI_TAG_START_STEP_B,RAY_SLAVE_MODE_STEP_B); + core->setMessageTagToSlaveModeSwitch(m_plugin,RAY_MPI_TAG_START_STEP_C,RAY_SLAVE_MODE_STEP_C); + + // finally, we define an entry point +// core->setFirstMasterMode(m_plugin,RAY_MASTER_MODE_STEP_A); + + m_core=core; + + // configure the two message tags + RAY_MPI_TAG_TIME_BOMB=core->allocateMessageTagHandle(m_plugin); + core->setMessageTagObjectHandler(m_plugin,RAY_MPI_TAG_TIME_BOMB, + __GetAdapter(Example,RAY_MPI_TAG_TIME_BOMB)); + + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_TIME_BOMB, "RAY_MPI_TAG_TIME_BOMB"); + + RAY_MPI_TAG_STOP_AND_DIE=core->allocateMessageTagHandle(m_plugin); + core->setMessageTagObjectHandler(m_plugin,RAY_MPI_TAG_STOP_AND_DIE, + __GetAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE)); + + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_STOP_AND_DIE, "RAY_MPI_TAG_STOP_AND_DIE"); + + /* a plugin can share any of its object with other plugins **/ + /** other plugins have to resolve the symbol. **/ + void*object=&m_doneA; + core->setObjectSymbol(m_plugin,object,"BooleanState"); +} + +void Example::resolveSymbols(ComputeCore*core){ + + // here, we resolve symbols owned by other m_plugins + // but needed by the current m_plugin + // obviously, this is not needed here because + // we only have one m_plugin + + RAY_SLAVE_MODE_STEP_A=core->getSlaveModeFromSymbol(m_plugin,"RAY_SLAVE_MODE_STEP_A"); + + // this slave mode is registered somewhere in RayPlatform + RAY_SLAVE_MODE_DO_NOTHING=core->getSlaveModeFromSymbol(m_plugin,"RAY_SLAVE_MODE_DO_NOTHING"); + + bool*example=(bool*) core->getObjectFromSymbol(m_plugin,"BooleanState"); + + if(*example) + *example=false; + + __BindPlugin(Example); + + __BindAdapter(Example,RAY_MASTER_MODE_STEP_A); + __BindAdapter(Example,RAY_MASTER_MODE_STEP_B); + __BindAdapter(Example,RAY_MASTER_MODE_STEP_C); + + __BindAdapter(Example,RAY_SLAVE_MODE_STEP_A); + __BindAdapter(Example,RAY_SLAVE_MODE_STEP_B); + __BindAdapter(Example,RAY_SLAVE_MODE_STEP_C); + + __BindAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); + __BindAdapter(Example,RAY_MPI_TAG_TIME_BOMB); +} diff --git a/code/plugin_Example/Example.h b/code/plugin_Example/Example.h new file mode 100644 index 0000000..600afe8 --- /dev/null +++ b/code/plugin_Example/Example.h @@ -0,0 +1,117 @@ +/* + Ray -- Parallel genome assemblies for parallel DNA sequencing + Copyright (C) 2013 Charles Joly Beauparlant + + http://DeNovoAssembler.SourceForge.Net/ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You have received a copy of the GNU General Public License + along with this program (gpl-3.0.txt). + see <http://www.gnu.org/licenses/> + + This is derived from RayPlatform-example. + +*/ + +#ifndef _Example_h +#define _Example_h + +#include <RayPlatform/core/ComputeCore.h> + +__DeclarePlugin(Example); + +__DeclareMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_A); +__DeclareMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_B); +__DeclareMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_C); + +__DeclareSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_A); +__DeclareSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_B); +__DeclareSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_C); + +__DeclareMessageTagAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); +__DeclareMessageTagAdapter(Example,RAY_MPI_TAG_TIME_BOMB); + +/** + * The plugin Example + * + * \author Charles Joly Beauparlant + **/ +class Example: public CorePlugin{ + + __AddAdapter(Example,RAY_MASTER_MODE_STEP_A); + __AddAdapter(Example,RAY_MASTER_MODE_STEP_B); + __AddAdapter(Example,RAY_MASTER_MODE_STEP_C); + + __AddAdapter(Example,RAY_SLAVE_MODE_STEP_A); + __AddAdapter(Example,RAY_SLAVE_MODE_STEP_B); + __AddAdapter(Example,RAY_SLAVE_MODE_STEP_C); + + __AddAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); + __AddAdapter(Example,RAY_MPI_TAG_TIME_BOMB); + +/** + * A list of master modes + */ + MasterMode RAY_MASTER_MODE_STEP_A; + MasterMode RAY_MASTER_MODE_STEP_B; + MasterMode RAY_MASTER_MODE_STEP_C; + +/** slave modes **/ + SlaveMode RAY_SLAVE_MODE_STEP_A; + SlaveMode RAY_SLAVE_MODE_STEP_B; + SlaveMode RAY_SLAVE_MODE_STEP_C; + SlaveMode RAY_SLAVE_MODE_DO_NOTHING; + + + MessageTag RAY_MPI_TAG_START_STEP_A; + MessageTag RAY_MPI_TAG_START_STEP_B; + MessageTag RAY_MPI_TAG_START_STEP_C; + + MessageTag RAY_MPI_TAG_TIME_BOMB; + MessageTag RAY_MPI_TAG_STOP_AND_DIE; + + ComputeCore*m_core; + +/** states for progression **/ + bool m_doneA; + bool m_doneB; + bool m_doneC; + bool m_doneExample; + +/** Example state **/ + bool m_example; +public: + + Example(); + +/** callbacks for master modes **/ + void call_RAY_MASTER_MODE_STEP_A(); + void call_RAY_MASTER_MODE_STEP_B(); + void call_RAY_MASTER_MODE_STEP_C(); + +/** callbacks for slave modes **/ + void call_RAY_SLAVE_MODE_STEP_A(); + void call_RAY_SLAVE_MODE_STEP_B(); + void call_RAY_SLAVE_MODE_STEP_C(); + + void call_RAY_MPI_TAG_TIME_BOMB(Message*message); + void call_RAY_MPI_TAG_STOP_AND_DIE(Message*message); + +/** the following two methods are required by the interface CorePlugin **/ + +/** register the plugin with the core **/ + void registerPlugin(ComputeCore*core); + +/** resolve symbols not owned by the current plugin **/ + void resolveSymbols(ComputeCore*core); +}; + +#endif diff --git a/code/plugin_Example/Makefile b/code/plugin_Example/Makefile new file mode 100644 index 0000000..50b1ba4 --- /dev/null +++ b/code/plugin_Example/Makefile @@ -0,0 +1,3 @@ +Example-y += code/plugin_Example/Example.o + +obj-y += $(Example-y) diff --git a/code/plugin_MachineHelper/MachineHelper.cpp b/code/plugin_MachineHelper/MachineHelper.cpp index fbe52a5..afc6335 100644 --- a/code/plugin_MachineHelper/MachineHelper.cpp +++ b/code/plugin_MachineHelper/MachineHelper.cpp @@ -1,6 +1,7 @@ /* - Ray - Copyright (C) 2012 Sébastien Boisvert + Ray -- Parallel genome assemblies for parallel DNA sequencing + Copyright (C) 2010, 2011, 2012 Sébastien Boisvert + Copyright (C) 2013 Charles Joly Beauparlant http://DeNovoAssembler.SourceForge.Net/ @@ -1225,6 +1226,7 @@ void MachineHelper::resolveSymbols(ComputeCore*core){ RAY_MASTER_MODE_UPDATE_DISTANCES=core->getMasterModeFromSymbol(m_plugin,"RAY_MASTER_MODE_UPDATE_DISTANCES"); RAY_MASTER_MODE_WRITE_KMERS=core->getMasterModeFromSymbol(m_plugin,"RAY_MASTER_MODE_WRITE_KMERS"); RAY_MASTER_MODE_WRITE_SCAFFOLDS=core->getMasterModeFromSymbol(m_plugin,"RAY_MASTER_MODE_WRITE_SCAFFOLDS"); + RAY_MASTER_MODE_STEP_A=core->getMasterModeFromSymbol(m_plugin,"RAY_MASTER_MODE_STEP_A"); RAY_MPI_TAG_FINISH_FUSIONS=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_FINISH_FUSIONS"); RAY_MPI_TAG_GET_CONTIG_CHUNK=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_GET_CONTIG_CHUNK"); @@ -1312,31 +1314,38 @@ void MachineHelper::resolveSymbols(ComputeCore*core){ RAY_MPI_TAG_SET_FILE_ENTRIES=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_SET_FILE_ENTRIES"); RAY_MPI_TAG_SET_FILE_ENTRIES_REPLY=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_SET_FILE_ENTRIES_REPLY"); - core->setFirstMasterMode(m_plugin,RAY_MASTER_MODE_LOAD_CONFIG); - - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_LOAD_CONFIG, RAY_MASTER_MODE_TEST_NETWORK); - - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_PREPARE_SEEDING,RAY_MASTER_MODE_TRIGGER_SEEDING); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_SEEDING,RAY_MASTER_MODE_START_UPDATING_DISTANCES); - - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_LOAD_SEQUENCES,RAY_MASTER_MODE_TRIGGER_VERTICE_DISTRIBUTION); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_VERTICE_DISTRIBUTION,RAY_MASTER_MODE_PREPARE_DISTRIBUTIONS); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_PREPARE_DISTRIBUTIONS,RAY_MASTER_MODE_PREPARE_DISTRIBUTIONS_WITH_ANSWERS); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_PREPARE_DISTRIBUTIONS_WITH_ANSWERS,RAY_MASTER_MODE_SEND_COVERAGE_VALUES); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_SEND_COVERAGE_VALUES,RAY_MASTER_MODE_TRIGGER_GRAPH_BUILDING); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_GRAPH_BUILDING,RAY_MASTER_MODE_PURGE_NULL_EDGES); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_PURGE_NULL_EDGES,RAY_MASTER_MODE_WRITE_KMERS); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_WRITE_KMERS,RAY_MASTER_MODE_TRIGGER_INDEXING); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_INDEXING,RAY_MASTER_MODE_PREPARE_SEEDING); - - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_START_UPDATING_DISTANCES,RAY_MASTER_MODE_UPDATE_DISTANCES); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_FUSIONS,RAY_MASTER_MODE_TRIGGER_FIRST_FUSIONS); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_FIRST_FUSIONS,RAY_MASTER_MODE_START_FUSION_CYCLE); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_START_FUSION_CYCLE,RAY_MASTER_MODE_ASK_EXTENSIONS); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_ASK_EXTENSIONS,RAY_MASTER_MODE_SCAFFOLDER); - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_SCAFFOLDER,RAY_MASTER_MODE_WRITE_SCAFFOLDS); - - core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_KILL_RANKS,RAY_MASTER_MODE_KILL_ALL_MPI_RANKS); + if (m_parameters->hasOption("-example")) { + cout << "************** Example Mode **************" << endl; +// core->setFirstMasterMode(m_plugin,RAY_MASTER_MODE_KILL_ALL_MPI_RANKS); + core->setFirstMasterMode(m_plugin, RAY_MASTER_MODE_STEP_A); + } + else { + core->setFirstMasterMode(m_plugin,RAY_MASTER_MODE_LOAD_CONFIG); + + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_LOAD_CONFIG, RAY_MASTER_MODE_TEST_NETWORK); + + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_PREPARE_SEEDING,RAY_MASTER_MODE_TRIGGER_SEEDING); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_SEEDING,RAY_MASTER_MODE_START_UPDATING_DISTANCES); + + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_LOAD_SEQUENCES,RAY_MASTER_MODE_TRIGGER_VERTICE_DISTRIBUTION); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_VERTICE_DISTRIBUTION,RAY_MASTER_MODE_PREPARE_DISTRIBUTIONS); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_PREPARE_DISTRIBUTIONS,RAY_MASTER_MODE_PREPARE_DISTRIBUTIONS_WITH_ANSWERS); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_PREPARE_DISTRIBUTIONS_WITH_ANSWERS,RAY_MASTER_MODE_SEND_COVERAGE_VALUES); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_SEND_COVERAGE_VALUES,RAY_MASTER_MODE_TRIGGER_GRAPH_BUILDING); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_GRAPH_BUILDING,RAY_MASTER_MODE_PURGE_NULL_EDGES); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_PURGE_NULL_EDGES,RAY_MASTER_MODE_WRITE_KMERS); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_WRITE_KMERS,RAY_MASTER_MODE_TRIGGER_INDEXING); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_INDEXING,RAY_MASTER_MODE_PREPARE_SEEDING); + + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_START_UPDATING_DISTANCES,RAY_MASTER_MODE_UPDATE_DISTANCES); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_FUSIONS,RAY_MASTER_MODE_TRIGGER_FIRST_FUSIONS); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_TRIGGER_FIRST_FUSIONS,RAY_MASTER_MODE_START_FUSION_CYCLE); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_START_FUSION_CYCLE,RAY_MASTER_MODE_ASK_EXTENSIONS); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_ASK_EXTENSIONS,RAY_MASTER_MODE_SCAFFOLDER); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_SCAFFOLDER,RAY_MASTER_MODE_WRITE_SCAFFOLDS); + + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_KILL_RANKS,RAY_MASTER_MODE_KILL_ALL_MPI_RANKS); + } RAY_MPI_TAG_GOOD_JOB_SEE_YOU_SOON=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_GOOD_JOB_SEE_YOU_SOON"); RAY_MPI_TAG_GOOD_JOB_SEE_YOU_SOON_REPLY=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_GOOD_JOB_SEE_YOU_SOON_REPLY"); diff --git a/code/plugin_MachineHelper/MachineHelper.h b/code/plugin_MachineHelper/MachineHelper.h index c58e680..459d21c 100644 --- a/code/plugin_MachineHelper/MachineHelper.h +++ b/code/plugin_MachineHelper/MachineHelper.h @@ -1,6 +1,7 @@ /* - Ray - Copyright (C) 2012 Sébastien Boisvert + Ray -- Parallel genome assemblies for parallel DNA sequencing + Copyright (C) 2010, 2011, 2012 Sébastien Boisvert + Copyright (C) 2013 Charles Joly Beauparlant http://DeNovoAssembler.SourceForge.Net/ @@ -24,6 +25,7 @@ #include <code/plugin_Mock/Parameters.h> #include <code/plugin_FusionData/FusionData.h> #include <code/plugin_NetworkTest/NetworkTest.h> +#include <code/plugin_Example/Example.h> #include <code/plugin_Partitioner/Partitioner.h> #include <code/plugin_SequencesLoader/SequencesLoader.h> #include <code/plugin_SeedingData/SeedingData.h> @@ -251,6 +253,7 @@ class MachineHelper: public CorePlugin{ MasterMode RAY_MASTER_MODE_UPDATE_DISTANCES; MasterMode RAY_MASTER_MODE_WRITE_KMERS; MasterMode RAY_MASTER_MODE_WRITE_SCAFFOLDS; + MasterMode RAY_MASTER_MODE_STEP_A; SlaveMode RAY_SLAVE_MODE_EXTENSION; SlaveMode RAY_SLAVE_MODE_ADD_COLORS; -- 1.7.7.6 |
From: Charles J. B. <Cha...@cr...> - 2013-02-01 20:59:44
|
This plugin comes from RayPlatform-example. Signed-off-by: Charles Joly Beauparlant <Cha...@cr...> --- code/plugin_Example/Example.cpp | 278 +++++++++++++++++++++++++++++++++++++++ code/plugin_Example/Example.h | 117 ++++++++++++++++ code/plugin_Example/Makefile | 3 + 3 files changed, 398 insertions(+), 0 deletions(-) create mode 100644 code/plugin_Example/Example.cpp create mode 100644 code/plugin_Example/Example.h create mode 100644 code/plugin_Example/Makefile diff --git a/code/plugin_Example/Example.cpp b/code/plugin_Example/Example.cpp new file mode 100644 index 0000000..baf949b --- /dev/null +++ b/code/plugin_Example/Example.cpp @@ -0,0 +1,278 @@ +/* + Ray -- Parallel genome assemblies for parallel DNA sequencing + Copyright (C) 2013 Charles Joly Beauparlant + + http://DeNovoAssembler.SourceForge.Net/ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You have received a copy of the GNU General Public License + along with this program (gpl-3.0.txt). + see <http://www.gnu.org/licenses/> + + This is derived from RayPlatform-example. + +*/ + +#include "Example.h" + +__CreatePlugin(Example); + +__CreateMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_A); +__CreateMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_B); +__CreateMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_C); + +__CreateSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_A); +__CreateSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_B); +__CreateSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_C); + +__CreateMessageTagAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); +__CreateMessageTagAdapter(Example,RAY_MPI_TAG_TIME_BOMB); + +Example::Example(){ + m_doneA=false; + m_doneB=false; + m_doneC=false; +} + +void Example::call_RAY_MASTER_MODE_STEP_A(){ + if(m_doneA==false){ + m_doneA=true; + cout<<"Rank "<<m_core->getRank()<<" call_RAY_MASTER_MODE_STEP_A"<<endl; + + m_core->getSwitchMan()->openMasterMode(m_core->getOutbox(),m_core->getRank()); + }else if(m_core->getSwitchMan()->allRanksAreReady()){ + m_core->getSwitchMan()->closeMasterMode(); + } +} + +void Example::call_RAY_MASTER_MODE_STEP_B(){ + if(m_doneB==false){ + m_doneB=true; + cout<<"Rank "<<MASTER_RANK<<" call_RAY_MASTER_MODE_STEP_B"<<endl; + m_core->getSwitchMan()->openMasterMode(m_core->getOutbox(),m_core->getRank()); + }else if(m_core->getSwitchMan()->allRanksAreReady()){ + m_core->getSwitchMan()->closeMasterMode(); + } +} + +void Example::call_RAY_MASTER_MODE_STEP_C(){ + if(m_doneC==false){ + m_doneC=true; + cout<<"Rank "<<MASTER_RANK<<" call_RAY_MASTER_MODE_STEP_C"<<endl; + m_core->getSwitchMan()->openMasterMode(m_core->getOutbox(),m_core->getRank()); + }else if(m_core->getSwitchMan()->allRanksAreReady()){ + m_core->getSwitchMan()->closeMasterMode(); + } +} + +void Example::call_RAY_SLAVE_MODE_STEP_A(){ + cout<<"I am "<<m_core->getRank()<<" doing call_RAY_SLAVE_MODE_STEP_A"<<endl; + + m_core->getSwitchMan()->closeSlaveModeLocally(m_core->getOutbox(),m_core->getRank()); +} + +void Example::call_RAY_SLAVE_MODE_STEP_B(){ + cout<<"I am "<<m_core->getRank()<<" doing call_RAY_SLAVE_MODE_STEP_B"<<endl; + + m_core->getSwitchMan()->closeSlaveModeLocally(m_core->getOutbox(),m_core->getRank()); +} + +void Example::call_RAY_SLAVE_MODE_STEP_C(){ + + cout<<"I am "<<m_core->getRank()<<" doing call_RAY_SLAVE_MODE_STEP_C, now I die"<<endl; + cout<<"This is over "<<endl; + + if(m_core->getRank()==0){ + uint64_t*buffer=(uint64_t*)m_core->getOutboxAllocator()->allocate(1*sizeof(uint64_t)); + buffer[0]=100; + + // compute the next destination + Rank destination=m_core->getRank()+1; + if(destination==m_core->getSize()) + destination=0; + + Message aMessage(buffer,1,destination,RAY_MPI_TAG_TIME_BOMB,m_core->getRank()); + + // send the bomb to another rank + m_core->getOutbox()->push_back(&aMessage); + } + + // do nothing now + m_core->getSwitchMan()->setSlaveMode(RAY_SLAVE_MODE_DO_NOTHING); +} + +void Example::call_RAY_MPI_TAG_TIME_BOMB(Message*message){ + uint64_t*buffer=message->getBuffer(); + + if(buffer[0]==0){ + cout<<"The bomb exploded on rank "<<m_core->getRank()<<" !"<<endl; + + // kill everyone + + m_core->sendEmptyMessageToAll(RAY_MPI_TAG_STOP_AND_DIE); + }else{ + uint64_t*bufferOut=(uint64_t*)m_core->getOutboxAllocator()->allocate(1*sizeof(uint64_t)); + bufferOut[0]=buffer[0]-1; + + cout<<"Remaining time before the explosion is "<<bufferOut[0]<<" according to rank "<<m_core->getRank()<<endl; + + // compute the next destination + Rank destination=m_core->getRank()+1; + if(destination==m_core->getSize()) + destination=0; + + Message aMessage(bufferOut,1,destination,RAY_MPI_TAG_TIME_BOMB,m_core->getRank()); + + // send the bomb to another rank + m_core->getOutbox()->push_back(&aMessage); + } +} + +void Example::call_RAY_MPI_TAG_STOP_AND_DIE(Message*message){ + + cout<<"rank "<<m_core->getRank()<<" received message RAY_MPI_TAG_STOP_AND_DIE, this kills the batman"<<endl; + + m_core->stop(); +} + +void Example::registerPlugin(ComputeCore*core){ + + /** register the m_plugin with the core **/ + + m_plugin=core->allocatePluginHandle(); + + core->setPluginName(m_plugin,"Example"); + core->setPluginDescription(m_plugin,"Minimal plugin example"); + core->setPluginAuthors(m_plugin,"Charles Joly Beauparlant"); + core->setPluginLicense(m_plugin,"GNU General Public License version 3"); + + // for each master mode, we allocate a handle + // after that, we register a handler for it + // + // allocateMasterModeHandle takes 1 arguments + // - the plugin handle + + RAY_MASTER_MODE_STEP_A=core->allocateMasterModeHandle(m_plugin); + core->setMasterModeObjectHandler(m_plugin,RAY_MASTER_MODE_STEP_A, + __GetAdapter(Example,RAY_MASTER_MODE_STEP_A)); + + core->setMasterModeSymbol(m_plugin,RAY_MASTER_MODE_STEP_A,"RAY_MASTER_MODE_STEP_A"); + + core->setMasterModePublicAccess(m_plugin, RAY_MASTER_MODE_STEP_A); + + RAY_MASTER_MODE_STEP_B=core->allocateMasterModeHandle(m_plugin); + core->setMasterModeObjectHandler(m_plugin,RAY_MASTER_MODE_STEP_B, + __GetAdapter(Example,RAY_MASTER_MODE_STEP_B)); + + core->setMasterModeSymbol(m_plugin,RAY_MASTER_MODE_STEP_B,"RAY_MASTER_MODE_STEP_B"); + + RAY_MASTER_MODE_STEP_C=core->allocateMasterModeHandle(m_plugin); + core->setMasterModeObjectHandler(m_plugin,RAY_MASTER_MODE_STEP_C, + __GetAdapter(Example,RAY_MASTER_MODE_STEP_C)); + + core->setMasterModeSymbol(m_plugin,RAY_MASTER_MODE_STEP_C,"RAY_MASTER_MODE_STEP_C"); + + // for each slave mode, we allocate a handle + // after that, we register a handler for it + + RAY_SLAVE_MODE_STEP_A=core->allocateSlaveModeHandle(m_plugin); + core->setSlaveModeObjectHandler(m_plugin,RAY_SLAVE_MODE_STEP_A, + __GetAdapter(Example,RAY_SLAVE_MODE_STEP_A)); + + core->setSlaveModeSymbol(m_plugin,RAY_SLAVE_MODE_STEP_A,"RAY_SLAVE_MODE_STEP_A"); + + RAY_SLAVE_MODE_STEP_B=core->allocateSlaveModeHandle(m_plugin); + core->setSlaveModeObjectHandler(m_plugin,RAY_SLAVE_MODE_STEP_B, + __GetAdapter(Example,RAY_SLAVE_MODE_STEP_B)); + + core->setSlaveModeSymbol(m_plugin,RAY_SLAVE_MODE_STEP_B,"RAY_SLAVE_MODE_STEP_B"); + + RAY_SLAVE_MODE_STEP_C=core->allocateSlaveModeHandle(m_plugin); + core->setSlaveModeObjectHandler(m_plugin,RAY_SLAVE_MODE_STEP_C, + __GetAdapter(Example,RAY_SLAVE_MODE_STEP_C)); + + core->setSlaveModeSymbol(m_plugin,RAY_SLAVE_MODE_STEP_C,"RAY_SLAVE_MODE_STEP_C"); + + RAY_MPI_TAG_START_STEP_A=core->allocateMessageTagHandle(m_plugin); + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_START_STEP_A, "RAY_MPI_TAG_START_STEP_A"); + RAY_MPI_TAG_START_STEP_B=core->allocateMessageTagHandle(m_plugin); + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_START_STEP_B, "RAY_MPI_TAG_START_STEP_B"); + RAY_MPI_TAG_START_STEP_C=core->allocateMessageTagHandle(m_plugin); + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_START_STEP_C, "RAY_MPI_TAG_START_STEP_C"); + + // now, we register the order of the master modes + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_STEP_A,RAY_MASTER_MODE_STEP_B); + core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_STEP_B,RAY_MASTER_MODE_STEP_C); + + // configure which control message to send given a master mode + core->setMasterModeToMessageTagSwitch(m_plugin,RAY_MASTER_MODE_STEP_A,RAY_MPI_TAG_START_STEP_A); + core->setMasterModeToMessageTagSwitch(m_plugin,RAY_MASTER_MODE_STEP_B,RAY_MPI_TAG_START_STEP_B); + core->setMasterModeToMessageTagSwitch(m_plugin,RAY_MASTER_MODE_STEP_C,RAY_MPI_TAG_START_STEP_C); + + // configure which slave mode to set given a message tag + core->setMessageTagToSlaveModeSwitch(m_plugin,RAY_MPI_TAG_START_STEP_A,RAY_SLAVE_MODE_STEP_A); + core->setMessageTagToSlaveModeSwitch(m_plugin,RAY_MPI_TAG_START_STEP_B,RAY_SLAVE_MODE_STEP_B); + core->setMessageTagToSlaveModeSwitch(m_plugin,RAY_MPI_TAG_START_STEP_C,RAY_SLAVE_MODE_STEP_C); + + // finally, we define an entry point +// core->setFirstMasterMode(m_plugin,RAY_MASTER_MODE_STEP_A); + + m_core=core; + + // configure the two message tags + RAY_MPI_TAG_TIME_BOMB=core->allocateMessageTagHandle(m_plugin); + core->setMessageTagObjectHandler(m_plugin,RAY_MPI_TAG_TIME_BOMB, + __GetAdapter(Example,RAY_MPI_TAG_TIME_BOMB)); + + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_TIME_BOMB, "RAY_MPI_TAG_TIME_BOMB"); + + RAY_MPI_TAG_STOP_AND_DIE=core->allocateMessageTagHandle(m_plugin); + core->setMessageTagObjectHandler(m_plugin,RAY_MPI_TAG_STOP_AND_DIE, + __GetAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE)); + + core->setMessageTagSymbol(m_plugin, RAY_MPI_TAG_STOP_AND_DIE, "RAY_MPI_TAG_STOP_AND_DIE"); + + /* a plugin can share any of its object with other plugins **/ + /** other plugins have to resolve the symbol. **/ + void*object=&m_doneA; + core->setObjectSymbol(m_plugin,object,"BooleanState"); +} + +void Example::resolveSymbols(ComputeCore*core){ + + // here, we resolve symbols owned by other m_plugins + // but needed by the current m_plugin + // obviously, this is not needed here because + // we only have one m_plugin + + RAY_SLAVE_MODE_STEP_A=core->getSlaveModeFromSymbol(m_plugin,"RAY_SLAVE_MODE_STEP_A"); + + // this slave mode is registered somewhere in RayPlatform + RAY_SLAVE_MODE_DO_NOTHING=core->getSlaveModeFromSymbol(m_plugin,"RAY_SLAVE_MODE_DO_NOTHING"); + + bool*example=(bool*) core->getObjectFromSymbol(m_plugin,"BooleanState"); + + if(*example) + *example=false; + + __BindPlugin(Example); + + __BindAdapter(Example,RAY_MASTER_MODE_STEP_A); + __BindAdapter(Example,RAY_MASTER_MODE_STEP_B); + __BindAdapter(Example,RAY_MASTER_MODE_STEP_C); + + __BindAdapter(Example,RAY_SLAVE_MODE_STEP_A); + __BindAdapter(Example,RAY_SLAVE_MODE_STEP_B); + __BindAdapter(Example,RAY_SLAVE_MODE_STEP_C); + + __BindAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); + __BindAdapter(Example,RAY_MPI_TAG_TIME_BOMB); +} diff --git a/code/plugin_Example/Example.h b/code/plugin_Example/Example.h new file mode 100644 index 0000000..600afe8 --- /dev/null +++ b/code/plugin_Example/Example.h @@ -0,0 +1,117 @@ +/* + Ray -- Parallel genome assemblies for parallel DNA sequencing + Copyright (C) 2013 Charles Joly Beauparlant + + http://DeNovoAssembler.SourceForge.Net/ + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You have received a copy of the GNU General Public License + along with this program (gpl-3.0.txt). + see <http://www.gnu.org/licenses/> + + This is derived from RayPlatform-example. + +*/ + +#ifndef _Example_h +#define _Example_h + +#include <RayPlatform/core/ComputeCore.h> + +__DeclarePlugin(Example); + +__DeclareMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_A); +__DeclareMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_B); +__DeclareMasterModeAdapter(Example,RAY_MASTER_MODE_STEP_C); + +__DeclareSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_A); +__DeclareSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_B); +__DeclareSlaveModeAdapter(Example,RAY_SLAVE_MODE_STEP_C); + +__DeclareMessageTagAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); +__DeclareMessageTagAdapter(Example,RAY_MPI_TAG_TIME_BOMB); + +/** + * The plugin Example + * + * \author Charles Joly Beauparlant + **/ +class Example: public CorePlugin{ + + __AddAdapter(Example,RAY_MASTER_MODE_STEP_A); + __AddAdapter(Example,RAY_MASTER_MODE_STEP_B); + __AddAdapter(Example,RAY_MASTER_MODE_STEP_C); + + __AddAdapter(Example,RAY_SLAVE_MODE_STEP_A); + __AddAdapter(Example,RAY_SLAVE_MODE_STEP_B); + __AddAdapter(Example,RAY_SLAVE_MODE_STEP_C); + + __AddAdapter(Example,RAY_MPI_TAG_STOP_AND_DIE); + __AddAdapter(Example,RAY_MPI_TAG_TIME_BOMB); + +/** + * A list of master modes + */ + MasterMode RAY_MASTER_MODE_STEP_A; + MasterMode RAY_MASTER_MODE_STEP_B; + MasterMode RAY_MASTER_MODE_STEP_C; + +/** slave modes **/ + SlaveMode RAY_SLAVE_MODE_STEP_A; + SlaveMode RAY_SLAVE_MODE_STEP_B; + SlaveMode RAY_SLAVE_MODE_STEP_C; + SlaveMode RAY_SLAVE_MODE_DO_NOTHING; + + + MessageTag RAY_MPI_TAG_START_STEP_A; + MessageTag RAY_MPI_TAG_START_STEP_B; + MessageTag RAY_MPI_TAG_START_STEP_C; + + MessageTag RAY_MPI_TAG_TIME_BOMB; + MessageTag RAY_MPI_TAG_STOP_AND_DIE; + + ComputeCore*m_core; + +/** states for progression **/ + bool m_doneA; + bool m_doneB; + bool m_doneC; + bool m_doneExample; + +/** Example state **/ + bool m_example; +public: + + Example(); + +/** callbacks for master modes **/ + void call_RAY_MASTER_MODE_STEP_A(); + void call_RAY_MASTER_MODE_STEP_B(); + void call_RAY_MASTER_MODE_STEP_C(); + +/** callbacks for slave modes **/ + void call_RAY_SLAVE_MODE_STEP_A(); + void call_RAY_SLAVE_MODE_STEP_B(); + void call_RAY_SLAVE_MODE_STEP_C(); + + void call_RAY_MPI_TAG_TIME_BOMB(Message*message); + void call_RAY_MPI_TAG_STOP_AND_DIE(Message*message); + +/** the following two methods are required by the interface CorePlugin **/ + +/** register the plugin with the core **/ + void registerPlugin(ComputeCore*core); + +/** resolve symbols not owned by the current plugin **/ + void resolveSymbols(ComputeCore*core); +}; + +#endif diff --git a/code/plugin_Example/Makefile b/code/plugin_Example/Makefile new file mode 100644 index 0000000..50b1ba4 --- /dev/null +++ b/code/plugin_Example/Makefile @@ -0,0 +1,3 @@ +Example-y += code/plugin_Example/Example.o + +obj-y += $(Example-y) -- 1.7.7.6 |
From: Sébastien B. <seb...@ul...> - 2013-01-18 16:52:45
|
Hello Carlos, I hope everything goes fine for you. Regarding the segmentation fault, I don't understand why the memory usage would be 3315548 KiB *before* loading any sequence. In /rap/nne-790-ac/Cray/2048-2013-01-10-1-Seg-Fault/ray_n2048.o470670 (on Colosse): Rank 1992 has 0 sequence reads Rank 1992: assembler memory usage: 3315548 KiB >From a 512-rank job on the same dataset on Colosse: ( log HiSeq-2500-NA12878-demo-2x150-2012-12-18-1.stdout ): Rank 258 has 0 sequence reads Rank 258: assembler memory usage: 210692 KiB Are you able to reproduce the segmentation fault with 2048 MPI ranks ? I downloaded the core files, but they are binary so I can not do anything with them I think. Ticket: https://github.com/sebhtml/ray/issues/134 (I CC'ed this to denovoassembler-devel to have some sort of archive) On Tue, Jan 08, 2013 at 03:53:53PM -0500, Carlos P. Sosa wrote: > This on hera from last night 2048 MPI tasks: (from stderr) > > > > Stack walkback for Rank 1992 starting: > > _start@start.S:113 > > __libc_start_main@0x2aaab0d74c35 > > main@ray_main.cpp:32 > > RankProcess<Machine>::run()@RankProcess.h:214 > > RankProcess<Machine>::startMiniRank()@RankProcess.h:294 > > Machine::run()@stl_construct.h:83 > > Machine::start()@stl_construct.h:83 > > ComputeCore::run()@stl_iterator.h:858 > > ComputeCore::runVanilla()@stl_iterator.h:858 > > ComputeCore::processData()@stl_iterator.h:858 > > SlaveModeExecutor::callHandler(int)@stl_iterator.h:858 > > Adapter_RAY_SLAVE_MODE_ADD_EDGES::call()@stl_algobase.h:217 > > VerticesExtractor::call_RAY_SLAVE_MODE_ADD_EDGES()@stl_algobase.h:217 > > Read::getSeq(char*, bool, bool) const@stl_algobase.h:217 > > Stack walkback for Rank 1992 done > > Process died with signal 11: 'Segmentation fault' > > Forcing core dumps of ranks 1992, 61, 218, 267, 271, 361, 510, 86, 1258, 8, > 126, 293, 106, 373, 688, 59, 129, 145, 208, 17 > > > > Carlos P Sosa > > 380 Jackson Street, Suite 210 | Saint Paul, MN 55101 | cp...@cr... | > www.cray.com > > > > Description: Description: cid:image004.jpg@01CA8E1A.B63D6050 > Description: Description: facebook Description: Description: twitter > Description: Description: youtube > > > |
From: Sébastien B. <seb...@ul...> - 2013-01-16 02:06:22
|
Thanks, I tested and merged your changes. commit 1e6be6861b6fa00a7e4250202067b00e1b62b584 Merge: b1535ec 828df04 Author: Sébastien Boisvert <seb...@ul...> Date: Tue Jan 15 21:03:06 2013 -0500 Merge git://github.com/plpla/Ray-Cloud-Browser.git master remote-tracking branch 'pier-luc/master' * pier-luc/master: added min and max buttons when selecting position On Tue, Jan 15, 2013 at 12:52:23PM -0500, Pier-Luc Plante wrote: > Salut, > j'ai fait une patch pour ajouter les boutons min et max. > Please pull from me: > git://github.com/plpla/Ray-Cloud-Browser.git master > > > Pier-Luc > > |
From: Sébastien B. <seb...@ul...> - 2013-01-13 02:51:57
|
Thanks for looking into this, I merged your work. On Sat, Jan 12, 2013 at 12:20:00PM -0500, Pier-Luc Plante wrote: > The patch you proposed solved the problem. > Please pull from me. > > git://github.com/plpla/Ray-Cloud-Browser.git master > > Thanks > Pier-Luc > > Le 2013-01-11 15:07, Sébastien Boisvert a écrit : > > On Fri, Jan 11, 2013 at 02:11:02PM -0500, Pier-Luc Plante wrote: > >> Salut, > >> j'ai approfondi mon analyse du bogue... > >> Pour un nombre (ex:12345), il est impossible d'aller plus haut que la > >> valeur maximal du chiffre à une position donnée. > >> Donc, par exemple, la position 999 ne peut pas être sélectionnée pour > >> une longueur de contig de 12345 mais pourtant la position existe. > > Obviously that's a bug. > > > >> Je suggère donc de mettre le minimum à 0 et le maximum à 9 excepté pour > >> les IntegerSelectionWidget critiques de gauche. > >> Par exemple pour un contig d'une longueur de 12345, > >> au stade initial: > >> Pos1--> 0..9 > >> Pos2--> 0..9 > >> Pos3--> 0..9 > >> Pos4--> 0..9 > >> Pos5--> 0..1 > >> > >> Si en cours d'utilisation le nombre sélectionné se trouve à devenir > >> 12000, les Widgets pourront: > >> Pos1--> 0..9 > >> Pos2--> 0..9 > >> Pos3--> 0..3 > >> Pos4--> 0..2 > >> Pos5--> 0..1 > >> Il faudra donc faire vérifier chaque Widget à droite de celui qui est > >> modifié pour s'assurer qu'il n'est pas à une valeur impossible. > >> Sinon je vois toujours l'option de permettre le 0..9 pour tout les > >> widget et de faire afficher "Position impossible" si la position > >> n'existe pas. > >> Qu'est-ce que tu en penses? > > I agree. Can you try this patch which solves the issue ? > > > > patch -p1 < fix-range.patch > > > > If you think it solves the bug, commit that on your repository and add > > my signed-off line like this in your commit: > > > > Signed-off-by: Pier-Luc Plante <pie...@ul...> > > Signed-off-by: Sébastien Boisvert <seb...@ul...> > > > > Then send the pull request here as usual. > > > > Thanks. > > > >> Je peux essayer de le coder si tu veux... > >> > >> Pier-Luc > |
From: Pier-Luc P. <pie...@ul...> - 2013-01-12 17:20:09
|
The patch you proposed solved the problem. Please pull from me. git://github.com/plpla/Ray-Cloud-Browser.git master Thanks Pier-Luc Le 2013-01-11 15:07, Sébastien Boisvert a écrit : > On Fri, Jan 11, 2013 at 02:11:02PM -0500, Pier-Luc Plante wrote: >> Salut, >> j'ai approfondi mon analyse du bogue... >> Pour un nombre (ex:12345), il est impossible d'aller plus haut que la >> valeur maximal du chiffre à une position donnée. >> Donc, par exemple, la position 999 ne peut pas être sélectionnée pour >> une longueur de contig de 12345 mais pourtant la position existe. > Obviously that's a bug. > >> Je suggère donc de mettre le minimum à 0 et le maximum à 9 excepté pour >> les IntegerSelectionWidget critiques de gauche. >> Par exemple pour un contig d'une longueur de 12345, >> au stade initial: >> Pos1--> 0..9 >> Pos2--> 0..9 >> Pos3--> 0..9 >> Pos4--> 0..9 >> Pos5--> 0..1 >> >> Si en cours d'utilisation le nombre sélectionné se trouve à devenir >> 12000, les Widgets pourront: >> Pos1--> 0..9 >> Pos2--> 0..9 >> Pos3--> 0..3 >> Pos4--> 0..2 >> Pos5--> 0..1 >> Il faudra donc faire vérifier chaque Widget à droite de celui qui est >> modifié pour s'assurer qu'il n'est pas à une valeur impossible. >> Sinon je vois toujours l'option de permettre le 0..9 pour tout les >> widget et de faire afficher "Position impossible" si la position >> n'existe pas. >> Qu'est-ce que tu en penses? > I agree. Can you try this patch which solves the issue ? > > patch -p1 < fix-range.patch > > If you think it solves the bug, commit that on your repository and add > my signed-off line like this in your commit: > > Signed-off-by: Pier-Luc Plante <pie...@ul...> > Signed-off-by: Sébastien Boisvert <seb...@ul...> > > Then send the pull request here as usual. > > Thanks. > >> Je peux essayer de le coder si tu veux... >> >> Pier-Luc |
From: Sébastien B. <seb...@ul...> - 2013-01-11 20:07:40
|
On Fri, Jan 11, 2013 at 02:11:02PM -0500, Pier-Luc Plante wrote: > Salut, > j'ai approfondi mon analyse du bogue... > Pour un nombre (ex:12345), il est impossible d'aller plus haut que la > valeur maximal du chiffre à une position donnée. > Donc, par exemple, la position 999 ne peut pas être sélectionnée pour > une longueur de contig de 12345 mais pourtant la position existe. Obviously that's a bug. > Je suggère donc de mettre le minimum à 0 et le maximum à 9 excepté pour > les IntegerSelectionWidget critiques de gauche. > Par exemple pour un contig d'une longueur de 12345, > au stade initial: > Pos1--> 0..9 > Pos2--> 0..9 > Pos3--> 0..9 > Pos4--> 0..9 > Pos5--> 0..1 > > Si en cours d'utilisation le nombre sélectionné se trouve à devenir > 12000, les Widgets pourront: > Pos1--> 0..9 > Pos2--> 0..9 > Pos3--> 0..3 > Pos4--> 0..2 > Pos5--> 0..1 > Il faudra donc faire vérifier chaque Widget à droite de celui qui est > modifié pour s'assurer qu'il n'est pas à une valeur impossible. > Sinon je vois toujours l'option de permettre le 0..9 pour tout les > widget et de faire afficher "Position impossible" si la position > n'existe pas. > Qu'est-ce que tu en penses? I agree. Can you try this patch which solves the issue ? patch -p1 < fix-range.patch If you think it solves the bug, commit that on your repository and add my signed-off line like this in your commit: Signed-off-by: Pier-Luc Plante <pie...@ul...> Signed-off-by: Sébastien Boisvert <seb...@ul...> Then send the pull request here as usual. Thanks. > Je peux essayer de le coder si tu veux... > > Pier-Luc |
From: Pier-Luc P. <pie...@ul...> - 2013-01-10 20:58:30
|
please pull from me! git://github.com/plpla/Ray-Cloud-Browser.git master |
From: Charles J. <cha...@cr...> - 2012-12-14 14:08:49
|
Yes, that would do the trick! On Thu, Dec 13, 2012 at 4:30 PM, Sébastien Boisvert <seb...@ul...> wrote: > gn lately |
From: Sébastien B. <seb...@ul...> - 2012-12-13 21:31:40
|
Hi Charles, On 12/04/2012 02:05 PM, Charles Joly wrote: > This looks very promising! > I thought about it and Gate are not required. I improved the design lately. > I think it would be a nice addition to be able to disable all the > current gates of a master mode without referring to them directly. The design is to still register the next master mode with: void ComputeCore::setMasterModeNextMasterMode(PluginHandle plugin,MasterMode mode,MasterMode next); but the new code will accept more than 1 next MasterMode handle for any current MasterMode. The selection will be done with: void CompureCore::setSelectNextMasterMode(PluginHandle plugin,MasterMode masterMode, MasterMode selectedNextMasterMode); So obviously the best thing to do here I think is to add a master mode whose role is just to do this selection. The path A B C D E F G H o---->o---->o---->o---->o---->o---->o---->o becomes A O* B C D E F G H o---->o---->o---->o---->o---->o---->o---->o---->o \ \ \ R S T U V W ->o---->o---->o---->o---->o---->o Where the O* MasterMode perform the test and decides which path to go. The default path is the first registered. Does that fulfil your requirements for your work ? If yes, I will cook up a patch. -Sébastien > This way a plugin do not have to know the name of every gates that > were associated with the master mode by other plugins. > > Charles Joly Beauparlant. > > On Tue, Dec 4, 2012 at 10:53 AM, Sébastien Boisvert > <seb...@ul...> wrote: >> Hello, >> >> [I need at least one person for reviewing this.] >> >> >> https://github.com/sebhtml/RayPlatform/blob/master/Documentation/Gates.txt |
From: Charles J. <cha...@cr...> - 2012-12-04 19:05:54
|
This looks very promising! I think it would be a nice addition to be able to disable all the current gates of a master mode without referring to them directly. This way a plugin do not have to know the name of every gates that were associated with the master mode by other plugins. Charles Joly Beauparlant. On Tue, Dec 4, 2012 at 10:53 AM, Sébastien Boisvert <seb...@ul...> wrote: > Hello, > > [I need at least one person for reviewing this.] > > > https://github.com/sebhtml/RayPlatform/blob/master/Documentation/Gates.txt |
From: Sébastien B. <seb...@ul...> - 2012-12-04 15:53:49
|
Hello, [I need at least one person for reviewing this.] https://github.com/sebhtml/RayPlatform/blob/master/Documentation/Gates.txt |
From: Sébastien B. <seb...@ul...> - 2012-11-20 15:11:54
|
Here is a sample dataset for testing the extraction of k-mers using FPGAs. http://www.ebi.ac.uk/ena/data/view/SRS011098 ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR055/SRR055676/SRR055676.fastq.gz ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR055/SRR055756/SRR055756.fastq.gz ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR056/SRR056894/SRR056894.fastq.gz ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR056/SRR056977/SRR056977.fastq.gz ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR059/SRR059326/SRR059326.fastq.gz ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR059/SRR059327/SRR059327.fastq.gz ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR062/SRR062051/SRR062051_1.fastq.gz ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR062/SRR062051/SRR062051_2.fastq.gz ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR062/SRR062052/SRR062052_1.fastq.gz ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR062/SRR062052/SRR062052_2.fastq.gz On 11/20/2012 09:52 AM, Sébastien Boisvert wrote: > Le code source sur ohloh: > > - http://www.ohloh.net/p/rayplatform > - http://www.ohloh.net/p/ray-assembler > > Le code source sur github: > > - https://github.com/sebhtml/RayPlatform/ > - https://github.com/sebhtml/ray > > > Il serait intéressant de voir si l'extraction des mots de longueur k pourraient être > extrait matériellement. > > On 11/14/2012 04:29 PM, Sébastien Boisvert wrote: >> Bonjour, >> >> Je vais visiter (invitation) SciNet (la branche Torontoise de Calcul Canada) les >> 26, 27, et 28 novembre 2012 et je dois préparer deux présentations. >> >> Donc, je ne participerai pas à la rencontre si elle a lieu avant le 29 novembre 2012. >> >> De toute façon, je suis plus une personne de "software" qu'une personne "hardware". >> Le hardware va m'intéresser si il y a une abstraction logicielle par dessus >> dans un langage portable et standardisé. Je pense par exemple à Thrust en C++ pour les >> GPUs ou à Rootbeer (coder les GPUs en java). CUDA ou OpenCL ne sont pas intéressant >> (mon opinion). >> >> Je crois qu'en génomique les FPGAs et GPUs nécessitent un effort extraordinaire >> de programmation pour obtenir un gain très faible. Voir par exemple >> MUMmerGPU, SOAP3/GPU. Jacopo Pantaleoni (un contact chez NVIDIA Research) a porté BWA >> sur GPU, ça a pris des mois et pendant ce temps "upstream" a sorti plusieurs nouvelles >> versions de BWA. >> >> Du côté des accélérateurs, je vais attendre d'avoir accès à un Intel Phi, ce qui devrait >> être bientôt. >> >> En tant que "maintainer" de Ray, je suis très content avec MPI avec IEEE POSIX thread dans >> les entrailles de RayPlatform. >> >> On 11/14/2012 03:55 PM, François Laviolette wrote: >>> Bonjour, >>> >>> Paul Fortier et moi-même aimerions céduler un petite rencontre afin d'explorer la possibilité d'avoir une version "hardware" de notre programme d'assemblage de génome RAY. >>> >>> >>> Afin de connaître les disponibilités de chacun, pourriez-vous SVP remplir le sondage Doodle suivant: http://www.doodle.com/rqbeuvudfs6ves9y >>> >>> Merci d'avance >>> >>> François Laviolette >> > |
From: Sébastien B. <seb...@ul...> - 2012-11-14 18:11:58
|
Hi Jacques, Ray will be added in Debian unstable in maximum 7 days, see forwarded message below. It should then make its way into Debian Testing , Ubuntu 13.04 in April 2013, and presumably Debian stable in 2015 (Debian stable is, well, stable and uses only packages that have proven stable in Debian Testing. So we have these distributors: - CloudBioLinux; https://groups.google.com/forum/?fromgroups=#!topic/cloudbiolinux/bVo9I89iZts - Debian (Unstable, Testing soon and Stable in some years); http://lists.debian.org/debian-med/2012/11/msg00088.html - The Debian package should be picked up by Ubuntu - Fedora (the Review Request is pretty much done, should be sponsored soon https://bugzilla.redhat.com/show_bug.cgi?id=872783 - The Fedora package should be picked up by OpenSUSE and RHEL (not sure about RHEL) - ArchLinux (done by Maxime Déraspe) https://aur.archlinux.org/packages/ray/ - SourceForge http://sourceforge.net/projects/denovoassembler/files/ - GitHub https://github.com/sebhtml/ray -------- Original Message -------- Subject: ray_2.1.0-1_amd64.changes is NEW Date: Wed, 14 Nov 2012 09:47:42 -0500 From: Debian FTP Masters <ftp...@ft...> To: Debian Med Packaging Team <deb...@li...>, Sébastien Boisvert <seb...@ul...>, "ti...@de..." <ti...@de...> Your package contains new components which requires manual editing of the override file. It is ok otherwise, so please be patient. New packages are usually added to the override file about once a week. |
From: Sébastien B. <seb...@ul...> - 2012-11-09 17:07:57
|
On 11/09/2012 11:50 AM, Charles Joly wrote: > You said: > " > TATCG -> ATCGA -> TCGAC > AATCG -> -> TCGAC > I don't see how you can represent this with just one letter." > > I'm not sure I get your example. You seem to have 2 identical k-mers It's a typo. Should be: TATCG -> ATCGA -> TCGAC AATCG -> -> TCGAG > (TCGAC) that are linked with the same k-mer (ATCGA): > > TATCG--- > |---ATCGA---TCGAC > AATCG--- > > Here we have two sequences, right? > > TATCGAC and AATCGAC(?) > > If 2 k-mers are linked isn't it by definition because they only have a > single base pair that differ? > > Seems to me that every k-mer except those at the right end of the > graph can be represented by the leftmost nucleotide (since the only > information about a k-mer that is not present in the next k-mer is the > first nucleotide): > > T--- > |---A---TCGAC > A--- > Yes, you need to bootstrap from one full-sequence k-mer, then you can just add 1 letter. > For the rightmost k-mers, it's a bit more complicated because there > are multiple cases possible. > Hence one letter is not enough for any k-mer with more than 1 parent or more than 1 child. Otherwise, people would be using the 1-letter-per-kmer to store de de Bruijn graph, right ? If I take my (corrected) example: TATCG -> ATCGA -> TCGAC AATCG -> -> TCGAG Taking only the last is useless: G -> A -> C G -> G Taking only the first is useless: T -> A -> C A -> -> G Why not, I will display all k-mer with only their last letter. Full sequence will be shown on-mouse-over. As you said, more stuff will be packed on the screen with smaller objects. Mathematically, you can spell DNA from a de Bruijn graph by taking the ith letter of each k-mer, in order, in a path. You then have to deal with ends. If you take the last, the head must be fully-taken and only the last is required in tail. If you take the first, just swap definitions of first and last. Anything in between is a linear variation. Thanks for feedbacks. > 2012/11/9 Sébastien Boisvert <seb...@ul...>: >> On 11/09/2012 10:02 AM, Charles Joly wrote: >>> >>> Salut Seb, >>> >>> J'ai regardé ton démo pour le browser avec Fred ce matin. C'est très cool! >>> >>> Est-ce que ce serait très compliqué de ne représenter que le >>> nucléotide qui est unique à chaque k-mer plutôt que la longeur totale? >>> Ça permettrait de représenter un plus grand nombre de k-mer dans une >>> fenêtre. >> >> >> Does not make sense. >> >> Example of a knot: >> >> TATCG -> ATCGA -> TCGAC >> AATCG -> -> TCGAC >> >> I don't see how you can represent this with just one letter. >> >> However, for chains x1 -> x2 -> x3 -> x4, I can do that: >> >> TATCG -> ATCGA -> TCGAC -> CGACA -> GACAC >> >> Can become: >> >> TATCG -> A -> C -> A -> GACAC >> >> In fact, we can only display any k-mer with a single nucleotide without >> loss of information for those with 1 child and 1 parent (1-1 k-mers). >> >> Lukily, most of k-mers are like this ! >> >> So what'll do is: >> >> - render 1-1 k-mers with the last nucleotide >> - render other k-mers with full sequence >> -when the user moves its mouse over a k-mer, it will be rendered in >> full-sequence mode >> regardless if it is a 1-1. >> >> >>> >>> De plus, tu pourrais avoir une couleur par nucléotide et ça pourrait >>> aider à visualiser plus facilement. >> >> >> Sure. >> >> >>> >>> Fred a même proposé de ne pas dessiner ni les cercle et ni arête et de >>> ne représenter qu'une lettre pour chaque nucléotide qu'on pourrait >>> déplacer de la même manière. >>> >> >> No. It's a graph, we need relationships. >> >>> >>> Charles. >>> >> |
From: Charles J. <cha...@cr...> - 2012-11-09 16:51:22
|
You said: " TATCG -> ATCGA -> TCGAC AATCG -> -> TCGAC I don't see how you can represent this with just one letter." I'm not sure I get your example. You seem to have 2 identical k-mers (TCGAC) that are linked with the same k-mer (ATCGA): TATCG--- |---ATCGA---TCGAC AATCG--- Here we have two sequences, right? TATCGAC and AATCGAC(?) If 2 k-mers are linked isn't it by definition because they only have a single base pair that differ? Seems to me that every k-mer except those at the right end of the graph can be represented by the leftmost nucleotide (since the only information about a k-mer that is not present in the next k-mer is the first nucleotide): T--- |---A---TCGAC A--- For the rightmost k-mers, it's a bit more complicated because there are multiple cases possible. 2012/11/9 Sébastien Boisvert <seb...@ul...>: > On 11/09/2012 10:02 AM, Charles Joly wrote: >> >> Salut Seb, >> >> J'ai regardé ton démo pour le browser avec Fred ce matin. C'est très cool! >> >> Est-ce que ce serait très compliqué de ne représenter que le >> nucléotide qui est unique à chaque k-mer plutôt que la longeur totale? >> Ça permettrait de représenter un plus grand nombre de k-mer dans une >> fenêtre. > > > Does not make sense. > > Example of a knot: > > TATCG -> ATCGA -> TCGAC > AATCG -> -> TCGAC > > I don't see how you can represent this with just one letter. > > However, for chains x1 -> x2 -> x3 -> x4, I can do that: > > TATCG -> ATCGA -> TCGAC -> CGACA -> GACAC > > Can become: > > TATCG -> A -> C -> A -> GACAC > > In fact, we can only display any k-mer with a single nucleotide without > loss of information for those with 1 child and 1 parent (1-1 k-mers). > > Lukily, most of k-mers are like this ! > > So what'll do is: > > - render 1-1 k-mers with the last nucleotide > - render other k-mers with full sequence > -when the user moves its mouse over a k-mer, it will be rendered in > full-sequence mode > regardless if it is a 1-1. > > >> >> De plus, tu pourrais avoir une couleur par nucléotide et ça pourrait >> aider à visualiser plus facilement. > > > Sure. > > >> >> Fred a même proposé de ne pas dessiner ni les cercle et ni arête et de >> ne représenter qu'une lettre pour chaque nucléotide qu'on pourrait >> déplacer de la même manière. >> > > No. It's a graph, we need relationships. > >> >> Charles. >> > |
From: Sébastien B. <seb...@ul...> - 2012-11-09 15:16:35
|
On 11/09/2012 10:02 AM, Charles Joly wrote: > Salut Seb, > > J'ai regardé ton démo pour le browser avec Fred ce matin. C'est très cool! > > Est-ce que ce serait très compliqué de ne représenter que le > nucléotide qui est unique à chaque k-mer plutôt que la longeur totale? > Ça permettrait de représenter un plus grand nombre de k-mer dans une > fenêtre. Does not make sense. Example of a knot: TATCG -> ATCGA -> TCGAC AATCG -> -> TCGAC I don't see how you can represent this with just one letter. However, for chains x1 -> x2 -> x3 -> x4, I can do that: TATCG -> ATCGA -> TCGAC -> CGACA -> GACAC Can become: TATCG -> A -> C -> A -> GACAC In fact, we can only display any k-mer with a single nucleotide without loss of information for those with 1 child and 1 parent (1-1 k-mers). Lukily, most of k-mers are like this ! So what'll do is: - render 1-1 k-mers with the last nucleotide - render other k-mers with full sequence -when the user moves its mouse over a k-mer, it will be rendered in full-sequence mode regardless if it is a 1-1. > > De plus, tu pourrais avoir une couleur par nucléotide et ça pourrait > aider à visualiser plus facilement. Sure. > > Fred a même proposé de ne pas dessiner ni les cercle et ni arête et de > ne représenter qu'une lettre pour chaque nucléotide qu'on pourrait > déplacer de la même manière. > No. It's a graph, we need relationships. > Charles. > |
From: Sébastien B. <seb...@ul...> - 2012-11-09 15:07:14
|
Add this in unit tests for library detection |
From: Sébastien B. <seb...@ul...> - 2012-11-09 13:19:59
|
Hey, My hypothesis for missing region is that the algorithm that builds seeds is not totally symmetric in regard to DNA strands. When the Ray Cloud Browser is up, I will play your path in the graph to see what's going on. |
From: Sébastien B. <seb...@ul...> - 2012-11-09 13:16:38
|
Hey, My hypothesis for missing region is that the algorithm that builds seeds is not totally symmetric in regard to DNA strands. When the Ray Cloud Browser is up, I will play your path in the graph to see what's going on. |
From: Sébastien B. <seb...@ul...> - 2012-10-31 15:23:23
|
Hello, A Core Team member of Funtoo tested Ray on the Pi: http://blog.boisvert.info/2012/10/ray-on-raspberry-pi.html I wonder if the code will run also on the Epiphany accelerator from http://www.kickstarter.com/projects/adapteva/parallella-a-supercomputer-for-everyone/posts/323691 |
From: Sébastien B. <seb...@ul...> - 2012-10-30 20:12:45
|
Hello, In the example below, https://github.com/sebhtml/RayPlatform-example you will find here the updated API for adapters in RayPlatform v7.0.0. This adapter API is frozen. With this API, your code will work with mini-ranks or with MPI ranks without any modification to your code. Sébastien |
From: Sébastien B. <seb...@ul...> - 2011-08-02 20:11:36
|
Hi! The rank of a Kmer is calculated using its reverse-complement if it is lower, otherwise the original Kmer is utilised. I think the change you did yields the opposite -- I suspect it uses the higher Kmer. Sébastien > Sébastien > ________________________________________ > De : David Eccles (gringer) [dav...@mp...] > Date d'envoi : 27 juillet 2011 04:38 > À : den...@li... > Objet : [Denovoassembler-devel] Segfault from removing ?unnecessary copy, but only when multiple processors are used > > I introduced a bug in sebhtml/git by carrying out the following code change: > > diff --git a/code/structures/Kmer.cpp b/code/structures/Kmer.cpp > index 83e145b..10e4871 100644 > --- a/code/structures/Kmer.cpp > +++ b/code/structures/Kmer.cpp > @@ -155,8 +155,8 @@ uint8_t Kmer::getFirstSegmentFirstCode(int w){ > int Kmer::vertexRank(int _size,int w,bool color){ > Kmer b=complementVertex(w,color); > if(isLower(&b)) > - b=*this; > - return b.hash_function_1()%(_size); > + return b.hash_function_1()%(_size); > + return hash_function_1()%(_size); > } > > /** > > In other words, I changed vertexRank to the following: > > int Kmer::vertexRank(int _size,int w,bool color){ > Kmer b=complementVertex(w,color); > if(isLower(&b)) > return b.hash_function_1()%(_size); > return hash_function_1()%(_size); > } > > This shouldn't be a problem, right? All I've done is remove the copy > from *this to b, which (in the absence of a copy constructor) should do > a shallow copy of the fields of (*this) [i.e. create a new > uint64_t[KMER_U64_ARRAY_SIZE], and copy the bytes across]. I can't see > how the function outcome can be changed by doing this. > > [there are a few other places in the code where a similar copy is done] > > However, I get segfaults after making this change, and I don't know why. > In order to get my phiX data to work on sebhtml/git, I needed to adjust > the minimumY for CoverageDistribution: > > diff --git a/code/graph/CoverageDistribution.cpp > b/code/graph/CoverageDistribution.cpp > index 82cae53..db6cc60 100644 > --- a/code/graph/CoverageDistribution.cpp > +++ b/code/graph/CoverageDistribution.cpp > @@ -48,7 +48,7 @@ > CoverageDistribution::CoverageDistribution(map<int,uint64_t>*distributionOfCover > > int windowSize=10; > int minimumX=1; > - uint64_t minimumY=2*4096; > + uint64_t minimumY=1; > uint64_t minimumY2=55000; > int maximumX=65535-1; > int safeThreshold=256; > > If you want the coverage distribution for this, you can find it here: > > http://pastebin.com/KG01Tepp > > If I run with one processor, everything is fine: > > $ mpirun -np 1 ../../../sebgit/ray/code/Ray -write-seeds -k 10 -p > tests/phix/phix_5k_1.fasta tests/phix/phix_5k_2.fasta | grep -A 8 > 'Number of contigs' > Number of contigs: 1 > Total length of contigs: 5382 > Number of contigs >= 500 nt: 1 > Total length of contigs >= 500 nt: 5382 > Number of scaffolds: 1 > Total length of scaffolds: 5382 > Number of scaffolds >= 500 nt: 1 > Total length of scaffolds >= 500: 5382 > > Rank 0 wrote RayOutput.Contigs.fasta > Rank 0 wrote RayOutput.Scaffolds.fasta > > But when I run with more than one processor, there is a segfault: > > $ mpirun -np 2 ../../../sebgit/ray/code/Ray -write-seeds -k 10 -p > tests/phix/phix_5k_1.fasta tests/phix/phix_5k_2.fasta | grep -A 8 > 'Number of contigs' > [thaliana:23082] *** Process received signal *** > [thaliana:23082] Signal: Segmentation fault (11) > [thaliana:23082] Signal code: Address not mapped (1) > [thaliana:23082] Failing at address: 0x8 > [thaliana:23082] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf020) > [0x7fc03c7aa020] > [thaliana:23082] [ 1] > ../../../sebgit/ray/code/Ray(_ZN16MessageProcessor30call_RAY_MPI_TAG_VERTICES_DATAEP7Message+0x29f) > [0x43306f] > [thaliana:23082] [ 2] > ../../../sebgit/ray/code/Ray(_ZN7Machine10runVanillaEv+0x75) [0x445695] > [thaliana:23082] [ 3] > ../../../sebgit/ray/code/Ray(_ZN7Machine5startEv+0xd57) [0x447767] > [thaliana:23082] [ 4] ../../../sebgit/ray/code/Ray(main+0x2b) [0x42608b] > [thaliana:23082] [ 5] > /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x7fc03c435ead] > [thaliana:23082] [ 6] ../../../sebgit/ray/code/Ray() [0x4262e1] > [thaliana:23082] *** End of error message *** > -------------------------------------------------------------------------- > mpirun noticed that process rank 0 with PID 23082 on node thaliana > exited on signal 11 (Segmentation fault). > -------------------------------------------------------------------------- > > So, I can turn on debug and get the same bug: > > diff --git a/Makefile b/Makefile > index d1aca41..fcd7b7e 100644 > --- a/Makefile > +++ b/Makefile > @@ -83,7 +83,7 @@ OPTIMIZE = y > > # profiling > GPROF = n > -DEBUG = n > +DEBUG = y > > ifeq ($(GPROF),y) > OPTIMIZE = n > > $ mpirun -np 2 xterm -e gdb --args ../../../sebgit/ray/code/Ray > -write-seeds -k 10 -p tests/phix/phix_5k_1.fasta > tests/phix/phix_5k_2.fasta | grep -A 8 'Number of contigs' > > [from window for rank 0] > > Program received signal SIGSEGV, Segmentation fault. > 0x00000000004c5aa7 in MessageProcessor::call_RAY_MPI_TAG_VERTICES_DATA ( > this=0x7b04c8, message=0x9ca280) > at code/communication/MessageProcessor.cpp:465 > 465 > if(candidate->m_count<m_parameters->getMinimumCoverageToStore()) > (gdb) bt > #0 0x00000000004c5aa7 in MessageProcessor::call_RAY_MPI_TAG_VERTICES_DATA ( > this=0x7b04c8, message=0x9ca280) > at code/communication/MessageProcessor.cpp:465 > #1 0x00000000004c3e61 in MessageProcessor::processMessage (this=0x7b04c8, > message=0x9ca280) at code/communication/MessageProcessor.cpp:65 > #2 0x00000000004e27fe in Machine::processMessages (this=0x79e090) > at code/core/Machine.cpp:614 > #3 0x00000000004e24ba in Machine::runVanilla (this=0x79e090) > at code/core/Machine.cpp:533 > #4 0x00000000004e2492 in Machine::run (this=0x79e090) > at code/core/Machine.cpp:517 > #5 0x00000000004e1f24 in Machine::start (this=0x79e090) > at code/core/Machine.cpp:462 > #6 0x00000000005469a4 in main (argc=7, argv=0x7fffffffdf48) > at code/assembler/ray_main.cpp:29 > (gdb) print candidate > $1 = (KmerCandidate *) 0x0 > > So that code change has caused a bug in the MessageProcessor, > specifically the call_RAY_MPI_TAG_VERTICES_DATA function.... but I'm > using DEBUG, which should activate ASSERT, which should verify canidate > == NULL with an assert. I eventually worked out that I need to make > another change to the makefile to remove an erroneous space (cat -A is > used here to make the change obvious): > > $ git diff Makefile | cat -A > diff --git a/Makefile b/Makefile$ > index d1aca41..8ca7842 100644$ > --- a/Makefile$ > +++ b/Makefile$ > @@ -83,7 +83,7 @@ OPTIMIZE = y$ > $ > # profiling$ > GPROF = n$ > -DEBUG = n$ > +DEBUG = y$ > $ > ifeq ($(GPROF),y)$ > ^IOPTIMIZE = n$ > @@ -93,7 +93,7 @@ endif$ > ifeq ($(DEBUG),y)$ > ^IOPTIMIZE = n$ > ^IFORCE_PACKING = n$ > -^IASSERT = y $ > +^IASSERT = y$ > endif$ > $ > PEDANTIC = n$ > > So now I get the assert failing, which means the segfault doesn't get > reached: > > $ mpirun -np 2 xterm -e gdb --args ../../../sebgit/ray/code/Ray > -write-seeds -k 10 -p tests/phix/phix_5k_1.fasta > tests/phix/phix_5k_2.fasta | grep -A 8 'Number of contigs > > [from window for rank 1] > > Ray: code/communication/MessageProcessor.cpp:462: void > MessageProcessor::call_RAY_MPI_TAG_VERTICES_DATA(Message*): Assertion > `candidate!=__null' failed. > > Program received signal SIGABRT, Aborted. > 0x00007ffff5f3a405 in raise (sig=<value optimized out>) > at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 > 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. > in ../nptl/sysdeps/unix/sysv/linux/raise.c > (gdb) bt > #0 0x00007ffff5f3a405 in raise (sig=<value optimized out>) > at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 > #1 0x00007ffff5f3d680 in abort () at abort.c:92 > #2 0x00007ffff5f335b1 in __assert_fail ( > assertion=0x563296 "candidate!=__null", file=<value optimized out>, > line=462, > function=0x563f40 "void > MessageProcessor::call_RAY_MPI_TAG_VERTICES_DATA(Message*)") at assert.c:81 > #3 0x00000000004c8d37 in MessageProcessor::call_RAY_MPI_TAG_VERTICES_DATA ( > this=0x7c44c8, message=0x9de2c0) > at code/communication/MessageProcessor.cpp:462 > #4 0x00000000004c6f8d in MessageProcessor::processMessage (this=0x7c44c8, > message=0x9de2c0) at code/communication/MessageProcessor.cpp:65 > #5 0x00000000004e6872 in Machine::processMessages (this=0x7b2090) > at code/core/Machine.cpp:614 > #6 0x00000000004e64e8 in Machine::runVanilla (this=0x7b2090) > at code/core/Machine.cpp:533 > #7 0x00000000004e64c0 in Machine::run (this=0x7b2090) > at code/core/Machine.cpp:517 > #8 0x00000000004e5f52 in Machine::start (this=0x7b2090) > at code/core/Machine.cpp:462 > #9 0x0000000000550ac0 in main (argc=7, argv=0x7fffffffdf48) > at code/assembler/ray_main.cpp:29 > > So, it's segfaulting because it can't find a k-mer (I've done additional > tests to verify that, as expected, both the k-mer and its reverse > complement cannot be found), which presumably means that the k-mer that > it's looking for wasn't inserted into the graph. > > Just as a reminder, everything still works with a single processor: > > $ mpirun -np 1 ../../../sebgit/ray/code/Ray -write-seeds -k 10 -p > tests/phix/phix_5k_1.fasta tests/phix/phix_5k_2.fasta | grep -A 8 > 'Number of contigs' > Number of contigs: 1 > Total length of contigs: 5382 > Number of contigs >= 500 nt: 1 > Total length of contigs >= 500 nt: 5382 > Number of scaffolds: 1 > Total length of scaffolds: 5382 > Number of scaffolds >= 500 nt: 1 > Total length of scaffolds >= 500: 5382 > > Rank 0 wrote RayOutput.Contigs.fasta > Rank 0 wrote RayOutput.Scaffolds.fasta > > I just don't understand why this removal of a k-mer copy breaks code. > What's going on here? Any insight would be appreciated. > > -- David > > ------------------------------------------------------------------------------ > Got Input? Slashdot Needs You. > Take our quick survey online. Come on, we don't ask for help often. > Plus, you'll get a chance to win $100 to spend on ThinkGeek. > http://p.sf.net/sfu/slashdot-survey > _______________________________________________ > Denovoassembler-devel mailing list > Den...@li... > https://lists.sourceforge.net/lists/listinfo/denovoassembler-devel > Sébastien Boisvert http://github.com/sebhtml/ray |
From: Sébastien B. <seb...@ul...> - 2011-08-02 20:07:40
|
Hi David, Any ideas why there are no peak in your transcriptome k-mer coverage distribution ? Thanks. > ________________________________________ > De : David Eccles (gringer) [dav...@mp...] > Date d'envoi : 27 juillet 2011 08:32 > À : den...@li... > Objet : [Denovoassembler-devel] Planaria transcriptome coverage distribution > > For testing, here's the coverage distribution that was created by > combining all the Smed RNA reads I have: > > http://user.interface.org.nz/~gringer/hacking/planaria_Ray_5_2011-07-26_RayOutput.CoverageDistribution.txt > [~140kb] > > I had a bit of trouble with firefox freezing when I tried pastebin, > which is why it's not there. > > For what it's worth, some of these RNA transcripts (the low-expression > transcripts) only have about 50-80 hits for reads from a single > platform. While I don't expect to be able to get the sequences from > these transcripts -- for one I looked at, the longest stretch with > coverage greater than 5 was about 70bp -- it would be nice to have some > way to tune Ray to work with RNA data that has similar distributions of > coverage. > > The analysis is as follows: > > k-mer length: 31 > Lowest coverage observed: 1 > MinimumCoverage: 215 > PeakCoverage: 216 > RepeatCoverage: 217 > Number of k-mers with at least MinimumCoverage: 1944260 k-mers > Estimated genome length: 972130 nucleotides > Percentage of vertices with coverage 1: 64.0808 % > DistributionFile: > results/Ray_5_2011-07-26/RayOutput.CoverageDistribution.txt > > I'm not quite sure I agree with a Peak/Repeat difference of 1, but given > that I'm not sure what the numbers are used for, I'll leave that > strangeness for someone else to comment on. > > Note that it has a the big decrease in k-mers found for the first bit of > the distribution. I'm not sure if this is because of the nature of RNA > data or something else. > > -- David > > ------------------------------------------------------------------------------ > Got Input? Slashdot Needs You. > Take our quick survey online. Come on, we don't ask for help often. > Plus, you'll get a chance to win $100 to spend on ThinkGeek. > http://p.sf.net/sfu/slashdot-survey > _______________________________________________ > Denovoassembler-devel mailing list > Den...@li... > https://lists.sourceforge.net/lists/listinfo/denovoassembler-devel > Sébastien Boisvert http://github.com/sebhtml/ray |