| 2671 | | #else |
|---|
| 2672 | | |
|---|
| 2673 | | computeDestinationGraphFromSources(bottomDistributedBuildLevel+1); |
|---|
| 2674 | | |
|---|
| 2675 | | if (!_destinationGraph.valid()) return false; |
|---|
| 2676 | | |
|---|
| 2677 | | // initialize various tasks related settings |
|---|
| 2678 | | std::string sourceFile = taskManager->getSourceFileName(); |
|---|
| 2679 | | std::string basename = taskManager->getBuildName(); |
|---|
| 2680 | | |
|---|
| 2681 | | std::string taskDirectory = getTaskDirectory(); |
|---|
| 2682 | | if (!taskDirectory.empty()) taskDirectory += "/"; |
|---|
| 2683 | | |
|---|
| 2684 | | std::string logDirectory = getLogDirectory(); |
|---|
| 2685 | | if (!logDirectory.empty()) logDirectory += "/"; |
|---|
| 2686 | | |
|---|
| 2687 | | std::string fileCacheName; |
|---|
| 2688 | | if (System::instance()->getFileCache()) fileCacheName = System::instance()->getFileCache()->getFileName(); |
|---|
| 2689 | | |
|---|
| 2690 | | bool logging = getNotifyLevel() > ALWAYS; |
|---|
| 2691 | | |
|---|
| 2692 | | |
|---|
| 2693 | | // create root task |
|---|
| 2694 | | { |
|---|
| 2695 | | std::ostringstream taskfile; |
|---|
| 2696 | | taskfile<<taskDirectory<<basename<<"_root_L0_X0_Y0.task"; |
|---|
| 2697 | | |
|---|
| 2698 | | std::ostringstream app; |
|---|
| 2699 | | app<<"osgdem --run-path "<<taskManager->getRunPath()<<" -s "<<sourceFile<<" --record-subtile-on-leaf-tiles -l "<<getDistributedBuildSplitLevel()<<" --task "<<taskfile.str(); |
|---|
| 2700 | | |
|---|
| 2701 | | if (!fileCacheName.empty()) |
|---|
| 2702 | | { |
|---|
| 2703 | | app<<" --cache "<<fileCacheName; |
|---|
| 2704 | | } |
|---|
| 2705 | | |
|---|
| 2706 | | if (logging) |
|---|
| 2707 | | { |
|---|
| 2708 | | std::ostringstream logfile; |
|---|
| 2709 | | logfile<<logDirectory<<basename<<"_root_L0_X0_Y0.log"; |
|---|
| 2710 | | app<<" --log "<<logfile.str(); |
|---|
| 2711 | | } |
|---|
| 2712 | | |
|---|
| 2713 | | taskManager->addTask(taskfile.str(), app.str(), sourceFile); |
|---|
| 2714 | | } |
|---|
| 2715 | | |
|---|
| 2716 | | |
|---|
| 2717 | | // need to create an intermediate level if required. |
|---|
| 2718 | | if (getDistributedBuildSecondarySplitLevel()!=0) |
|---|
| 2719 | | { |
|---|
| 2720 | | |
|---|
| 2721 | | CollectSubtiles cs(getDistributedBuildSplitLevel()-1); |
|---|
| 2722 | | _destinationGraph->accept(cs); |
|---|
| 2723 | | |
|---|
| 2724 | | for(CollectSubtiles::SubtileList::iterator itr = cs._subtileList.begin(); |
|---|
| 2725 | | itr != cs._subtileList.end(); |
|---|
| 2726 | | ++itr) |
|---|
| 2727 | | { |
|---|
| 2728 | | CompositeDestination* cd = itr->get(); |
|---|
| 2729 | | |
|---|
| 2730 | | std::ostringstream taskfile; |
|---|
| 2731 | | taskfile<<taskDirectory<<basename<<"_subtile_L"<<cd->_level<<"_X"<<cd->_tileX<<"_Y"<<cd->_tileY<<".task"; |
|---|
| 2732 | | |
|---|
| 2733 | | |
|---|
| 2734 | | std::ostringstream app; |
|---|
| 2735 | | app<<"osgdem --run-path "<<taskManager->getRunPath()<<" -s "<<sourceFile<<" --record-subtile-on-leaf-tiles -l "<<getDistributedBuildSecondarySplitLevel()<<" --subtile "<<cd->_level<<" "<<cd->_tileX<<" "<<cd->_tileY<<" --task "<<taskfile.str(); |
|---|
| 2736 | | |
|---|
| 2737 | | |
|---|
| 2738 | | if (!fileCacheName.empty()) |
|---|
| 2739 | | { |
|---|
| 2740 | | app<<" --cache "<<fileCacheName; |
|---|
| 2741 | | } |
|---|
| 2742 | | |
|---|
| 2743 | | if (logging) |
|---|
| 2744 | | { |
|---|
| 2745 | | std::ostringstream logfile; |
|---|
| 2746 | | |
|---|
| 2747 | | logfile<<logDirectory<<basename<<"_subtile_L"<<cd->_level<<"_X"<<cd->_tileX<<"_Y"<<cd->_tileY<<".log"; |
|---|
| 2748 | | app<<" --log "<<logfile.str(); |
|---|
| 2749 | | } |
|---|
| 2750 | | |
|---|
| 2751 | | taskManager->addTask(taskfile.str(), app.str(), sourceFile); |
|---|
| 2752 | | } |
|---|
| 2753 | | } |
|---|
| 2754 | | |
|---|
| 2755 | | // create the bottom level split |
|---|
| 2756 | | { |
|---|
| 2757 | | |
|---|
| 2758 | | // bottom set of tasks |
|---|
| 2759 | | CollectSubtiles cs(bottomDistributedBuildLevel-1); |
|---|
| 2760 | | _destinationGraph->accept(cs); |
|---|
| 2761 | | |
|---|
| 2762 | | for(CollectSubtiles::SubtileList::iterator itr = cs._subtileList.begin(); |
|---|
| 2763 | | itr != cs._subtileList.end(); |
|---|
| 2764 | | ++itr) |
|---|
| 2765 | | { |
|---|
| 2766 | | CompositeDestination* cd = itr->get(); |
|---|
| 2767 | | |
|---|
| 2768 | | std::ostringstream taskfile; |
|---|
| 2769 | | taskfile<<taskDirectory<<basename<<"_subtile_L"<<cd->_level<<"_X"<<cd->_tileX<<"_Y"<<cd->_tileY<<".task"; |
|---|
| 2770 | | |
|---|
| 2771 | | |
|---|
| 2772 | | std::ostringstream app; |
|---|
| 2773 | | app<<"osgdem --run-path "<<taskManager->getRunPath()<<" -s "<<sourceFile<<" --subtile "<<cd->_level<<" "<<cd->_tileX<<" "<<cd->_tileY<<" --task "<<taskfile.str(); |
|---|
| 2774 | | |
|---|
| 2775 | | if (!fileCacheName.empty()) |
|---|
| 2776 | | { |
|---|
| 2777 | | app<<" --cache "<<fileCacheName; |
|---|
| 2778 | | } |
|---|
| 2779 | | |
|---|
| 2780 | | if (logging) |
|---|
| 2781 | | { |
|---|
| 2782 | | std::ostringstream logfile; |
|---|
| 2783 | | |
|---|
| 2784 | | logfile<<logDirectory<<basename<<"_subtile_L"<<cd->_level<<"_X"<<cd->_tileX<<"_Y"<<cd->_tileY<<".log"; |
|---|
| 2785 | | app<<" --log "<<logfile.str(); |
|---|
| 2786 | | } |
|---|
| 2787 | | |
|---|
| 2788 | | taskManager->addTask(taskfile.str(), app.str(), sourceFile); |
|---|
| 2789 | | } |
|---|
| 2790 | | } |
|---|
| 2791 | | #endif |
|---|
| 2794 | | } |
|---|
| 2795 | | |
|---|
| 2796 | | bool DataSet::generateTasks_old(TaskManager* taskManager) |
|---|
| 2797 | | { |
|---|
| 2798 | | loadSources(); |
|---|
| 2799 | | |
|---|
| 2800 | | if (!prepareForDestinationGraphCreation()) return false; |
|---|
| 2801 | | |
|---|
| 2802 | | selectAppropriateSplitLevels(); |
|---|
| 2803 | | |
|---|
| 2804 | | if (getDistributedBuildSplitLevel()==0) return false; |
|---|
| 2805 | | |
|---|
| 2806 | | |
|---|
| 2807 | | computeDestinationGraphFromSources(getDistributedBuildSplitLevel()+1); |
|---|
| 2808 | | |
|---|
| 2809 | | if (_destinationGraph.valid()) |
|---|
| 2810 | | { |
|---|
| 2811 | | CollectSubtiles cs(getDistributedBuildSplitLevel()-1); |
|---|
| 2812 | | |
|---|
| 2813 | | _destinationGraph->accept(cs); |
|---|
| 2814 | | |
|---|
| 2815 | | std::string sourceFile = taskManager->getSourceFileName(); |
|---|
| 2816 | | |
|---|
| 2817 | | std::string basename = taskManager->getBuildName(); |
|---|
| 2818 | | std::string taskDirectory = getTaskDirectory(); |
|---|
| 2819 | | if (!taskDirectory.empty()) taskDirectory += "/"; |
|---|
| 2820 | | |
|---|
| 2821 | | std::string logDirectory = getLogDirectory(); |
|---|
| 2822 | | if (!logDirectory.empty()) logDirectory += "/"; |
|---|
| 2823 | | |
|---|
| 2824 | | std::string fileCacheName; |
|---|
| 2825 | | if (System::instance()->getFileCache()) fileCacheName = System::instance()->getFileCache()->getFileName(); |
|---|
| 2826 | | |
|---|
| 2827 | | bool logging = getNotifyLevel() > ALWAYS; |
|---|
| 2828 | | |
|---|
| 2829 | | // create root task |
|---|
| 2830 | | { |
|---|
| 2831 | | std::ostringstream taskfile; |
|---|
| 2832 | | taskfile<<taskDirectory<<basename<<"_root_L0_X0_Y0.task"; |
|---|
| 2833 | | |
|---|
| 2834 | | std::ostringstream app; |
|---|
| 2835 | | app<<"osgdem --run-path "<<taskManager->getRunPath()<<" -s "<<sourceFile<<" --record-subtile-on-leaf-tiles -l "<<getDistributedBuildSplitLevel()<<" --task "<<taskfile.str(); |
|---|
| 2836 | | |
|---|
| 2837 | | if (!fileCacheName.empty()) |
|---|
| 2838 | | { |
|---|
| 2839 | | app<<" --cache "<<fileCacheName; |
|---|
| 2840 | | } |
|---|
| 2841 | | |
|---|
| 2842 | | if (logging) |
|---|
| 2843 | | { |
|---|
| 2844 | | std::ostringstream logfile; |
|---|
| 2845 | | logfile<<logDirectory<<basename<<"_root_L0_X0_Y0.log"; |
|---|
| 2846 | | app<<" --log "<<logfile.str(); |
|---|
| 2847 | | } |
|---|
| 2848 | | #if 0 |
|---|
| 2849 | | else |
|---|
| 2850 | | { |
|---|
| 2851 | | app<<" > /dev/null"; |
|---|
| 2852 | | } |
|---|
| 2853 | | #endif |
|---|
| 2854 | | |
|---|
| 2855 | | taskManager->addTask(taskfile.str(), app.str(), sourceFile); |
|---|
| 2856 | | } |
|---|
| 2857 | | |
|---|
| 2858 | | // taskManager->nextTaskSet(); |
|---|
| 2859 | | |
|---|
| 2860 | | for(CollectSubtiles::SubtileList::iterator itr = cs._subtileList.begin(); |
|---|
| 2861 | | itr != cs._subtileList.end(); |
|---|
| 2862 | | ++itr) |
|---|
| 2863 | | { |
|---|
| 2864 | | CompositeDestination* cd = itr->get(); |
|---|
| 2865 | | |
|---|
| 2866 | | std::ostringstream taskfile; |
|---|
| 2867 | | taskfile<<taskDirectory<<basename<<"_subtile_L"<<cd->_level<<"_X"<<cd->_tileX<<"_Y"<<cd->_tileY<<".task"; |
|---|
| 2868 | | |
|---|
| 2869 | | |
|---|
| 2870 | | std::ostringstream app; |
|---|
| 2871 | | app<<"osgdem --run-path "<<taskManager->getRunPath()<<" -s "<<sourceFile<<" --subtile "<<cd->_level<<" "<<cd->_tileX<<" "<<cd->_tileY<<" --task "<<taskfile.str(); |
|---|
| 2872 | | |
|---|
| 2873 | | if (!fileCacheName.empty()) |
|---|
| 2874 | | { |
|---|
| 2875 | | app<<" --cache "<<fileCacheName; |
|---|
| 2876 | | } |
|---|
| 2877 | | |
|---|
| 2878 | | if (logging) |
|---|
| 2879 | | { |
|---|
| 2880 | | std::ostringstream logfile; |
|---|
| 2881 | | |
|---|
| 2882 | | logfile<<logDirectory<<basename<<"_subtile_L"<<cd->_level<<"_X"<<cd->_tileX<<"_Y"<<cd->_tileY<<".log"; |
|---|
| 2883 | | app<<" --log "<<logfile.str(); |
|---|
| 2884 | | } |
|---|
| 2885 | | #if 0 |
|---|
| 2886 | | else |
|---|
| 2887 | | { |
|---|
| 2888 | | app<<" > /dev/null"; |
|---|
| 2889 | | } |
|---|
| 2890 | | #endif |
|---|
| 2891 | | taskManager->addTask(taskfile.str(), app.str(), sourceFile); |
|---|
| 2892 | | } |
|---|
| 2893 | | |
|---|
| 2894 | | } |
|---|
| 2895 | | |
|---|
| 2896 | | return true; |
|---|
| | 2743 | } |
|---|
| | 2744 | } |
|---|
| | 2745 | |
|---|
| | 2746 | |
|---|
| | 2747 | bool printOutContributingSources = true; |
|---|
| | 2748 | if (printOutContributingSources) |
|---|
| | 2749 | { |
|---|
| | 2750 | CompositeDestination* startPoint = _destinationGraph.get(); |
|---|
| | 2751 | if (getGenerateSubtile()) |
|---|
| | 2752 | { |
|---|
| | 2753 | startPoint = getComposite(getSubtileLevel(), getSubtileX(), getSubtileY()); |
|---|
| | 2754 | } |
|---|
| | 2755 | |
|---|
| | 2756 | DestinationTile::Sources sources = startPoint->getAllContributingSources(); |
|---|
| | 2757 | log(osg::NOTICE,"There are %d contributing source files:",sources.size()); |
|---|
| | 2758 | |
|---|
| | 2759 | for(DestinationTile::Sources::iterator itr = sources.begin(); |
|---|
| | 2760 | itr != sources.end(); |
|---|
| | 2761 | ++itr) |
|---|
| | 2762 | { |
|---|
| | 2763 | log(osg::NOTICE," %s",(*itr)->getFileName().c_str()); |
|---|