printLog macro
This commit is contained in:
parent
9f3d21ac20
commit
f4711dab25
|
@ -24,6 +24,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#define BASE_H
|
#define BASE_H
|
||||||
|
|
||||||
|
@ -37,6 +38,9 @@ struct {
|
||||||
int *space;
|
int *space;
|
||||||
} typedef IntArray_t;
|
} typedef IntArray_t;
|
||||||
|
|
||||||
|
#define LOGMSG "[%s]"
|
||||||
|
#define printLog(FORMAT, ...) printf(LOGMSG " " FORMAT, __func__, ##__VA_ARGS__)
|
||||||
|
|
||||||
//
|
//
|
||||||
// Scheduler
|
// Scheduler
|
||||||
//
|
//
|
||||||
|
|
|
@ -53,6 +53,8 @@ void SchedulerCrashTest(void)
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
printLog("Starting gem-graph-server...\n");
|
||||||
|
|
||||||
//
|
//
|
||||||
// Creating parameters structure for the Scheduler
|
// Creating parameters structure for the Scheduler
|
||||||
//
|
//
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
#include "../include/base.h"
|
#include "../include/base.h"
|
||||||
#include "../include/localworker.h"
|
#include "../include/localworker.h"
|
||||||
|
|
||||||
|
#include <sys/sysinfo.h>
|
||||||
|
|
||||||
static void *GreatScheduler(void *parameters);
|
static void *GreatScheduler(void *parameters);
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
@ -41,9 +43,13 @@ pthread_t *SchedInit(SchedulerParams_t *parameters)
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
static void *GreatScheduler(void *params)
|
static void *GreatScheduler(void *params)
|
||||||
{
|
{
|
||||||
|
// récupération des paramètres et annonce
|
||||||
SchedulerParams_t *parameters = (SchedulerParams_t*) params;
|
SchedulerParams_t *parameters = (SchedulerParams_t*) params;
|
||||||
|
printLog("Scheduler id %lu: I'm alive!\n", *(parameters->id));
|
||||||
|
|
||||||
|
int ncpu = get_nprocs();
|
||||||
|
printLog("%d CPUs available.\n", ncpu);
|
||||||
|
|
||||||
printf("Scheduler id %p: I'm alive!\n", parameters->id);
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue