Changeset 79290f for pcp/src/output.c
- Timestamp:
- Jun 7, 2008, 1:13:29 PM (17 years ago)
- Children:
- 02bc3c
- Parents:
- a97897
- File:
-
- 1 edited
-
pcp/src/output.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pcp/src/output.c
ra97897 r79290f 30 30 $Id: output.c,v 1.51.2.2 2007-04-21 12:55:50 foo Exp $ 31 31 */ 32 33 #ifdef HAVE_CONFIG_H 34 #include <config.h> 35 #endif 36 32 37 #include<stdlib.h> 33 38 #include<stdio.h> … … 310 315 int OutputSrcPsiDensity(struct Problem *P, enum PsiTypeTag type) 311 316 { 312 int i,j,k, Index, zahl, owner; 317 int i,j,k, Index, owner; 318 size_t zahl; 313 319 struct Lattice *Lat = &P->Lat; 314 320 //struct RunStruct *R = &P->R; … … 414 420 Error(SomeError, "OutputSrcPsiDensity: MPI_Recv of loaded coefficients failed!"); 415 421 MPI_Get_count(&status, MPI_DOUBLE, &zahl); 416 if (zahl != LevS->Dens->LocalSizeR) // check number of elements422 if (zahl != (size_t)LevS->Dens->LocalSizeR) // check number of elements 417 423 fprintf(stderr,"(%i)OutputSrcPsiDensity: MPI_Recv of loaded coefficients of GlobalNo %i, owner %i failed: Too few coefficients - %i instead of %i!\n", P->Par.me, k, i, zahl, LevS->Dens->LocalSizeR); 418 424 //else … … 423 429 Error(SomeError, "OutputSrcPsiDensity: MPI_Recv of loaded coefficients failed!"); 424 430 MPI_Get_count(&status, MPI_DOUBLE, &zahl); 425 if (zahl != LevS->Dens->LocalSizeR) // check number of elements431 if (zahl != (size_t)LevS->Dens->LocalSizeR) // check number of elements 426 432 fprintf(stderr,"(%i)OutputSrcPsiDensity: MPI_Recv of loaded coefficients of GlobalNo %i, owner %i failed: Too few coefficients - %i instead of %i!\n", P->Par.me, k, i, zahl, LevS->Dens->LocalSizeR); 427 433 //else … … 445 451 Error(SomeError, "OutputSrcPsiDensity: MPI_Recv of loaded coefficients failed!"); 446 452 MPI_Get_count(&status, MPI_DOUBLE, &zahl); 447 if (zahl != LevS->Dens->LocalSizeR) // check number of elements453 if (zahl != (size_t)LevS->Dens->LocalSizeR) // check number of elements 448 454 fprintf(stderr,"(%i)OutputSrcPsiDensity: MPI_Recv of loaded coefficients of GlobalNo %i, owner %i failed: Too few coefficients - %i instead of %i!\n", P->Par.me, k, owner, zahl, LevS->Dens->LocalSizeR); 449 455 //else … … 570 576 int N[NDIM], GlobalNo[2]; 571 577 int LevelNo, readnr=0; 572 int zahl, signal = test ? 1 : 2; // 0 - ok, 1 - test failed, 2 - throw Error 578 int breaksignal = test ? 1 : 2; // 0 - ok, 1 - test failed, 2 - throw Error 579 size_t zahl; 573 580 char suffixdat[MAXSTRINGSIZE], suffixdoc[MAXSTRINGSIZE]; 574 int read_type, Num = 0, colorNo = 0; 581 int Num = 0, colorNo = 0; 582 enum PsiTypeTag read_type; 575 583 char spin[20]; 576 584 double Eps[2]; … … 611 619 debug(P,"ReadSrcPsiDensity: doc file pointer NULL\n"); 612 620 if (test) { 613 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)621 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 614 622 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 615 623 return 0; 616 624 } 617 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)625 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 618 626 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 619 627 Error(SomeError,"ReadSrcPsiDensity: cannot open doc file!"); … … 635 643 fclose(SrcPsiDoc); 636 644 if (test) { 637 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)645 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 638 646 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 639 647 return 0; 640 648 } 641 649 fprintf(stderr,"ReadSrcPsiDensity: Only %i items read!\n",readnr); 642 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)650 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 643 651 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 644 652 Error(SomeError, "ReadSrcPsiDensity: read error"); … … 649 657 fclose(SrcPsiDoc); 650 658 if (test) { 651 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)659 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 652 660 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 653 661 return 0; 654 662 } 655 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)663 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 656 664 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 657 665 Error(SomeError,"ReadSrcPsiDensity: Mismatching levels!"); … … 666 674 if (test) { 667 675 fprintf(stderr,"(%i) Min\t N(x,y,z)\tPsiNo+AddNo\n file: %s\t %i %i %i\t %i + %i\nsystem: %s\t %d %d %d\t %d + %d\n",P->Par.me, R->MinimisationName[read_type], N[0], N[1], N[2], GlobalNo[0], GlobalNo[1], R->MinimisationName[R->CurrentMin], LevS->N[0] , LevS->N[1], LevS->N[2], Lat->Psi.GlobalNo[PsiMaxNoDouble], Lat->Psi.GlobalNo[PsiMaxAdd]); 668 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)676 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 669 677 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 670 678 return 0; 671 679 } 672 680 fprintf(stderr,"ReadSrcPsiDensity: Type %i != CurrentMin %i || N[0] %i != %i || N[1] %i != %i || N[2] %i != %i || %s %i + %i != %i + %i\n", read_type, R->CurrentMin, N[0], LevS->N[0], N[1], LevS->N[1], N[2], LevS->N[2], spin, GlobalNo[0], GlobalNo[1], Num, P->Lat.Psi.GlobalNo[PsiMaxAdd]); 673 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)681 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 674 682 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 675 683 Error(SomeError,"ReadSrcPsiDensity: srcpsi file does not fit to system"); 676 684 } 677 signal = 0; // everything went alright, signal ok678 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)685 breaksignal = 0; // everything went alright, signal ok 686 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 679 687 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 680 688 } else { // others wait for signal from root process 681 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)689 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 682 690 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 683 if ( signal == 1)691 if (breaksignal == 1) 684 692 return 0; 685 else if ( signal == 2)693 else if (breaksignal == 2) 686 694 Error(SomeError, "ReadSrcPsiDensity: Something went utterly wrong, see root process"); 687 695 else if (P->Call.out[PsiOut]) … … 748 756 Error(SomeError, "ReadSrcPsiDensity: MPI_Recv of loaded coefficients failed!"); 749 757 MPI_Get_count(&status, MPI_DOUBLE, &zahl); 750 if (zahl != LevS->Dens->LocalSizeR) // check number of elements758 if (zahl != (size_t)LevS->Dens->LocalSizeR) // check number of elements 751 759 fprintf(stderr,"(%i)ReadSrcPsiDensity: MPI_Recv from process 0 of loaded coefficients of GlobalNo %i, owner %i failed: Too few coefficients - %i instead of %i!\n", P->Par.me, k, owner, zahl, LevS->Dens->LocalSizeR); 752 760 //else … … 766 774 Error(SomeError, "ReadSrcPsiDensity: MPI_Recv of loaded coefficients failed!"); 767 775 MPI_Get_count(&status, MPI_DOUBLE, &zahl); 768 if (zahl != LevS->Dens->LocalSizeR) // check number of elements776 if (zahl != (size_t)LevS->Dens->LocalSizeR) // check number of elements 769 777 fprintf(stderr,"(%i)ReadSrcPsiDensity: MPI_Recv of loaded coefficients of GlobalNo %i, owner %i failed: Too few coefficients - %i instead of %i!\n", P->Par.me, k, P->Par.me_comm_ST_Psi, zahl, LevS->Dens->LocalSizeR); 770 778 //else
Note:
See TracChangeset
for help on using the changeset viewer.
