1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637
|
/*
Ray
Copyright (C) 2010, 2011, 2012 Sébastien Boisvert
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/>
*/
//#define GUILLIMIN_BUG
#include "Library.h"
#include <code/SequencesIndexer/ReadAnnotation.h>
#include <code/Mock/common_functions.h>
#include <code/Mock/Parameters.h>
#include <RayPlatform/communication/mpi_tags.h>
#include <RayPlatform/core/OperatingSystem.h>
#include <sstream>
#include <assert.h>
using namespace std;
__CreatePlugin(Library);
__CreateMasterModeAdapter(Library,RAY_MASTER_MODE_UPDATE_DISTANCES);
__CreateSlaveModeAdapter(Library,RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION);
__CreateSlaveModeAdapter(Library,RAY_SLAVE_MODE_SEND_LIBRARY_DISTANCES);
/* send the information to all ranks */
void Library::call_RAY_MASTER_MODE_UPDATE_DISTANCES(){
if(m_currentLibrary<m_parameters->getNumberOfLibraries()){
/** don't send information for manually-provided information */
if(!m_parameters->isAutomatic(m_currentLibrary)){
m_currentLibrary++;
/** send the message if not already done */
}else if(!m_informationSent){
MessageUnit*message=(MessageUnit*)m_outboxAllocator->allocate(MAXIMUM_MESSAGE_SIZE_IN_BYTES);
int outputPosition=0;
for(int i=0;i<m_parameters->getLibraryPeaks(m_currentLibrary);i++){
message[outputPosition++]=m_currentLibrary;
message[outputPosition++]=m_parameters->getLibraryAverageLength(m_currentLibrary,i);
message[outputPosition++]=m_parameters->getLibraryStandardDeviation(m_currentLibrary,i);
}
for(int i=0;i<m_size;i++){
Message aMessage(message,outputPosition,i,RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION,m_rank);
m_outbox->push_back(&aMessage);
}
m_informationSent=true;
m_ranksThatReplied=0;
/** wait for a reply */
}else if(m_inbox->size()>0 && m_inbox->at(0)->getTag()==RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION_REPLY){
m_ranksThatReplied++;
/** when everyone replied, we can proceed with the next library */
if(m_ranksThatReplied==m_parameters->getSize()){
m_currentLibrary++;
m_informationSent=false;
m_ranksThatReplied=0;
}
}
/** basically, we updated all libraries */
}else{
m_timePrinter->printElapsedTime("Estimation of outer distances for paired reads");
cout<<endl;
(*m_master_mode)=RAY_MASTER_MODE_TRIGGER_EXTENSIONS;
m_ed->m_EXTENSION_rank=-1;
m_ed->m_EXTENSION_currentRankIsSet=false;
}
}
bool Library::hasLibraryCheckpoint(){
return m_parameters->hasCheckpoint("PairedLibraries");
}
void Library::readLibraryCheckpoint(){
ifstream f(m_parameters->getCheckpointFile("PairedLibraries").c_str());
cout<<"Rank "<<m_parameters->getRank()<<" is reading checkpoint PairedLibraries"<<endl;
uint32_t entries=0;
f.read((char*)&entries,sizeof(uint32_t));
#ifdef CONFIG_ASSERT
assert(m_libraryDistances.size() == 0);
assert(m_detectedDistances ==0);
#endif
while(entries--){
uint32_t library=0;
uint32_t distance=0;
uint32_t count=0;
f.read((char*)&library,sizeof(uint32_t));
f.read((char*)&distance,sizeof(uint32_t));
f.read((char*)&count,sizeof(uint32_t));
if(count == 0)
continue;
#ifdef CONFIG_ASSERT
assert(count > 0);
#endif
#ifdef CONFIG_ASSERT
if(m_libraryDistances.count(library)>0){
if(m_libraryDistances[library].count(distance) !=0 ) {
cout << "Error: expected 0, got " << m_libraryDistances[library][distance] << " for library " << library;
cout << " and distance " << distance << endl;
}
assert(m_libraryDistances[library].count(distance)==0);
}
#endif
m_libraryDistances[library][distance]=count;
m_detectedDistances+=count;
}
f.close();
}
void Library::call_RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION(){
if(!m_initiatedIterator){
m_SEEDING_i=0;
m_activeWorkerIterator=m_activeWorkers.begin();
m_initiatedIterator=true;
m_maximumAliveWorkers=32768;
if(!m_parameters->hasPairedReads()){
completeSlaveMode();
return;
}
/*
* If we have checkpoints, we read them right away and
* skip this code path.
*/
if(hasLibraryCheckpoint()){
readLibraryCheckpoint();
completeSlaveMode();
return;
}
m_virtualCommunicator->resetCounters();
}
#ifdef GUILLIMIN_BUG
if(m_inbox->hasMessage(RAY_MPI_TAG_REQUEST_VERTEX_READS_REPLY)){
Message*message=m_inbox->at(0);
MessageUnit*buffer=message->getBuffer();
if(m_parameters->getRank()==message->getSource()){
cout<<endl;
cout<<"Globally receiving RAY_MPI_TAG_REQUEST_VERTEX_READS_REPLY from "<<message->getSource()<<endl;
cout<<"Inbox: "<<m_inbox->size()<<" Outbox: "<<m_outbox->size()<<endl;
for(int p=0;p<message->getCount();p++){
cout<<"; "<<p<<" -> "<<buffer[p];
}
cout<<endl;
cout<<"This is before m_virtualCommunicator->processInbox()"<<endl;
}
}
#endif
m_virtualCommunicator->processInbox(&m_activeWorkersToRestore);
#ifdef GUILLIMIN_BUG
if(m_inbox->hasMessage(RAY_MPI_TAG_REQUEST_VERTEX_READS_REPLY)){
Message*message=m_inbox->at(0);
MessageUnit*buffer=message->getBuffer();
if(m_parameters->getRank()==message->getSource()){
cout<<endl;
cout<<"Globally receiving RAY_MPI_TAG_REQUEST_VERTEX_READS_REPLY from "<<message->getSource()<<endl;
cout<<"Inbox: "<<m_inbox->size()<<" Outbox: "<<m_outbox->size()<<endl;
for(int p=0;p<message->getCount();p++){
cout<<"; "<<p<<" -> "<<buffer[p];
}
cout<<endl;
cout<<"This is after m_virtualCommunicator->processInbox()"<<endl;
}
}
if(m_outbox->hasMessage(RAY_MPI_TAG_REQUEST_VERTEX_READS_REPLY)){
Message*message=m_outbox->at(0);
MessageUnit*buffer=message->getBuffer();
if(m_parameters->getRank()==message->getDestination()){
cout<<endl;
cout<<"Globally sending RAY_MPI_TAG_REQUEST_VERTEX_READS_REPLY to "<<message->getDestination()<<endl;
cout<<"Inbox: "<<m_inbox->size()<<" Outbox: "<<m_outbox->size()<<endl;
for(int p=0;p<message->getCount();p++){
cout<<"; "<<p<<" -> "<<buffer[p];
}
cout<<endl;
cout<<"This is before the code in call_RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION()"<<endl;
}
}
#endif
/* there is a strange bug that is avoided by waiting an
extra tick before doing actual stuff.
if we don't wait for m_outbox to be flushed, we get
2 messages in the outbox and something strange happens
the bug does not happen on
- Mammouth Parallel II;
- colosse
- ls30
the bug occurs only on
- guillimin
*/
if(!m_virtualCommunicator->isReady() || m_outbox->size() > 0){
#ifdef GUILLIMIN_BUG
if(m_inbox->size()>0 || m_outbox->size()>0){
cout<<"m_virtualCommunicator is not ready yet."<<endl;
cout<<"Inbox: "<<m_inbox->size()<<" Outbox: "<<m_outbox->size()<<endl;
cout<<"returning."<<endl;
}
#endif
return;
}
if(m_activeWorkerIterator!=m_activeWorkers.end()){
WorkerHandle workerId=*m_activeWorkerIterator;
#ifdef CONFIG_ASSERT
if(m_aliveWorkers.count(workerId)==0){
cout<<"Error: "<<workerId<<" is not in alive workers "<<m_activeWorkers.size()<<endl;
}
assert(m_aliveWorkers.count(workerId)>0);
assert(!m_aliveWorkers[workerId].isDone());
#endif
m_virtualCommunicator->resetLocalPushedMessageStatus();
//force the worker to work until he finishes or pushes something on the stack
while(!m_aliveWorkers[workerId].isDone()&&!m_virtualCommunicator->getLocalPushedMessageStatus()){
m_aliveWorkers[workerId].work();
}
if(m_virtualCommunicator->getLocalPushedMessageStatus()){
m_waitingWorkers.push_back(workerId);
}
if(m_aliveWorkers[workerId].isDone()){
m_workersDone.push_back(workerId);
}
m_activeWorkerIterator++;
}else{
updateStates();
// add one worker to active workers
// reason is that those already in the pool don't communicate anymore --
// as for they need responses.
if(!m_virtualCommunicator->getGlobalPushedMessageStatus()&&m_activeWorkers.empty()){
// there is at least one worker to start
// AND
// the number of alive workers is below the maximum
if(m_SEEDING_i<m_seedingData->m_SEEDING_seeds.size()
&&(int)m_aliveWorkers.size()<m_maximumAliveWorkers){
#ifdef CONFIG_ASSERT
if(m_SEEDING_i==0){
assert(m_completedJobs==0&&m_activeWorkers.size()==0&&m_aliveWorkers.size()==0);
}
#endif
// create a worker
m_aliveWorkers[m_SEEDING_i].constructor(m_SEEDING_i,m_seedingData,m_virtualCommunicator,m_outboxAllocator,m_parameters,m_inbox,m_outbox,&m_libraryDistances,&m_detectedDistances,&m_allocator,
RAY_MPI_TAG_GET_READ_MATE, RAY_MPI_TAG_REQUEST_VERTEX_READS
);
m_activeWorkers.insert(m_SEEDING_i);
int population=m_aliveWorkers.size();
if(population>m_maximumWorkers){
m_maximumWorkers=population;
}
m_SEEDING_i++;
}else{
/* if there are no active workers and we failed to add
new workers above, then we need to flush something right
now
otherwise, it is safe to wait a little longer */
if(m_activeWorkers.empty()){
m_virtualCommunicator->forceFlush();
}
#ifdef GUILLIMIN_BUG
if(m_outbox->size()>0){
cout<<endl;
cout<<"Produced messages with forceFlush()"<<endl;
cout<<"Inbox: "<<m_inbox->size()<<" Outbox: "<<m_outbox->size()<<endl;
for(int p=0;p<m_outbox->size();p++){
cout<<endl;
cout<<"Message "<<p<<" destination "<<m_outbox->at(p)->getDestination();
cout<<" tag "<<MESSAGE_TAGS[m_outbox->at(p)->getTag()]<<endl;
cout<<"Content"<<endl;
MessageUnit*buffer=m_outbox->at(p)->getBuffer();
for(int q=0;q<m_outbox->at(p)->getCount();q++){
cout<<"; "<<q<<" -> "<<buffer[q];
}
cout<<endl;
}
}
#endif
}
}
m_activeWorkerIterator=m_activeWorkers.begin();
}
#ifdef CONFIG_ASSERT
assert((int)m_aliveWorkers.size()<=m_maximumAliveWorkers);
#endif
if(m_completedJobs==(int)m_seedingData->m_SEEDING_seeds.size()){
printf("Rank %i detected %i library lengths\n",getRank(),m_detectedDistances);
printf("Rank %i is calculating library lengths [%i/%i] (completed)\n",getRank(),(int)m_seedingData->m_SEEDING_seeds.size(),(int)m_seedingData->m_SEEDING_seeds.size());
if(mustWriteLibraryCheckpoint())
writeLibraryCheckpoint();
completeSlaveMode();
}
#ifdef GUILLIMIN_BUG
for(int i=0;i<(int)m_outbox->size();i++){
if(m_outbox->at(i)->getTag()!=RAY_MPI_TAG_REQUEST_VERTEX_READS_REPLY){
continue;
}
Message*message=m_outbox->at(i);
MessageUnit*buffer=message->getBuffer();
if(m_parameters->getRank()==message->getDestination()){
cout<<endl;
cout<<"Globally sending RAY_MPI_TAG_REQUEST_VERTEX_READS_REPLY to "<<message->getDestination()<<endl;
cout<<"Inbox: "<<m_inbox->size()<<" Outbox: "<<m_outbox->size()<<endl;
for(int p=0;p<message->getCount();p++){
cout<<"; "<<p<<" -> "<<buffer[p];
}
cout<<endl;
cout<<"This is after the code in call_RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION()"<<endl;
}
}
#endif
}
bool Library::mustWriteLibraryCheckpoint(){
return m_parameters->writeCheckpoints() && !m_parameters->hasCheckpoint("PairedLibraries");
}
void Library::writeLibraryCheckpoint(){
ostringstream buffer;
ostringstream name;
name << m_parameters->getCheckpointFile("PairedLibraries").c_str();
FILE* file = fopen(name.str().c_str(), "w");
uint32_t entries=0;
cout<<"Rank "<<m_parameters->getRank()<<" is writing checkpoint PairedLibraries"<<endl;
// count the entries
for(map<int,map<int,int> >::iterator i=m_libraryDistances.begin();
i!=m_libraryDistances.end();i++){
entries+=i->second.size();
}
buffer.write((char*)&entries, sizeof(uint32_t));
// write the entries
for(map<int,map<int,int> >::iterator i=m_libraryDistances.begin();
i!=m_libraryDistances.end();i++){
int library=i->first;
for(map<int,int>::iterator j=i->second.begin();
j!=i->second.end();j++){
int distance=j->first;
int count=j->second;
buffer.write((char*)&library, sizeof(uint32_t));
buffer.write((char*)&distance, sizeof(uint32_t));
buffer.write((char*)&count, sizeof(uint32_t));
flushFileOperationBuffer_FILE(false, &buffer, file, CONFIG_FILE_IO_BUFFER_SIZE);
}
}
flushFileOperationBuffer_FILE(true, &buffer, file, CONFIG_FILE_IO_BUFFER_SIZE);
fclose(file);
}
void Library::constructor(int m_rank,StaticVector*m_outbox,RingAllocator*m_outboxAllocator,ExtensionData*m_ed,
int m_size,
TimePrinter*m_timePrinter,int*m_mode,int*m_master_mode,
Parameters*m_parameters,SeedingData*m_seedingData,StaticVector*inbox,VirtualCommunicator*vc
){
this->m_rank=m_rank;
m_currentLibrary=0;
m_ranksThatReplied=0;
this->m_outbox=m_outbox;
this->m_outboxAllocator=m_outboxAllocator;
#ifdef CONFIG_ASSERT
assert(this->m_outboxAllocator!=NULL);
#endif
this->m_ed=m_ed;
this->m_size=m_size;
this->m_timePrinter=m_timePrinter;
this->m_mode=m_mode;
this->m_master_mode=m_master_mode;
this->m_parameters=m_parameters;
this->m_seedingData=m_seedingData;
m_ready=0;
m_virtualCommunicator=vc;
m_inbox=inbox;
m_initiatedIterator=false;
ostringstream prefixFull;
prefixFull<<m_parameters->getMemoryPrefix()<<"_Library";
int chunkSize=4194304;
m_allocator.constructor(chunkSize,"RAY_MALLOC_TYPE_LIBRARY_ALLOCATOR",m_parameters->showMemoryAllocations());
m_completedJobs=0;
m_informationSent=false;
}
void Library::setReadiness(){
m_ready--;
}
int Library::getRank(){
return m_rank;
}
int Library::getSize(){
return m_size;
}
Library::Library(){
m_detectedDistances=0;
}
void Library::allocateBuffers(){
m_bufferedData.constructor(m_size,MAXIMUM_MESSAGE_SIZE_IN_BYTES/sizeof(MessageUnit),
"RAY_MALLOC_TYPE_LIBRARY_BUFFERS",m_parameters->showMemoryAllocations(),3);
(m_libraryIndexInitiated)=false;
(m_libraryIterator)=0;
for(map<int,map<int,int> >::iterator i=m_libraryDistances.begin();
i!=m_libraryDistances.end();i++){
int libraryName=i->first;
m_libraryIndexes.push_back(libraryName);
}
}
void Library::call_RAY_SLAVE_MODE_SEND_LIBRARY_DISTANCES(){
if(m_ready!=0){
return;
}
if(m_libraryIterator==(int)m_libraryIndexes.size()){
if(!m_bufferedData.isEmpty()){
m_ready+=m_bufferedData.flushAll(RAY_MPI_TAG_LIBRARY_DISTANCE,m_outboxAllocator,m_outbox,getRank());
return;
}
Message aMessage(NULL,0,MASTER_RANK,RAY_MPI_TAG_ASK_LIBRARY_DISTANCES_FINISHED,getRank());
m_outbox->push_back(&aMessage);
(*m_mode)=RAY_SLAVE_MODE_DO_NOTHING;
m_bufferedData.showStatistics(m_parameters->getRank());
}else if(!m_libraryIndexInitiated){
m_libraryIndexInitiated=true;
m_libraryIndex=m_libraryDistances[m_libraryIndexes[m_libraryIterator]].begin();
}else if(m_libraryIndex==m_libraryDistances[m_libraryIndexes[m_libraryIterator]].end()){
m_libraryIterator++;
m_libraryIndexInitiated=false;
}else{
int library=m_libraryIndexes[m_libraryIterator];
int distance=m_libraryIndex->first;
int count=m_libraryIndex->second;
m_bufferedData.addAt(MASTER_RANK,library);
m_bufferedData.addAt(MASTER_RANK,distance);
m_bufferedData.addAt(MASTER_RANK,count);
if(m_bufferedData.flush(MASTER_RANK,3,RAY_MPI_TAG_LIBRARY_DISTANCE,m_outboxAllocator,m_outbox,getRank(),false)){
m_ready++;
}
m_libraryIndex++;
}
}
void Library::updateStates(){
// erase completed jobs
for(int i=0;i<(int)m_workersDone.size();i++){
WorkerHandle workerId=m_workersDone[i];
#ifdef CONFIG_ASSERT
assert(m_activeWorkers.count(workerId)>0);
assert(m_aliveWorkers.count(workerId)>0);
#endif
m_activeWorkers.erase(workerId);
m_aliveWorkers.erase(workerId);
if(m_completedJobs%1000==0){
printf("Rank %i is calculating library lengths [%i/%i]\n",m_parameters->getRank(),m_completedJobs+1,(int)m_seedingData->m_SEEDING_seeds.size());
}
m_completedJobs++;
}
m_workersDone.clear();
for(int i=0;i<(int)m_waitingWorkers.size();i++){
WorkerHandle workerId=m_waitingWorkers[i];
#ifdef CONFIG_ASSERT
assert(m_activeWorkers.count(workerId)>0);
#endif
m_activeWorkers.erase(workerId);
}
m_waitingWorkers.clear();
for(int i=0;i<(int)m_activeWorkersToRestore.size();i++){
WorkerHandle workerId=m_activeWorkersToRestore[i];
m_activeWorkers.insert(workerId);
}
m_activeWorkersToRestore.clear();
m_virtualCommunicator->resetGlobalPushedMessageStatus();
}
void Library::completeSlaveMode(){
Message aMessage(NULL,0,MASTER_RANK,RAY_MPI_TAG_AUTOMATIC_DISTANCE_DETECTION_IS_DONE,getRank());
m_outbox->push_back(&aMessage);
(*m_mode)=RAY_SLAVE_MODE_DO_NOTHING;
m_allocator.clear();
printf("Rank %i: peak number of workers: %i, maximum: %i\n",m_rank,m_maximumWorkers,m_maximumAliveWorkers);
m_virtualCommunicator->printStatistics();
if(m_parameters->showMemoryUsage()){
showMemoryUsage(m_rank);
}
}
void Library::registerPlugin(ComputeCore*core){
PluginHandle plugin=core->allocatePluginHandle();
m_plugin=plugin;
core->setPluginName(plugin,"Library");
core->setPluginDescription(plugin,"Obtains an estimation of library lengths");
core->setPluginAuthors(plugin,"Sébastien Boisvert");
core->setPluginLicense(plugin,"GNU General Public License version 3");
RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION=core->allocateSlaveModeHandle(plugin);
core->setSlaveModeObjectHandler(plugin,RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION, __GetAdapter(Library,RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION));
core->setSlaveModeSymbol(plugin,RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION,"RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION");
RAY_SLAVE_MODE_SEND_LIBRARY_DISTANCES=core->allocateSlaveModeHandle(plugin);
core->setSlaveModeObjectHandler(plugin,RAY_SLAVE_MODE_SEND_LIBRARY_DISTANCES, __GetAdapter(Library,RAY_SLAVE_MODE_SEND_LIBRARY_DISTANCES));
core->setSlaveModeSymbol(plugin,RAY_SLAVE_MODE_SEND_LIBRARY_DISTANCES,"RAY_SLAVE_MODE_SEND_LIBRARY_DISTANCES");
RAY_MASTER_MODE_UPDATE_DISTANCES=core->allocateMasterModeHandle(plugin);
core->setMasterModeObjectHandler(plugin,RAY_MASTER_MODE_UPDATE_DISTANCES, __GetAdapter(Library,RAY_MASTER_MODE_UPDATE_DISTANCES));
core->setMasterModeSymbol(plugin,RAY_MASTER_MODE_UPDATE_DISTANCES,"RAY_MASTER_MODE_UPDATE_DISTANCES");
RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION_REPLY=core->allocateMessageTagHandle(plugin);
core->setMessageTagSymbol(plugin,RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION_REPLY,"RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION_REPLY");
}
void Library::resolveSymbols(ComputeCore*core){
RAY_SLAVE_MODE_SEND_LIBRARY_DISTANCES=core->getSlaveModeFromSymbol(m_plugin,"RAY_SLAVE_MODE_SEND_LIBRARY_DISTANCES");
RAY_SLAVE_MODE_DO_NOTHING=core->getSlaveModeFromSymbol(m_plugin,"RAY_SLAVE_MODE_DO_NOTHING");
RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION=core->getSlaveModeFromSymbol(m_plugin,"RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION");
RAY_MASTER_MODE_TRIGGER_EXTENSIONS=core->getMasterModeFromSymbol(m_plugin,"RAY_MASTER_MODE_TRIGGER_EXTENSIONS");
RAY_MASTER_MODE_UPDATE_DISTANCES=core->getMasterModeFromSymbol(m_plugin,"RAY_MASTER_MODE_UPDATE_DISTANCES");
RAY_MASTER_MODE_TRIGGER_FUSIONS=core->getMasterModeFromSymbol(m_plugin,"RAY_MASTER_MODE_TRIGGER_FUSIONS");
RAY_MPI_TAG_ASK_LIBRARY_DISTANCES_FINISHED=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_ASK_LIBRARY_DISTANCES_FINISHED");
RAY_MPI_TAG_AUTOMATIC_DISTANCE_DETECTION_IS_DONE=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_AUTOMATIC_DISTANCE_DETECTION_IS_DONE");
RAY_MPI_TAG_LIBRARY_DISTANCE=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_LIBRARY_DISTANCE");
RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION");
RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION_REPLY=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION_REPLY");
RAY_MPI_TAG_GET_READ_MATE=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_GET_READ_MATE");
RAY_MPI_TAG_REQUEST_VERTEX_READS=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_REQUEST_VERTEX_READS");
RAY_MPI_TAG_REQUEST_VERTEX_READS_REPLY=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_REQUEST_VERTEX_READS_REPLY");
RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION_REPLY=core->getMessageTagFromSymbol(m_plugin,"RAY_MPI_TAG_UPDATE_LIBRARY_INFORMATION_REPLY");
core->setMasterModeNextMasterMode(m_plugin,RAY_MASTER_MODE_UPDATE_DISTANCES,RAY_MASTER_MODE_TRIGGER_FUSIONS);
__BindPlugin(Library);
__BindAdapter(Library,RAY_MASTER_MODE_UPDATE_DISTANCES);
__BindAdapter(Library,RAY_SLAVE_MODE_AUTOMATIC_DISTANCE_DETECTION);
__BindAdapter(Library,RAY_SLAVE_MODE_SEND_LIBRARY_DISTANCES);
}
|