Job.ecl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*##############################################################################
  2. ## HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®. All rights reserved.
  3. ############################################################################## */
  4. RETURN MODULE
  5. /*
  6. * Internal functions for accessing system information relating to the current job.
  7. *
  8. * This module is provisional and subject to change without notice.
  9. */
  10. shared externals :=
  11. SERVICE
  12. varstring daliServer() : once, ctxmethod, entrypoint='getDaliServers';
  13. varstring jobname() : once, ctxmethod, entrypoint='getJobName';
  14. varstring jobowner() : once, ctxmethod, entrypoint='getJobOwner';
  15. varstring cluster() : once, ctxmethod, entrypoint='getClusterName';
  16. varstring platform() : once, ctxmethod, entrypoint='getPlatform';
  17. varstring os() : once, ctxmethod, entrypoint='getOS';
  18. unsigned integer4 logString(const varstring text) : ctxmethod, entrypoint='logString';
  19. END;
  20. /*
  21. * How many nodes in the cluster that this code will be executed on.
  22. */
  23. export nodes() := CLUSTERSIZE;
  24. /*
  25. * Returns the name of the current workunit.
  26. */
  27. export wuid() := WORKUNIT;
  28. /*
  29. * Returns the dali server this thor is connected to.
  30. */
  31. export daliServer() := externals.daliServer();
  32. /*
  33. * Returns the name of the current job.
  34. */
  35. export name() := externals.jobname();
  36. /*
  37. * Returns the name of the user associated with the current job.
  38. */
  39. export user() := externals.jobowner();
  40. /*
  41. * Returns the name of the cluster the current job is targetted at.
  42. */
  43. export target() := externals.cluster();
  44. /*
  45. * Returns the platform type the job is running on.
  46. */
  47. export platform() := externals.platform();
  48. /*
  49. * Returns a string representing the target operating system.
  50. */
  51. export os() := externals.os();
  52. /*
  53. * Adds the string argument to the current logging context.
  54. *
  55. * @param text The string to add to the logging.
  56. */
  57. export logString(const varstring text) := externals.logString(text);
  58. END;