(const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension> >&) const;
template
- void FEValuesViews::SymmetricTensor<2,deal_II_dimension>::get_function_values<dealii::IndexSet>
+ void FEValuesViews::SymmetricTensor<2,deal_II_dimension,deal_II_dimension>::get_function_values<dealii::IndexSet>
(const dealii::IndexSet&, std::vector<dealii::SymmetricTensor<2,deal_II_dimension> >&) const;
template
- void FEValuesViews::SymmetricTensor<2,deal_II_dimension>::get_function_divergences<dealii::IndexSet>
+ void FEValuesViews::SymmetricTensor<2,deal_II_dimension,deal_II_dimension>::get_function_divergences<dealii::IndexSet>
(const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension> >&) const;
# define __GNUC__ 3
#endif
-#include <sys/wait.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <unistd.h>
-
+#ifndef DEAL_II_MSVC
+# include <sys/wait.h>
+# include <unistd.h>
#ifndef DEAL_II_USE_DIRECT_ERRNO_H
# include <errno.h>
#else
# include </usr/include/errno.h>
#endif
#include <sys/errno.h>
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <signal.h>
+
DEAL_II_NAMESPACE_OPEN
// repeat writing until
// syscall is not
// interrupted
- int ret;
+ int ret = -1;
+#ifndef DEAL_II_MSVC
do
ret = write (server_client_pipe[1],
reinterpret_cast<const char *> (t) + count,
sizeof(T) * N - count);
while ((ret<0) && (errno==EINTR));
+#else
+ Assert (false,
+ ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
if (ret < 0)
die ("error on client side in 'put'", ret, errno, child_pid);
unsigned int count = 0;
while (count < sizeof(T)*N)
{
- int ret;
+ int ret = -1;
+#ifndef DEAL_II_MSVC
do
- ret = read (client_server_pipe[0],
- reinterpret_cast<char *> (t) + count,
+ ret = write (server_client_pipe[1],
+ reinterpret_cast<const char *> (t) + count,
sizeof(T) * N - count);
while ((ret<0) && (errno==EINTR));
+#else
+ Assert (false,
+ ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
if (ret < 0)
die ("error on client side in 'get'", ret, errno, child_pid);
// Assign the result of write
// and reset the variable to
// avoid compiler warnings
-//TODO:[WB] Should t be used to trace errors?
+#ifndef DEAL_II_MSVC
+//TODO:[WB] Shouldn't t be used to trace errors?
ssize_t t = write (detached_mode_data->server_client_pipe[1], "7", 1);
(void)t;
+#else
+ Assert (false,
+ ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
// then also delete data
delete detached_mode_data;
detached_mode_data = 0;
// Assign the return value to a
// variable to avoid compiler
// warnings
+#ifndef DEAL_II_MSVC
//TODO:[WB] Use t to trace errors?
int t = pipe(detached_mode_data->server_client_pipe);
(void)t;
-
+#else
+ Assert (false,
+ ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
// fflush(NULL) is said to be a
// good idea before fork()
std::fflush(NULL);
// now fork and create child
// process
+#ifndef DEAL_II_MSVC
+ // BG comment out until pipes are implemented in MSVC
detached_mode_data->child_pid = fork();
+#else
+ Assert (false,
+ ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
+
if (detached_mode_data->child_pid == 0)
// child process starts here
{
// pipe to stdin, and
// likewise with write end
// of pipe to stdout
+#ifndef DEAL_II_MSVC
dup2(detached_mode_data->server_client_pipe[0], 0);
close(detached_mode_data->server_client_pipe[0]);
const char * const child_argv[] = { program_name, NULL };
execv(program_name, const_cast<char * const *>(child_argv));
+
// usually execv does not
// return. if it does, then an
// error happened and we report it
// herewith:
- AssertThrow (false,
- ExcMessage ("execv returned, which it is not supposed to do!"));
- std::exit(1);
+ AssertThrow (false,
+ ExcMessage ("execv returned, which it is not supposed to do!"));
+ std::exit(1);
+
+#else
+ Assert (false,
+ ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
};
// parent process continues
// here. first thing is to
// process was somehow
// terminated without sending
// him this information
+#ifndef DEAL_II_MSVC
const pid_t parent_pid = getpid();
detached_mode_data->put (&parent_pid, 1, "parent_pid");
+#else
+ Assert (false,
+ ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
};