MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / setup_redirection

Method setup_redirection

Processor/ProcessorBase.cpp:29–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29void ProcessorBase::setup_redirection(int my_num, int thread_num,
30 OnlineOptions& opts, SwitchableOutput& out, bool real)
31{
32 // only output on party 0 if not interactive
33 bool always_stdout = opts.cmd_private_output_file == ".";
34 bool output = my_num == 0 or opts.interactive or always_stdout;
35 output &= real or always_stdout;
36 out.activate(output);
37
38 if (not (opts.cmd_private_output_file.empty() or always_stdout))
39 {
40 const string stdout_filename = get_parameterized_filename(my_num,
41 thread_num, opts.cmd_private_output_file);
42 stdout_redirect_file.open(stdout_filename.c_str(), ios_base::out);
43 out.redirect_to_file(stdout_redirect_file);
44 }
45}

Callers 2

RealProgramPartyMethod · 0.80
runMethod · 0.80

Calls 4

activateMethod · 0.45
emptyMethod · 0.45
openMethod · 0.45
redirect_to_fileMethod · 0.45

Tested by

no test coverage detected