ifeq ($(dbg),1)
DBGFLAG = -g
else
- DBGFLAG = -O3
+ DBGFLAG = -O3 -combine
endif
# now the actual build rules, pretty general
$(EXECNAME): $(SRCS)
$(CXX) $(SRCS) $(CFLAGS) $(LIBDIR) $(INCLUDEDIR) -o $(EXECNAME) $(LIBS)
+
+# concatenate all the source files before compiling
+# ./concat.sh $(EXECNAME) $(SRCS)
+# $(CXX) -x c++ $(EXECNAME).combined $(CFLAGS) $(LIBDIR) $(INCLUDEDIR) -o $(EXECNAME) $(LIBS)
+
# $(CXX) $(SRCS) $(CFLAGS) $(LFLAGS) $(INCLUDES) $(LIBS) -o $(EXECNAME)
# $(CXX) $(CFLAGS) $(INCLUDES) -o $(EXECNAME) $(OBJS) $(LFLAGS) $(LIBS)
clean:
$(RM) *.o $(EXECNAME)
+# $(RM) *.o *.combined $(EXECNAME)
// Run the program
-void run(RunParameters &r) {
+void run(RunParameters &r, unsigned seed) {
// Initialize RNG and set initial state, if importing from file
//srand((unsigned)time(0));
//gsl_rng_set(rnd,rand());
- gsl_rng_set(rnd,sim_random_seed());
+ gsl_rng_set(rnd,seed);
r.setFiles();
FILE *popout=fopen(r.trajectoryOutfile.c_str(),"w"); // <outfile>.dat
unsigned int i;
for (i=0; i<r.g; ++i) {
+ //printf("%d\t%d\n",n,i);
P.next_generation(H, rnd, r.useRelative, r.useVerbose);
P.write_two_site_population(popout,H,i+1);
int main(int argc, char *argv[]) {
RunParameters r;
+
+ unsigned seed = sim_random_seed();
// Process command line input
else if (strcmp(argv[i],"-p01")==0) { if (++i==argc) break; else add_to_two_site_pop(r,false,true ,strtodouble(argv[i])); }
else if (strcmp(argv[i],"-p11")==0) { if (++i==argc) break; else add_to_two_site_pop(r,true ,true ,strtodouble(argv[i])); }
+ else if (strcmp(argv[i],"-seed")==0) { if (++i==argc) break; else seed=(unsigned)strtodouble(argv[i]); }
else if (strcmp(argv[i],"-h")==0) { usage(); return 0; }
}
- run(r);
+ std::cout << "seed = " << seed << "\n";
+ run(r,seed);
return 0;