Get TypeNames of Variadic Templates

2013-02-01 Thread Christian Köstlin
Hi, i am trying to generate members for all types in a variadic class template like this: import std.stdio; class Component(Children...) { /// results eg. in public Component1 fComponent1; static string createMembers() { string res = ""; foreach (child; Children) { res ~= "p

Re: Tutorial on how to build DMD/druntime/phobos and docs from source?

2013-02-01 Thread timewulf
On 31.01.2013 19:17, Philippe Sigaud wrote: > On Thu, Jan 31, 2013 at 6:47 PM, Joseph Rushton Wakeling > wrote: >> On 01/31/2013 05:58 PM, Philippe Sigaud wrote: >>> >>> Could you please update the wiki accordingly? (If you don't have an >>> account, it takes 5 secs to get one, I did that a few w

Re: maybe i got a bug

2013-02-01 Thread bioinfornatics
Apparently I didn't understand the code. :) My comments should be generally correct: Calling front() multiple times should return the same element and it should not change the state of the range. Ali my code works like you said you ca

Re: maybe i got a bug

2013-02-01 Thread bioinfornatics
Apparently I didn't understand the code. :) My comments should be generally correct: Calling front() multiple times should return the same element and it should not change the state of the range. Ali My code works like you said you can call front multiple time he will return same thing.

Re: maybe i got a bug

2013-02-01 Thread bioinfornatics
My code works like you said you can call front multiple time he will return same thing. I check in front the letter return to set or not the state and the section number. this maye should move to popFront. To explain, i iterate over a fastq file with a memory mapped file. Then i iterate letter by

Re: Deimos (How to port a header)

2013-02-01 Thread Johannes Pfau
On Thursday, 31 January 2013 at 20:42:47 UTC, Marco Leise wrote: Maybe Deimos (the GitHub presence) could use a dry piece of text that explains how to convert a header. I have just had the need for xcb for example, but no idea how a good header translation is supposed to look like, if all files n

Re: Tutorial on how to build DMD/druntime/phobos and docs from source?

2013-02-01 Thread Joseph Rushton Wakeling
On 02/01/2013 09:33 AM, timewulf wrote: During my first approach, there was just one misunderstanding on my side: I didn't realize (I just didn't look for it.) , that the dmd-compiler itself is purely C-code. I thought, I need dmd for compiling the newer version. Actually it's C++, it's just th

Linking against clang produced libs on OSX

2013-02-01 Thread Hagen
Hi all, 1. I made a static lib in C++ using the Lion standard compilers. 2. I made a static lib using dmd (which calls the C++ lib) 3. I made a testprogram that links against both libs I get this answer from dmd: Undefined symbols for architecture x86_64: "createQuicked()", referenced from:

Re: maybe i got a bug

2013-02-01 Thread monarch_dodra
On Friday, 1 February 2013 at 09:09:10 UTC, bioinfornatics wrote: As i use a memory mapped file i won't copy my struct for able to loop as i do not want map the file twice that is rather a big problem for a big file this a perf issue. memory mapped file is used to read fastly a file so is a nonse

Re: maybe i got a bug

2013-02-01 Thread monarch_dodra
On Friday, 1 February 2013 at 09:09:10 UTC, bioinfornatics wrote: As i use a memory mapped file i won't copy my struct for able to loop as i do not want map the file twice that is rather a big problem for a big file this a perf issue. memory mapped file is used to read fastly a file so is a nonse

Re: Linking against clang produced libs on OSX

2013-02-01 Thread Jacob Carlborg
On 2013-02-01 15:07, Hagen wrote: Hi all, 1. I made a static lib in C++ using the Lion standard compilers. 2. I made a static lib using dmd (which calls the C++ lib) 3. I made a testprogram that links against both libs I get this answer from dmd: Undefined symbols for architecture x86_64: "c

Re: Understanding the GC

2013-02-01 Thread Steven Schveighoffer
On Fri, 01 Feb 2013 02:07:00 -0500, monarch_dodra wrote: On Thursday, 31 January 2013 at 23:53:26 UTC, Steven Schveighoffer wrote: A destructor should ONLY be used to free up resources other than GC allocated memory. Because of that, it's generally not used. It should be used almost as

Not able to get scaled performance on increasing number of threads

2013-02-01 Thread Sparsh Mittal
I am parallelizing a program which follows this structure: for iter = 1 to MAX_ITERATION { myLocalBarrier = new Barrier(numberOfThreads+1); for i= 1 to numberOfThreads { spawn(&myFunc, args) } }

Re: Tutorial on how to build DMD/druntime/phobos and docs from source?

2013-02-01 Thread timewulf
On 01.02.2013 13:08, Joseph Rushton Wakeling wrote: > Have you tried installing LDC? I consider it by far the friendliest > install experience of all the D compilers, and if someone was going to > have a go at reworking the install scripts for DMD, it'd be worth > following this model. > http://wi

Not able to get scaled performance on increasing number of threads

2013-02-01 Thread Sparsh Mittal
It got posted before I completed it! Sorry. I am parallelizing a program which follows this structure: immutable int numberOfThreads= 2 for iter = 1 to MAX_ITERATION { myLocalBarrier = new Barrier(numberOfThreads+1); for i= 1 to numberOfThreads { spawn(&myFunc, args)

Re: Understanding the GC

2013-02-01 Thread monarch_dodra
On Friday, 1 February 2013 at 15:37:25 UTC, Steven Schveighoffer wrote: On Fri, 01 Feb 2013 02:07:00 -0500, monarch_dodra wrote: On Thursday, 31 January 2013 at 23:53:26 UTC, Steven Schveighoffer wrote: A destructor should ONLY be used to free up resources other than GC allocated memory.

Re: Not able to get scaled performance on increasing number of threads

2013-02-01 Thread Dmitry Olshansky
01-Feb-2013 19:42, Sparsh Mittal пишет: It got posted before I completed it! Sorry. I am parallelizing a program which follows this structure: immutable int numberOfThreads= 2 for iter = 1 to MAX_ITERATION { myLocalBarrier = new Barrier(numberOfThreads+1); for i= 1 to numberOfThre

Re: Understanding the GC

2013-02-01 Thread Sean Kelly
On Jan 31, 2013, at 11:07 PM, "monarch_dodra" wrote: > On Thursday, 31 January 2013 at 23:53:26 UTC, Steven Schveighoffer wrote: >> >> A destructor should ONLY be used to free up resources other than GC >> allocated memory. Because of that, it's generally not used. >> >> It should be used a

Re: Not able to get scaled performance on increasing number of threads

2013-02-01 Thread Sparsh Mittal
Can't tell much without the whole source or at least compilable standalone piece. Give me a moment. I will post.

Re: Not able to get scaled performance on increasing number of threads

2013-02-01 Thread Sparsh Mittal
Here is the code: #!/usr/bin/env rdmd import std.stdio; import std.concurrency; import core.thread; import std.datetime; import std.conv; import core.sync.barrier; immutable int gridSize = 256; immutable int MAXSTEPS = 5; /* Maximum number of iterations */ immutable d

Re: Understanding the GC

2013-02-01 Thread FG
On 2013-02-01 16:37, Steven Schveighoffer wrote: Actually, that's a different problem. File is a struct, and structs do NOT have their destructor run by the GC. Only Objects do. This is a GC limitation, since structs do not contain a pointer to their typeinfo like classes do, and there is no p

Re: Not able to get scaled performance on increasing number of threads

2013-02-01 Thread FG
On 2013-02-01 16:42, Sparsh Mittal wrote: When I run it, and compare this parallel version with its serial version, I only get speedup of nearly <1.3 for 2 threads. When I write same program in Go, scaling is nearly 2. Also, in D, on doing "top", I see the usage as only 130% CPU and not nearly 2

Re: Understanding the GC

2013-02-01 Thread Steven Schveighoffer
On Fri, 01 Feb 2013 10:46:11 -0500, monarch_dodra wrote: On Friday, 1 February 2013 at 15:37:25 UTC, Steven Schveighoffer wrote: This is a GC limitation, since structs do not contain a pointer to their typeinfo like classes do, and there is no provision for storing a pointer to the type

Re: Not able to get scaled performance on increasing number of threads

2013-02-01 Thread Dmitry Olshansky
01-Feb-2013 20:08, Sparsh Mittal пишет: Here is the code: Mine reiteration on it, with a bit of help from std.parallelism. std.parallelism uses thread pool thus it's somewhat faster then creating threads anew. Still it's instantaneous for me in a range of 30-40ms even with grid size of 1024

Re: Not able to get scaled performance on increasing number of threads

2013-02-01 Thread FG
On 2013-02-01 20:33, Dmitry Olshansky wrote: Mine reiteration on it, with a bit of help from std.parallelism. std.parallelism uses thread pool thus it's somewhat faster then creating threads anew. Interestingly, threads+barrier here wasn't much slower than tasks: 14% slower for dmd32, only 5% f

Re: Get TypeNames of Variadic Templates

2013-02-01 Thread Christian Köstlin
Hi Philippe, wonderful solution. I also added T get(T)() { return components[staticIndexOf!(T, Children)]; } to the class to get the Children out by type (works as long as there is only one child of each type in the tuple). thanks a lot!!! christian On 2/1/13 16:04 , Philippe Sigaud wrote

Re: Not able to get scaled performance on increasing number of threads

2013-02-01 Thread Sparsh Mittal
Excellent. Thank you so much for your suggestion and code. It now produces near linear speedup.

Re: Not able to get scaled performance on increasing number of threads

2013-02-01 Thread Sparsh Mittal
Thanks. Yes, you are right. I have increased the dimension.

Re: Tutorial on how to build DMD/druntime/phobos and docs from source?

2013-02-01 Thread timewulf
On Friday, 1 February 2013 at 15:41:25 UTC, timewulf wrote: With the complete infos to dmd-installation, I'll try to create a new dmd2.ebuild for installation out of git now. I'll post it, when it is ready. I've got adapted the ebuild and the patch of v 2.060 to 2.061. May you tell me, whom

Why are commands executing out of order?

2013-02-01 Thread Josh
Here's my code: import std.datetime; import std.file; import std.stdio; struct info { string name; bool isDir; ulong size; SysTime timeCreated; SysTime timeLastAccessed; SysTime timeLastModified; this(DirEntry d) { this.name = d.name; this.isDir =