On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev
wrote:
able ?
how to use correctly?
```d
import std.parallelism;
auto async_task = task!fn( args ); // error
// Error: no property
`opCall` for type `app.A`, did you mean `new A`?
async_
On Thursday, September 21, 2023 10:33:44 PM MDT Vitaliy Fadeev via
Digitalmars-d-learn wrote:
> On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev
>
> wrote:
> > ...
>
> Skip this thread. I see solution.
>
> How to delete missed posts on this forum ?
This forum is esentially just a web
On Friday, 22 September 2023 at 04:33:44 UTC, Vitaliy Fadeev
wrote:
On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev
wrote:
...
Skip this thread. I see solution.
How to delete missed posts on this forum ?
It's there forever, you have to live with that error ;)
See https://forum
On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev
wrote:
...
Skip this thread. I see solution.
How to delete missed posts on this forum ?
able ?
how to use correctly?
```d
import std.parallelism;
auto async_task = task!fn( args ); // error
// Error: no property
`opCall` for type `app.A`, did you mean `new A`?
async_task.executeInNewThread();
```
where
```d
auto a = new A();
auto fn
,
[https://forum.dlang.org/post/xysyidbkjdinclmrx...@forum.dlang.org](this forum post) says that only one loop can be parallelized. Will it be an error or inefficient or useless if I try to do both?
Also, what is the best way to do parallelism in such a situation?
You could also do a custom range
/xysyidbkjdinclmrx...@forum.dlang.org](this
forum post) says that only one loop can be parallelized. Will it be an
error or inefficient or useless if I try to do both?
Also, what is the best way to do parallelism in such a situation?
You could also do a custom range that makes a one-dimensional range (aka
On Friday, 19 August 2022 at 02:02:57 UTC, Adam D Ruppe wrote:
Even if they aren't equal, you'll get decent benefit from
parallel on the outer one alone, but not as good since the work
won't be balanced.
Unless there's some kind of blocking going on in D's
implementation, if the number of pa
On 8/18/22 18:49, Shriramana Sharma wrote:
> Hello. I want to parallelize a computation which has two for loops
An option is to add tasks individually but I am not sure how wise doing
this and I don't know how to determine whether all tasks are completed.
In any case, Roy Margalit's DConf 2022
On Friday, 19 August 2022 at 01:49:43 UTC, Shriramana Sharma
wrote:
Also, what is the best way to do parallelism in such a
situation?
If the inner loops are about the same size for each pass of the
outer loop, you can just simply parallel on the outer loop and
get the same benefit.
Even if
) says that only one loop can be parallelized. Will it be an error or inefficient or useless if I try to do both?
Also, what is the best way to do parallelism in such a situation?
On Sunday, 14 November 2021 at 16:55:24 UTC, Alexey wrote:
Remove "!"
On Sunday, 14 November 2021 at 17:42:18 UTC, Imperatorn wrote:
Try task(&threadFunc) instead of task!(&threadFunc)
worked! huge thanks!
On Sunday, 14 November 2021 at 16:55:24 UTC, Alexey wrote:
On Sunday, 14 November 2021 at 16:40:58 UTC, Andrey Zherikov
wrote:
Just do `auto t1 = task(&threadFunc)` in `threadCreator` then.
Error: value of `this` is not known at compile time
```D
import std.stdio;
import std.parallelism;
cl
On Sunday, 14 November 2021 at 16:40:58 UTC, Andrey Zherikov
wrote:
Just do `auto t1 = task(&threadFunc)` in `threadCreator` then.
Error: value of `this` is not known at compile time
```D
import std.stdio;
import std.parallelism;
class TC
{
void threadFunc()
{
import core.thr
On Sunday, 14 November 2021 at 14:41:21 UTC, Alexey wrote:
On Sunday, 14 November 2021 at 14:24:00 UTC, Andrey Zherikov
wrote:
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
You just need two changes:
- make `threadFunc` function static: `static void threadFunc()`
- use `task` in
On Sunday, 14 November 2021 at 14:24:00 UTC, Andrey Zherikov
wrote:
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
You just need two changes:
- make `threadFunc` function static: `static void threadFunc()`
- use `task` instead of `Task`: `auto t1 = task!threadFunc;`
I need `this
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
You just need two changes:
- make `threadFunc` function static: `static void threadFunc()`
- use `task` instead of `Task`: `auto t1 = task!threadFunc;`
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(436):
Error: need `this` for `threadFunc` of type `void()`
Go example for contrast. Ideally, I'd like something similar;
```Go
p
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
auto t1 = Task!threadFunc;
if this line rewritten as `auto t1 = Task!(TC.threadFunc, this);`
```text
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(451):
Error
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(436):
Error: need `this` for `threadFunc` of type `void()`
./t.d(22): Error: template instance
`std.parallelism.Task!(threadFunc)` error instantiating
thou documentation says `a function
On Sunday, 28 January 2018 at 04:44:23 UTC, thedeemon wrote:
On Saturday, 27 January 2018 at 20:49:43 UTC, Arun
Chandrasekaran wrote:
But really I'm not sure why you want static foreach here
I was just trying to see if static foreach can be used here, but
well, you showed that it's not requi
On Saturday, 27 January 2018 at 20:49:43 UTC, Arun Chandrasekaran
wrote:
Error: must use labeled break within static foreach
Just follow the compiler suggestion:
void main(string[] args) {
auto op = Operation.a;
foreach (_; 0 .. args.length) {
ops: final switch (op) {
On Saturday, 27 January 2018 at 17:54:53 UTC, thedeemon wrote:
On Saturday, 27 January 2018 at 11:19:37 UTC, Arun
Chandrasekaran wrote:
Simplified test case that still errors:
You got really close here. Here's a working version:
enum Operation {
a,
b
}
import std.traits, std.conv, st
On Saturday, 27 January 2018 at 11:19:37 UTC, Arun Chandrasekaran
wrote:
Simplified test case that still errors:
You got really close here. Here's a working version:
enum Operation {
a,
b
}
import std.traits, std.conv, std.stdio;
void main(string[] args) {
auto op = Operation.a;
On Saturday, 27 January 2018 at 10:49:45 UTC, Arun Chandrasekaran
wrote:
On Saturday, 27 January 2018 at 10:38:25 UTC, Nicholas Wilson
wrote:
...
[snip]
Simplified test case that still errors:
```
enum Operation {
a,
b
}
import std.traits;
import std.conv;
void main(string[] args) {
On Saturday, 27 January 2018 at 10:38:25 UTC, Nicholas Wilson
wrote:
On Saturday, 27 January 2018 at 10:28:10 UTC, Arun
Chandrasekaran wrote:
```
import std.parallelism;
auto pool = new TaskPool(options.threadCount);
foreach (_; 0 .. options.iterationCount) {
switch (options.
On Saturday, 27 January 2018 at 10:28:10 UTC, Arun Chandrasekaran
wrote:
```
import std.parallelism;
auto pool = new TaskPool(options.threadCount);
foreach (_; 0 .. options.iterationCount) {
switch (options.operation) {
static foreach(e; EnumMembers!Operation) {
On Saturday, 27 January 2018 at 10:28:10 UTC, Arun Chandrasekaran
wrote:
Hi All,
Is there a way to rewrite this
[...]
Damn! The subject should've been something else.. naming is
surely hard..
Hi All,
Is there a way to rewrite this
```
import std.parallelism;
auto pool = new TaskPool(options.threadCount);
foreach (_; 0 .. options.iterationCount) {
switch (options.operation) {
case Operation.a:
pool.put(task!a(options));
break;
On Friday, 22 December 2017 at 00:18:40 UTC, Seb wrote:
On Friday, 22 December 2017 at 00:12:45 UTC, Vino wrote:
On Thursday, 21 December 2017 at 06:31:52 UTC, Ali Çehreli
wrote:
[...]
Hi Ali,
Thank you very much, the pull request is in open state, so can
you please let me know when can we
On Friday, 22 December 2017 at 00:12:45 UTC, Vino wrote:
On Thursday, 21 December 2017 at 06:31:52 UTC, Ali Çehreli
wrote:
On 12/19/2017 02:32 AM, Vino wrote:
> even though it is a simple code copy+paste
The change was a little more complicated than my naive
adaptation from std.algorithm.fold
On Thursday, 21 December 2017 at 06:31:52 UTC, Ali Çehreli wrote:
On 12/19/2017 02:32 AM, Vino wrote:
> even though it is a simple code copy+paste
The change was a little more complicated than my naive
adaptation from std.algorithm.fold. Here is the pull request:
https://github.com/dlang/p
On Wed, 2017-12-20 at 22:31 -0800, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 12/19/2017 02:32 AM, Vino wrote:
>
> > even though it is a simple code copy+paste
>
> The change was a little more complicated than my naive adaptation
> from
> std.algorithm.fold. Here is the pull request:
>
>
On 12/19/2017 02:32 AM, Vino wrote:
> even though it is a simple code copy+paste
The change was a little more complicated than my naive adaptation from
std.algorithm.fold. Here is the pull request:
https://github.com/dlang/phobos/pull/5951
Ali
On Monday, 18 December 2017 at 20:53:28 UTC, Russel Winder wrote:
Ali,
Shouldn't this be a pull request for std.parallelism to be
extended?
If the function is in std.algorithm, then people should not
have to write it for themselves in std.parallelism.
On Mon, 2017-12-18 at 11:01 -0800, Al
Ali,
Shouldn't this be a pull request for std.parallelism to be extended?
If the function is in std.algorithm, then people should not have to
write it for themselves in std.parallelism.
On Mon, 2017-12-18 at 11:01 -0800, Ali Çehreli via Digitalmars-d-learn
wrote:
>
[…]
> > Hi Ali,
> >
> >
On 12/18/2017 02:18 AM, Vino wrote:
On Sunday, 17 December 2017 at 20:00:53 UTC, Ali Çehreli wrote:
On 12/17/2017 08:11 AM, Vino wrote:
> As per the document form std.parallelism it states that we
can use
> taskPool.reduce so can we use the same for fold
(taskPool.fold) as
> basically both ar
On Sunday, 17 December 2017 at 20:00:53 UTC, Ali Çehreli wrote:
On 12/17/2017 08:11 AM, Vino wrote:
> As per the document form std.parallelism it states that we
can use
> taskPool.reduce so can we use the same for fold
(taskPool.fold) as
> basically both are same with slight variation on seed
On 12/17/2017 08:11 AM, Vino wrote:
> As per the document form std.parallelism it states that we can use
> taskPool.reduce so can we use the same for fold (taskPool.fold) as
> basically both are same with slight variation on seed values, if
> possible can can we define the same in the below lin
HI All,
As per the document form std.parallelism it states that we can
use taskPool.reduce so can we use the same for fold
(taskPool.fold) as basically both are same with slight variation
on seed values, if possible can can we define the same in the
below lines
Tried the below but getting
On Tue, 2015-09-08 at 07:33 +, Dominikus Dittes Scherkl via
Digitalmars-d-learn wrote:
> On Tuesday, 8 September 2015 at 05:50:30 UTC, Russel Winder wrote:
> > void main() {
> > immutable imax = 10;
> > immutable jmax = 10;
> > float[imax][jmax] x;
> > foreach(int j;
On Tuesday, 8 September 2015 at 05:50:30 UTC, Russel Winder wrote:
void main() {
immutable imax = 10;
immutable jmax = 10;
float[imax][jmax] x;
foreach(int j; 1..jmax){
foreach(int i, ref item; parallel(x[j-1])){
x[j][i] = complicatedFunction(i, item)
tem);
}
}
}
(though sadly, this doesn't compile for a reason I can't fathom
instantly) this brings into stark relieve the fact that there is a
potential coupling between x[j-1][m] and x[j-1][n] which means
enforcing parallelism here will almost certainly resul
On Monday, 7 September 2015 at 02:56:04 UTC, Charles wrote:
Friends,
I have a program that would be pretty easy to parallelize with
an openmp pragra in C. I'd like to avoid the performance cost
of using message passing, and the shared qualifier seems like
it's enforcing guarantees I don't nee
Friends,
I have a program that would be pretty easy to parallelize with an
openmp pragra in C. I'd like to avoid the performance cost of
using message passing, and the shared qualifier seems like it's
enforcing guarantees I don't need. Essentially, I have
x = float[imax][jmax]; //x is about
On Sunday, 26 January 2014 at 20:34:27 UTC, bearophile wrote:
Do you know that module level variables in D are thread-local?
If you don't what that, you have to use __gshared.
Bye,
bearophile
Perfect, thanks!
If anyone wants to make things easy on stupid people like me,
using a module level
Andrew Klaassen:
This happens with dmd, ldc2 and gdc, so I assume it's something
I'm doing wrong rather than a bug. What's the explanation?
What am I doing wrong?
Do you know that module level variables in D are thread-local? If
you don't what that, you have to use __gshared.
Bye,
bearophi
I've got some code which sets values in a 2D array. Each value
is independent, so I'm using std.parallelism to set the values a
row at a time. When my variables are class variables it seems to
work (though it's hard to tell, given that the effect is
intermittent), but when I use module-level
On 01/17/2014 01:28 PM, Kelet wrote:
> create a Task[2]. Once the Task is created, use the executeInNewThread
> function. You can use yieldForce to wait on it.
That's what I thought initially as well but then I realized that it can
be even simpler than that:
import std.stdio;
import std.paral
On Friday, 17 January 2014 at 21:07:46 UTC, Mineko wrote:
Today I'm asking a more theoretical question, since I can't
quite grasp this one too well.
Let's say I want 3 while-loops running in parallel, without
getting in the way of each other, how would I do that?
With std.parallel of course,
On Friday, 17 January 2014 at 21:07:46 UTC, Mineko wrote:
Let's say I want 3 while-loops running in parallel, without
getting in the way of each other, how would I do that?
On the same set of data? That's optimistic if one of the loops
writes :) Otherwise, you could just create three tasks, o
Today I'm asking a more theoretical question, since I can't quite
grasp this one too well.
Let's say I want 3 while-loops running in parallel, without
getting in the way of each other, how would I do that?
With std.parallel of course, but that's where I get confused,
perhaps someone could en
On 12/12/2012 05:47 AM, Zardoz wrote:
> On Tuesday, 11 December 2012 at 17:50:31 UTC, Ali Çehreli wrote:
>> On 12/11/2012 08:12 AM, Zardoz wrote:
>>
>>
>> Could you please move MapIntegrator() to module-level. Then it should
>> work.
>>
>> Ali
>
> I try it and now even with normal Map function giv
On Tuesday, 11 December 2012 at 17:50:31 UTC, Ali Çehreli wrote:
On 12/11/2012 08:12 AM, Zardoz wrote:
Could you please move MapIntegrator() to module-level. Then it
should work.
Ali
I try it and now even with normal Map function give me errors
with dmd !
public Entity MapIntegrator ( E
On Tuesday, 11 December 2012 at 15:22:49 UTC, Ali Çehreli wrote:
That used to work a couple of dmd versions ago. I think it was
a bug that it worked, so it stopped working after bug fixes.
If I'm not mistaken this is actually related to a compiler
implementation issue: Lambda's have a single p
Ali Çehreli:
The single pointer of the lambda is not sufficient to store
both without big changes in the compiler.
I think adding a heavier 3-word delegate is not too much hard to
do. But it makes the language more complex, so so far Walter is
not willing to introduce them.
But in the end
On 12/11/2012 02:53 AM, Zardoz wrote:
> auto acelByObjs = map!( (Entity o) {
> Vector3 r = o.pos[0] - pos[0];
> return r * (o.mass / pow((r.sq_length + epsilon2), 1.5));
> } )(objects);
> newAcel = reduce!("a + b")(acelByObjs);
>
> It works very well with the std.algorithm Map and Reduce but when
Hello,
Im starting one process in the main thread who in turn is going
to kick off another process but has no way of passing along
main's Tid, hence the shared(Tid) nonsense.
* This works in serial (i.e. change workUnitSize > x.length in
mains foreach loop).
* It also works when passing the tid
59 matches
Mail list logo