From 40739ce0cc8b34513698bd4ab0123e5a6b9b75e3 Mon Sep 17 00:00:00 2001
From: Meg Millhouse <meg.millhouse@ldas-pcdev6.ligo.caltech.edu>
Date: Wed, 10 Apr 2024 09:42:04 -0700
Subject: [PATCH] Comment out timing to avoid segfaults

---
 src/BayesLine.c     | 12 ++++++------
 src/BayesWave.c     | 10 +++++-----
 src/BayesWaveMCMC.c | 18 +++++++++---------
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/BayesLine.c b/src/BayesLine.c
index 728e37d1..a38699e3 100644
--- a/src/BayesLine.c
+++ b/src/BayesLine.c
@@ -4304,9 +4304,9 @@ void blstart(double *data, double *residual, int N, double dt, double fmin, int
         fprintf(outFile,"%.15e %.15e\n", (double)(i)/Tobs, SN[i]);
         }
         fclose(outFile);
-        time ( &rawtime );
-        timeinfo = localtime ( &rawtime );
-        printf ("Avg PSD: Current local time and date: %s\n", asctime (timeinfo) );
+        // time ( &rawtime );
+        // timeinfo = localtime ( &rawtime );
+        // printf ("Avg PSD: Current local time and date: %s\n", asctime (timeinfo) );
      
   }
   
@@ -4371,9 +4371,9 @@ void blstart(double *data, double *residual, int N, double dt, double fmin, int
   }
   fclose(outFile);
   
-  time ( &rawtime );
-  timeinfo = localtime ( &rawtime );
-  printf("Fairdraw PSD: Current local time and date: %s\n", asctime (timeinfo) );
+  // time ( &rawtime );
+  // timeinfo = localtime ( &rawtime );
+  // printf("Fairdraw PSD: Current local time and date: %s\n", asctime (timeinfo) );
     
   free(xint);
   free(yint);
diff --git a/src/BayesWave.c b/src/BayesWave.c
index 8b28a52d..4f9ffe8d 100644
--- a/src/BayesWave.c
+++ b/src/BayesWave.c
@@ -58,11 +58,11 @@ int main(int argc, char *argv[])
   char filename[MAXSTRINGSIZE];
   char modelname[MAXSTRINGSIZE];
   
-  time_t rawtime;
-  struct tm * timeinfo;
-  time ( &rawtime );
-  timeinfo = localtime ( &rawtime );
-  printf ("Begin: Current local time and date: %s\n", asctime (timeinfo) );
+  // time_t rawtime;
+  // struct tm * timeinfo;
+  // time ( &rawtime );
+  // timeinfo = localtime ( &rawtime );
+  // printf ("Begin: Current local time and date: %s\n", asctime (timeinfo) );
 
   /* LAL data structure that will contain all of the data from the frame files */
   LALInferenceRunState *runState = XLALCalloc(1,sizeof(LALInferenceRunState));
diff --git a/src/BayesWaveMCMC.c b/src/BayesWaveMCMC.c
index ef5da563..75d988e5 100644
--- a/src/BayesWaveMCMC.c
+++ b/src/BayesWaveMCMC.c
@@ -1330,9 +1330,9 @@ void RJMCMC(struct Data *data, struct Model **model, struct BayesLineParams ***b
 
    time_t rawtime;
    struct tm * timeinfo;
-   time ( &rawtime );
-   timeinfo = localtime ( &rawtime );
-   printf ("Current local time and date: %s\n", asctime (timeinfo) );
+  //  time ( &rawtime );
+  //  timeinfo = localtime ( &rawtime );
+  //  printf ("Current local time and date: %s\n", asctime (timeinfo) );
   /******************************************************************************/
   /*                                                                            */
   /*  Set up checkpointing                                                      */
@@ -1750,15 +1750,15 @@ void RJMCMC(struct Data *data, struct Model **model, struct BayesLineParams ***b
 
     chain->mc+=chain->cycle;
 
-    time ( &rawtime );
-    timeinfo = localtime ( &rawtime );
+    // time ( &rawtime );
+    // timeinfo = localtime ( &rawtime );
 
     // Save progress
     if(__bayeswave_saveStateFlag)
     {
       fprintf(stdout,"Interrupt/Timer message received\n");
       fprintf(stdout,"Saving state to checkpoint directory\n");//,resumefilename);
-      fprintf (stdout, "Current local time and date: %s\n", asctime (timeinfo) );
+      // fprintf (stdout, "Current local time and date: %s\n", asctime (timeinfo) );
       save_sampler(data, chain, model, bayesline, bayescbc, modelname, fprop);
       __bayeswave_saveStateFlag = 0;
       fflush(stdout);
@@ -1777,9 +1777,9 @@ void RJMCMC(struct Data *data, struct Model **model, struct BayesLineParams ***b
   end = clock();
   cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
   printf("RJMCMC took %e seconds\n", cpu_time_used);
-  time ( &rawtime );
-  timeinfo = localtime ( &rawtime );
-  printf ("Current local time and date: %s\n", asctime (timeinfo) );
+  // time ( &rawtime );
+  // timeinfo = localtime ( &rawtime );
+  // printf ("Current local time and date: %s\n", asctime (timeinfo) );
   
   free_double_matrix(fprop,NI);
   
-- 
GitLab