61 const map<String, Index>::const_iterator i2 =
MdMap.find(methodname);
62 assert(i2 !=
MdMap.end());
63 Index id = i2->second;
107 Index this_wsv = this_data.
Out()[i];
111 os <<
"The agenda " <<
mname <<
" must generate the output WSV "
113 <<
"but it does not. It only generates:\n";
116 throw runtime_error(os.str());
124 Index this_wsv = this_data.
In()[i];
128 os <<
"The agenda " <<
mname <<
" must use the input WSV "
130 <<
"but it does not. It only uses:\n";
133 throw runtime_error(os.str());
151 os <<
"Agenda *" <<
mname <<
"* hasn't been checked for consistency yet."
153 <<
"This check is usually done by AgendaSet or AgendaAppend." << endl
154 <<
"There are two possible causes for this:" << endl
155 <<
"1) You're trying to execute an agenda that has been created in"
157 <<
" the controlfile with AgendaCreate. This is not allowed. You have"
159 <<
" to use *Copy* to store it into one of the predefined agendas and"
161 <<
" execute that one." << endl
162 <<
"2) Developer error: If you have written code that modifies an Agenda"
164 <<
" directly (changing its name or altering its method list), it's up"
166 <<
" to you to call Agenda::check in your code after your modifications.";
167 throw runtime_error(os.str());
192 aout1 <<
"Executing " <<
name() <<
"\n"
209 out3 <<
"- " + mdd.
Name() +
"\n";
211 out1 <<
"- " + mdd.
Name() +
"\n";
221 "Method " + mdd.
Name() +
230 throw runtime_error(
"Method " + mdd.
Name() +
231 " needs input variable: " +
238 }
catch (
const std::bad_alloc&
x) {
242 os <<
"Memory allocation error in method: " << mdd.
Name() <<
'\n'
243 <<
"For memory intensive jobs it could help to limit the\n"
244 <<
"number of threads with the -n option.\n"
247 throw runtime_error(os.str());
248 }
catch (
const std::exception&
x) {
252 os <<
"Run-time error in method: " << mdd.
Name() <<
'\n' <<
x.what();
254 throw runtime_error(os.str());
278 set<Index> outs2push;
281 const Index WsmAgendaExecuteIndex =
MdMap.find(
"AgendaExecute")->second;
282 const Index WsmAgendaExecuteExclIndex =
283 MdMap.find(
"AgendaExecuteExclusive")->second;
284 const Index WsmDeleteIndex =
MdMap.find(
"Delete")->second;
295 souts.insert(gouts.begin(), gouts.end());
299 inputs.insert(gins.begin(), gins.end());
305 if (method->Id() == WsmDeleteIndex) {
306 souts.insert(gins.begin(), gins.end());
313 if (method->Id() == WsmAgendaExecuteIndex ||
314 method->Id() == WsmAgendaExecuteExclIndex) {
316 if (
md_data[method->Id()].GInType()[j] == WsvAgendaGroupIndex) {
318 const map<String, Index>::const_iterator agenda_it =
323 os <<
"Manual execution of the agenda \"" << agenda_name
324 <<
"\" is not supported.";
325 throw std::runtime_error(os.str());
328 souts.insert(agouts.begin(), agouts.end());
330 inputs.insert(agins.begin(), agins.end());
336 outputs.insert(souts.begin(), souts.end());
341 set_intersection(souts.begin(),
345 insert_iterator<set<Index> >(outs2dup, outs2dup.begin()));
352 inputs.insert(output[mdinout[j]]);
357 set_difference(outputs.begin(),
361 insert_iterator<set<Index> >(outs2push, outs2push.begin()));
372 saout.insert(aout.begin(), aout.end());
373 sain.insert(ain.begin(), ain.end());
381 set<Index> outs2push_without_agenda_input;
387 insert_iterator<set<Index> >(outs2push_without_agenda_input,
388 outs2push_without_agenda_input.begin()));
392 outs2push_without_agenda_input.begin(),
393 outs2push_without_agenda_input.end(),
401 set<Index> outs2dup_without_agenda_input;
407 insert_iterator<set<Index> >(outs2dup_without_agenda_input,
408 outs2dup_without_agenda_input.begin()));
412 outs2dup_without_agenda_input.begin(),
413 outs2dup_without_agenda_input.end(),
422 set<Index> saout_only;
424 set_difference(saout.begin(),
428 insert_iterator<set<Index> >(saout_only, saout_only.begin()));
431 set_intersection(outs2dup.begin(),
435 insert_iterator<ArrayOfIndex>(
436 agenda_only_out_wsm_in, agenda_only_out_wsm_in.begin()));
442 set<Index> sain_only;
444 set_difference(sain.begin(),
448 insert_iterator<set<Index> >(sain_only, sain_only.begin()));
451 set_intersection(outs2push.begin(),
455 insert_iterator<ArrayOfIndex>(
456 agenda_only_in_wsm_out, agenda_only_in_wsm_out.begin()));
460 out3 <<
" [Agenda::pushpop] : " <<
name() <<
"\n";
461 out3 <<
" [Agenda::pushpop] - # Funcs in Ag : " <<
mml.
nelem() <<
"\n";
462 out3 <<
" [Agenda::pushpop] - AgOut : ";
465 out3 <<
" [Agenda::pushpop] - AgIn : ";
468 out3 <<
" [Agenda::pushpop] - All WSM output: ";
471 out3 <<
" [Agenda::pushpop] - All WSM input : ";
474 out3 <<
" [Agenda::pushpop] - Output WSVs push : ";
477 out3 <<
" [Agenda::pushpop] - Output WSVs dup : ";
480 out3 <<
" [Agenda::pushpop] - Ag inp dup : ";
483 out3 <<
" [Agenda::pushpop] - Ag out dup : ";
506 const Index WsmAgendaExecuteIndex =
MdMap.find(
"AgendaExecute")->second;
507 const Index WsmAgendaExecuteExclIndex =
508 MdMap.find(
"AgendaExecuteExclusive")->second;
528 if (
var == input[j])
return true;
536 if (
var == output[mdinout[j]])
return true;
542 if (this_method.
Id() == WsmAgendaExecuteIndex ||
543 this_method.
Id() == WsmAgendaExecuteExclIndex) {
544 for (
Index j = 0; j <
md_data[this_method.
Id()].GInType().nelem();
546 if (
md_data[this_method.
Id()].GInType()[j] == WsvAgendaGroupIndex) {
548 const map<String, Index>::const_iterator agenda_it =
553 os <<
"Manual execution of the agenda \"" << agenda_name
554 <<
"\" is not supported.";
555 throw std::runtime_error(os.str());
559 if (
var == agins[k])
return true;
588 const Index WsmAgendaExecuteIndex =
MdMap.find(
"AgendaExecute")->second;
589 const Index WsmAgendaExecuteExclIndex =
590 MdMap.find(
"AgendaExecuteExclusive")->second;
606 if (
var == output[j])
return true;
612 if (this_method.
Id() == WsmAgendaExecuteIndex ||
613 this_method.
Id() == WsmAgendaExecuteExclIndex) {
614 for (
Index j = 0; j <
md_data[this_method.
Id()].GInType().nelem();
616 if (
md_data[this_method.
Id()].GInType()[j] == WsvAgendaGroupIndex) {
617 const String& agenda_name =
619 const map<String, Index>::const_iterator agenda_it =
624 os <<
"Manual execution of the agenda \"" << agenda_name
625 <<
"\" is not supported.";
626 throw std::runtime_error(os.str());
630 if (agouts[k] ==
var)
return true;
677 !found && it !=
mml.end();
679 if (
md_data[it->Id()].Name() == methodname) found =
true;
699 mml[i].print(os, indent);
752 os << indent << tmd.
Name();
785 os << indent <<
"}\n";