[Yt-svn] yt-commit r1218 - trunk/yt/lagos/hop

sskory at wrangler.dreamhost.com sskory at wrangler.dreamhost.com
Tue Mar 17 15:25:33 PDT 2009


Author: sskory
Date: Tue Mar 17 15:25:33 2009
New Revision: 1218
URL: http://yt.spacepope.org/changeset/1218

Log:
a temporary fix to a temporary file creation problem on Kraken.

Modified:
   trunk/yt/lagos/hop/hop_regroup.c

Modified: trunk/yt/lagos/hop/hop_regroup.c
==============================================================================
--- trunk/yt/lagos/hop/hop_regroup.c	(original)
+++ trunk/yt/lagos/hop/hop_regroup.c	Tue Mar 17 15:25:33 2009
@@ -11,6 +11,8 @@
 #include <stdio.h>
 #include <limits.h>
 #include <float.h>
+#include <time.h>
+#include <sys/types.h>
 //#include "macros_and_parameters.h"
 #include "hop.h"
 
@@ -404,13 +406,13 @@
     Group *gr;
     float *densestbound, fdum[3], dens;
     int *densestboundgroup, changes;
-    char line[80], *tempfilename;
+    char line[80]; /*, *tempfilename; */
+    char tempfilename[256];
     FILE *fp;
     FILE *boundfp;
     float *gdensity = my_comm->gdensity;
     ngroups = my_comm->ngroups;
 
-    tempfilename = tmpnam(NULL);
     if (densthresh<MINDENS) densthresh=MINDENS;
 	/* Have a 2*MINDENS condition below... */
     densestbound = vector(0,ngroups-1);
@@ -440,6 +442,12 @@
     for the lower density group, then record this information */
     /* If neither group is above peakdensthresh, skip the boundary */
  
+    time_t t1;
+    long rand_int;
+    (void) time(&t1);
+    srand48((long) t1); /* use time in seconds to set seed */
+    rand_int = lrand48();
+    sprintf(tempfilename,"%032d",rand_int);
     if ((boundfp=fopen(tempfilename,"w"))==NULL)
 	myerror("Error opening scratch file");
  



More information about the yt-svn mailing list