Пример #1
0
void rmsummary_print(FILE *stream, struct rmsummary *s, struct rmsummary *limits, char *preamble, char *epilogue)
{
	if(preamble)
		fprintf(stream, "%s", preamble);

	if(s->command)
		fprintf(stream, "%s %s\n",  "command:", s->command);

	if(s->category)
		fprintf(stream, "%-15s%s\n",  "category:", s->category);

	if(s->exit_type)
		fprintf(stream, "%-20s%20s\n",  "exit_type:", s->exit_type);

	fprintf(stream, "%-20s%20" PRId64 "\n",  "exit_status:", s->exit_status);

	if(s->exit_type)
	{
		if( strcmp(s->exit_type, "signal") == 0 )
			fprintf(stream, "%-20s%20" PRId64 "\n",  "signal:", s->signal);
		else if( strcmp(s->exit_type, "limits") == 0 )
			fprintf(stream, "%-20s%s\n",  "limits_exceeded:", s->limits_exceeded);
	}

	rmsummary_print_only_resources(stream, s, "");

	if(limits) {
		rmsummary_print_only_resources(stream, limits, "limits_");
	}

	if(epilogue)
		fprintf(stream, "%s", epilogue);

	fprintf(stream, "--\n\n");
}
Пример #2
0
void rmsummary_print(FILE *stream, struct rmsummary *s)
{
	if(s->command)
		fprintf(stream, "%-15s%s\n",  "command:", s->command);

	if(s->cores > -1)
		fprintf(stream, "%-20s%20" PRId64 "\n",  "cores:", s->cores);

	if(s->start > -1)
		fprintf(stream, "%-20s%20lf s\n", "start:", s->start / 1000000e0);

	if(s->end > -1)
		fprintf(stream, "%-20s%20lf s\n", "end:",  s->end / 1000000e0);

	if(s->exit_type)
		fprintf(stream, "%-20s%20s\n",  "exit_type:", s->exit_type);

	if(s->exit_status)
		fprintf(stream, "%-20s%20" PRId64 "\n",  "exit_status:", s->exit_status);

	if(s->exit_type)
	{
		if( strcmp(s->exit_type, "signal") == 0 )
			fprintf(stream, "%-20s%20" PRId64 "\n",  "signal:", s->signal);
		else if( strcmp(s->exit_type, "limits") == 0 )
			fprintf(stream, "%-20s%s\n",  "limits_exceeded:", s->limits_exceeded);
	}

	rmsummary_print_only_resources(stream, s, "");
}