<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div>Hello Sir,<br><br></div>Sorry for your inconvenience. I will ask this on forum. Thanks for all your kind help.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div><div>Regards,<br><br>Umesh Sharad Shisode,<br></div>M.Tech in Modeling and Simulation(2013-15),<br></div>Centre for Modeling and Simulation,<br></div>University of Pune.<br></div></div></div>
<br><div class="gmail_quote">On Thu, May 21, 2015 at 6:55 PM, Kenneth Raffenetti <span dir="ltr"><<a href="mailto:raffenet@mcs.anl.gov" target="_blank">raffenet@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Please do not use this list for general programming questions. Either take this discussion offline, or move it to a more appropriate forum. This list is for questions about MPICH.<br>
<br>
Thanks,<br>
Ken<span class=""><br>
<br>
On 05/21/2015 06:54 AM, Umesh Shisode wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Hello Antoine Rougier,<br>
<br>
I did not understand, [You have to change your code if you want to<br>
keep using blocking communication.] you ask me about. Also now the<br>
code is working fine, but it is only for same process and same numbers<br>
of rows. For other cases it is giving me error (segmentation fault).<br>
Please check it, I am attaching here the tar file of compile code. But<br>
it is working for only following commands<br>
<br>
>> mpic++ main.cpp -o result<br>
>> mpirun -np 4 result<br>
<br>
But for this case input matrix is (4 X 4) only.<br>
<br>
If you find any mistake please let me know.<br>
<br>
<br>
<br>
Regards,<br>
<br>
Umesh Sharad Shisode,<br>
M.Tech in Modeling and Simulation(2013-15),<br>
Centre for Modeling and Simulation,<br>
University of Pune.<br>
<br>
On Wed, May 20, 2015 at 11:29 PM, Antoine Rougier<br></span><div><div class="h5">
<<a href="mailto:rougier@par.tuwien.ac.at" target="_blank">rougier@par.tuwien.ac.at</a> <mailto:<a href="mailto:rougier@par.tuwien.ac.at" target="_blank">rougier@par.tuwien.ac.at</a>>> wrote:<br>
<br>
First, as far as I understand, the broadcast should not be between<br>
blocking send on a process and blocking recv on the others. You have to<br>
change your code if you want to keep using blocking communication.<br>
<br>
Then, by running (with the previous modifications), I have got:<br>
Fatal error in MPI_Recv: Invalid buffer pointer, error stack:<br>
MPI_Recv(187): MPI_Recv(buf=(nil), count=8, MPI_DOUBLE, src=0, tag=3,<br>
MPI_COMM_WORLD, status=0x7fffbc4e02d0) failed<br>
MPI_Recv(126): Null buffer pointer<br>
<br>
It is probably an issue on your side, such as bad index.<br>
<br>
Antoine Rougier<br>
<br>
On 05/20/2015 05:17 PM, Umesh Shisode wrote:<br>
> Hello Antoine Rougier,<br>
><br>
> Thanks for your reply. Now I have code which can broadcast vector<br>
as well<br>
> as Matrix object (Attached here). But it is giving error when I<br>
tried to<br>
> send and receive part of matrix object it is giving me error.<br>
Thanks again<br>
> for your time. Please help me out. As it is not giving me correct<br>
answer. I<br>
> am waiting for your reply.<br>
> Sorry for your inconvenience.<br>
><br>
> I have attached here new code. It compiles when I want to<br>
broadcast. But<br>
> giving error for send and receive. I also attached error in png file.<br>
><br>
> Regards,<br>
><br>
> Umesh Sharad Shisode,<br>
> M.Tech in Modeling and Simulation(2013-15),<br>
> Centre for Modeling and Simulation,<br>
> University of Pune.<br>
><br>
> On Wed, May 20, 2015 at 4:07 PM, Antoine Rougier<br></div></div>
<<a href="mailto:rougier@par.tuwien.ac.at" target="_blank">rougier@par.tuwien.ac.at</a> <mailto:<a href="mailto:rougier@par.tuwien.ac.at" target="_blank">rougier@par.tuwien.ac.at</a>>><div><div class="h5"><br>
> wrote:<br>
><br>
>> Hello,<br>
>><br>
>> I think your issue comes from b.vect=NULL (according to the used<br>
>> constructor) which is not a checked value in T<br>
Vector<T>::get(int i). By<br>
>> the way Ncol is no initialized before using it in MPI_Bcast.<br>
>><br>
>> best regards,<br>
>><br>
>> Antoine Rougier<br>
>><br>
>><br>
>> On 05/20/2015 11:55 AM, Umesh Shisode wrote:<br>
>>> Hello Junchao,<br>
>>><br>
>>> I initialize vector b, but even then it is not working for<br>
broadcasting.<br>
>> It<br>
>>> gives same error. As the vector class is user defined and also<br>
I use<br>
>>> dynamic memory allocation. This may be the reason for failing.<br>
If you<br>
>> know<br>
>>> about it then please tell.<br>
>>> I am here attaching the zip file which contains only the vector<br>
class and<br>
>>> main file as well as error I am facing. Please have a look at<br>
it. Thanks<br>
>>> for your time. I am waiting for your reply.<br>
>>><br>
>>><br>
>>> Regards,<br>
>>><br>
>>> Umesh Sharad Shisode,<br>
>>> M.Tech in Modeling and Simulation(2013-15),<br>
>>> Centre for Modeling and Simulation,<br>
>>> University of Pune.<br>
>>><br>
>>> On Tue, May 19, 2015 at 10:57 PM, Junchao Zhang<br></div></div>
<<a href="mailto:jczhang@mcs.anl.gov" target="_blank">jczhang@mcs.anl.gov</a> <mailto:<a href="mailto:jczhang@mcs.anl.gov" target="_blank">jczhang@mcs.anl.gov</a>>><span class=""><br>
>> wrote:<br>
>>><br>
>>>> Your code "MPI_Bcast(&b(0), b.get_row(), MPI_DOUBLE, 1,<br>
MPI_COMM_WORLD)"<br>
>>>> is OK. You can find manual of MPI_Bcast at<br>
>>>> <a href="http://mpi.deino.net/mpi_functions/MPI_Bcast.html" target="_blank">http://mpi.deino.net/mpi_functions/MPI_Bcast.html</a><br>
>>>> Don't forget to initialize the vector b, in other words,<br>
allocate memory<br>
>>>> for it, on ALL ranks.<br>
>>>><br>
>>>><br>
>>>> --Junchao Zhang<br>
>>>><br>
>>>> On Tue, May 19, 2015 at 9:27 AM, Umesh Shisode<br></span>
<<a href="mailto:ushisode1@gmail.com" target="_blank">ushisode1@gmail.com</a> <mailto:<a href="mailto:ushisode1@gmail.com" target="_blank">ushisode1@gmail.com</a>>><span class=""><br>
>>>> wrote:<br>
>>>><br>
>>>>> Hi Junchao,<br>
>>>>><br>
>>>>> I sort out the problem for MPI_Send() and MPI_Recv(), as I<br>
requested in<br>
>>>>> last mail. Now I have one more difficulty which is how can I<br>
broadcast<br>
>>>>> class object using MPI_Bcast() function. In my case, class is<br>
Vector<br>
>> (you<br>
>>>>> can check it at vect_fun.h header file). I want to broadcast<br>
it to all<br>
>>>>> processes. I have used dynamic memory allocation in the code.<br>
Please<br>
>> help<br>
>>>>> me to solved the issue. I am waiting for your reply. Thanks.<br>
>>>>><br>
>>>>><br>
>>>>> Regards,<br>
>>>>><br>
>>>>> Umesh Sharad Shisode,<br>
>>>>> M.Tech in Modeling and Simulation(2013-15),<br>
>>>>> Centre for Modeling and Simulation,<br>
>>>>> University of Pune.<br>
>>>>><br>
>>>>> On Tue, May 19, 2015 at 7:51 AM, Umesh Shisode<br></span>
<<a href="mailto:ushisode1@gmail.com" target="_blank">ushisode1@gmail.com</a> <mailto:<a href="mailto:ushisode1@gmail.com" target="_blank">ushisode1@gmail.com</a>>><span class=""><br>
>>>>> wrote:<br>
>>>>><br>
>>>>>> Sorry Junchao,<br>
>>>>>><br>
>>>>>> Thanks for your reply. But my problem is with MPICH only. My<br>
question<br>
>> is<br>
>>>>>> how to send part of class object (in my case matrix object)<br>
from one<br>
>>>>>> process to another process using MPI_Send and receive using<br>
MPI_Recv<br>
>>>>>> functions. I tried a lot of way but couldn't do it. I hope<br>
you will<br>
>> help<br>
>>>>>> me. Thanks in advance. I have write a function to get the<br>
pointer<br>
>> address<br>
>>>>>> for first parameter of MPI_Send() function. Waiting for your<br>
reply.<br>
>>>>>><br>
>>>>>> Regards,<br>
>>>>>><br>
>>>>>> Umesh Sharad Shisode,<br>
>>>>>> M.Tech in Modeling and Simulation(2013-15),<br>
>>>>>> Centre for Modeling and Simulation,<br>
>>>>>> University of Pune.<br>
>>>>>><br>
>>>>>> On Mon, May 18, 2015 at 7:31 PM, Junchao Zhang<br></span>
<<a href="mailto:jczhang@mcs.anl.gov" target="_blank">jczhang@mcs.anl.gov</a> <mailto:<a href="mailto:jczhang@mcs.anl.gov" target="_blank">jczhang@mcs.anl.gov</a>>><span class=""><br>
>>>>>> wrote:<br>
>>>>>><br>
>>>>>>> Could not reproduce it with the latest MPICH. If the<br>
problem is not<br>
>>>>>>> specific to MPICH, you'd better move your question to other<br>
forums<br>
>> like<br>
>>>>>>> stackoverflow.<br>
>>>>>>><br>
>>>>>>> $mpirun -n 2 ./test<br>
>>>>>>> Matrix A :<br>
>>>>>>><br>
>>>>>>> 1 2 3 4<br>
>>>>>>> 1 2 3 4<br>
>>>>>>> 1 2 3 4<br>
>>>>>>> 1 2 3 4<br>
>>>>>>><br>
>>>>>>> Vector b before broadcast:<br>
>>>>>>> 1.000000, 2.000000, 3.000000, 4.000000<br>
>>>>>>> Matrix A column : 4<br>
>>>>>>> after sending: lLim = 2 uLim = 4 for rank : 1<br>
>>>>>>> count = 8<br>
>>>>>>><br>
>>>>>>> Matrix A column : 0for rank = 1<br>
>>>>>>> after receive: lLim = 2 uLim = 4 for rank : 1<br>
>>>>>>> Ncol after broadcasting = 4<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> --Junchao Zhang<br>
>>>>>>><br>
>>>>>>> On Mon, May 18, 2015 at 6:33 AM, Umesh Shisode<br></span>
<<a href="mailto:ushisode1@gmail.com" target="_blank">ushisode1@gmail.com</a> <mailto:<a href="mailto:ushisode1@gmail.com" target="_blank">ushisode1@gmail.com</a>>><div><div class="h5"><br>
>>>>>>> wrote:<br>
>>>>>>><br>
>>>>>>>> Hello Sir / Madam,<br>
>>>>>>>><br>
>>>>>>>> This is Umesh Sharad Shisode, pursuing Masters in Modeling and<br>
>>>>>>>> Simulation, at Centre for Modeling and Simulation, Pune<br>
University.<br>
>> I am in<br>
>>>>>>>> the final stage of my course. My Masters Thesis title is :<br>
>>>>>>>><br>
>>>>>>>> Development of Conjugate Gradient solver in OpenFOAM /<br>
CPP using<br>
>>>>>>>> MPI<br>
>>>>>>>><br>
>>>>>>>> I am now doing MPI part of my project and facing some<br>
problems with<br>
>>>>>>>> MPI functions syntax. I am trying to use CPP class object<br>
with MPI<br>
>>>>>>>> functions but it is giving some error. Which I don't<br>
understand.<br>
>>>>>>>><br>
>>>>>>>> Operating system : LINUX<br>
>>>>>>>> Programming Language : CPP<br>
>>>>>>>><br>
>>>>>>>> Commands I am using are :<br>
>>>>>>>><br>
>>>>>>>> > mpic++ main.cpp -o result<br>
>>>>>>>> > mpirun -np 2 result<br>
>>>>>>>><br>
>>>>>>>> Please help me to sort out this issue . I am attaching<br>
herewith zip<br>
>>>>>>>> file containing the code which I want to parallelize with<br>
the png<br>
>> file<br>
>>>>>>>> containing error. Waiting for your reply. Thanks in advance.<br>
>>>>>>>><br>
>>>>>>>> Regards,<br>
>>>>>>>><br>
>>>>>>>> Umesh Sharad Shisode,<br>
>>>>>>>> M.Tech in Modeling and Simulation(2013-15),<br>
>>>>>>>> Centre for Modeling and Simulation,<br>
>>>>>>>> University of Pune.<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> _______________________________________________<br>
>>>>>>>> discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br></div></div>
<mailto:<a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a>><span class=""><br>
>>>>>>>> To manage subscription options or unsubscribe:<br>
>>>>>>>> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
>>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> _______________________________________________<br>
>>>>>>> discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br></span>
<mailto:<a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a>><span class=""><br>
>>>>>>> To manage subscription options or unsubscribe:<br>
>>>>>>> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
>>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>><br>
>>>>> _______________________________________________<br></span>
>>>>> discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a> <mailto:<a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a>><span class=""><br>
>>>>> To manage subscription options or unsubscribe:<br>
>>>>> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
>>>>><br>
>>>><br>
>>>><br>
>>>> _______________________________________________<br></span>
>>>> discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a> <mailto:<a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a>><span class=""><br>
>>>> To manage subscription options or unsubscribe:<br>
>>>> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br></span>
>>> discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a> <mailto:<a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a>><span class=""><br>
>>> To manage subscription options or unsubscribe:<br>
>>> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
>>><br>
>><br>
>><br>
>> _______________________________________________<br></span>
>> discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a> <mailto:<a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a>><span class=""><br>
>> To manage subscription options or unsubscribe:<br>
>> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
>><br>
><br>
><br>
><br>
> _______________________________________________<br></span>
> discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a> <mailto:<a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a>><span class=""><br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
><br>
<br>
<br>
_______________________________________________<br></span>
discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a> <mailto:<a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a>><span class=""><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
_______________________________________________<br>
discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
</div></div></blockquote></div><br></div>