Hi Daniel,

Thank you, I used mpicc to compile. Replace NULL by nullptr won't help 
because compiler can not recognize nullptr neither.

On Saturday, October 28, 2017 at 1:21:25 PM UTC-5, Daniel Arndt wrote:
>
> Michael,
>
> are actually compiling with a MPI compiler?
> Does replacing NULL by nullptr help?
>
> Best,
> Daniel
>
> Am Samstag, 28. Oktober 2017 01:52:24 UTC+2 schrieb Michael:
>>
>> Thanks for your reply. I did install mpich_3.2-7_amd64.deb before. When I 
>> tried your simple mpi example, I can not even compile it and the the error 
>> is:
>>
>> hello.c: In function ‘main’:
>> hello.c:3:5: warning: implicit declaration of function ‘MPI_Init’ 
>> [-Wimplicit-function-declaration]
>>      MPI_Init(NULL, NULL);
>>      ^~~~~~~~
>> hello.c:3:14: error: ‘NULL’ undeclared (first use in this function)
>>      MPI_Init(NULL, NULL);
>>               ^~~~
>> hello.c:3:14: note: each undeclared identifier is reported only once for 
>> each function it appears in
>> hello.c:7:5: warning: implicit declaration of function ‘MPI_Comm_size’ 
>> [-Wimplicit-function-declaration]
>>      MPI_Comm_size(MPI_COMM_WORLD, &world_size);
>>      ^~~~~~~~~~~~~
>> hello.c:7:19: error: ‘MPI_COMM_WORLD’ undeclared (first use in this 
>> function)
>>      MPI_Comm_size(MPI_COMM_WORLD, &world_size);
>>                    ^~~~~~~~~~~~~~
>> hello.c:11:5: warning: implicit declaration of function ‘MPI_Comm_rank’ 
>> [-Wimplicit-function-declaration]
>>      MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
>>      ^~~~~~~~~~~~~
>> hello.c:14:25: error: ‘MPI_MAX_PROCESSOR_NAME’ undeclared (first use in 
>> this function)
>>      char processor_name[MPI_MAX_PROCESSOR_NAME];
>>                          ^~~~~~~~~~~~~~~~~~~~~~
>> hello.c:16:5: warning: implicit declaration of function 
>> ‘MPI_Get_processor_name’ [-Wimplicit-function-declaration]
>>      MPI_Get_processor_name(processor_name, &name_len);
>>      ^~~~~~~~~~~~~~~~~~~~~~
>> hello.c:19:5: warning: implicit declaration of function ‘printf’ 
>> [-Wimplicit-function-declaration]
>>      printf("Hello world from processor %s, rank %d"
>>      ^~~~~~
>> hello.c:19:5: warning: incompatible implicit declaration of built-in 
>> function ‘printf’
>> hello.c:19:5: note: include ‘<stdio.h>’ or provide a declaration of 
>> ‘printf’
>> hello.c:24:5: warning: implicit declaration of function ‘MPI_Finalize’ 
>> [-Wimplicit-function-declaration]
>>      MPI_Finalize();
>>      ^~~~~~~~~~~~
>> <builtin>: recipe for target 'hello.o' failed
>> make: *** [hello.o] Error 1
>>
>> Not sure if this is because of I didn't install mpi package correctly 
>> which was installed by ubuntu software manager.
>>
>>
>> On Friday, October 27, 2017 at 12:57:55 PM UTC-5, Timo Heister wrote:
>>>
>>> Well, do you have more than one MPI library installed? If yes, you 
>>> need to address that by removing one of them. 
>>>
>>> You can check if a simple hello world MPI program compiles and runs 
>>> correctly. See for example 
>>>
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__mpitutorial.com_tutorials_mpi-2Dhello-2Dworld_&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=xqP0pwi1MCtRPItXgJGYSlWmAdkua1-iL_svoI2Icgg&s=uE9uaCa2RV_G7HtjV6sxyfx9GduRM9wHUH-EOF3VvNM&e=
>>>  
>>>
>>> On Thu, Oct 26, 2017 at 6:38 PM, Michael <micha...@gmail.com> wrote: 
>>> > Hi, 
>>> > 
>>> > Test 4 failed after make test. I make my research and find the 
>>> following 
>>> > answer: 
>>> > 
>>> > 
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_msg_dealii_mV-2DjuFpnybA_DSBP4DArCQAJ&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=xqP0pwi1MCtRPItXgJGYSlWmAdkua1-iL_svoI2Icgg&s=b_s_RUQD1qLw_eZ_t42IRcNKemfVWZIUnPr0jIQTF5c&e=
>>>  
>>> > 
>>> > I guess it may be caused by different version of MPI. And I get the 
>>> > following return of suggested command: 
>>> > 
>>> > 
>>> ************************************************************************************************
>>>  
>>>
>>> > mpirun -n 2 ./mpi.debug 
>>> >  Hi from 0/1 
>>> >  Hi from 0/1 
>>> > ERROR: process does not see nproc=2! 
>>> > ERROR: process does not see nproc=2! 
>>> > ------------------------------------------------------- 
>>> > Primary job  terminated normally, but 1 process returned 
>>> > a non-zero exit code.. Per user-direction, the job has been aborted. 
>>> > ------------------------------------------------------- 
>>> > 
>>> -------------------------------------------------------------------------- 
>>> > mpirun detected that one or more processes exited with non-zero 
>>> status, thus 
>>> > causing 
>>> > the job to be terminated. The first process to do so was: 
>>> > 
>>> >   Process name: [[18180,1],0] 
>>> >   Exit code:    255 
>>> > 
>>> ************************************************************************************************
>>>  
>>>
>>> >  mpiexec -n 2 ./mpi.debug 
>>> >  Hi from 0/1 
>>> >  Hi from 0/1 
>>> > ERROR: process does not see nproc=2! 
>>> > ERROR: process does not see nproc=2! 
>>> > ------------------------------------------------------- 
>>> > Primary job  terminated normally, but 1 process returned 
>>> > a non-zero exit code.. Per user-direction, the job has been aborted. 
>>> > ------------------------------------------------------- 
>>> > 
>>> -------------------------------------------------------------------------- 
>>> > mpiexec detected that one or more processes exited with non-zero 
>>> status, 
>>> > thus causing 
>>> > the job to be terminated. The first process to do so was: 
>>> > 
>>> >   Process name: [[18211,1],0] 
>>> >   Exit code:    255 
>>> > 
>>> ************************************************************************************************
>>>  
>>>
>>> > which mpirun 
>>> > /usr/bin/mpirun 
>>> > 
>>> ************************************************************************************************
>>>  
>>>
>>> > which mpiexec 
>>> > /usr/bin/mpiexec 
>>> > 
>>> ************************************************************************************************
>>>  
>>>
>>> > 
>>> > Please tell me how to solve this(how to choose the correct mpi 
>>> compiler)? Do 
>>> > I need to reinstall dealii and trilinos? Thanks! 
>>> > 
>>> > -- 
>>> > The deal.II project is located at 
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=xqP0pwi1MCtRPItXgJGYSlWmAdkua1-iL_svoI2Icgg&s=UIJ0hYC1YEmLHJ5Djjsj_XcW_2LGt7Q5raqDotwhhac&e=
>>>  
>>> > For mailing list/forum options, see 
>>> > 
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_forum_dealii-3Fhl-3Den&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=xqP0pwi1MCtRPItXgJGYSlWmAdkua1-iL_svoI2Icgg&s=JKE6aBeInND4IfgBW9RSAgN9OCmcy2saC2mphp8BAMM&e=
>>>  
>>> > --- 
>>> > You received this message because you are subscribed to the Google 
>>> Groups 
>>> > "deal.II User Group" group. 
>>> > To unsubscribe from this group and stop receiving emails from it, send 
>>> an 
>>> > email to dealii+un...@googlegroups.com. 
>>> > For more options, visit 
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=DwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=xqP0pwi1MCtRPItXgJGYSlWmAdkua1-iL_svoI2Icgg&s=Eq64x4K04k3VFV3CDPo-vz5RrxJJmqZn3nruLvMycQY&e=
>>>  
>>> . 
>>>
>>>
>>>
>>> -- 
>>> Timo Heister 
>>> http://www.math.clemson.edu/~heister/ 
>>>
>>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to