Extracted (nearly identical) function DelaySeconds.

master
Julian M. Kunkel 2018-07-07 22:26:57 +01:00
parent 6f8d2e8845
commit 48c17b4d81
4 changed files with 14 additions and 33 deletions

View File

@ -670,18 +670,6 @@ static void DestroyTests(IOR_test_t *tests_head)
}
}
/*
* Sleep for 'delay' seconds.
*/
static void DelaySecs(int delay)
{
if (rank == 0 && delay > 0) {
if (verbose >= VERBOSE_1)
fprintf(out_logfile, "delaying %d seconds . . .\n", delay);
sleep(delay);
}
}
/*
* Display freespace (df).
*/

View File

@ -174,25 +174,6 @@ typedef struct{
enum {MK_UNI_DIR, STAT_SUB_DIR, READ_SUB_DIR, RM_SUB_DIR, RM_UNI_DIR};
void delay_secs(int delay) {
if (( rank == 0 ) && ( verbose >= 1 )) {
fprintf( out_logfile, "V-1: Entering delay_secs...\n" );
fflush( out_logfile );
}
if (rank == 0 && delay > 0) {
if (verbose >= 1) {
fprintf(out_logfile, "delaying %d seconds . . .\n", delay);
fflush(out_logfile);
}
sleep(delay);
}
MPI_Barrier(testComm);
}
void offset_timers(double * t, int tcount) {
double toffset;
int i;
@ -1938,13 +1919,13 @@ static void mdtest_iteration(int i, int j, MPI_Group testgroup, mdtest_results_t
if (dirs_only && !shared_file) {
if (pre_delay) {
delay_secs(pre_delay);
DelaySecs(pre_delay);
}
directory_test(j, i, unique_mk_dir, progress);
}
if (files_only) {
if (pre_delay) {
delay_secs(pre_delay);
DelaySecs(pre_delay);
}
file_test(j, i, unique_mk_dir, progress);
}

View File

@ -586,3 +586,14 @@ void StoreStoneWallingIterations(char * const filename, int64_t count){
fprintf(out, "%lld", (long long) count);
fclose(out);
}
/*
* Sleep for 'delay' seconds.
*/
void DelaySecs(int delay){
if (rank == 0 && delay > 0) {
if (verbose >= VERBOSE_1)
fprintf(out_logfile, "delaying %d seconds . . .\n", delay);
sleep(delay);
}
}

View File

@ -55,6 +55,7 @@ void SeedRandGen(MPI_Comm);
void SetHints (MPI_Info *, char *);
void ShowHints (MPI_Info *);
int CountTasksPerNode(MPI_Comm comm);
void DelaySecs(int delay);
/* Returns -1, if cannot be read */
int64_t ReadStoneWallingIterations(char * const filename);