| 722 | |
| 723 | |
| 724 | int |
| 725 | DataFileStream::setOrder(const ID &orderData) |
| 726 | { |
| 727 | if (sendSelfCount == 0) |
| 728 | return 0; |
| 729 | |
| 730 | if (sendSelfCount < 0) { |
| 731 | static ID numColumnID(1); |
| 732 | int numColumn = orderData.Size(); |
| 733 | numColumnID(0) = numColumn; |
| 734 | theChannels[0]->sendID(0, 0, numColumnID); |
| 735 | if (numColumn != 0) |
| 736 | theChannels[0]->sendID(0, 0, orderData); |
| 737 | } |
| 738 | |
| 739 | if (sendSelfCount > 0) { |
| 740 | |
| 741 | sizeColumns = new ID(sendSelfCount+1); |
| 742 | theColumns = new ID *[sendSelfCount+1]; |
| 743 | theData = new double *[sendSelfCount+1]; |
| 744 | theRemoteData = new Vector *[sendSelfCount+1]; |
| 745 | |
| 746 | for (int i=0; i<=sendSelfCount; i++) { |
| 747 | (*sizeColumns)(i) = 0; |
| 748 | theColumns[i] = 0; |
| 749 | theData[i] = 0; |
| 750 | theRemoteData[i] = 0; |
| 751 | } |
| 752 | |
| 753 | int numColumns = orderData.Size(); |
| 754 | (*sizeColumns)(0) = numColumns; |
| 755 | if (numColumns != 0) { |
| 756 | theColumns[0] = new ID(orderData); |
| 757 | theData[0] = new double [numColumns]; |
| 758 | } else { |
| 759 | theColumns[0] = 0; |
| 760 | theData[0] = 0; |
| 761 | } |
| 762 | theRemoteData[0] = 0; |
| 763 | |
| 764 | maxCount = 0; |
| 765 | if (numColumns != 0) |
| 766 | maxCount = orderData(numColumns-1); |
| 767 | |
| 768 | // now receive orderData from the other channels |
| 769 | for (int i=0; i<sendSelfCount; i++) { |
| 770 | static ID numColumnID(1); |
| 771 | if (theChannels[i]->recvID(0, 0, numColumnID) < 0) { |
| 772 | opserr << "DataFileStream::setOrder - failed to recv column size for process: " << i+1 << endln; |
| 773 | return -1; |
| 774 | } |
| 775 | |
| 776 | int numColumns = numColumnID(0); |
| 777 | |
| 778 | (*sizeColumns)(i+1) = numColumns; |
| 779 | if (numColumns != 0) { |
| 780 | theColumns[i+1] = new ID(numColumns); |
| 781 | if (theChannels[i]->recvID(0, 0, *theColumns[i+1]) < 0) { |