mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-27 04:32:55 +00:00
omped it up
This commit is contained in:
parent
bf2d9de16a
commit
9c331dce49
@ -338,6 +338,9 @@ void update_stuff(void)
|
||||
/* clear speeds and up status in case device was removed and doesn't get
|
||||
* updated */
|
||||
|
||||
#ifdef HAVE_OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif /* HAVE_OPENMP */
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (netstats[i].dev) {
|
||||
netstats[i].up = 0;
|
||||
|
21
src/conky.c
21
src/conky.c
@ -3898,9 +3898,15 @@ static void generate_text_internal(char *p, int p_max_size,
|
||||
#endif
|
||||
if(!obj->a) obj->a = DEFAULT_BAR_WIDTH_NO_X;
|
||||
barnum = round_to_int( ( barnum * obj->a ) / 100);
|
||||
#ifdef HAVE_OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif /* HAVE_OPENMP */
|
||||
for(i=0; i<barnum; i++) {
|
||||
*(p+i)='#';
|
||||
}
|
||||
#ifdef HAVE_OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif /* HAVE_OPENMP */
|
||||
for(; i < obj->a; i++) {
|
||||
*(p+i)='_';
|
||||
}
|
||||
@ -5288,13 +5294,22 @@ static void generate_text_internal(char *p, int p_max_size,
|
||||
struct text_object * objsub = obj->sub;
|
||||
|
||||
p[0]=0;
|
||||
#ifdef HAVE_OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif /* HAVE_OPENMP */
|
||||
for(i=0; i<2; i++) {
|
||||
nr_rows[i] = 1;
|
||||
nextstart = 0;
|
||||
ll_rows[i] = malloc(sizeof(struct llrows));
|
||||
current[i] = ll_rows[i];
|
||||
#ifdef HAVE_OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif /* HAVE_OPENMP */
|
||||
for(j=0; j<i; j++) objsub = objsub->sub;
|
||||
generate_text_internal(buf[i], max_user_text, *objsub, cur);
|
||||
#ifdef HAVE_OPENMP
|
||||
#pragma omp parallel for reduction (+:nr_rows[i])
|
||||
#endif /* HAVE_OPENMP */
|
||||
for(j=0; buf[i][j] != 0; j++) {
|
||||
if(buf[i][j] == '\t') buf[i][j] = ' ';
|
||||
if(buf[i][j] == '\n') {
|
||||
@ -5326,8 +5341,14 @@ static void generate_text_internal(char *p, int p_max_size,
|
||||
strcat(p, current[1]->row);
|
||||
}
|
||||
strcat(p, "\n");
|
||||
#ifdef HAVE_OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif /* HAVE_OPENMP */
|
||||
for(i=0; i<2; i++) if(current[i]) current[i]=current[i]->next;
|
||||
}
|
||||
#ifdef HAVE_OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif /* HAVE_OPENMP */
|
||||
for(i=0; i<2; i++) {
|
||||
while(ll_rows[i] != NULL) {
|
||||
current[i]=ll_rows[i];
|
||||
|
@ -53,6 +53,9 @@ set_temp_output_unit(const char *name)
|
||||
return 1;
|
||||
|
||||
buf = strdup(name);
|
||||
#ifdef HAVE_OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif /* HAVE_OPENMP */
|
||||
for (i = 0; i < strlen(name); i++)
|
||||
buf[i] = tolower(name[i]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user