diff --git a/library/lammpi/prologterms2c.c b/library/lammpi/prologterms2c.c index 88673202a..7996f9e2c 100644 --- a/library/lammpi/prologterms2c.c +++ b/library/lammpi/prologterms2c.c @@ -208,8 +208,8 @@ YAP_Term string2term(char *const ptr,const size_t *size) { YAP_Term t; struct buffer_ds b; - b.size=b.len=b.pos=0; + b.size=b.len=b.pos=0; if (BUFFER_PTR!=ptr) { // #ifdef DEBUG write_msg(__FUNCTION__,__FILE__,__LINE__,"copy buffer string2term\n"); @@ -222,7 +222,6 @@ string2term(char *const ptr,const size_t *size) { b.ptr=NULL; } BUFFER_POS=0; - LOCAL_ErrorMessage=NULL; t = YAP_ReadBuffer( BUFFER_PTR , NULL ); if ( t==FALSE ) { write_msg(__FUNCTION__,__FILE__,__LINE__,"FAILED string2term>>>>size:%d %d %s\n",BUFFER_SIZE,strlen(BUFFER_PTR),LOCAL_ErrorMessage); diff --git a/library/lammpi/yap_mpi.c b/library/lammpi/yap_mpi.c index 4bba051f9..daa8e38e4 100644 --- a/library/lammpi/yap_mpi.c +++ b/library/lammpi/yap_mpi.c @@ -260,8 +260,10 @@ static int mpi_error(int errcode){ static int mpi_init(void){ int thread_level; + char ** my_argv; + int my_argc = YAP_Argv(&my_argv); // MPI_Init(&GLOBAL_argc, &GLOBAL_argv); - MPI_Init_thread(&GLOBAL_argc, &GLOBAL_argv,MPI_THREAD_SINGLE,&thread_level); + MPI_Init_thread(&my_argc, &my_argv, MPI_THREAD_SINGLE, &thread_level); #ifdef DEBUG write_msg(__FUNCTION__,__FILE__,__LINE__,"Thread level: %d\n",thread_level); #endif