fix mpi compilation ( not working but compile ) 68/15568/2
Antoine ELIAS [Thu, 20 Nov 2014 12:13:25 +0000 (13:13 +0100)]
Change-Id: I9e736c11c887c292d66c8d8f6df35d648da5f205

16 files changed:
scilab/Scilab.sln
scilab/modules/mpi/mpi.vcxproj
scilab/modules/mpi/sci_gateway/c/gw_mpi.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_bcast.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_comm_rank.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_comm_size.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_finalize.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_get_processor_name.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_init.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_irecv.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_isend.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_recv.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_send.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_wait.c
scilab/modules/mpi/src/c/deserialization.c
scilab/modules/mpi/src/c/serialization.c

index d081a6e..0e294cf 100644 (file)
@@ -1,6 +1,6 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 2013
-VisualStudioVersion = 12.0.30723.0
+VisualStudioVersion = 12.0.31101.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WScilex", "modules\windows_tools\src\c\WScilex\WScilex.vcxproj", "{CCD80549-EB9C-42AA-9B86-D687377E94F6}"
        ProjectSection(ProjectDependencies) = postProject
@@ -1762,9 +1762,13 @@ Global
                {FC2F9DEC-EF14-401B-A0A9-CCD88552A359}.Release|x64.ActiveCfg = Release|x64
                {FC2F9DEC-EF14-401B-A0A9-CCD88552A359}.Release|x64.Build.0 = Release|x64
                {5E726409-247A-464A-A994-6E6A7A02A981}.Debug|Win32.ActiveCfg = Debug|Win32
+               {5E726409-247A-464A-A994-6E6A7A02A981}.Debug|Win32.Build.0 = Debug|Win32
                {5E726409-247A-464A-A994-6E6A7A02A981}.Debug|x64.ActiveCfg = Debug|x64
+               {5E726409-247A-464A-A994-6E6A7A02A981}.Debug|x64.Build.0 = Debug|x64
                {5E726409-247A-464A-A994-6E6A7A02A981}.Release|Win32.ActiveCfg = Release|Win32
+               {5E726409-247A-464A-A994-6E6A7A02A981}.Release|Win32.Build.0 = Release|Win32
                {5E726409-247A-464A-A994-6E6A7A02A981}.Release|x64.ActiveCfg = Release|x64
+               {5E726409-247A-464A-A994-6E6A7A02A981}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 6daedd8..6d34927 100644 (file)
@@ -80,7 +80,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../libs/mpi/include;includes;src/c;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../../libs/intl</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../elementary_functions/includes;../ast/includes/operations;../ast/includes/ast</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;MPI_EXPORTS;_CRT_SECURE_NO_DEPRECATE;OMPI_IMPORTS;OPAL_IMPORTS;ORTE_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../libs/mpi/include;includes;src/c;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../../libs/intl</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../elementary_functions/includes;../ast/includes/operations;../ast/includes/ast</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;MPI_EXPORTS;_CRT_SECURE_NO_DEPRECATE;OMPI_IMPORTS;OPAL_IMPORTS;ORTE_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../../libs/mpi/include;includes;src/c;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../../libs/intl</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../elementary_functions/includes;../ast/includes/operations;../ast/includes/ast</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;MPI_EXPORTS;_CRT_SECURE_NO_DEPRECATE;OMPI_IMPORTS;OPAL_IMPORTS;ORTE_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../../libs/mpi/include;includes;src/c;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../../libs/intl</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../elementary_functions/includes;../ast/includes/operations;../ast/includes/ast</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;MPI_EXPORTS;_CRT_SECURE_NO_DEPRECATE;OMPI_IMPORTS;OPAL_IMPORTS;ORTE_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
index 10b0eeb..42a614b 100644 (file)
@@ -31,16 +31,6 @@ static gw_generic_table Tab[] =
 /*-----------------------------------------------------------------------------------*/
 int gw_mpi(void)
 {
-    Rhs = Max(0, Rhs);
-
-    if (pvApiCtx == NULL)
-    {
-        pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
-    }
-
-    pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
-    callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
-    return 0;
 }
 
 /*-----------------------------------------------------------------------------------*/
index e93cf85..0edbf4a 100644 (file)
@@ -20,7 +20,7 @@
 #include "serialization.h"
 #include "deserialization.h"
 
-int sci_mpi_bcast(char *fname, unsigned long fname_len)
+int sci_mpi_bcast(char *fname, void* pvApiCtx)
 {
     SciErr sciErr;
     int iRet = 0;
index 9dd1e8b..1167868 100644 (file)
@@ -19,7 +19,7 @@
  * This function returns the rank of a process within
  * the specified communicator.
  */
-int sci_mpi_comm_rank (char *fname, unsigned long fname_len)
+int sci_mpi_comm_rank(char *fname, void* pvApiCtx)
 {
     int comm_rank = 0;
 
index 5c45e5c..fcc4d6a 100644 (file)
@@ -13,7 +13,6 @@
 #include "gw_mpi.h"
 #include "sci_mpi.h"
 #include "api_scilab.h"
-#include "stack-c.h"
 #include "Scierror.h"
 #include "localization.h"
 #include "sci_malloc.h"
@@ -21,7 +20,7 @@
 /**
  * This function returns the rank of a process
  */
-int sci_mpi_comm_size(char *fname, unsigned long fname_len)
+int sci_mpi_comm_size(char *fname, void* pvApiCtx)
 {
     SciErr sciErr;
     int comm_size;
index bb28415..29e67de 100644 (file)
@@ -25,7 +25,7 @@ static void mpi_finalize_internal()
     FREE(request);
 }
 
-int sci_mpi_finalize(char *fname, unsigned long fname_len)
+int sci_mpi_finalize(char *fname, void* pvApiCtx)
 {
     int iRet = 0;
     CheckInputArgument(pvApiCtx, 0, 0);
index 8213bef..37c91bf 100644 (file)
@@ -12,7 +12,6 @@
 #include <stdio.h>
 #include "gw_mpi.h"
 #include "sci_mpi.h"
-#include "stack-c.h"
 #include "api_scilab.h"
 #include "Scierror.h"
 #include "localization.h"
@@ -20,7 +19,7 @@
 /**
  * This function returns the rank of a process
  */
-int sci_mpi_get_processor_name(char *fname, unsigned long fname_len)
+int sci_mpi_get_processor_name(char *fname, void* pvApiCtx)
 {
     int iSizeProcessorName;
     char processorName[MPI_MAX_PROCESSOR_NAME];
index b79ced2..5c8ce15 100644 (file)
@@ -61,7 +61,7 @@ static void mpi_init_internal()
 
 }
 
-int sci_mpi_init(char *fname, unsigned long fname_len)
+int sci_mpi_init(char *fname, void* pvApiCtx)
 {
     int flag;
 
index 5c9e0d3..0041dbc 100644 (file)
@@ -19,7 +19,7 @@
 #include "sci_malloc.h"
 #include "deserialization.h"
 
-int sci_mpi_irecv(char *fname, unsigned long fname_len)
+int sci_mpi_irecv(char *fname, void* pvApiCtx)
 {
     SciErr sciErr;
     int iRet = 0;
index aa45219..71215e7 100644 (file)
@@ -22,7 +22,7 @@
 #define TAG 0
 
 
-int sci_mpi_isend(char *fname, unsigned long fname_len)
+int sci_mpi_isend(char *fname, void* pvApiCtx)
 {
     SciErr sciErr;
     int iRet = 0;
index 8dee71f..38b3952 100644 (file)
@@ -18,7 +18,7 @@
 #include "localization.h"
 #include "deserialization.h"
 
-int sci_mpi_recv(char *fname, unsigned long fname_len)
+int sci_mpi_recv(char *fname, void* pvApiCtx)
 {
     SciErr sciErr;
     int iRet = 0;
index 08a0a28..5f6a108 100644 (file)
@@ -20,7 +20,7 @@
 
 #define TAG 0
 
-int sci_mpi_send(char *fname, unsigned long fname_len)
+int sci_mpi_send(char *fname, void* pvApiCtx)
 {
     SciErr sciErr;
     int iRet = 0;
index b1631fd..41869f2 100644 (file)
@@ -20,7 +20,7 @@
 #include "serialization.h"
 #include "deserialization.h"
 
-int sci_mpi_wait(char *fname, unsigned long fname_len)
+int sci_mpi_wait(char *fname, void* pvApiCtx)
 {
     SciErr sciErr;
     int iRet = 0;
index c36d525..b69ee20 100644 (file)
@@ -290,17 +290,17 @@ int deserialize_from_mpi(void *_pvCtx, int *_piBuffer, int _iBufferSize)
     switch (*_piBuffer)
     {
         case sci_matrix:
-            return deserialize_double(pvApiCtx, _piBuffer, _iBufferSize);
+            return deserialize_double(_pvCtx, _piBuffer, _iBufferSize);
         case sci_strings:
-            return deserialize_string(pvApiCtx, _piBuffer, _iBufferSize);
+            return deserialize_string(_pvCtx, _piBuffer, _iBufferSize);
         case sci_boolean:
-            return deserialize_boolean(pvApiCtx, _piBuffer, _iBufferSize);
+            return deserialize_boolean(_pvCtx, _piBuffer, _iBufferSize);
         case sci_sparse:
-            return deserialize_sparse(pvApiCtx, _piBuffer, _iBufferSize, TRUE);
+            return deserialize_sparse(_pvCtx, _piBuffer, _iBufferSize, TRUE);
         case sci_boolean_sparse:
-            return deserialize_sparse(pvApiCtx, _piBuffer, _iBufferSize, FALSE);
+            return deserialize_sparse(_pvCtx, _piBuffer, _iBufferSize, FALSE);
         case sci_ints:
-            return deserialize_int(pvApiCtx, _piBuffer, _iBufferSize);
+            return deserialize_int(_pvCtx, _piBuffer, _iBufferSize);
         default:
             return -1; //unknow type
     }
index 29303eb..6318ed7 100644 (file)
@@ -15,6 +15,7 @@
 #include "BOOL.h"
 #include "sci_malloc.h"
 #include "serialization.h"
+#include "elem_common.h"
 
 static int serialize_double(void *_pvCtx, int *_piAddr, int **_piBuffer, int *_piBufferSize)
 {
@@ -433,22 +434,22 @@ int serialize_to_mpi(void *_pvCtx, int *_piAddr, int **_piBuffer, int *_piBuffer
     switch (*_piAddr)
     {
         case sci_matrix:
-            return serialize_double(pvApiCtx, _piAddr, _piBuffer, _piBufferSize);
+            return serialize_double(_pvCtx, _piAddr, _piBuffer, _piBufferSize);
             break;
         case sci_strings:
-            return serialize_string(pvApiCtx, _piAddr, _piBuffer, _piBufferSize);
+            return serialize_string(_pvCtx, _piAddr, _piBuffer, _piBufferSize);
             break;
         case sci_boolean:
-            return serialize_boolean(pvApiCtx, _piAddr, _piBuffer, _piBufferSize);
+            return serialize_boolean(_pvCtx, _piAddr, _piBuffer, _piBufferSize);
             break;
         case sci_sparse:
-            return serialize_sparse(pvApiCtx, _piAddr, _piBuffer, _piBufferSize, TRUE);
+            return serialize_sparse(_pvCtx, _piAddr, _piBuffer, _piBufferSize, TRUE);
             break;
         case sci_boolean_sparse:
-            return serialize_sparse(pvApiCtx, _piAddr, _piBuffer, _piBufferSize, FALSE);
+            return serialize_sparse(_pvCtx, _piAddr, _piBuffer, _piBufferSize, FALSE);
             break;
         case sci_ints:
-            return serialize_int(pvApiCtx, _piAddr, _piBuffer, _piBufferSize);
+            return serialize_int(_pvCtx, _piAddr, _piBuffer, _piBufferSize);
             break;
         default:
             return -1;