Revision 1231 branches/threaded2merge/src/linad99/thread_stuff.cpp

thread_stuff.cpp (revision 1231)
498 498
  send_id_string_to_slave("TY",sno);
499 499
  writebuffer(&x,sizeof(double),sno);
500 500
}
501
void adpthread_manager::send_double_to_slave(const double &x,int sno)
502
{
503
  send_id_string_to_slave("TY",sno);
504
  writebuffer(&x,sizeof(double),sno);
505
}
506
void adpthread_manager::send_int_to_slave(int x,int sno)
507
{
508
  send_id_string_to_slave("RY",sno);
509
  writebuffer(&x,sizeof(int),sno);
510
}
511

  
512 501
void adpthread_manager::send_int(int x,int sno)
513 502
{
514 503
  send_id_string_to_slave("ES",sno);
515 504
  writebuffer(&x,sizeof(int),sno);
516 505
}
517
void adpthread_manager::send_int_to_master(int x,int sno)
518
{
519
  send_id_string_to_slave("YY",sno);
520
  writebuffer(&x,sizeof(int),sno);
521
}
522
int adpthread_manager::get_int_from_master(int sno)
523
{
524
  verify_id_string_from_master("RY",sno);
525
  int x;
526
  readbuffer(&x,sizeof(int),sno);
527
  return x;
528
}
529 506
int adpthread_manager::get_int(int sno)
530 507
{
531 508
  verify_id_string_from_master("ES",sno);
......
533 510
  readbuffer(&x,sizeof(int),sno);
534 511
  return x;
535 512
}
536
int adpthread_manager::get_int_from_slave(int sno)
537
{
538
  verify_id_string_from_master("YY",sno);
539
  int x;
540
  readbuffer(&x,sizeof(int),sno);
541
  return x;
542
}
543
double adpthread_manager::get_double_from_master(int sno)
544
{
545
  verify_id_string_from_master("TY",sno);
546
  double x;
547
  readbuffer(&x,sizeof(double),sno);
548
  return x;
549
}
550 513
double adpthread_manager::get_double(int sno)
551 514
{
552 515
  verify_id_string_from_master("TY",sno);
......
554 517
  readbuffer(&x,sizeof(double),sno);
555 518
  return x;
556 519
}
557
void adpthread_manager::send_double_to_master(const double &x,int sno)
558
{
559
  send_id_string_to_master("EY",sno);
560
  writebuffer(&x,sizeof(double),sno);
561
}
562
double adpthread_manager::get_double_from_slave(int sno)
563
{
564
  verify_id_string_from_master("EY",sno);
565
  double x;
566
  readbuffer(&x,sizeof(double),sno);
567
  return x;
568
}
569 520
void adpthread_manager::send_id_string_to_slave(const char * x,int sno)
570 521
{
571 522
#if defined(CHK_ID_STRING)
......
602 553
  int sz=mmax-mmin+1;
603 554
  writebuffer(&(dv(mmin)),sz*sizeof(double),sno);
604 555
}
605
dvar_vector adpthread_manager::get_dvar_vector_from_master(int sno)
606
{
607
  int mmin;
608
  int mmax;
609
  verify_id_string_from_master("DCY",sno);
610
  readbuffer(&mmin,sizeof(int),sno);
611
  readbuffer(&mmax,sizeof(int),sno);
612
  // cout  << "In dvar_vector get_dvar_vector_from_master " << endl;
613
  // cout  << " mmin = " << mmin   << " mmax = " << mmax  << endl;
614
  dvar_vector x(mmin,mmax);
615
  int sz=mmax-mmin+1;
616
  readbuffer(&(value(x(mmin))),sz*sizeof(double),sno);
617
  save_identifier_string("C");
618
  x.save_dvar_vector_position();
619
  save_identifier_string("Y7");
620
  save_int_value(sno);
621
  save_identifier_string("K6");
622
  save_pointer_value(this);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff