Skip to content
Snippets Groups Projects
Commit f9e7e7f9 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

simple example on how to use -pid
parent 13bd077b
No related branches found
No related tags found
No related merge requests found
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(void)
{
int i, pid;
FILE *fp;
char str[32];
for(i = 0; i < 5; i++){
system("gmsh -pid fichier.msh fichier.pos > /tmp/gmsh.pid &");
printf("computing %d...\n", i);
sleep(2);
fp = fopen("/tmp/gmsh.pid", "r");
fscanf(fp, "%d", &pid);
sprintf(str, "kill %d", pid);
system(str);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment