File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ template<class P>
1515static int tree_r_file_impl (const char * last_layer_filename,
1616 const char * data_filename,
1717 const char * output_dir) {
18- topology_t topology (" supra_seal.cfg" );
18+ // File-based TreeR only needs PC2 core affinity. A missing config is not
19+ // fatal — unlike NVMe sealing, this path does not require SPDK devices.
20+ topology_t topology (" supra_seal.cfg" , false );
1921 set_core_affinity (topology.pc2_hasher );
2022
2123 size_t stream_count = P::GetSectorSizeLg () <= 24 ? 8 : 64 ;
Original file line number Diff line number Diff line change @@ -105,13 +105,47 @@ class topology_t {
105105 int c1_sleep_time;
106106 int c1_qpair;
107107
108- topology_t (const char * filename) {
108+ // Defaults used by file-based TreeR (no NVMe / SPDK). pc2_writer_cores
109+ // must be > 0 or the CUDA writer pool will have zero threads.
110+ void set_file_based_defaults () {
111+ hashers_per_core = 1 ;
112+ pc1_reader = 0 ;
113+ pc1_writer = 1 ;
114+ pc1_orchestrator = 2 ;
115+ pc1_qpair_reader = 0 ;
116+ pc1_qpair_writer = 1 ;
117+ pc1_writer_sleep_time = 500 ;
118+ pc1_reader_sleep_time = 250 ;
119+ pc2_reader = 0 ;
120+ pc2_hasher = 0 ;
121+ pc2_hasher_cpu = 1 ;
122+ pc2_writer = 2 ;
123+ pc2_writer_cores = 4 ;
124+ pc2_sleep_time = 200 ;
125+ pc2_qpair = 2 ;
126+ c1_reader = 0 ;
127+ c1_sleep_time = 200 ;
128+ c1_qpair = 3 ;
129+ }
130+
131+ topology_t () {
132+ set_file_based_defaults ();
133+ }
134+
135+ // required=true (default) exits if the file cannot be read — used by NVMe
136+ // batch sealing. required=false keeps defaults so file-based TreeR works
137+ // without a dummy supra_seal.cfg in the process working directory.
138+ topology_t (const char * filename, bool required = true ) {
139+ set_file_based_defaults ();
109140 Config cfg;
110141 try {
111142 cfg.readFile (filename);
112143 } catch (const FileIOException &fioex) {
113- std::cerr << " Could not read config file " << filename << std::endl;
114- exit (1 );
144+ if (required) {
145+ std::cerr << " Could not read config file " << filename << std::endl;
146+ exit (1 );
147+ }
148+ return ;
115149 } catch (const ParseException &pex) {
116150 std::cerr << " Parse error at " << pex.getFile () << " :" << pex.getLine ()
117151 << " - " << pex.getError () << std::endl;
You can’t perform that action at this time.
0 commit comments