Whats the fastest lock to use when a few indices in an array is to be locked? I've only used pthread before, so be patient. :-)
Example:
some global array = {0,1,2,3,4,5,6,7,8,9}
...
//omp...
Type: Posts; User: überfuzz
Whats the fastest lock to use when a few indices in an array is to be locked? I've only used pthread before, so be patient. :-)
Example:
some global array = {0,1,2,3,4,5,6,7,8,9}
...
//omp...
OK! I'll wont look into it further, based on the assumption that you know what you're talking about. :-)
THANKS!
Elysia - That's exactly what I planed to do. There is no 'automatic' way of knowing the intervals assigned in a parallel for loop in openmp, right?
I found this: omp_get_num_threads() - should do the trick!
Is there a way of knowing which indices a thread is assigned in a parallel openMP scope?
Maybe i was unclear... Each thread is deleting entries in the assigned array interval. Well lets say Im interested in what to do after the code you posted.
I think ill go with memcpy. Ill monitor...
I have a bunch of numbers in an array, lets say 1,2,3,4,5,6,etc... and assign these to different threads.
processor 0: arraypart = 1,2
processor 1: arraypart = 3,4
etc...
Each processor is going...
I found an old laptop that I'd like to... revive. I tried to run Mint 15 (32bit), with no luck. Does anyone know where I can find older versions of Linux, any distribution. I'm just going to use a...
Thanks to all, dazzling me with their knowledge... and to all eagerly pointing out things frustrating you in the code. I was just parallelizing some stuff and came across some lines I didn't get.
Ok, I see that my first post was missing information.
(*hist) = (int *) malloc( ncolors * sizeof(int) );
// populate histo and nc ...
(*permut_index) = (int *) malloc( n * sizeof(int) );...
OK, I got it. Thanks Meiyrusa!
I using a library and in it there are some lines I don't understand. What does this syntax do?
//array of ints
//index is an integer
(*array)[index]
Hi again!
Ok, this is a version of my code with all other junk deleted.
#include <iostream>
#include <string.h>
#include <stdlib.h>
using namespace std;
#define ValueType int
It should be more like this:
delete_vertex(&node); // This is done in the loop iterating through the linked list.
delete_vertex(struct vertex ** node ){
(*node)->prev->next =...
Thanks for replying. Unfortunately I'm not on my own computer, waiting for a host to fix drinks, beers, snacks and ......... I'll write from memory...
I tried to set it up like this:
...
Ok I got that sorted. Now it turns out I'm having trouble deleting nodes in the list...
I started all over again. The thing is, I have a code that works properly. It iterates through nodes, the nodes are stored in an array. In each iteration about 2/3s is handled and 'marked done'...
Thanks for showing such interest in my code, or whatever you like to call it. ;-) First of all I use C/C++ for the good support of parallelizing libraries. I never really bothered my about the prints...
Still the same result... Here's the updated code:
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
#define ValueType int
Aha, I found this: Setting up Code::Blocks and MINGW, A Free C and C++ Compiler, on Windows - Cprogramming.com. I guess it will solve the compiler part of my query.
I'm recently started using windows. I'm a seasoned Linux user, but this is new and exciting to me.
Is there an (easy) way of getting a compiler for my windows 7? If so, does libraries such as...
Argh, and I missed that? Thanks for pointing it out!
It looks like a school example. I bet your teacher would be thrilled if you'd ask. (I used to work as a teacher)
I remember how I felt when I realised that there are not one living person who has skills worth mentioning in all fields of mathematics...
The issue with code languages, take C/C++ for instance,...
I'm trying to set up a simple implementation of a double linked list. I can't make it fly. Here's my code:
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
...