Changeset 96


Ignore:
Timestamp:
11/23/13 09:05:44 (6 years ago)
Author:
mmamonski
Message:

C -> C++ wrapper for pbs_conn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_drmaa/pbs_conn.c

    r95 r96  
    1818 */ 
    1919 
    20 #ifdef HAVE_CONFIG_H 
     20 #ifdef HAVE_CONFIG_H 
    2121#       include <config.h> 
    2222#endif 
     
    3737#include <signal.h> 
    3838#include <unistd.h> 
    39  
    4039 
    4140 
     
    155154} 
    156155 
    157 #ifdef HAVE_PBS_SUBMIT_HASH 
    158  
    159  
    160 #include <torque4.h> 
     156#define HAS_PBS_SUBMIT_HASH              
     157#ifdef HAS_PBS_SUBMIT_HASH 
     158 
     159#include <qsub_functions.h> 
    161160 
    162161void set_job_defaults(job_info *ji) { 
    163   hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_c, CHECKPOINT_UNSPECIFIED, STATIC_DATA); 
    164  
    165   hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_h, NO_HOLD, STATIC_DATA); 
    166  
    167   hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_j, NO_JOIN, STATIC_DATA); 
    168  
    169   hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_k, NO_KEEP, STATIC_DATA); 
    170  
    171   hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_m, MAIL_AT_ABORT, STATIC_DATA); 
    172  
    173   hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_p, DEFAULT_PRIORITY, STATIC_DATA); 
    174  
    175   hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_r, "FALSE", STATIC_DATA); 
    176   hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_f, "FALSE", STATIC_DATA); 
     162  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_c, CHECKPOINT_UNSPECIFIED, STATIC_DATA); 
     163 
     164  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_h, NO_HOLD, STATIC_DATA); 
     165 
     166  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_j, NO_JOIN, STATIC_DATA); 
     167 
     168  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_k, NO_KEEP, STATIC_DATA); 
     169 
     170  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_m, MAIL_AT_ABORT, STATIC_DATA); 
     171 
     172  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_p, DEFAULT_PRIORITY, STATIC_DATA); 
     173 
     174  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_r, "FALSE", STATIC_DATA); 
     175  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_f, "FALSE", STATIC_DATA); 
    177176   
    178   hash_add_or_exit_c(&ji->mm, &ji->client_attr, "pbs_dprefix", "#PBS", STATIC_DATA); 
    179   hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_job_radix, "0", STATIC_DATA); 
    180   hash_add_or_exit_c(&ji->mm, &ji->job_attr, ATTR_v, "", ENV_DATA); 
     177  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->client_attr, "pbs_dprefix", "#PBS", STATIC_DATA); 
     178  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_job_radix, "0", STATIC_DATA); 
     179  _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji->mm, &ji->job_attr, ATTR_v, ""); 
    181180 
    182181 
     
    193192        memset(&ji, 0, sizeof(job_info)); 
    194193 
    195         if (memmgr_init_c(&ji.mm, 8192) != PBSE_NONE) /* do not want to use g++ just for this file*/ 
     194        if (_Z11memmgr_initPP6memmgri(&ji.mm, 8192) != PBSE_NONE) /* do not want to use g++ just for this file*/ 
    196195          { 
    197196                pbsdrmaa_exc_raise_pbs( "memmgr_init", connection_fd); 
     
    202201        for (p = attrib; p; p = p->next) { 
    203202                if (p->resource) { 
    204                         hash_add_or_exit_c(&ji.mm, &ji.res_attr, p->resource, p->value, CMDLINE_DATA); 
     203                        _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji.mm, &ji.res_attr, p->resource, p->value); 
    205204                } else { 
    206                         hash_add_or_exit_c(&ji.mm, &ji.job_attr, p->name, p->value, CMDLINE_DATA); 
     205                        _Z16hash_add_or_exitPP6memmgrPP8job_dataPKcS6_i(&ji.mm, &ji.job_attr, p->name, p->value); 
    207206                } 
    208207        } 
     
    224223        jobname_copy = fsd_strdup(new_jobname); 
    225224 
    226         memmgr_destroy_c(&ji.mm); 
     225        _Z14memmgr_destroyPP6memmgr(&ji.mm); 
    227226 
    228227        return jobname_copy; 
     
    247246retry: 
    248247 
    249 #ifdef HAVE_PBS_SUBMIT_HASH 
     248#ifdef HAS_PBS_SUBMIT_HASH 
    250249                job_id = pbs_submit_4_wrapper(self->connection_fd, attrib, script, destination); 
    251250#else 
Note: See TracChangeset for help on using the changeset viewer.