Re: [OMPI users] sndlib problem by mpicc compiler

2012-07-31 Thread Jeff Squyres
On Jul 31, 2012, at 4:26 AM, Paweł Jaromin wrote:

> Sorry, in the code is big mes, but I`am sure it not effects my
> problem. - I tried another ways to solve the problem.

I can pretty guarantee you that these two issues will cause you problems.  You 
need to fix them.

Specifically: it seems like you're focusing on the one symptom that you think 
is the problem.  But there seem to be other symptoms that you don't fully grok 
yet (e.g., how do you know *for absolutely sure* that problems leading from 
those two warnings aren't leading to silent memory corruption that ends up 
causing other problems later?), and they might *all* be contributing to the 
overall problem.

I don't know your code, and I don't know how it's structured.  But if I were 
you, I would fix those two problems.  And I'd fix any other warnings that may 
be leading to non-deterministic behavior.

>> Also, you shouldn't be adding -I/usr/include/mpi.  mpicc will add the right 
>> -I option for you (e.g., do you know for sure that your MPI header files are 
>> in /usr/include/mpi?).  It's useless at best, and harmful at worst (E.g., if 
>> some other MPI implementation is installed into /usr/include/mpi).
> 
> I don't know why, but in Eclipse I had to add option -l. Was not
> enought  #include mpi/mpi.h - problem "undefined references" in linker
> :(.

I cited -I (upper case i, as in "include"), not -l (lower case l, as in 
"library").

You might need to understand your build system a bit more to solve this issue.  
I do not use Eclipse, so I'm afraid I have no advice to offer here.

All I'm saying is that mpicc adds all the -I, -L, and -l flags that you need.  
You do not need to add any more.  *Usually* adding such extra flags is 
harmless, but sometimes they can actually be harmful in unexpected ways.  You 
should figure out and fix this issue.

> Because I need to procesing  wav files, I wanted load it into array,
> then by MPI_Scater send   to nodes. I haveI found a code that does
> this, and then i try use with MPI (sndfile lib). "main" in "snd_test"
> is exactly this code, witch copmpile and runs without problems. So,
> after that I copied it into MPI program to master node "rank == 0". I
> expected run the same way like in no MPI program. It means, that I
> compare normal code with the same code in MPI runs by node 0.

I'm afraid I still don't understand what you're saying, and can't reconcile 
that with the code and compiler snipits you have sent so far (e.g., you said 
above that the MPI code runs without problems, but before you said that the MPI 
code had problems -- which is it?). :-(

-

FWIW, I don't think that the use of libsndfile is the issue.  It's a symptom.  
You have some other problem that is causing the real issue.

In your prior mail, you show compiling one program (snd_0.1.c) with mpicc and a 
specific set of compiler / linker flags.  You say that this program does not 
work when you run it.

You also showed compiling a different program (main.c) with gcc and what looks 
to be the same specific set of compiler flags, but without -laudiofile.  You 
say that this program works.

The fact that one works and the other doesn't is likely due to the fact that 
you have a bug in the one that doesn't work.  If you don't understand the 
MPI-based code, then that might well be the issue -- it may be buggy and you 
don't yet grok why.  

A simple test: compile your non-MPI program with mpicc.  You'll most likely see 
that it works fine.

Remember: mpicc is just a "wrapper" compiler -- it is not a compiler in itself. 
 All it does is add some extra command line options (e.g., -I, -L, and -l 
options) and invoke the underlying gcc.  Hence, mpicc is likely not your issue. 
 A bug (or set of bugs) in your MPI-based code is likely the issue.  My best 
advice to you is to use normal debugging techniques to find this(these) bug(s).

Good luck!

-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/




Re: [OMPI users] sndlib problem by mpicc compiler

2012-07-31 Thread Paweł Jaromin
2012/7/30 Jeff Squyres :
> On Jul 30, 2012, at 12:48 PM, Paweł Jaromin wrote:
>
>> make all
>> Building file: ../src/snd_0.1.c
>> Invoking: GCC C Compiler
>> mpicc -I/usr/include/mpi -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP
>> -MF"src/snd_0.1.d" -MT"src/snd_0.1.d" -o "src/snd_0.1.o"
>> "../src/snd_0.1.c"
>> ../src/snd_0.1.c:24: warning: return type defaults to 'int'
>> ../src/snd_0.1.c: In function 'main':
>> ../src/snd_0.1.c:45: warning: unused variable 'outfile'
>> ../src/snd_0.1.c:42: warning: unused variable 'FILE_OUT'
>> ../src/snd_0.1.c:41: warning: unused variable 'FILE_NAME'
>> ../src/snd_0.1.c:40: warning: unused variable 'AF_setup'
>> ../src/snd_0.1.c:38: warning: unused variable 'snd_buffor'
>> ../src/snd_0.1.c:37: warning: unused variable 'i'
>> ../src/snd_0.1.c: In function 'print_usage':
>> ../src/snd_0.1.c:29: warning: control reaches end of non-void function
>> Finished building: ../src/snd_0.1.c
>
> You might want to fix these warnings.  The first one and the last one seem 
> like they could cause nondeterminism.

Sorry, in the code is big mes, but I`am sure it not effects my
problem. - I tried another ways to solve the problem.

>
> Also, you shouldn't be adding -I/usr/include/mpi.  mpicc will add the right 
> -I option for you (e.g., do you know for sure that your MPI header files are 
> in /usr/include/mpi?).  It's useless at best, and harmful at worst (E.g., if 
> some other MPI implementation is installed into /usr/include/mpi).
>

I don't know why, but in Eclipse I had to add option -l. Was not
enought  #include mpi/mpi.h - problem "undefined references" in linker
:(.

>> no MPI -program which was based on
>>
>>  Build of configuration Debug for project snd_test 
>>
>> make all
>> Building file: ../main.c
>> Invoking: GCC C Compiler
>> gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d"
>> -MT"main.d" -o "main.o" "../main.c"
>> Finished building: ../main.c
>>
>> Building target: snd_test
>> Invoking: GCC C Linker
>> gcc  -o "snd_test"  ./main.o   -lsndfile
>> Finished building target: snd_test
>
> I notice that you're not including -Wall and a bunch of other compiler flags 
> in the non-MPI install.
>
> I also notice that you're not compiling the same .c files at all.
>
> So if I'm understanding this thread right -- and I may well not be -- it 
> seems like you're saying:
>
> - when I use gcc to compile main.c, the program runs file
> - when I used mpicc to compile ../src/snd_0.1.c, the program fails
>
> If that's the case, your comparing apples to oranges here.

Not exactly, maybe I show You my thinking:

Because I need to procesing  wav files, I wanted load it into array,
then by MPI_Scater send   to nodes. I haveI found a code that does
this, and then i try use with MPI (sndfile lib). "main" in "snd_test"
is exactly this code, witch copmpile and runs without problems. So,
after that I copied it into MPI program to master node "rank == 0". I
expected run the same way like in no MPI program. It means, that I
compare normal code with the same code in MPI runs by node 0.

Jeff, Thank you for your commitment, but I'm afraid about
misunderstanding. I try clarify the problem as good as I can, but I
feel that You don't understand me. Maybe my english is not enough good
:(.I hope, background above, give you bigger view for what I want to
do. Maybe You have suggestion, how do it or good example how deal with
it.

>
> --
> Jeff Squyres
> jsquy...@cisco.com
> For corporate legal information go to: 
> http://www.cisco.com/web/about/doing_business/legal/cri/
>
>
> ___
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users



-- 
--
pozdrawiam

Paweł Jaromin



Re: [OMPI users] sndlib problem by mpicc compiler

2012-07-30 Thread Jeff Squyres
On Jul 30, 2012, at 12:48 PM, Paweł Jaromin wrote:

> make all
> Building file: ../src/snd_0.1.c
> Invoking: GCC C Compiler
> mpicc -I/usr/include/mpi -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP
> -MF"src/snd_0.1.d" -MT"src/snd_0.1.d" -o "src/snd_0.1.o"
> "../src/snd_0.1.c"
> ../src/snd_0.1.c:24: warning: return type defaults to 'int'
> ../src/snd_0.1.c: In function 'main':
> ../src/snd_0.1.c:45: warning: unused variable 'outfile'
> ../src/snd_0.1.c:42: warning: unused variable 'FILE_OUT'
> ../src/snd_0.1.c:41: warning: unused variable 'FILE_NAME'
> ../src/snd_0.1.c:40: warning: unused variable 'AF_setup'
> ../src/snd_0.1.c:38: warning: unused variable 'snd_buffor'
> ../src/snd_0.1.c:37: warning: unused variable 'i'
> ../src/snd_0.1.c: In function 'print_usage':
> ../src/snd_0.1.c:29: warning: control reaches end of non-void function
> Finished building: ../src/snd_0.1.c

You might want to fix these warnings.  The first one and the last one seem like 
they could cause nondeterminism.

Also, you shouldn't be adding -I/usr/include/mpi.  mpicc will add the right -I 
option for you (e.g., do you know for sure that your MPI header files are in 
/usr/include/mpi?).  It's useless at best, and harmful at worst (E.g., if some 
other MPI implementation is installed into /usr/include/mpi).

> no MPI -program which was based on
> 
>  Build of configuration Debug for project snd_test 
> 
> make all
> Building file: ../main.c
> Invoking: GCC C Compiler
> gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d"
> -MT"main.d" -o "main.o" "../main.c"
> Finished building: ../main.c
> 
> Building target: snd_test
> Invoking: GCC C Linker
> gcc  -o "snd_test"  ./main.o   -lsndfile
> Finished building target: snd_test

I notice that you're not including -Wall and a bunch of other compiler flags in 
the non-MPI install.

I also notice that you're not compiling the same .c files at all.

So if I'm understanding this thread right -- and I may well not be -- it seems 
like you're saying:

- when I use gcc to compile main.c, the program runs file
- when I used mpicc to compile ../src/snd_0.1.c, the program fails

If that's the case, your comparing apples to oranges here.

-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/




Re: [OMPI users] sndlib problem by mpicc compiler

2012-07-30 Thread Paweł Jaromin
normal MPI compiling:

 Build of configuration Debug for project snd_0.1 

make all
Building file: ../src/snd_0.1.c
Invoking: GCC C Compiler
mpicc -I/usr/include/mpi -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP
-MF"src/snd_0.1.d" -MT"src/snd_0.1.d" -o "src/snd_0.1.o"
"../src/snd_0.1.c"
../src/snd_0.1.c:24: warning: return type defaults to 'int'
../src/snd_0.1.c: In function 'main':
../src/snd_0.1.c:45: warning: unused variable 'outfile'
../src/snd_0.1.c:42: warning: unused variable 'FILE_OUT'
../src/snd_0.1.c:41: warning: unused variable 'FILE_NAME'
../src/snd_0.1.c:40: warning: unused variable 'AF_setup'
../src/snd_0.1.c:38: warning: unused variable 'snd_buffor'
../src/snd_0.1.c:37: warning: unused variable 'i'
../src/snd_0.1.c: In function 'print_usage':
../src/snd_0.1.c:29: warning: control reaches end of non-void function
Finished building: ../src/snd_0.1.c

Building target: snd_0.1
Invoking: GCC C Linker
mpicc  -o "snd_0.1"  ./src/snd_0.1.o   -lsndfile -laudiofile
Finished building target: snd_0.1


 Build Finished 


MPI with option --showme:

 Build of configuration Debug for project snd_0.1 

make all
Building file: ../src/snd_0.1.c
Invoking: GCC C Compiler
mpicc --showme -I/usr/include/mpi -O0 -g3 -Wall -c -fmessage-length=0
-MMD -MP -MF"src/snd_0.1.d" -MT"src/snd_0.1.d" -o "src/snd_0.1.o"
"../src/snd_0.1.c"
gcc -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi
-pthread -I/usr/include/mpi -O0 -g3 -Wall -c -fmessage-length=0 -MMD
-MP -MFsrc/snd_0.1.d -MTsrc/snd_0.1.d -o src/snd_0.1.o
../src/snd_0.1.c
gcc: ./src/snd_0.1.o: No file or directory
make: *** [libsnd_0.1] Error 1
Finished building: ../src/snd_0.1.c

Building target: libsnd_0.1
Invoking: GCC C Linker
mpicc -shared -o "libsnd_0.1"  ./src/snd_0.1.o   -lsndfile

 Build Finished 



no MPI -program which was based on

 Build of configuration Debug for project snd_test 

make all
Building file: ../main.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d"
-MT"main.d" -o "main.o" "../main.c"
Finished building: ../main.c

Building target: snd_test
Invoking: GCC C Linker
gcc  -o "snd_test"  ./main.o   -lsndfile
Finished building target: snd_test


 Build Finished 


2012/7/30 TERRY DONTJE :
> Please show me how you are compiling the program under gcc and mpicc.  Plus
> do a "mpicc --showme".
>
> --td
>
>
> On 7/30/2012 8:33 AM, Paweł Jaromin wrote:
>
> This situation is also strange for me, I spend 2 days to find a bug :(.
>
> Unfortunately I am not  a professional  C/C++ programmer, but I have
> to make this program. Please have a look in a picture from link below,
> maybe it will be more clear.
>
> http://vipjg.nazwa.pl/sndfile_error.png
>
>
>
>
>
>
>
>
>
> 2012/7/30 TERRY DONTJE :
>
> On 7/30/2012 6:11 AM, Paweł Jaromin wrote:
>
> Hello
>
> Thanks for fast answer, but the problem looks a little different.
>
> Of course, I use this code only for master node (rank 0), because only
> this node has an access to file.
>
> As You can see i use "if" clause to check sndFile for NULL:
>
> if (sndFile == NULL)
>
> and it returns not NULL value, so the code can run forward.
> I have found the problem during check array:
>
>
>  long numFrames = sf_readf_float(sndFile, snd_buffor, 
> sfinfo.frames);
>
>  // Check correct number of samples loaded
>  if (numFrames != sfinfo.frames) {
> fprintf(stderr, "Did not read enough frames for 
> source\n");
> sf_close(sndFile);
> free(snd_buffor);
> MPI_Finalize();
> return 1;
>  }
>
> So, after that I went to debuger to check variables (I use Eclipse PTP
> and sdm enviroment), then after inicjalization variable "sndFile" has
> "no value" not "NULL" . Unfortunatelly sndFile has still the same
> value to the end of program :(.
>
> What do you mean by sndFile has "no value"?  There isn't a special "no
> value" value to a variable unless you are debugging a code that somehow had
> some variable optimized out at the particular line you are interested in.
>
> Declarations:
>   FILE*outfile = NULL ;
>   SF_INFO sfinfo ;
>   SNDFILE *sndFile= NULL;
>
> Very interesting is , that "sfinfo" from the same library  works perfect.
> At the end of this story, I modified the program without MPI , then
> compiled it by gcc (not mpicc) and it works fine (in debuger sndFile
> has proper value).
>
> So it seems you believe mpicc is doing something wrong when all mpicc is is
> a wrapper to a compiler.  Maybe doing a "mpicc --showme" will give you an
> idea what compiler and options mpicc is passing to the compiler.  This
> should give you an idea  the difference between your gcc and mpicc
> 

Re: [OMPI users] sndlib problem by mpicc compiler

2012-07-30 Thread TERRY DONTJE
Please show me how you are compiling the program under gcc and mpicc.  
Plus do a "mpicc --showme".


--td

On 7/30/2012 8:33 AM, Paweł Jaromin wrote:

This situation is also strange for me, I spend 2 days to find a bug :(.

Unfortunately I am not  a professional  C/C++ programmer, but I have
to make this program. Please have a look in a picture from link below,
maybe it will be more clear.

http://vipjg.nazwa.pl/sndfile_error.png









2012/7/30 TERRY DONTJE:

On 7/30/2012 6:11 AM, Paweł Jaromin wrote:

Hello

Thanks for fast answer, but the problem looks a little different.

Of course, I use this code only for master node (rank 0), because only
this node has an access to file.

As You can see i use "if" clause to check sndFile for NULL:

if (sndFile == NULL)

and it returns not NULL value, so the code can run forward.
I have found the problem during check array:


   long numFrames = sf_readf_float(sndFile, snd_buffor, 
sfinfo.frames);

   // Check correct number of samples loaded
   if (numFrames != sfinfo.frames) {
  fprintf(stderr, "Did not read enough frames for 
source\n");
  sf_close(sndFile);
  free(snd_buffor);
  MPI_Finalize();
  return 1;
   }

So, after that I went to debuger to check variables (I use Eclipse PTP
and sdm enviroment), then after inicjalization variable "sndFile" has
"no value" not "NULL" . Unfortunatelly sndFile has still the same
value to the end of program :(.

What do you mean by sndFile has "no value"?  There isn't a special "no
value" value to a variable unless you are debugging a code that somehow had
some variable optimized out at the particular line you are interested in.

Declarations:
FILE*outfile = NULL ;
SF_INFO sfinfo ;
SNDFILE *sndFile= NULL;

Very interesting is , that "sfinfo" from the same library  works perfect.
At the end of this story, I modified the program without MPI , then
compiled it by gcc (not mpicc) and it works fine (in debuger sndFile
has proper value).

So it seems you believe mpicc is doing something wrong when all mpicc is is
a wrapper to a compiler.  Maybe doing a "mpicc --showme" will give you an
idea what compiler and options mpicc is passing to the compiler.  This
should give you an idea  the difference between your gcc and mpicc
compilation.  I would suspect either mpicc is using a compiler significantly
different than gcc or that mpicc might be passing some optimization
parameter that is messing the code execution (just a guess).


I hope, now is clear.

Not really.

--td



2012/7/30 TERRY DONTJE:

I am not sure I am understanding the problem correctly so let me describe it
back to you with a couple clarifications.

So your program using sf_open compiles successfully when using gcc and
mpicc.  However, when you run the executable compiled using mpicc sndFile is
null?

If the above is right can you tell us how you ran the code?
Will the code run ok if ran with "mpirun -np 1" on the same machine you run
the gcc code normally?
When the mpicc compiled code sf_open call returns NULL what does the
successive sf_strerror report?
My wild guess is when you run the mpicc compiled code one of the processes
is on a node that doesn't have access to the file passed to sf_open.

--td

On 7/28/2012 1:08 PM, Paweł Jaromin wrote:

Hello all

Because I try make a program to parallel procesing sound files, I use
libsndfile library to load and write wav files. Sytuation is strange,
because when I compile the program by gcc is good (no parallel), but
if I do it by mpicc is a problem with sndFile variable.

// Open sound file
SF_INFO sndInfo;
SNDFILE *sndFile = sf_open(argv[1], SFM_READ,);
if (sndFile == NULL) {
   fprintf(stderr, "Error reading source file '%s': %s\n", argv[1],
sf_strerror(sndFile));
   return 1;
}

This code run witout an error, but variable is "No value"

Maybe somone can help me ??


--
Terry D. Dontje | Principal Software Engineer
Developer Tools Engineering | +1.781.442.2631
Oracle - Performance Technologies
95 Network Drive, Burlington, MA 01803
Email terry.don...@oracle.com




___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users



--
Terry D. Dontje | Principal Software Engineer
Developer Tools Engineering | +1.781.442.2631
Oracle - Performance Technologies
95 Network Drive, Burlington, MA 01803
Email terry.don...@oracle.com




___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users





--
Terry D. Dontje | Principal Software Engineer
Developer Tools Engineering | +1.781.442.2631

Re: [OMPI users] sndlib problem by mpicc compiler

2012-07-30 Thread TERRY DONTJE

On 7/30/2012 6:11 AM, Paweł Jaromin wrote:

Hello

Thanks for fast answer, but the problem looks a little different.

Of course, I use this code only for master node (rank 0), because only
this node has an access to file.

As You can see i use "if" clause to check sndFile for NULL:

if (sndFile == NULL)

and it returns not NULL value, so the code can run forward.
I have found the problem during check array:


   long numFrames = sf_readf_float(sndFile, snd_buffor, 
sfinfo.frames);

   // Check correct number of samples loaded
   if (numFrames != sfinfo.frames) {
  fprintf(stderr, "Did not read enough frames for 
source\n");
  sf_close(sndFile);
  free(snd_buffor);
  MPI_Finalize();
  return 1;
   }

So, after that I went to debuger to check variables (I use Eclipse PTP
and sdm enviroment), then after inicjalization variable "sndFile" has
"no value" not "NULL" . Unfortunatelly sndFile has still the same
value to the end of program :(.
What do you mean by sndFile has "no value"?  There isn't a special "no 
value" value to a variable unless you are debugging a code that somehow 
had some variable optimized out at the particular line you are 
interested in.

Declarations:
FILE*outfile = NULL ;
SF_INFO sfinfo ;
SNDFILE *sndFile= NULL;

Very interesting is , that "sfinfo" from the same library  works perfect.
At the end of this story, I modified the program without MPI , then
compiled it by gcc (not mpicc) and it works fine (in debuger sndFile
has proper value).
So it seems you believe mpicc is doing something wrong when all mpicc is 
is a wrapper to a compiler.  Maybe doing a "mpicc --showme" will give 
you an idea what compiler and options mpicc is passing to the compiler.  
This should give you an idea  the difference between your gcc and mpicc 
compilation.  I would suspect either mpicc is using a compiler 
significantly different than gcc or that mpicc might be passing some 
optimization parameter that is messing the code execution (just a guess).


I hope, now is clear.

Not really.

--td



2012/7/30 TERRY DONTJE:

I am not sure I am understanding the problem correctly so let me describe it
back to you with a couple clarifications.

So your program using sf_open compiles successfully when using gcc and
mpicc.  However, when you run the executable compiled using mpicc sndFile is
null?

If the above is right can you tell us how you ran the code?
Will the code run ok if ran with "mpirun -np 1" on the same machine you run
the gcc code normally?
When the mpicc compiled code sf_open call returns NULL what does the
successive sf_strerror report?
My wild guess is when you run the mpicc compiled code one of the processes
is on a node that doesn't have access to the file passed to sf_open.

--td

On 7/28/2012 1:08 PM, Paweł Jaromin wrote:

Hello all

Because I try make a program to parallel procesing sound files, I use
libsndfile library to load and write wav files. Sytuation is strange,
because when I compile the program by gcc is good (no parallel), but
if I do it by mpicc is a problem with sndFile variable.

// Open sound file
SF_INFO sndInfo;
SNDFILE *sndFile = sf_open(argv[1], SFM_READ,);
if (sndFile == NULL) {
   fprintf(stderr, "Error reading source file '%s': %s\n", argv[1],
sf_strerror(sndFile));
   return 1;
}

This code run witout an error, but variable is "No value"

Maybe somone can help me ??


--
Terry D. Dontje | Principal Software Engineer
Developer Tools Engineering | +1.781.442.2631
Oracle - Performance Technologies
95 Network Drive, Burlington, MA 01803
Email terry.don...@oracle.com




___
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users





--
Terry D. Dontje | Principal Software Engineer
Developer Tools Engineering | +1.781.442.2631
Oracle *- Performance Technologies*
95 Network Drive, Burlington, MA 01803
Email terry.don...@oracle.com 





Re: [OMPI users] sndlib problem by mpicc compiler

2012-07-30 Thread Paweł Jaromin
Hello

Thanks for fast answer, but the problem looks a little different.

Of course, I use this code only for master node (rank 0), because only
this node has an access to file.

As You can see i use "if" clause to check sndFile for NULL:

if (sndFile == NULL)

and it returns not NULL value, so the code can run forward.
I have found the problem during check array:


   long numFrames = sf_readf_float(sndFile, snd_buffor, 
sfinfo.frames);

   // Check correct number of samples loaded
   if (numFrames != sfinfo.frames) {
  fprintf(stderr, "Did not read enough frames for 
source\n");
  sf_close(sndFile);
  free(snd_buffor);
  MPI_Finalize();
  return 1;
   }

So, after that I went to debuger to check variables (I use Eclipse PTP
and sdm enviroment), then after inicjalization variable "sndFile" has
"no value" not "NULL" . Unfortunatelly sndFile has still the same
value to the end of program :(.
Declarations:
FILE*outfile = NULL ;
SF_INFO sfinfo ;
SNDFILE *sndFile= NULL;

Very interesting is , that "sfinfo" from the same library  works perfect.
At the end of this story, I modified the program without MPI , then
compiled it by gcc (not mpicc) and it works fine (in debuger sndFile
has proper value).

I hope, now is clear.



2012/7/30 TERRY DONTJE :
> I am not sure I am understanding the problem correctly so let me describe it
> back to you with a couple clarifications.
>
> So your program using sf_open compiles successfully when using gcc and
> mpicc.  However, when you run the executable compiled using mpicc sndFile is
> null?
>
> If the above is right can you tell us how you ran the code?
> Will the code run ok if ran with "mpirun -np 1" on the same machine you run
> the gcc code normally?
> When the mpicc compiled code sf_open call returns NULL what does the
> successive sf_strerror report?
> My wild guess is when you run the mpicc compiled code one of the processes
> is on a node that doesn't have access to the file passed to sf_open.
>
> --td
>
> On 7/28/2012 1:08 PM, Paweł Jaromin wrote:
>
> Hello all
>
> Because I try make a program to parallel procesing sound files, I use
> libsndfile library to load and write wav files. Sytuation is strange,
> because when I compile the program by gcc is good (no parallel), but
> if I do it by mpicc is a problem with sndFile variable.
>
>// Open sound file
>SF_INFO sndInfo;
>SNDFILE *sndFile = sf_open(argv[1], SFM_READ, );
>if (sndFile == NULL) {
>   fprintf(stderr, "Error reading source file '%s': %s\n", argv[1],
> sf_strerror(sndFile));
>   return 1;
>}
>
> This code run witout an error, but variable is "No value"
>
> Maybe somone can help me ??
>
>
> --
> Terry D. Dontje | Principal Software Engineer
> Developer Tools Engineering | +1.781.442.2631
> Oracle - Performance Technologies
> 95 Network Drive, Burlington, MA 01803
> Email terry.don...@oracle.com
>
>
>
>
> ___
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users



-- 
--
pozdrawiam

Paweł Jaromin



Re: [OMPI users] sndlib problem by mpicc compiler

2012-07-30 Thread TERRY DONTJE
I am not sure I am understanding the problem correctly so let me 
describe it back to you with a couple clarifications.


So your program using sf_open compiles successfully when using gcc and 
mpicc.  However, when you run the executable compiled using mpicc 
sndFile is null?


If the above is right can you tell us how you ran the code?
Will the code run ok if ran with "mpirun -np 1" on the same machine you 
run the gcc code normally?
When the mpicc compiled code sf_open call returns NULL what does the 
successive sf_strerror report?
My wild guess is when you run the mpicc compiled code one of the 
processes is on a node that doesn't have access to the file passed to 
sf_open.


--td
On 7/28/2012 1:08 PM, Paweł Jaromin wrote:

Hello all

Because I try make a program to parallel procesing sound files, I use
libsndfile library to load and write wav files. Sytuation is strange,
because when I compile the program by gcc is good (no parallel), but
if I do it by mpicc is a problem with sndFile variable.

// Open sound file
SF_INFO sndInfo;
SNDFILE *sndFile = sf_open(argv[1], SFM_READ,);
if (sndFile == NULL) {
   fprintf(stderr, "Error reading source file '%s': %s\n", argv[1],
sf_strerror(sndFile));
   return 1;
}

This code run witout an error, but variable is "No value"

Maybe somone can help me ??



--
Terry D. Dontje | Principal Software Engineer
Developer Tools Engineering | +1.781.442.2631
Oracle *- Performance Technologies*
95 Network Drive, Burlington, MA 01803
Email terry.don...@oracle.com 





[OMPI users] sndlib problem by mpicc compiler

2012-07-28 Thread Paweł Jaromin
Hello all

Because I try make a program to parallel procesing sound files, I use
libsndfile library to load and write wav files. Sytuation is strange,
because when I compile the program by gcc is good (no parallel), but
if I do it by mpicc is a problem with sndFile variable.

   // Open sound file
   SF_INFO sndInfo;
   SNDFILE *sndFile = sf_open(argv[1], SFM_READ, );
   if (sndFile == NULL) {
  fprintf(stderr, "Error reading source file '%s': %s\n", argv[1],
sf_strerror(sndFile));
  return 1;
   }

This code run witout an error, but variable is "No value"

Maybe somone can help me ??

-- 

pozdrawiam

Paweł Jaromin