List Info

Thread: LAM: problem with non-blocking




LAM: problem with non-blocking
user name
2007-03-28 00:08:45
Hi. now im doing parallel GA for my final project using C++. But now im having a problem with my program. when im running my program this kind of error happened :

One of the processes started by mpirun has exited with a nonzero exit
code.  This typically indicates that the process finished in error.
If your process did not finish in error, be sure to include a "return
0 " or "exit(0)" in your C code before exiting the application.

PID 26349 failed on node n0 (10.1.1.1) due to signal 13 .

I hope there is someone can help me
explain whats wrong with my program and whats the maeaning by signal 13. Thanks

Here is algorithm of my program (most of my parallel program at function Objective1) :

.............................................................................................................................................................................................................

int main (argc, argv) { //all in main is master part

MPI::Init(argc, argv);

master = id = 0;

if (id == master) {

ga(); //calling the function GA

MPI::Finalize();

} //end master

} // end main
.
.
.
void ga(); {
.
.
.
float Objective1();

} //function ga

void svm_train(); //function svm_train

float Objective1(); float Objective1(GAGenome& g)
{
 ;
  int p, id, slave;
  int master = 0;
  int tag = 15;
  MPI::Status status;
 
  id = MPI::COMM_WORLD.Get_rank();
   p = MPI::COMM_WORLD.Get_size();

  MPI::Request send[p], recv[p];

  GA1DBinaryStringGenome & genome = (GA1DBinaryStringGenome &)g;
  fstream file_index(indexf,ios::trunc|ios::in|ios::out);//create file for index output
  double score=0.0;

  if (id == master) {

    if(!file_index)
 ;   {
 &nbsp;   &nbsp;  cerr << "Cannot open index1 file  " << file_index << " for input.n&quot;;
   ;  &nbsp;  exit(1);
 &nbsp;  }

 &nbsp;  cout<&lt;"chromosome value "<<++bilang<<&quot;: ";
&nbsp; &nbsp;  &nbsp;  for (int i=0; i<genome.length(); i++)
 ; &nbsp; {
 &nbsp;   &nbsp;   &nbsp;  cout<&lt;(genome.gene(i));
&nbsp; &nbsp;  &nbsp;   &nbsp;  file_index<<( genome.gene(i));
 ; &nbsp; }
   &nbsp;   &nbsp;   &nbsp;  cout<&lt;" ";
&nbsp;  &nbsp;   &nbsp;   &nbsp;  file_index<<endl;
   &nbsp;   &nbsp;   &nbsp;  file_index.close();

  ;  for (slave = 1; slave < p; slave++) {
 &nbsp; &nbsp;   ; &nbsp;  //cout<<"sending to slave "<<slave&lt;<"; from "<<id<&lt;endl;
  ;   &nbsp; send[slave] = MPI::COMM_WORLD.Isend(&indexf, 1, MPI::CHAR, bilang, tag);
&nbsp; &nbsp;  &nbsp; send[slave] = MPI::COMM_WORLD.Isend(&file_index, 1, MPI::CHAR, bilang, tag);

&nbsp; &nbsp; }//end for

 ; &nbsp; }//end master
&nbsp;   else {

 &nbsp;  recv[slave] = MPI::COMM_WORLD.Irecv(&indexf, 1, MPI::CHAR, master, tag);
&nbsp; &nbsp; recv[slave] = MPI::COMM_WORLD.Irecv(&file_index, 1, MPI::CHAR, master, tag);

&nbsp;  &nbsp;  featureselection_train();  //select features (genes) from s2AMLALL_train.fs.data
   &nbsp;  featureselection_test();  //select features (genes) from s2AMLALL_test.fs.data
   &nbsp;  svm_train();

 &nbsp;  send[slave] = MPI::COMM_WORLD.Isend(&cvscore, 1, MPI:OUBLE, master, tag);

&nbsp; &nbsp; }//end slaves

  ;  if (id == master) {

 &nbsp;  for (slave = 1; slave < bilang; slave++) {
 &nbsp;  recv[slave] = MPI::COMM_WORLD.Irecv(&cvscore, 1, MPI::CHAR, slave, tag);

&nbsp; &nbsp; }//end for

 ; &nbsp; //MPI::Request::Waitall(p, recv);

   &nbsp;  //svm__test();
   &nbsp;  //score=testscore;
&nbsp;  &nbsp;  cout<&lt;"&nbsp; cvs in fitness: "<<cvscore<<&quot; "<<endl;

  ;  score=cvscore;

 ; &nbsp; }//end master

&nbsp;  &nbsp;  return score;
&nbsp; }




Re: LAM: problem with non-blocking
user name
2007-03-28 04:06:02
Hello.
I9;m not very familiar with the C++ calls, but some points to watch out for over a quick scan of the code:

1) Do the slaves ever call MPI::Finalize(); ?
2) Do the slaves ever enter ga() or Objective1(); ? main() only has the master doing anything..


On 3/28/07, Muhammad Faiz Misman < faizmismangmail.com">faizmismangmail.com> wrote:
Hi. now im doing parallel GA for my final project using C++. But now im having a problem with my program. when im running my program this kind of error happened :

One of the processes started by mpirun has exited with a nonzero exit
code.  This typically indicates that the process finished in error.
If your process did not finish in error, be sure to include a "return
0 " or "exit(0)" in your C code before exiting the application.

PID 26349 failed on node n0 (10.1.1.1) due to signal 13 .

I hope there is someone can help me
explain whats wrong with my program and whats the maeaning by signal 13. Thanks

Here is algorithm of my program (most of my parallel program at function Objective1) :

.............................................................................................................................................................................................................

int main (argc, argv) { //all in main is master part

MPI::Init(argc, argv);

master = id = 0;

if (id == master) {

ga(); //calling the function GA

MPI::Finalize();

} //end master

} // end main
.
.
.
void ga(); {
.
.
.
float Objective1();

} //function ga

void svm_train(); //function svm_train

float Objective1(); float Objective1(GAGenome&amp; g)
{
 ;
  int p, id, slave;
&nbsp; int master = 0;
  int tag = 15;
  MPI::Status status;
 
&nbsp; id = MPI::COMM_WORLD.Get_rank();
&nbsp;  p = MPI::COMM_WORLD.Get_size();

&nbsp; MPI::Request send[p], recv[p];

  GA1DBinaryStringGenome & genome = (GA1DBinaryStringGenome &)g;
&nbsp; fstream file_index(indexf,ios::trunc|ios::in|ios::out);//create file for index output
&nbsp; double score=0.0;

  if (id == master) {

 &nbsp;  if(!file_index)
 ; &nbsp; {
 &nbsp;   &nbsp;  cerr << "Cannot open index1 file  " << file_index << " for input.n&quot;;
   ;  &nbsp;  exit(1);
 &nbsp;  }

 &nbsp;  cout<&lt;"chromosome value "<<++bilang<<&quot;: ";
&nbsp; &nbsp;  &nbsp;  for (int i=0; i<genome.length(); i++)
 ; &nbsp; {
 &nbsp;   &nbsp;   &nbsp;  cout<&lt;(genome.gene(i));
&nbsp; &nbsp;  &nbsp;   &nbsp;  file_index<<( genome.gene(i));
 ; &nbsp; }
   &nbsp;   &nbsp;   &nbsp;  cout<&lt;" ";
&nbsp;  &nbsp;   &nbsp;   &nbsp;  file_index<<endl;
   &nbsp;   &nbsp;   &nbsp;  file_index.close();

  ;  for (slave = 1; slave < p; slave++) {
 &nbsp; &nbsp;   ; &nbsp;  //cout<<"sending to slave "<<slave&lt;<"; from "<<id<&lt;endl;
  ;   &nbsp; send[slave] = MPI::COMM_WORLD.Isend(&indexf, 1, MPI::CHAR, bilang, tag);
&nbsp; &nbsp;  &nbsp; send[slave] = MPI::COMM_WORLD.Isend(&file_index, 1, MPI::CHAR, bilang, tag);

&nbsp; &nbsp; }//end for

 ; &nbsp; }//end master
&nbsp;   else {

 &nbsp;  recv[slave] = MPI::COMM_WORLD.Irecv(&indexf, 1, MPI::CHAR, master, tag);
&nbsp; &nbsp; recv[slave] = MPI::COMM_WORLD.Irecv(&file_index, 1, MPI::CHAR, master, tag);

&nbsp;  &nbsp;  featureselection_train();  //select features (genes) from s2AMLALL_train.fs.data
   &nbsp;  featureselection_test();  //select features (genes) from s2AMLALL_test.fs.data
   &nbsp;  svm_train();

 &nbsp;  send[slave] = MPI::COMM_WORLD.Isend(&cvscore, 1, MPI:OUBLE, master, tag);

&nbsp; &nbsp; }//end slaves

  ;  if (id == master) {

 &nbsp;  for (slave = 1; slave < bilang; slave++) {
 &nbsp;  recv[slave] = MPI::COMM_WORLD.Irecv(&cvscore, 1, MPI::CHAR, slave, tag);

&nbsp; &nbsp; }//end for

 ; &nbsp; //MPI::Request::Waitall(p, recv);

   &nbsp;  //svm__test();
   &nbsp;  //score=testscore;
&nbsp;  &nbsp;  cout<&lt;"&nbsp; cvs in fitness: "<<cvscore<<&quot; "<<endl;

  ;  score=cvscore;

 ; &nbsp; }//end master

&nbsp;  &nbsp;  return score;
&nbsp; }





_______________________________________________
This list is archived at http://www.lam-mpi.org/MailArchives/lam/



--
(N)E
Re: LAM: problem with non-blocking
user name
2007-03-30 04:11:33
Yes you're right. the slave never enter the function GA() and Objective1(), thanks for your help. Is anybody can help me on giving some advice or idea on how im gonna call the slave in function Objective1() ? because in my program, main() only for master.

On 3/28/07, Elie Choueiri < elie.choueirigmail.com">elie.choueirigmail.com> wrote:
Hello.
I'm not very familiar with the C++ calls, but some points to watch out for over a quick scan of the code:

1) Do the slaves ever call MPI::Finalize(); ?
2) Do the slaves ever enter ga() or Objective1(); ? main() only has the master doing anything..


On 3/28/07, Muhammad Faiz Misman < faizmismangmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">faizmismangmail.com> wrote:
Hi. now im doing parallel GA for my final project using C++. But now im having a problem with my program. when im running my program this kind of error happened :

One of the processes started by mpirun has exited with a nonzero exit
code.  This typically indicates that the process finished in error.
If your process did not finish in error, be sure to include a "return
0 " or "exit(0)" in your C code before exiting the application.

PID 26349 failed on node n0 (10.1.1.1) due to signal 13 .

I hope there is someone can help me
explain whats wrong with my program and whats the maeaning by signal 13. Thanks

Here is algorithm of my program (most of my parallel program at function Objective1) :

.............................................................................................................................................................................................................

int main (argc, argv) { //all in main is master part

MPI::Init(argc, argv);

master = id = 0;

if (id == master) {

ga(); //calling the function GA

MPI::Finalize();

} //end master

} // end main
.
.
.
void ga(); {
.
.
.
float Objective1();

} //function ga

void svm_train(); //function svm_train

float Objective1(); float Objective1(GAGenome&amp; g)
{
 ;
  int p, id, slave;
&nbsp; int master = 0;
  int tag = 15;
  MPI::Status status;
 
&nbsp; id = MPI::COMM_WORLD.Get_rank();
&nbsp;  p = MPI::COMM_WORLD.Get_size();

&nbsp; MPI::Request send[p], recv[p];

  GA1DBinaryStringGenome & genome = (GA1DBinaryStringGenome &)g;
&nbsp; fstream file_index(indexf,ios::trunc|ios::in|ios::out);//create file for index output
&nbsp; double score=0.0;

  if (id == master) {

 &nbsp;  if(!file_index)
 ; &nbsp; {
 &nbsp;   &nbsp;  cerr << "Cannot open index1 file  " << file_index << " for input.n&quot;;
   ;  &nbsp;  exit(1);
 &nbsp;  }

 &nbsp;  cout<&lt;"chromosome value "<<++bilang<<&quot;: ";
&nbsp; &nbsp;  &nbsp;  for (int i=0; i<genome.length(); i++)
 ; &nbsp; {
 &nbsp;   &nbsp;   &nbsp;  cout<&lt;(genome.gene(i));
&nbsp; &nbsp;  &nbsp;   &nbsp;  file_index<<( genome.gene(i));
 ; &nbsp; }
   &nbsp;   &nbsp;   &nbsp;  cout<&lt;" ";
&nbsp;  &nbsp;   &nbsp;   &nbsp;  file_index<<endl;
   &nbsp;   &nbsp;   &nbsp;  file_index.close();

  ;  for (slave = 1; slave < p; slave++) {
 &nbsp; &nbsp;   ; &nbsp;  //cout<<"sending to slave "<<slave&lt;<"; from "<<id<&lt;endl;
  ;   &nbsp; send[slave] = MPI::COMM_WORLD.Isend(&indexf, 1, MPI::CHAR, bilang, tag);
&nbsp; &nbsp;  &nbsp; send[slave] = MPI::COMM_WORLD.Isend(&file_index, 1, MPI::CHAR, bilang, tag);

&nbsp; &nbsp; }//end for

 ; &nbsp; }//end master
&nbsp;   else {

 &nbsp;  recv[slave] = MPI::COMM_WORLD.Irecv(&indexf, 1, MPI::CHAR, master, tag);
&nbsp; &nbsp; recv[slave] = MPI::COMM_WORLD.Irecv(&file_index, 1, MPI::CHAR, master, tag);

&nbsp;  &nbsp;  featureselection_train();  //select features (genes) from s2AMLALL_train.fs.data
   &nbsp;  featureselection_test();  //select features (genes) from s2AMLALL_test.fs.data
   &nbsp;  svm_train();

 &nbsp;  send[slave] = MPI::COMM_WORLD.Isend(&cvscore, 1, MPI:OUBLE, master, tag);

&nbsp; &nbsp; }//end slaves

  ;  if (id == master) {

 &nbsp;  for (slave = 1; slave < bilang; slave++) {
 &nbsp;  recv[slave] = MPI::COMM_WORLD.Irecv(&cvscore, 1, MPI::CHAR, slave, tag);

&nbsp; &nbsp; }//end for

 ; &nbsp; //MPI::Request::Waitall(p, recv);

   &nbsp;  //svm__test();
   &nbsp;  //score=testscore;
&nbsp;  &nbsp;  cout<&lt;"&nbsp; cvs in fitness: "<<cvscore<<&quot; "<<endl;

  ;  score=cvscore;

 ; &nbsp; }//end master

&nbsp;  &nbsp;  return score;
&nbsp; }





_______________________________________________
This list is archived at http://www.lam-mpi.org/MailArchives/lam/



--
(N)E

_______________________________________________
This list is archived at http://www.lam-mpi.org/MailArchives/lam/

Re: LAM: problem with non-blocking
user name
2007-03-30 04:27:06
Organize your code differently.

Instead of saying
id = MPI::COMM_WORLD.Get_rank(); in Objective1(), use it in main().

Then you can say:

if (id == 0) { // master
// do master work
}
else
{ // slave work
}

and if master and slave both call the same function anyway, you can ignore the if's and just call the function..

On 3/30/07, Muhammad Faiz Misman < faizmismangmail.com">faizmismangmail.com> wrote:
Yes you're right. the slave never enter the function GA() and Objective1(), thanks for your help. Is anybody can help me on giving some advice or idea on how im gonna call the slave in function Objective1() ? because in my program, main() only for master.


On 3/28/07, Elie Choueiri < elie.choueirigmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">elie.choueirigmail.com> wrote:
Hello.
I'm not very familiar with the C++ calls, but some points to watch out for over a quick scan of the code:

1) Do the slaves ever call MPI::Finalize(); ?
2) Do the slaves ever enter ga() or Objective1(); ? main() only has the master doing anything..


On 3/28/07, Muhammad Faiz Misman < faizmismangmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">faizmismangmail.com> wrote:
Hi. now im doing parallel GA for my final project using C++. But now im having a problem with my program. when im running my program this kind of error happened :

One of the processes started by mpirun has exited with a nonzero exit
code.  This typically indicates that the process finished in error.
If your process did not finish in error, be sure to include a "return
0 " or "exit(0)" in your C code before exiting the application.

PID 26349 failed on node n0 (10.1.1.1) due to signal 13 .

I hope there is someone can help me
explain whats wrong with my program and whats the maeaning by signal 13. Thanks

Here is algorithm of my program (most of my parallel program at function Objective1) :

.............................................................................................................................................................................................................

int main (argc, argv) { //all in main is master part

MPI::Init(argc, argv);

master = id = 0;

if (id == master) {

ga(); //calling the function GA

MPI::Finalize();

} //end master

} // end main
.
.
.
void ga(); {
.
.
.
float Objective1();

} //function ga

void svm_train(); //function svm_train

float Objective1(); float Objective1(GAGenome&amp; g)
{
 ;
  int p, id, slave;
&nbsp; int master = 0;
  int tag = 15;
  MPI::Status status;
 
&nbsp; id = MPI::COMM_WORLD.Get_rank();
&nbsp;  p = MPI::COMM_WORLD.Get_size();

&nbsp; MPI::Request send[p], recv[p];

  GA1DBinaryStringGenome & genome = (GA1DBinaryStringGenome &)g;
&nbsp; fstream file_index(indexf,ios::trunc|ios::in|ios::out);//create file for index output
&nbsp; double score=0.0;

  if (id == master) {

 &nbsp;  if(!file_index)
 ; &nbsp; {
 &nbsp;   &nbsp;  cerr << "Cannot open index1 file  " << file_index << " for input.n&quot;;
   ;  &nbsp;  exit(1);
 &nbsp;  }

 &nbsp;  cout<&lt;"chromosome value "<<++bilang<<&quot;: ";
&nbsp; &nbsp;  &nbsp;  for (int i=0; i<genome.length(); i++)
 ; &nbsp; {
 &nbsp;   &nbsp;   &nbsp;  cout<&lt;(genome.gene(i));
&nbsp; &nbsp;  &nbsp;   &nbsp;  file_index<<( genome.gene(i));
 ; &nbsp; }
   &nbsp;   &nbsp;   &nbsp;  cout<&lt;" ";
&nbsp;  &nbsp;   &nbsp;   &nbsp;  file_index<<endl;
   &nbsp;   &nbsp;   &nbsp;  file_index.close();

  ;  for (slave = 1; slave < p; slave++) {
 &nbsp; &nbsp;   ; &nbsp;  //cout<<"sending to slave "<<slave&lt;<"; from "<<id<&lt;endl;
  ;   &nbsp; send[slave] = MPI::COMM_WORLD.Isend(&indexf, 1, MPI::CHAR, bilang, tag);
&nbsp; &nbsp;  &nbsp; send[slave] = MPI::COMM_WORLD.Isend(&file_index, 1, MPI::CHAR, bilang, tag);

&nbsp; &nbsp; }//end for

 ; &nbsp; }//end master
&nbsp;   else {

 &nbsp;  recv[slave] = MPI::COMM_WORLD.Irecv(&indexf, 1, MPI::CHAR, master, tag);
&nbsp; &nbsp; recv[slave] = MPI::COMM_WORLD.Irecv(&file_index, 1, MPI::CHAR, master, tag);

&nbsp;  &nbsp;  featureselection_train();  //select features (genes) from s2AMLALL_train.fs.data
   &nbsp;  featureselection_test();  //select features (genes) from s2AMLALL_test.fs.data
   &nbsp;  svm_train();

 &nbsp;  send[slave] = MPI::COMM_WORLD.Isend(&cvscore, 1, MPI:OUBLE, master, tag);

&nbsp; &nbsp; }//end slaves

  ;  if (id == master) {

 &nbsp;  for (slave = 1; slave < bilang; slave++) {
 &nbsp;  recv[slave] = MPI::COMM_WORLD.Irecv(&cvscore, 1, MPI::CHAR, slave, tag);

&nbsp; &nbsp; }//end for

 ; &nbsp; //MPI::Request::Waitall(p, recv);

   &nbsp;  //svm__test();
   &nbsp;  //score=testscore;
&nbsp;  &nbsp;  cout<&lt;"&nbsp; cvs in fitness: "<<cvscore<<&quot; "<<endl;

  ;  score=cvscore;

 ; &nbsp; }//end master

&nbsp;  &nbsp;  return score;
&nbsp; }





_______________________________________________
This list is archived at http://www.lam-mpi.org/MailArchives/lam/



--
(N)E

_______________________________________________
This list is archived at http://www.lam-mpi.org/MailArchives/lam/


_______________________________________________
This list is archived at http://www.lam-mpi.org/MailArchives/lam/



--
(N)E
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )