OpenMP parallel file writing
-
hello, Can anyone help me out in writing large number of files(almost 8000) parallely in a directory using openMP support in VC++ I am also using a recursive function inside WriteFile to do the writng texts to the corresponding file My code snippet is as below =========================== #pragma omp parallel private(i) { #pragma omp for schedule(dynamic, 1) for ( i= 0; i< 10000; i++) { WriteFiles("directory path..", "w+"); } } But it is not working and crashing particularly inside recursive function. Can anyone help me out? Thanks in advance
asdsa
-
hello, Can anyone help me out in writing large number of files(almost 8000) parallely in a directory using openMP support in VC++ I am also using a recursive function inside WriteFile to do the writng texts to the corresponding file My code snippet is as below =========================== #pragma omp parallel private(i) { #pragma omp for schedule(dynamic, 1) for ( i= 0; i< 10000; i++) { WriteFiles("directory path..", "w+"); } } But it is not working and crashing particularly inside recursive function. Can anyone help me out? Thanks in advance
asdsa
Ashish Ranjan Mishra wrote:
it is not working and crashing
You will need to provide much more detail if you want help with this. We have no idea what "not working" means, or where it is crashing. Also, you need to understand that trying to write that many files at the same time will run extremely slowly as the system tries to schedule the different threads.
-
hello, Can anyone help me out in writing large number of files(almost 8000) parallely in a directory using openMP support in VC++ I am also using a recursive function inside WriteFile to do the writng texts to the corresponding file My code snippet is as below =========================== #pragma omp parallel private(i) { #pragma omp for schedule(dynamic, 1) for ( i= 0; i< 10000; i++) { WriteFiles("directory path..", "w+"); } } But it is not working and crashing particularly inside recursive function. Can anyone help me out? Thanks in advance
asdsa
Apart from the problem, you also did not show the
WriteFiles
function that you have. The function that you have is not recursive, it does not call itself, or does it? If that does, remove the recursion as soon as possible. Secondly, also show the code of that function. OpenMP is helpful in most cases, but multithreading can be overkill in majority of the cases. Use with caution.The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
-
hello, Can anyone help me out in writing large number of files(almost 8000) parallely in a directory using openMP support in VC++ I am also using a recursive function inside WriteFile to do the writng texts to the corresponding file My code snippet is as below =========================== #pragma omp parallel private(i) { #pragma omp for schedule(dynamic, 1) for ( i= 0; i< 10000; i++) { WriteFiles("directory path..", "w+"); } } But it is not working and crashing particularly inside recursive function. Can anyone help me out? Thanks in advance
asdsa
Until your code works with 1 file, non-recursively, don't bother adding the complexity of multiple files, in parallel, using recursion. Start small until you have a firm understanding, and then bother building it up.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
hello, Can anyone help me out in writing large number of files(almost 8000) parallely in a directory using openMP support in VC++ I am also using a recursive function inside WriteFile to do the writng texts to the corresponding file My code snippet is as below =========================== #pragma omp parallel private(i) { #pragma omp for schedule(dynamic, 1) for ( i= 0; i< 10000; i++) { WriteFiles("directory path..", "w+"); } } But it is not working and crashing particularly inside recursive function. Can anyone help me out? Thanks in advance
asdsa
Hi,
Ashish Ranjan Mishra wrote:
But it is not working and crashing particularly inside recursive function. Can anyone help me out?
Unfortunately you did not give any error message or debug information. Also wanted to point out that you will need to avoid the C runtime if you plan on opening more than 512/2048 files at a time. If you use the C wrappers you will be limited to 512 file handles which can be extended to 2048 via the _setmaxstdio function[^]. Best Wishes, -David Delaune