From 4d2d896e28446928d820bf1353abcf40e3f66ed8 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sun, 1 Mar 2015 13:02:50 +0100 Subject: Switch to OpenMP Replaces quality (target density) parameter with time limit. In preparation for rendering resumption. --- flam3.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'flam3.c') diff --git a/flam3.c b/flam3.c index 3bb89cd..873efbd 100644 --- a/flam3.c +++ b/flam3.c @@ -37,8 +37,6 @@ #include #include -#include - char *flam3_version() { return VERSION; } @@ -182,7 +180,7 @@ int flam3_create_chaos_distrib(flam3_genome *cp, int xi, unsigned short *xform_d */ -int flam3_iterate(flam3_genome *cp, int n, int fuse, const double4 in, double4 *samples, unsigned short *xform_distrib, randctx *rc) { +int flam3_iterate(flam3_genome *cp, int n, int fuse, const double4 in, double4 *samples, const unsigned short *xform_distrib, randctx *rc) { int i; double4 p, q; int consec = 0; @@ -933,7 +931,7 @@ void flam3_copy_xform(flam3_xform *dest, flam3_xform *src) { } /* Copy one control point to another */ -void flam3_copy(flam3_genome *dest, flam3_genome *src) { +void flam3_copy(flam3_genome *dest, const flam3_genome * const src) { int i,ii; int numstd; @@ -1107,32 +1105,6 @@ void clear_cp(flam3_genome *cp, int default_flag) { } - -int flam3_count_nthreads(void) { - int nthreads; - -#ifndef _SC_NPROCESSORS_ONLN - char line[MAXBUF]; - FILE *f = fopen("/proc/cpuinfo", "r"); - if (NULL == f) goto def; - nthreads = 0; - while (fgets(line, MAXBUF, f)) { - if (!strncmp("processor\t:", line, 11)) - nthreads++; - } - fclose(f); - if (nthreads < 1) goto def; - return (nthreads); -def: - fprintf(stderr, "could not read /proc/cpuinfo, using one render thread.\n"); - nthreads = 1; -#else - nthreads = sysconf(_SC_NPROCESSORS_ONLN); - if (nthreads < 1) nthreads = 1; -#endif - return (nthreads); -} - flam3_genome *flam3_parse_xml2(char *xmldata, char *xmlfilename, int default_flag, int *ncps, randctx * const rc) { xmlDocPtr doc; /* Parsed XML document tree */ -- cgit v1.2.3