[OMPI users] Multiple connections to MySQL vi MPI
Hello, I am trying to connect to MySQL with the following if (!mysql_real_connect(connection,server,user,password,database, 0, NULL, 0)) { printf("Conection error : %s\n", mysql_error(connection)); exit(1); } The code compiles with g++ and works fine. It compiles with mpicxx as well but when run through pbs script mpirun -np 1 -hostfile $PBS_NODEFILE mysqlconnect I get a run time error Conection error : Access denied for user 'someUser'@'node2' (using password: YES) I guess mysql itself adds the @ "node2" and my connection fails. How can I prevent this, any suggestions? thanks in advance _alev ___ users mailing list users@lists.open-mpi.org https://rfd.newmexicoconsortium.org/mailman/listinfo/users
[OMPI users] Signal code: Address not mapped (1) error
Hi the following codes compiles fine but gives some run time errors. Ant suggestions to fix the problem. cheers Code #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MASTER 0 int arraySize = 7; using namespace std; namespace mpi = boost::mpi; struct field { string field_name; string field_type; string field_ref; string field_colType; }; namespace boost { namespace serialization{ template void serialize(Archive & ar, struct field & f, unsigned int version){ ar & f.field_name; ar & f.field_type; ar & f.field_ref; ar & f.field_colType; } } } int main(int argc, char* argv[]) { mpi::environment env(argc, argv); mpi::communicator world; int m_mySize, w_mySize, kk,i; struct field *relAllValues; struct field *relMyValues; vector C; struct field c; w_mySize = arraySize / world.size(); cout << "w_mySize = " << w_mySize << endl; if (world.rank() == MASTER){ for(int i = 0; i < arraySize; i++){ c.field_name = "field_name=" ; c.field_type = "field_type="; c.field_ref = "field_ref="; c.field_colType = "field_colType="; C.push_back(c); } m_mySize = arraySize / world.size() + arraySize % world.size(); relMyValues = (struct field *) malloc(sizeof(struct field) * w_mySize); relAllValues = (struct field *) malloc(sizeof(struct field) * arraySize); } else{ relMyValues = (struct field *) malloc(sizeof(struct field) * w_mySize); } if (world.rank() == MASTER){ scatter(world, C, relMyValues, w_mySize, 0); } else{ scatter(world, C, relMyValues, w_mySize, 0); } } and the run time errors [ceng34:00724] *** Process received signal *** [ceng34:00724] Signal: Segmentation fault (11) [ceng34:00724] Signal code: Address not mapped (1) [ceng34:00724] Failing at address: 0xfff8 [ceng34:00724] [ 0] /lib64/libpthread.so.0 [0x315880de80] [ceng34:00724] [ 1] /usr/lib64/libstdc++.so.6(_ZN9__gnu_cxx18__exchange_and_addEPVii+0x2) [0x385dab7672] [ceng34:00724] [ 2] /usr/lib64/libstdc++.so.6(_ZNSs6assignERKSs+0x9b) [0x385da9ca4b] [ceng34:00724] [ 3] test-boost(_ZN5fieldaSERKS_+0x47) [0x42197f] [ceng34:00724] [ 4] test-boost(_ZNSt6__copyILb0ESt26random_access_iterator_tagE4copyIPK5fieldPS3_EET0_T_S8_S7_+0x3c) [0x4221be] [ceng34:00724] [ 5] test-boost(_ZSt10__copy_auxIPK5fieldPS0_ET0_T_S5_S4_+0x29) [0x422203] [ceng34:00724] [ 6] test-boost(_ZNSt13__copy_normalILb0ELb0EE6copy_nIPK5fieldPS2_EET0_T_S7_S6_+0x25) [0x4b] [ceng34:00724] [ 7] test-boost(_ZSt4copyIPK5fieldPS0_ET0_T_S5_S4_+0x2d) [0x42225b] [ceng34:00724] [ 8] test-boost(_ZN5boost3mpi6detail12scatter_implI5fieldEEvRKNS0_12communicatorEPKT_PS7_iiN4mpl_5bool_ILb0EEE+0x90) [0x42a630] [ceng34:00724] [ 9] test-boost(_ZN5boost3mpi7scatterI5fieldEEvRKNS0_12communicatorEPKT_PS6_ii+0x50) [0x42b162] [ceng34:00724] [10] test-boost(_ZN5boost3mpi7scatterI5fieldEEvRKNS0_12communicatorERKSt6vectorIT_SaIS7_EEPS7_ii+0x55) [0x42b1db] [ceng34:00724] [11] test-boost(main+0x20e) [0x420880] [ceng34:00724] [12] /lib64/libc.so.6(__libc_start_main+0xf4) [0x3157c1d8b4] [ceng34:00724] [13] test-boost(__gxx_personality_v0+0x169) [0x420489] [ceng34:00724] *** End of error message *** mpirun noticed that job rank 0 with PID 724 on node ceng34-ib exited on signal 11 (Segmentation fault).
Re: [OMPI users] Signal code: Address not mapped (1) error
Oh yes Dorian, now it works! On Thu, Mar 18, 2010 at 11:57 AM, Dorian Krause wrote: > Hi, > > Since you are using std::string in your structure you should allocate the > memory with "new" instead of "malloc". Otherwise the constructor of > std::string is not called and things like the length() of a string might not > give the desired result leading boost to iterate over too many chars. > > I don't know if this is the particular problem here but it might be ... > > > > On Mar 17, 2010, at 6:11 AM, alev mutlu wrote: >> >> >> >>> Hi the following codes compiles fine but gives some run time errors. >>> Ant suggestions to fix the problem. >>> >>> cheers >>> >>> >>> Code >>> >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> >>> >>> >>> #include >>> #include >>> #include >>> #include >>> >>> #define MASTER 0 >>> >>> int arraySize = 7; >>> >>> using namespace std; >>> namespace mpi = boost::mpi; >>> >>> struct field { >>> string field_name; >>> string field_type; >>> string field_ref; >>> string field_colType; >>> >>> }; >>> >>> namespace boost { >>> namespace serialization{ >>> template >>> void serialize(Archive& ar, struct field& f, unsigned int >>> version){ >>> ar& f.field_name; >>> ar& f.field_type; >>> ar& f.field_ref; >>> ar& f.field_colType; >>> } >>> } >>> } >>> >>> int main(int argc, char* argv[]) >>> { >>> mpi::environment env(argc, argv); >>> mpi::communicator world; >>> int m_mySize, w_mySize, kk,i; >>> struct field *relAllValues; >>> struct field *relMyValues; >>> vector C; >>> struct field c; >>> >>> w_mySize = arraySize / world.size(); >>> cout<< "w_mySize = "<< w_mySize<< endl; >>> if (world.rank() == MASTER){ >>> for(int i = 0; i< arraySize; i++){ >>> c.field_name = "field_name=" ; >>> c.field_type = "field_type="; >>> c.field_ref = "field_ref="; >>> c.field_colType = "field_colType="; >>> C.push_back(c); >>> } >>> m_mySize = arraySize / world.size() + arraySize % world.size(); >>> relMyValues = (struct field *) malloc(sizeof(struct field) * >>> w_mySize); >>> relAllValues = (struct field *) malloc(sizeof(struct field) * >>> arraySize); >>> >>> } >>> else{ >>> relMyValues = (struct field *) malloc(sizeof(struct field) * >>> w_mySize); >>> } >>> >>> if (world.rank() == MASTER){ >>> scatter(world, C, relMyValues, w_mySize, 0); >>> } >>> else{ >>> scatter(world, C, relMyValues, w_mySize, 0); >>> } >>> } >>> >>> and the run time errors >>> >>> [ceng34:00724] *** Process received signal *** >>> [ceng34:00724] Signal: Segmentation fault (11) >>> [ceng34:00724] Signal code: Address not mapped (1) >>> [ceng34:00724] Failing at address: 0xfff8 >>> [ceng34:00724] [ 0] /lib64/libpthread.so.0 [0x315880de80] >>> [ceng34:00724] [ 1] >>> /usr/lib64/libstdc++.so.6(_ZN9__gnu_cxx18__exchange_and_addEPVii+0x2) >>> [0x385dab7672] >>> [ceng34:00724] [ 2] /usr/lib64/libstdc++.so.6(_ZNSs6assignERKSs+0x9b) >>> [0x385da9ca4b] >>> [ceng34:00724] [ 3] test-boost(_ZN5fieldaSERKS_+0x47) [0x42197f] >>> [ceng34:00724] [ 4] >>> test-boost(_ZNSt6__copyILb0ESt26random_access_iterator_tagE4copyIPK5fieldPS3_EET0_