text
stringlengths
0
234
procedure get_command_args
is
begin
for i in 1 .. Argument_Count loop
declare
the_arg : String := Argument (i);
the_len : Integer := the_arg'last;
the_flag : flags;
begin
if the_len > 1 then
if the_arg (1) = '-' then
the_flag := to_flags (the_arg (2));
cmd_args (the_flag) := (exists => True,
image => the_arg (2),
index => i,
value => str (the_arg (3..the_len),max_arg_length));
end if;
end if;
Function Definition: procedure write_results is
Function Body: num_loop_str : String := fill_str (num_loop, 5, '0');
begin
set_constraints;
Ada.Directories.create_path (results_directory & "/xy/");
Ada.Directories.create_path (results_directory & "/xz/");
Ada.Directories.create_path (results_directory & "/yz/");
write_results (xy_index_list, xy_index_num, results_directory & "/xy/" & num_loop_str & ".txt");
write_results (xz_index_list, xz_index_num, results_directory & "/xz/" & num_loop_str & ".txt");
write_results (yz_index_list, yz_index_num, results_directory & "/yz/" & num_loop_str & ".txt");
end write_results;
procedure write_history (point : GridPoint;
file_name : String)
is
txt : File_Type;
i, j, k : Integer;
x, y, z : Real;
begin
i := sample_point.i;
j := sample_point.j;
k := sample_point.k;
x := sample_point.x;
y := sample_point.y;
z := sample_point.z;
begin
Open (txt, Append_File, file_name);
exception when Name_Error =>
Create (txt, Out_File, file_name);
Put_Line (txt, "# 4 more lines before the data");
Put_Line (txt, "# 11 columns of data");
Put_Line (txt,"# (" & str (i,0) & ", " &
str (j,0) & ", " &
str (k,0) & ") = grid indices of target");
Put_Line (txt,"# (" & str (x,10) & ", " &
str (y,10) & ", " &
str (z,10) & ") = grid coords of target");
Put_Line (txt, "# " &
centre ("Time",10) &
centre ("gxx",11) &
centre ("gyy",11) &
centre ("gzz",11) &
centre ("Kxx",11) &
centre ("Kyy",11) &
centre ("Kzz",11) &
centre ("Ham",11) &
centre ("Mom(x)",11) &
centre ("Mom(y)",11) &
centre ("Mom(z)",11));
Function Definition: procedure evolve_data is
Function Body: looping : Boolean;
task type SlaveTask is
entry resume;
entry pause;
entry release;
entry set_params (slave_params : SlaveParams);
end SlaveTask;
task body SlaveTask is
params : SlaveParams;
begin
-- collect parameters for this task ------------------------