Displaying 20 results from an estimated 66 matches for "num_threads".
2009 Mar 18
3
[LLVMdev] Status of LLVM's atomic intrinsics
...c -o waitfree
/tmp/cc6t7jaO.o: In function `inc_count(void*)':
(.text+0x2ee): undefined reference to `__sync_add_and_fetch_4'
collect2: ld returned 1 exit status
The source is:
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#define NUM_THREADS 9
#define TCOUNT (1 << 23)
#define COUNT_LIMIT (1 << 25)
volatile int count = 0;
pthread_mutex_t count_mutex;
pthread_cond_t count_threshold_cv;
void *inc_count(void *t)
{
int j,i;
double result=0.0;
long my_id = (long)t;
for (i=0; i<TCOUNT; i++) {
//void *data = mal...
2008 Jul 16
2
[PATCH] stopmachine: add stopmachine_timeout v2
...ons(-)
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 5b72c2b..2968b8a 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -35,15 +35,18 @@ struct stop_machine_data {
};
/* Like num_online_cpus(), but hotplug cpu uses us, so we need this. */
-static unsigned int num_threads;
+static atomic_t num_threads;
static atomic_t thread_ack;
+static cpumask_t prepared_cpus;
static struct completion finished;
static DEFINE_MUTEX(lock);
+unsigned long stopmachine_timeout = 200; /* msecs, arbitrary */
+
static void set_state(enum stopmachine_state newstate)
{
/* Reset ack...
2008 Jul 16
2
[PATCH] stopmachine: add stopmachine_timeout v2
...ons(-)
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 5b72c2b..2968b8a 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -35,15 +35,18 @@ struct stop_machine_data {
};
/* Like num_online_cpus(), but hotplug cpu uses us, so we need this. */
-static unsigned int num_threads;
+static atomic_t num_threads;
static atomic_t thread_ack;
+static cpumask_t prepared_cpus;
static struct completion finished;
static DEFINE_MUTEX(lock);
+unsigned long stopmachine_timeout = 200; /* msecs, arbitrary */
+
static void set_state(enum stopmachine_state newstate)
{
/* Reset ack...
2008 Jul 17
1
[PATCH] stopmachine: add stopmachine_timeout v4
...to run
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 5b72c2b..9059b9e 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -35,15 +35,18 @@ struct stop_machine_data {
};
/* Like num_online_cpus(), but hotplug cpu uses us, so we need this. */
-static unsigned int num_threads;
+static atomic_t num_threads;
static atomic_t thread_ack;
+static cpumask_t prepared_cpus;
static struct completion finished;
static DEFINE_MUTEX(lock);
+unsigned long stopmachine_timeout; /* msecs, default is 0 = "never timeout" */
+
static void set_state(enum stopmachine_state ne...
2008 Jul 17
1
[PATCH] stopmachine: add stopmachine_timeout v4
...to run
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 5b72c2b..9059b9e 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -35,15 +35,18 @@ struct stop_machine_data {
};
/* Like num_online_cpus(), but hotplug cpu uses us, so we need this. */
-static unsigned int num_threads;
+static atomic_t num_threads;
static atomic_t thread_ack;
+static cpumask_t prepared_cpus;
static struct completion finished;
static DEFINE_MUTEX(lock);
+unsigned long stopmachine_timeout; /* msecs, default is 0 = "never timeout" */
+
static void set_state(enum stopmachine_state ne...
2018 Nov 30
1
Xapian Benchmark results
...getting the
search results correctly but I am just not able to get over the fact that
xapian is performing so much faster than my other implementations. There
have been no optimizations in my code. Awaiting your response.
Regards,
Krishna Bharadwaj
-------------- next part --------------
#define NUM_THREADS 4
void parallel_index(int tid, int num_threads,vector<string> documents,Xapian::WritableDatabase *db )
{
int i =0;
char line[2048];
string line_string;
Xapian::TermGenerator indexer;
Xapian::Stem stemmer("english");
indexer.set_stemmer(stemmer);
// doc....
2012 Jul 27
2
[PATCH] btrfs-progs: btrfs-image.c: Added NULL pointer check.
...Nageswara R Sastry <nasastry@in.ibm.com>
---
btrfs-image.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/btrfs-image.c b/btrfs-image.c
index f2bbcc8..2a33a55 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -491,6 +491,7 @@ static int create_metadump(const char *input, FILE *out, int num_threads,
int ret;
root = open_ctree(input, 0, 0);
+ BUG_ON(!root);
BUG_ON(root->nodesize != root->leafsize);
ret = metadump_init(&metadump, root, out, num_threads,
--
1.7.11.1
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a messag...
2012 Sep 27
1
CAM Target Layer and Linux (continued)
Hi All,
With the help of Chuck Tuffli, I'm now able to use CTL to export a zvol over FC to a Linux host:
LUN Backend Size (Blocks) BS Serial Number Device ID
0 block 4185915392 512 FBSDZFS001 ORA_ASM_01
lun_type=0
num_threads=14
file=/dev/zvol/tank/oracle_asm_01
1 block 4185915392 512 FBSDZFS002 ORA_ASM_02
lun_type=0
num_threads=14
file=/dev/zvol/tank/oracle_asm_02
2 block 4185915392 512 FBSDZFS003 ORA_ASM_03
lun_type=0
num_threads=1...
2009 Nov 18
2
[LLVMdev] lli -force-interpreter complains about external function
...quot;, f);
return 0;
}
========================
$ llvm-gcc -o hellosin.bc -emit-llvm -c hellosin.c
$ lli -force-interpreter=true hellosin.bc
hello sin: 0.00
$ lli hellosin.bc
hello sin: 0.50
phello.c
========================
#include <pthread.h>
#include <stdio.h>
#define NUM_THREADS 4
void *PrintHello(void *threadid)
{
long tid;
tid = (long)threadid;
printf("Hello from %ld.\n", tid);
pthread_exit(NULL);
}
int main (int argc, char *argv[])
{
pthread_t threads[NUM_THREADS];
int ret;
long t;
for(t=0; t<NUM_THREADS; t++){
#ifdef DEBUG...
2009 Mar 18
0
[LLVMdev] Status of LLVM's atomic intrinsics
...I
think... it's also possible there just isn't anything mapped to
__sync_add_and_fetch_4 in Intrinsics.td).
Luke
>
> The source is:
>
> #include <pthread.h>
> #include <unistd.h>
> #include <stdio.h>
> #include <stdlib.h>
>
> #define NUM_THREADS 9
> #define TCOUNT (1 << 23)
> #define COUNT_LIMIT (1 << 25)
>
> volatile int count = 0;
> pthread_mutex_t count_mutex;
> pthread_cond_t count_threshold_cv;
>
> void *inc_count(void *t)
> {
> int j,i;
> double result=0.0;
> long my_id = (lon...
2009 Nov 18
0
[LLVMdev] lli -force-interpreter complains about external function
...$ llvm-gcc -o hellosin.bc -emit-llvm -c hellosin.c
> $ lli -force-interpreter=true hellosin.bc
> hello sin: 0.00
> $ lli hellosin.bc
> hello sin: 0.50
>
> phello.c
> ========================
> #include <pthread.h>
> #include <stdio.h>
> #define NUM_THREADS 4
>
> void *PrintHello(void *threadid)
> {
> long tid;
> tid = (long)threadid;
> printf("Hello from %ld.\n", tid);
> pthread_exit(NULL);
> }
>
> int main (int argc, char *argv[])
> {
> pthread_t threads[NUM_THREADS];
> int ret;...
2017 Jan 20
9
[RFC] IR-level Region Annotations
Hi Sanjoy,
Yes, that's exactly what we have been looking at recently here, but the region tags seem to make it possible to express the control flow as well, so I think we could start with reg ions+metadata, as Hal and Xinmin proposed, and then figure out what needs to be first class instructions.
--Vikram Adve
> On Jan 19, 2017, at 11:03 PM, Sanjoy Das <sanjoy at
2009 Nov 18
3
[LLVMdev] lli -force-interpreter complains about external function
...m -c hellosin.c
> $ lli -force-interpreter=true hellosin.bc
> hello sin: 0.00
> $ lli hellosin.bc
> hello sin: 0.50
>
> phello.c
> ========================
> #include <pthread.h>
> #include <stdio.h>
> #define NUM_THREADS 4
>
> void *PrintHello(void *threadid)
> {
> long tid;
> tid = (long)threadid;
> printf("Hello from %ld.\n", tid);
> pthread_exit(NULL);
> }
>
> int main (int argc, char *argv[])
> {
> pthr...
2017 Jan 21
2
[RFC] IR-level Region Annotations
...97.html
—
Mehdi
>
> { void main() {
> i32* val = alloca i32
> i32* I = alloca 32
> i32* priv_val = alloca i32
> i32* priv_i alloca 32
> tok = llvm.experimental.intrinsic_a()[ "DIR.PARALLEL"(),"QUAL.PRIVATE"(i32* %priv_val, i32 %priv_i), "QUAL.NUM_THREADS"(i32 4)]
>
> %priv_i = omp_get_thread_num();
> compute_something_into_val(%priv_val, %priv_i);
> a[priv_i] = %priv_val;
>
> llvm.experimental.intrinsic_b(tok)["DIR.END.PARALLEL"()];
> ....
>
> I =
> Val =
> Foo(val, i).
> }
>
&...
2017 Jan 20
5
[RFC] IR-level Region Annotations
...loca instruction outside the region. There are some small changes in optimizer to understand region-annotation intrinsic.
>
> { void main() {
> i32* val = alloca i32
> tok = llvm.experimental.intrinsic_a()[ "DIR.PARALLEL"(), "QUAL.PRIVATE"(i32* val), "QUAL.NUM_THREADS"(i32 4)]
>
> int i = omp_get_thread_num();
> compute_something_into_val(val, i);
> a[i] = val;
>
> llvm.experimental.intrinsic_b(tok)["DIR.END.PARALLEL"()];
> }
>
> With above representation, we can do privatization and outlining as below
>
>...
2017 Feb 01
0
[RFC] IR-level Region Annotations
...97.html
—
Mehdi
>
> { void main() {
> i32* val = alloca i32
> i32* I = alloca 32
> i32* priv_val = alloca i32
> i32* priv_i alloca 32
> tok = llvm.experimental.intrinsic_a()[ "DIR.PARALLEL"(),"QUAL.PRIVATE"(i32* %priv_val, i32 %priv_i), "QUAL.NUM_THREADS"(i32 4)]
>
> %priv_i = omp_get_thread_num();
> compute_something_into_val(%priv_val, %priv_i);
> a[priv_i] = %priv_val;
>
> llvm.experimental.intrinsic_b(tok)["DIR.END.PARALLEL"()];
> ....
>
> I =
> Val =
> Foo(val, i).
> }
>
&...
2017 Feb 01
2
[RFC] IR-level Region Annotations
...t;>
>> { void main() {
>> i32* val = alloca i32
>> i32* I = alloca 32
>> i32* priv_val = alloca i32
>> i32* priv_i alloca 32
>> tok = llvm.experimental.intrinsic_a()[ "DIR.PARALLEL"(),"QUAL.PRIVATE"(i32* %priv_val, i32 %priv_i), "QUAL.NUM_THREADS"(i32 4)]
>>
>> %priv_i = omp_get_thread_num();
>> compute_something_into_val(%priv_val, %priv_i);
>> a[priv_i] = %priv_val;
>>
>> llvm.experimental.intrinsic_b(tok)["DIR.END.PARALLEL"()];
>> ....
>>
>> I =
>> Val =
&g...
2009 Nov 18
0
[LLVMdev] lli -force-interpreter complains about external function
...li -force-interpreter=true hellosin.bc
>> hello sin: 0.00
>> $ lli hellosin.bc
>> hello sin: 0.50
>>
>> phello.c
>> ========================
>> #include <pthread.h>
>> #include <stdio.h>
>> #define NUM_THREADS 4
>>
>> void *PrintHello(void *threadid)
>> {
>> long tid;
>> tid = (long)threadid;
>> printf("Hello from %ld.\n", tid);
>> pthread_exit(NULL);
>> }
>>
>> int main (int argc, char *argv...
2017 Jan 20
3
[RFC] IR-level Region Annotations
...nnotate the outlined function together with the intrinsic_a so
> that hoisting can be performed, in which case the instrisic_a would like
> this:
>
>
>
> tok = llvm.experimental.intrinsic_a()[ "DIR.PARALLEL"(), "QUAL.PRIVATE"(i32*
> %val, i32 %i), "QUAL.NUM_THREADS"(i32 4) plus info for OUTLINED_call.
>
>
>
> Mehdi,
>
>
>
> I think i am asking the same question as you asked me.
>
>
>
> Yonghong
>
>
>
>
>
>
>
> On Fri, Jan 20, 2017 at 1:54 PM, Mehdi Amini via llvm-dev
> <llvm-dev at lists.l...
2017 Feb 01
0
[RFC] IR-level Region Annotations
...t;>
>> { void main() {
>> i32* val = alloca i32
>> i32* I = alloca 32
>> i32* priv_val = alloca i32
>> i32* priv_i alloca 32
>> tok = llvm.experimental.intrinsic_a()[ "DIR.PARALLEL"(),"QUAL.PRIVATE"(i32* %priv_val, i32 %priv_i), "QUAL.NUM_THREADS"(i32 4)]
>>
>> %priv_i = omp_get_thread_num();
>> compute_something_into_val(%priv_val, %priv_i);
>> a[priv_i] = %priv_val;
>>
>> llvm.experimental.intrinsic_b(tok)["DIR.END.PARALLEL"()];
>> ....
>>
>> I =
>> Val =
&g...