Commit bbd67d36 authored by Hendryk Bockelmann's avatar Hendryk Bockelmann
Browse files

add patch from Luis to add sct stop time with calling sct_reporter

parent 3f12da06
......@@ -598,6 +598,23 @@ static void report_hdf5(int timer_choice){
status = H5Awrite(attr, attr_type, print_prg_start_time());
status = H5Aclose(attr);
char prg_stop_time_string[40];
#if (HAVE_TIME_H || HAVE_SYS_TIME_H)
struct timeval prg_stop_time;
struct tm * ptm;
gettimeofday(&prg_stop_time, NULL);
ptm = localtime(&prg_stop_time.tv_sec);
strftime(prg_stop_time_string, sizeof(prg_stop_time_string), "%Y-%m-%d %H:%M:%S", ptm);
#else
strcpy(prg_stop_time_string,"not available");
#endif
status = H5Tset_size(attr_type, strlen(prg_stop_time_string)+1);
status = H5Tset_strpad(attr_type, H5T_STR_NULLTERM);
attr = H5Acreate(group_id, "sct stop time", attr_type, attr_id,
H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(attr, attr_type, prg_stop_time_string);
status = H5Aclose(attr);
status = H5Gclose(group_id);
/* add various attributes if attribute_table is not NULL */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment